summaryrefslogtreecommitdiffstats
path: root/util/cmake/pro2cmake.py
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2019-02-27 15:31:29 +0100
committerTobias Hunger <tobias.hunger@qt.io>2019-02-28 08:08:30 +0000
commitf2e968b245e0428b75eecb0bb7244a0391e3b355 (patch)
tree91669c143ebc9102c683398909c45c90a02dd5e3 /util/cmake/pro2cmake.py
parent33fe56c630d9e59b2a33e28db5e062323d577d34 (diff)
CMake: pro2cmake.py: Handle for loops without block
Handle for loops with a single line of instructions and add a test for that. Change-Id: I041ae30f64abcbd3db7df29933647f047b92ede3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'util/cmake/pro2cmake.py')
-rwxr-xr-xutil/cmake/pro2cmake.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py
index 1f76d9dedd..06d0c925d9 100755
--- a/util/cmake/pro2cmake.py
+++ b/util/cmake/pro2cmake.py
@@ -568,11 +568,13 @@ class QmakeParser:
+ pp.nestedExpr(opener='{', closer='}', ignoreExpr=pp.LineEnd())) # ignore the whole thing...
ForLoop = pp.Suppress(pp.Keyword('for') + CallArgs
+ pp.nestedExpr(opener='{', closer='}', ignoreExpr=pp.LineEnd())) # ignore the whole thing...
+ ForLoopSingleLine = pp.Suppress(pp.Keyword('for') + CallArgs
+ + pp.Literal(':') + pp.SkipTo(EOL, ignore=LC)) # ignore the whole thing...
FunctionCall = pp.Suppress(Identifier + pp.nestedExpr())
Scope = pp.Forward()
- Statement = pp.Group(Load | Include | Option | ForLoop \
+ Statement = pp.Group(Load | Include | Option | ForLoop | ForLoopSingleLine \
| DefineTestDefinition | FunctionCall | Operation)
StatementLine = Statement + (EOL | pp.FollowedBy('}'))
StatementGroup = pp.ZeroOrMore(StatementLine | Scope | pp.Suppress(EOL))