diff options
| author | Olof Johansson <olof.johansson@axis.com> | 2013-02-14 12:28:32 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-02-15 12:12:36 +0000 |
| commit | 423dd2f7cdcb5181ec1e7029ee700e1685c38483 (patch) | |
| tree | ba4731316887f5a3db40ab2bb04a7f3e3cd37706 /bitbake/lib/bb/parse/parse_py | |
| parent | bc7c8fa99a0914dc052c148d3aff51abcbb84b26 (diff) | |
| download | poky-423dd2f7cdcb5181ec1e7029ee700e1685c38483.tar.gz | |
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>
Diffstat (limited to 'bitbake/lib/bb/parse/parse_py')
| -rw-r--r-- | bitbake/lib/bb/parse/parse_py/ConfHandler.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py index 4b62a3a5eb..3255c8beb8 100644 --- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py +++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py | |||
| @@ -29,7 +29,30 @@ import logging | |||
| 29 | import bb.utils | 29 | import bb.utils |
| 30 | from bb.parse import ParseError, resolve_file, ast, logger | 30 | from bb.parse import ParseError, resolve_file, ast, logger |
| 31 | 31 | ||
| 32 | __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)$") | 32 | __config_regexp__ = re.compile( r""" |
| 33 | ^ | ||
| 34 | (?P<exp>export\s*)? | ||
| 35 | (?P<var>[a-zA-Z0-9\-~_+.${}/]+?) | ||
| 36 | (\[(?P<flag>[a-zA-Z0-9\-_+.]+)\])? | ||
| 37 | |||
| 38 | \s* ( | ||
| 39 | (?P<colon>:=) | | ||
| 40 | (?P<lazyques>\?\?=) | | ||
| 41 | (?P<ques>\?=) | | ||
| 42 | (?P<append>\+=) | | ||
| 43 | (?P<prepend>=\+) | | ||
| 44 | (?P<predot>=\.) | | ||
| 45 | (?P<postdot>\.=) | | ||
| 46 | = | ||
| 47 | ) \s* | ||
| 48 | |||
| 49 | (?!'[^']*'[^']*'$) | ||
| 50 | (?!\"[^\"]*\"[^\"]*\"$) | ||
| 51 | (?P<apo>['\"]) | ||
| 52 | (?P<value>.*) | ||
| 53 | (?P=apo) | ||
| 54 | $ | ||
| 55 | """, re.X) | ||
| 33 | __include_regexp__ = re.compile( r"include\s+(.+)" ) | 56 | __include_regexp__ = re.compile( r"include\s+(.+)" ) |
| 34 | __require_regexp__ = re.compile( r"require\s+(.+)" ) | 57 | __require_regexp__ = re.compile( r"require\s+(.+)" ) |
| 35 | __export_regexp__ = re.compile( r"export\s+([a-zA-Z0-9\-_+.${}/]+)$" ) | 58 | __export_regexp__ = re.compile( r"export\s+([a-zA-Z0-9\-_+.${}/]+)$" ) |
