diff options
-rwxr-xr-x | util/cmake/pro2cmake.py | 2 | ||||
-rw-r--r-- | util/cmake/tests/data/sql.pro | 3 | ||||
-rwxr-xr-x | util/cmake/tests/test_parsing.py | 6 |
3 files changed, 10 insertions, 1 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 6002f78037..5d161a139a 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -518,7 +518,7 @@ class QmakeParser: pp.ParserElement.setDefaultWhitespaceChars(' \t') LC = pp.Suppress(pp.Literal('\\\n')) - EOL = pp.Suppress(pp.Literal('\n')) + EOL = pp.Suppress(pp.Literal('\n') ^ pp.LineEnd()) Else = pp.Keyword('else') Identifier = pp.Word(pp.alphas + '_', bodyChars=pp.alphanums+'_-./') BracedValue = pp.nestedExpr(ignoreExpr=pp.quotedString \ diff --git a/util/cmake/tests/data/sql.pro b/util/cmake/tests/data/sql.pro new file mode 100644 index 0000000000..a9d7fc7c5a --- /dev/null +++ b/util/cmake/tests/data/sql.pro @@ -0,0 +1,3 @@ +TEMPLATE = subdirs +SUBDIRS = \ + kernel \ diff --git a/util/cmake/tests/test_parsing.py b/util/cmake/tests/test_parsing.py index d0a9960dc7..1f50fc87ab 100755 --- a/util/cmake/tests/test_parsing.py +++ b/util/cmake/tests/test_parsing.py @@ -281,3 +281,9 @@ def test_realworld_complex_condition(): assert len(else_branch) == 0 + +def test_realworld_sql(): + result = parse_file(_tests_path + '/data/sql.pro') + assert len(result) == 2 + validate_op('TEMPLATE', '=', ['subdirs'], result[0]) + validate_op('SUBDIRS', '=', ['kernel'], result[1]) |