bitbake: ConfHandler: Use re.X to make long regexp more readable
The __config_regexp__ in ConfHandler is quite long, and using re.X to break the expression onto several lines make it a bit easier to read. (Bitbake rev: 54dce9e14ab0657d76f0d0ae22eef7fab8e8950d) Signed-off-by: Olof Johansson <olof.johansson@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
bc7c8fa99a
commit
423dd2f7cd
|
@ -29,7 +29,30 @@ import logging
|
||||||
import bb.utils
|
import bb.utils
|
||||||
from bb.parse import ParseError, resolve_file, ast, logger
|
from bb.parse import ParseError, resolve_file, ast, logger
|
||||||
|
|
||||||
__config_regexp__ = re.compile( r"(?P<exp>export\s*)?(?P<var>[a-zA-Z0-9\-~_+.${}/]+?)(\[(?P<flag>[a-zA-Z0-9\-_+.]+)\])?\s*((?P<colon>:=)|(?P<lazyques>\?\?=)|(?P<ques>\?=)|(?P<append>\+=)|(?P<prepend>=\+)|(?P<predot>=\.)|(?P<postdot>\.=)|=)\s*(?!'[^']*'[^']*'$)(?!\"[^\"]*\"[^\"]*\"$)(?P<apo>['\"])(?P<value>.*)(?P=apo)$")
|
__config_regexp__ = re.compile( r"""
|
||||||
|
^
|
||||||
|
(?P<exp>export\s*)?
|
||||||
|
(?P<var>[a-zA-Z0-9\-~_+.${}/]+?)
|
||||||
|
(\[(?P<flag>[a-zA-Z0-9\-_+.]+)\])?
|
||||||
|
|
||||||
|
\s* (
|
||||||
|
(?P<colon>:=) |
|
||||||
|
(?P<lazyques>\?\?=) |
|
||||||
|
(?P<ques>\?=) |
|
||||||
|
(?P<append>\+=) |
|
||||||
|
(?P<prepend>=\+) |
|
||||||
|
(?P<predot>=\.) |
|
||||||
|
(?P<postdot>\.=) |
|
||||||
|
=
|
||||||
|
) \s*
|
||||||
|
|
||||||
|
(?!'[^']*'[^']*'$)
|
||||||
|
(?!\"[^\"]*\"[^\"]*\"$)
|
||||||
|
(?P<apo>['\"])
|
||||||
|
(?P<value>.*)
|
||||||
|
(?P=apo)
|
||||||
|
$
|
||||||
|
""", re.X)
|
||||||
__include_regexp__ = re.compile( r"include\s+(.+)" )
|
__include_regexp__ = re.compile( r"include\s+(.+)" )
|
||||||
__require_regexp__ = re.compile( r"require\s+(.+)" )
|
__require_regexp__ = re.compile( r"require\s+(.+)" )
|
||||||
__export_regexp__ = re.compile( r"export\s+([a-zA-Z0-9\-_+.${}/]+)$" )
|
__export_regexp__ = re.compile( r"export\s+([a-zA-Z0-9\-_+.${}/]+)$" )
|
||||||
|
|
Loading…
Reference in New Issue