CMake: pro2cmake.py: Simplify code and add test for line continuation

Simplify code a bit and add a test for line continuation fixup.

Change-Id: If865bc94d7d419c65d3280b5f9613ebc0d3db74a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Tobias Hunger 2019-02-27 16:12:13 +01:00
parent f2e968b245
commit 83354655b2
3 changed files with 16 additions and 1 deletions

View File

@ -518,7 +518,7 @@ class QmakeParser:
pp.ParserElement.setDefaultWhitespaceChars(' \t')
LC = pp.Suppress(pp.Literal('\\\n'))
EOL = pp.Suppress(pp.Literal('\n') ^ pp.LineEnd())
EOL = pp.Suppress(pp.LineEnd())
Else = pp.Keyword('else')
Identifier = pp.Word(pp.alphas + '_', bodyChars=pp.alphanums+'_-./')
BracedValue = pp.nestedExpr(ignoreExpr=pp.quotedString \

View File

@ -0,0 +1,10 @@
TEMPLATE=subdirs
SUBDIRS=\
qmacstyle \
qstyle \
qstyleoption \
qstylesheetstyle \
!qtConfig(private_tests): SUBDIRS -= \
qstylesheetstyle \

View File

@ -300,3 +300,8 @@ def test_realworld_qtconfig():
assert len(result) == 1
validate_op('MODULE_AUX_INCLUDES', '=', ['\\$\\$QT_MODULE_INCLUDE_BASE/QtANGLE'], result[0])
def test_realworld_lc():
result = parse_file(_tests_path + '/data/lc.pro')
assert len(result) == 3