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:
parent
f2e968b245
commit
83354655b2
@ -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 \
|
||||
|
10
util/cmake/tests/data/lc.pro
Normal file
10
util/cmake/tests/data/lc.pro
Normal file
@ -0,0 +1,10 @@
|
||||
TEMPLATE=subdirs
|
||||
SUBDIRS=\
|
||||
qmacstyle \
|
||||
qstyle \
|
||||
qstyleoption \
|
||||
qstylesheetstyle \
|
||||
|
||||
!qtConfig(private_tests): SUBDIRS -= \
|
||||
qstylesheetstyle \
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user