diff options
author | Brad King <brad.king@kitware.com> | 2012-08-06 13:53:03 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-08-08 17:26:26 (GMT) |
commit | 28685ade7a8f60e8519b6bf8a824e6a01365c181 (patch) | |
tree | b9e9afbf887d2871ba61aab0d620a908eb32dd66 /Source/cmListFileLexer.in.l | |
parent | 1eafa3edaf34569cb6fa7eb449a9825049fe6270 (diff) | |
download | CMake-28685ade7a8f60e8519b6bf8a824e6a01365c181.zip CMake-28685ade7a8f60e8519b6bf8a824e6a01365c181.tar.gz CMake-28685ade7a8f60e8519b6bf8a824e6a01365c181.tar.bz2 |
cmListFileLexer: Split normal and legacy unquoted arguments
Match legacy arguments separately. Add macros to simplify and clarify
matching rules.
Diffstat (limited to 'Source/cmListFileLexer.in.l')
-rw-r--r-- | Source/cmListFileLexer.in.l | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Source/cmListFileLexer.in.l b/Source/cmListFileLexer.in.l index 4459c7b..45fcdd2 100644 --- a/Source/cmListFileLexer.in.l +++ b/Source/cmListFileLexer.in.l @@ -75,6 +75,8 @@ static void cmListFileLexerDestroy(cmListFileLexer* lexer); %x STRING MAKEVAR \$\([A-Za-z0-9_]*\) +UNQUOTED ([^ \t\r\n\(\)#\\\"]|\\.) +LEGACY {MAKEVAR}|{UNQUOTED}|\"({MAKEVAR}|{UNQUOTED}|[ \t])*\" %% @@ -111,7 +113,14 @@ MAKEVAR \$\([A-Za-z0-9_]*\) return 1; } -({MAKEVAR}|[^ \t\r\n\(\)#\\\"]|\\.)({MAKEVAR}|[^ \t\r\n\(\)#\\\"]|\\.|\"({MAKEVAR}|[^\r\n\(\)#\\\"]|\\.)*\")* { +({UNQUOTED})({UNQUOTED})* { + lexer->token.type = cmListFileLexer_Token_ArgumentUnquoted; + cmListFileLexerSetToken(lexer, yytext, yyleng); + lexer->column += yyleng; + return 1; +} + +({MAKEVAR}|{UNQUOTED})({LEGACY})* { lexer->token.type = cmListFileLexer_Token_ArgumentUnquoted; cmListFileLexerSetToken(lexer, yytext, yyleng); lexer->column += yyleng; |