[Cmake-commits] CMake branch, next, updated. v2.8.11.2-3730-gf7621eb
Brad King
brad.king at kitware.com
Tue Aug 6 16:34:28 EDT 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via f7621eb082b53a9dff05259ec66bec3dd524639d (commit)
via a6134537848f6ae076cfcb1a59684e2cb4d644d3 (commit)
via bd08a489979556bbcfa4f8e50251270ae2744178 (commit)
via b2ac3463b5ef5dfd3fc662c12aaaacdd177e5dc1 (commit)
via a89b8d92e264c5afb9a605fdcfe9fc593c78692e (commit)
via 5d155d2df32b63bbc98c3cd112ea3edb4f0a55cf (commit)
via 95c04da78dac218cd346a3a4c905754a79a7c42d (commit)
via 2362ea01974b96ca14b72a6e494eceac603f0b0a (commit)
via 0a7786a1d5c4b27889be1d6a25b0c180051f2cbc (commit)
via 6db5c8c353ce3618c0e58274caf572187a1eeb2b (commit)
from 1849419857cb7f960e71af4f99be9327ce3f4675 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f7621eb082b53a9dff05259ec66bec3dd524639d
commit f7621eb082b53a9dff05259ec66bec3dd524639d
Merge: 1849419 a613453
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Aug 6 16:34:22 2013 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Aug 6 16:34:22 2013 -0400
Merge topic 'cmake-syntax' into next
a613453 Merge branch 'dev/fix-variable-watch-crash' into cmake-syntax
bd08a48 Warn about unquoted arguments that look like long brackets
b2ac346 Warn about arguments not separated by whitespace
a89b8d9 cmListFileCache: Convert CMake language parser to class
5d155d2 Add RunCMake.Syntax test cases for command invocation styles
95c04da cmListFileArgument: Generalize 'Quoted' bool to 'Delimeter' enum
2362ea0 cmListFileLexer: Split normal and legacy unquoted arguments
0a7786a cmListFileLexer: Fix line number after backslash in string
6db5c8c Add RunCMake.Syntax test to cover argument parsing
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a6134537848f6ae076cfcb1a59684e2cb4d644d3
commit a6134537848f6ae076cfcb1a59684e2cb4d644d3
Merge: bd08a48 56e770f
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Aug 6 16:24:02 2013 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Aug 6 16:24:02 2013 -0400
Merge branch 'dev/fix-variable-watch-crash' into cmake-syntax
Resolve conflict in Source/cmVariableWatchCommand.cxx by integrating the
changes from both sides.
diff --cc Source/cmVariableWatchCommand.cxx
index 70c6524,4eff19e..33e159b
--- a/Source/cmVariableWatchCommand.cxx
+++ b/Source/cmVariableWatchCommand.cxx
@@@ -80,27 -44,20 +44,25 @@@ static void cmVariableWatchCommandVaria
cmMakefile* makefile = const_cast<cmMakefile*>(mf);
std::string stack = makefile->GetProperty("LISTFILE_STACK");
- for ( it = handler->Commands.begin(); it != handler->Commands.end();
- ++ it )
+ if ( !data->Command.empty() )
{
- std::string command = *it;
newLFF.Arguments.clear();
newLFF.Arguments.push_back(
- cmListFileArgument(variable, true, "unknown", 9999));
+ cmListFileArgument(variable, cmListFileArgument::Quoted,
+ "unknown", 9999));
newLFF.Arguments.push_back(
- cmListFileArgument(accessString, true, "unknown", 9999));
+ cmListFileArgument(accessString, cmListFileArgument::Quoted,
+ "unknown", 9999));
newLFF.Arguments.push_back(
- cmListFileArgument(newValue?newValue:"", true, "unknown", 9999));
+ cmListFileArgument(newValue?newValue:"", cmListFileArgument::Quoted,
+ "unknown", 9999));
newLFF.Arguments.push_back(
- cmListFileArgument(currentListFile, true, "unknown", 9999));
+ cmListFileArgument(currentListFile, cmListFileArgument::Quoted,
+ "unknown", 9999));
newLFF.Arguments.push_back(
- cmListFileArgument(stack, true, "unknown", 9999));
+ cmListFileArgument(stack, cmListFileArgument::Quoted,
+ "unknown", 9999));
- newLFF.Name = command;
+ newLFF.Name = data->Command;
newLFF.FilePath = "Some weird path";
newLFF.Line = 9999;
cmExecutionStatus status;
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bd08a489979556bbcfa4f8e50251270ae2744178
commit bd08a489979556bbcfa4f8e50251270ae2744178
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Aug 6 15:48:28 2013 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Aug 6 15:52:38 2013 -0400
Warn about unquoted arguments that look like long brackets
In the future CMake will introduce Lua-style long bracket syntax.
Warn about unquoted arguments that in the future will be treated
as opening long brackets.
Teach the RunCMake.Syntax test to cover such cases and ensure that the
warning appears.
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 750d988..debde0d 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -343,6 +343,27 @@ void cmListFileParser::AddArgument(cmListFileLexer_Token* token,
{
cmListFileArgument a(token->text, delim, this->FileName, token->line);
this->Function.Arguments.push_back(a);
+ if(delim == cmListFileArgument::Unquoted)
+ {
+ // Warn about a future behavior change.
+ const char* c = a.Value.c_str();
+ if(*c++ == '[')
+ {
+ while(*c == '=')
+ { ++c; }
+ if(*c == '[')
+ {
+ cmOStringStream m;
+ m << "Syntax Warning in cmake code at\n"
+ << " " << this->FileName << ":" << token->line << ":"
+ << token->column << "\n"
+ << "A future version of CMake may treat unquoted argument:\n"
+ << " " << a.Value << "\n"
+ << "as an opening long bracket. Double-quote the argument.";
+ this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, m.str().c_str());
+ }
+ }
+ }
if(this->Separation == SeparationOkay)
{
return;
diff --git a/Tests/RunCMake/Syntax/BracketWarn-stderr.txt b/Tests/RunCMake/Syntax/BracketWarn-stderr.txt
new file mode 100644
index 0000000..4a9cca6
--- /dev/null
+++ b/Tests/RunCMake/Syntax/BracketWarn-stderr.txt
@@ -0,0 +1,35 @@
+CMake Warning \(dev\) at CMakeLists.txt:3 \(include\):
+ Syntax Warning in cmake code at
+
+ .*/Tests/RunCMake/Syntax/BracketWarn.cmake:1:16
+
+ A future version of CMake may treat unquoted argument:
+
+ \[\[
+
+ as an opening long bracket. Double-quote the argument.
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at CMakeLists.txt:3 \(include\):
+ Syntax Warning in cmake code at
+
+ .*/Tests/RunCMake/Syntax/BracketWarn.cmake:1:19
+
+ A future version of CMake may treat unquoted argument:
+
+ \[=\[
+
+ as an opening long bracket. Double-quote the argument.
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at CMakeLists.txt:3 \(include\):
+ Syntax Warning in cmake code at
+
+ .*/Tests/RunCMake/Syntax/BracketWarn.cmake:1:27
+
+ A future version of CMake may treat unquoted argument:
+
+ \[==\[x
+
+ as an opening long bracket. Double-quote the argument.
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/Syntax/BracketWarn-stdout.txt b/Tests/RunCMake/Syntax/BracketWarn-stdout.txt
new file mode 100644
index 0000000..01b2caa
--- /dev/null
+++ b/Tests/RunCMake/Syntax/BracketWarn-stdout.txt
@@ -0,0 +1 @@
+-- \[\[\[=\[\[=x\[==\[x
diff --git a/Tests/RunCMake/Syntax/BracketWarn.cmake b/Tests/RunCMake/Syntax/BracketWarn.cmake
new file mode 100644
index 0000000..8f33946
--- /dev/null
+++ b/Tests/RunCMake/Syntax/BracketWarn.cmake
@@ -0,0 +1 @@
+message(STATUS [[ [=[ [=x [==[x)
diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
index b1eeff9..8975b25 100644
--- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
@@ -14,3 +14,4 @@ run_cmake(Unquoted1)
run_cmake(UnterminatedCall1)
run_cmake(UnterminatedCall2)
run_cmake(UnterminatedString)
+run_cmake(BracketWarn)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b2ac3463b5ef5dfd3fc662c12aaaacdd177e5dc1
commit b2ac3463b5ef5dfd3fc662c12aaaacdd177e5dc1
Author: Brad King <brad.king at kitware.com>
AuthorDate: Sat Feb 16 20:41:47 2013 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Aug 6 15:22:13 2013 -0400
Warn about arguments not separated by whitespace
Teach the lexer to return tokens for whitespace. Teach the parser to
tolerate the space tokens where whitespace is allowed. Also teach the
parser to diagnose and warn about cases of quoted arguments followed
immediately by another argument. This was accidentally allowed
previously, so we only warn.
Update the RunCMake.Syntax test case StringNoSpace expected stderr to
include the warnings.
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index f57ca22..750d988 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -36,6 +36,7 @@ struct cmListFileParser
const char* FileName;
cmListFileLexer* Lexer;
cmListFileFunction Function;
+ enum { SeparationOkay, SeparationWarning } Separation;
};
//----------------------------------------------------------------------------
@@ -69,7 +70,10 @@ bool cmListFileParser::ParseFile()
while(cmListFileLexer_Token* token =
cmListFileLexer_Scan(this->Lexer))
{
- if(token->type == cmListFileLexer_Token_Newline)
+ if(token->type == cmListFileLexer_Token_Space)
+ {
+ }
+ else if(token->type == cmListFileLexer_Token_Newline)
{
haveNewline = true;
}
@@ -244,7 +248,9 @@ bool cmListFileParser::ParseFunction(const char* name, long line)
// Command name has already been parsed. Read the left paren.
cmListFileLexer_Token* token;
- if(!(token = cmListFileLexer_Scan(this->Lexer)))
+ while((token = cmListFileLexer_Scan(this->Lexer)) &&
+ token->type == cmListFileLexer_Token_Space);
+ if(!token)
{
cmOStringStream error;
error << "Error in cmake code at\n" << this->FileName << ":"
@@ -266,14 +272,23 @@ bool cmListFileParser::ParseFunction(const char* name, long line)
}
// Arguments.
- unsigned long lastLine = cmListFileLexer_GetCurrentLine(this->Lexer);
+ unsigned long lastLine;
unsigned long parenDepth = 0;
- while((token = cmListFileLexer_Scan(this->Lexer)))
+ this->Separation = SeparationOkay;
+ while((lastLine = cmListFileLexer_GetCurrentLine(this->Lexer),
+ token = cmListFileLexer_Scan(this->Lexer)))
{
+ if(token->type == cmListFileLexer_Token_Space ||
+ token->type == cmListFileLexer_Token_Newline)
+ {
+ this->Separation = SeparationOkay;
+ continue;
+ }
if(token->type == cmListFileLexer_Token_ParenLeft)
{
parenDepth++;
this->AddArgument(token, cmListFileArgument::Unquoted);
+ this->Separation = SeparationOkay;
}
else if(token->type == cmListFileLexer_Token_ParenRight)
{
@@ -282,18 +297,22 @@ bool cmListFileParser::ParseFunction(const char* name, long line)
return true;
}
parenDepth--;
+ this->Separation = SeparationOkay;
this->AddArgument(token, cmListFileArgument::Unquoted);
+ this->Separation = SeparationWarning;
}
else if(token->type == cmListFileLexer_Token_Identifier ||
token->type == cmListFileLexer_Token_ArgumentUnquoted)
{
this->AddArgument(token, cmListFileArgument::Unquoted);
+ this->Separation = SeparationWarning;
}
else if(token->type == cmListFileLexer_Token_ArgumentQuoted)
{
this->AddArgument(token, cmListFileArgument::Quoted);
+ this->Separation = SeparationWarning;
}
- else if(token->type != cmListFileLexer_Token_Newline)
+ else
{
// Error.
cmOStringStream error;
@@ -306,7 +325,6 @@ bool cmListFileParser::ParseFunction(const char* name, long line)
cmSystemTools::Error(error.str().c_str());
return false;
}
- lastLine = cmListFileLexer_GetCurrentLine(this->Lexer);
}
cmOStringStream error;
@@ -325,6 +343,16 @@ void cmListFileParser::AddArgument(cmListFileLexer_Token* token,
{
cmListFileArgument a(token->text, delim, this->FileName, token->line);
this->Function.Arguments.push_back(a);
+ if(this->Separation == SeparationOkay)
+ {
+ return;
+ }
+ cmOStringStream m;
+ m << "Syntax Warning in cmake code at\n"
+ << " " << this->FileName << ":" << token->line << ":"
+ << token->column << "\n"
+ << "Argument not separated from preceding token by whitespace.";
+ this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, m.str().c_str());
}
//----------------------------------------------------------------------------
diff --git a/Source/cmListFileLexer.c b/Source/cmListFileLexer.c
index a256b9b..09dd011 100644
--- a/Source/cmListFileLexer.c
+++ b/Source/cmListFileLexer.c
@@ -378,13 +378,13 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[44] =
+static yyconst flex_int16_t yy_accept[45] =
{ 0,
0, 0, 0, 0, 17, 6, 14, 1, 8, 2,
6, 3, 4, 6, 15, 9, 11, 12, 13, 6,
- 0, 6, 0, 2, 0, 5, 6, 9, 0, 10,
- 0, 7, 0, 0, 0, 7, 0, 7, 0, 0,
- 0, 0, 0
+ 0, 6, 0, 14, 2, 0, 5, 6, 9, 0,
+ 10, 0, 7, 0, 0, 0, 7, 0, 7, 0,
+ 0, 0, 0, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
@@ -421,62 +421,64 @@ static yyconst flex_int32_t yy_ec[256] =
static yyconst flex_int32_t yy_meta[13] =
{ 0,
- 1, 1, 2, 1, 3, 1, 1, 1, 4, 4,
- 4, 1
+ 1, 2, 3, 2, 4, 1, 1, 1, 5, 5,
+ 5, 1
} ;
-static yyconst flex_int16_t yy_base[54] =
+static yyconst flex_int16_t yy_base[56] =
{ 0,
- 0, 0, 10, 20, 36, 32, 102, 102, 102, 0,
- 27, 102, 102, 35, 0, 22, 102, 102, 44, 0,
- 49, 23, 0, 0, 21, 0, 0, 17, 23, 102,
- 0, 61, 19, 0, 17, 0, 15, 13, 0, 11,
- 10, 9, 102, 73, 77, 81, 85, 89, 13, 93,
- 12, 97, 10
+ 0, 0, 10, 20, 38, 32, 0, 109, 109, 0,
+ 28, 109, 109, 35, 0, 23, 109, 109, 44, 0,
+ 49, 26, 0, 0, 0, 22, 0, 0, 18, 24,
+ 109, 0, 61, 20, 0, 18, 0, 17, 16, 0,
+ 12, 11, 10, 109, 73, 16, 78, 83, 88, 93,
+ 12, 98, 11, 103, 9
} ;
-static yyconst flex_int16_t yy_def[54] =
+static yyconst flex_int16_t yy_def[56] =
{ 0,
- 43, 1, 44, 44, 43, 43, 43, 43, 43, 45,
- 6, 43, 43, 6, 46, 47, 43, 43, 47, 6,
- 43, 6, 48, 45, 49, 14, 6, 47, 47, 43,
- 21, 43, 21, 50, 51, 32, 49, 32, 52, 53,
- 51, 53, 0, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43
+ 44, 1, 45, 45, 44, 44, 46, 44, 44, 47,
+ 6, 44, 44, 6, 48, 49, 44, 44, 49, 6,
+ 44, 6, 50, 46, 47, 51, 14, 6, 49, 49,
+ 44, 21, 44, 21, 52, 53, 33, 51, 33, 54,
+ 55, 53, 55, 0, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44
} ;
-static yyconst flex_int16_t yy_nxt[115] =
+static yyconst flex_int16_t yy_nxt[122] =
{ 0,
6, 7, 8, 7, 9, 10, 11, 12, 13, 6,
- 14, 15, 17, 42, 18, 41, 37, 31, 32, 31,
- 35, 19, 17, 36, 18, 32, 40, 28, 29, 36,
- 35, 19, 20, 29, 25, 43, 21, 43, 22, 43,
- 43, 20, 20, 23, 26, 26, 30, 43, 28, 31,
- 31, 43, 43, 32, 43, 33, 43, 43, 31, 31,
- 34, 32, 43, 43, 43, 21, 43, 38, 43, 43,
- 32, 32, 39, 16, 16, 16, 16, 24, 43, 24,
- 24, 27, 43, 27, 27, 28, 43, 43, 28, 20,
- 43, 20, 20, 31, 43, 31, 31, 32, 43, 32,
-
- 32, 5, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43
+ 14, 15, 17, 43, 18, 42, 38, 24, 32, 33,
+ 32, 19, 17, 36, 18, 37, 33, 41, 29, 30,
+ 37, 19, 20, 36, 30, 26, 21, 44, 22, 44,
+ 44, 20, 20, 23, 27, 27, 31, 44, 29, 32,
+ 32, 44, 44, 33, 44, 34, 44, 44, 32, 32,
+ 35, 33, 44, 44, 44, 21, 44, 39, 44, 44,
+ 33, 33, 40, 16, 16, 16, 16, 16, 25, 25,
+ 44, 25, 25, 28, 28, 44, 28, 28, 29, 29,
+ 44, 44, 29, 20, 20, 44, 20, 20, 32, 32,
+
+ 44, 32, 32, 33, 33, 44, 33, 33, 5, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44
} ;
-static yyconst flex_int16_t yy_chk[115] =
+static yyconst flex_int16_t yy_chk[122] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 3, 53, 3, 51, 49, 42, 41, 40,
- 38, 3, 4, 37, 4, 35, 33, 29, 28, 25,
- 22, 4, 6, 16, 11, 5, 6, 0, 6, 0,
+ 1, 1, 3, 55, 3, 53, 51, 46, 43, 42,
+ 41, 3, 4, 39, 4, 38, 36, 34, 30, 29,
+ 26, 4, 6, 22, 16, 11, 6, 5, 6, 0,
0, 6, 6, 6, 14, 14, 19, 0, 19, 21,
21, 0, 0, 21, 0, 21, 0, 0, 21, 21,
- 21, 32, 0, 0, 0, 32, 0, 32, 0, 0,
- 32, 32, 32, 44, 44, 44, 44, 45, 0, 45,
- 45, 46, 0, 46, 46, 47, 0, 0, 47, 48,
- 0, 48, 48, 50, 0, 50, 50, 52, 0, 52,
-
- 52, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43
+ 21, 33, 0, 0, 0, 33, 0, 33, 0, 0,
+ 33, 33, 33, 45, 45, 45, 45, 45, 47, 47,
+ 0, 47, 47, 48, 48, 0, 48, 48, 49, 49,
+ 0, 0, 49, 50, 50, 0, 50, 50, 52, 52,
+
+ 0, 52, 52, 54, 54, 0, 54, 54, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44
} ;
/* Table of booleans, true if rule could match eol. */
@@ -561,7 +563,7 @@ static void cmListFileLexerDestroy(cmListFileLexer* lexer);
/*--------------------------------------------------------------------------*/
-#line 567 "cmListFileLexer.c"
+#line 569 "cmListFileLexer.c"
#define INITIAL 0
#define STRING 1
@@ -793,7 +795,7 @@ YY_DECL
#line 81 "cmListFileLexer.in.l"
-#line 801 "cmListFileLexer.c"
+#line 803 "cmListFileLexer.c"
if ( !yyg->yy_init )
{
@@ -846,13 +848,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 44 )
+ if ( yy_current_state >= 45 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
- while ( yy_base[yy_current_state] != 102 );
+ while ( yy_base[yy_current_state] != 109 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
@@ -1016,12 +1018,14 @@ case 14:
YY_RULE_SETUP
#line 171 "cmListFileLexer.in.l"
{
+ lexer->token.type = cmListFileLexer_Token_Space;
+ cmListFileLexerSetToken(lexer, yytext, yyleng);
lexer->column += yyleng;
+ return 1;
}
- YY_BREAK
case 15:
YY_RULE_SETUP
-#line 175 "cmListFileLexer.in.l"
+#line 178 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_BadCharacter;
cmListFileLexerSetToken(lexer, yytext, yyleng);
@@ -1029,7 +1033,7 @@ YY_RULE_SETUP
return 1;
}
case YY_STATE_EOF(INITIAL):
-#line 182 "cmListFileLexer.in.l"
+#line 185 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_None;
cmListFileLexerSetToken(lexer, 0, 0);
@@ -1037,10 +1041,10 @@ case YY_STATE_EOF(INITIAL):
}
case 16:
YY_RULE_SETUP
-#line 188 "cmListFileLexer.in.l"
+#line 191 "cmListFileLexer.in.l"
ECHO;
YY_BREAK
-#line 1058 "cmListFileLexer.c"
+#line 1063 "cmListFileLexer.c"
case YY_END_OF_BUFFER:
{
@@ -1332,7 +1336,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 44 )
+ if ( yy_current_state >= 45 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1361,11 +1365,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 44 )
+ if ( yy_current_state >= 45 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 43);
+ yy_is_jam = (yy_current_state == 44);
return yy_is_jam ? 0 : yy_current_state;
}
@@ -2162,7 +2166,7 @@ void cmListFileLexer_yyfree (void * ptr , yyscan_t yyscanner)
#define YYTABLES_NAME "yytables"
-#line 188 "cmListFileLexer.in.l"
+#line 191 "cmListFileLexer.in.l"
@@ -2399,6 +2403,7 @@ const char* cmListFileLexer_GetTypeAsString(cmListFileLexer* lexer,
switch(type)
{
case cmListFileLexer_Token_None: return "nothing";
+ case cmListFileLexer_Token_Space: return "space";
case cmListFileLexer_Token_Newline: return "newline";
case cmListFileLexer_Token_Identifier: return "identifier";
case cmListFileLexer_Token_ParenLeft: return "left paren";
diff --git a/Source/cmListFileLexer.h b/Source/cmListFileLexer.h
index 5f4db33..cc78b5c 100644
--- a/Source/cmListFileLexer.h
+++ b/Source/cmListFileLexer.h
@@ -15,6 +15,7 @@
typedef enum cmListFileLexer_Type_e
{
cmListFileLexer_Token_None,
+ cmListFileLexer_Token_Space,
cmListFileLexer_Token_Newline,
cmListFileLexer_Token_Identifier,
cmListFileLexer_Token_ParenLeft,
diff --git a/Source/cmListFileLexer.in.l b/Source/cmListFileLexer.in.l
index 45fcdd2..e5ddb9e 100644
--- a/Source/cmListFileLexer.in.l
+++ b/Source/cmListFileLexer.in.l
@@ -168,8 +168,11 @@ LEGACY {MAKEVAR}|{UNQUOTED}|\"({MAKEVAR}|{UNQUOTED}|[ \t])*\"
return 1;
}
-[ \t\r] {
+[ \t\r]+ {
+ lexer->token.type = cmListFileLexer_Token_Space;
+ cmListFileLexerSetToken(lexer, yytext, yyleng);
lexer->column += yyleng;
+ return 1;
}
. {
@@ -420,6 +423,7 @@ const char* cmListFileLexer_GetTypeAsString(cmListFileLexer* lexer,
switch(type)
{
case cmListFileLexer_Token_None: return "nothing";
+ case cmListFileLexer_Token_Space: return "space";
case cmListFileLexer_Token_Newline: return "newline";
case cmListFileLexer_Token_Identifier: return "identifier";
case cmListFileLexer_Token_ParenLeft: return "left paren";
diff --git a/Tests/RunCMake/Syntax/StringNoSpace-stderr.txt b/Tests/RunCMake/Syntax/StringNoSpace-stderr.txt
index 2d111aa..89c2d2a 100644
--- a/Tests/RunCMake/Syntax/StringNoSpace-stderr.txt
+++ b/Tests/RunCMake/Syntax/StringNoSpace-stderr.txt
@@ -1,3 +1,19 @@
-^\[1 \${var} \\n 4\]
+CMake Warning \(dev\) at CMakeLists.txt:3 \(include\):
+ Syntax Warning in cmake code at
+
+ .*/Tests/RunCMake/Syntax/StringNoSpace.cmake:2:28
+
+ Argument not separated from preceding token by whitespace.
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at CMakeLists.txt:3 \(include\):
+ Syntax Warning in cmake code at
+
+ .*/Tests/RunCMake/Syntax/StringNoSpace.cmake:2:31
+
+ Argument not separated from preceding token by whitespace.
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+\[1 \${var} \\n 4\]
\[x\]
\[y\]$
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a89b8d92e264c5afb9a605fdcfe9fc593c78692e
commit a89b8d92e264c5afb9a605fdcfe9fc593c78692e
Author: Brad King <brad.king at kitware.com>
AuthorDate: Sat Feb 16 20:14:23 2013 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Aug 6 15:20:08 2013 -0400
cmListFileCache: Convert CMake language parser to class
Refactor the parser implementation into a class to make
it easier to extend.
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 7b25351..f57ca22 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -22,43 +22,52 @@
# pragma warn -8060 /* possibly incorrect assignment */
#endif
-bool cmListFileCacheParseFunction(cmListFileLexer* lexer,
- cmListFileFunction& function,
- const char* filename);
+//----------------------------------------------------------------------------
+struct cmListFileParser
+{
+ cmListFileParser(cmListFile* lf, cmMakefile* mf, const char* filename);
+ ~cmListFileParser();
+ bool ParseFile();
+ bool ParseFunction(const char* name, long line);
+ void AddArgument(cmListFileLexer_Token* token,
+ cmListFileArgument::Delimiter delim);
+ cmListFile* ListFile;
+ cmMakefile* Makefile;
+ const char* FileName;
+ cmListFileLexer* Lexer;
+ cmListFileFunction Function;
+};
-bool cmListFile::ParseFile(const char* filename,
- bool topLevel,
- cmMakefile *mf)
+//----------------------------------------------------------------------------
+cmListFileParser::cmListFileParser(cmListFile* lf, cmMakefile* mf,
+ const char* filename):
+ ListFile(lf), Makefile(mf), FileName(filename),
+ Lexer(cmListFileLexer_New())
{
- if(!cmSystemTools::FileExists(filename))
- {
- return false;
- }
+}
- // Create the scanner.
- cmListFileLexer* lexer = cmListFileLexer_New();
- if(!lexer)
- {
- cmSystemTools::Error("cmListFileCache: error allocating lexer ");
- return false;
- }
+//----------------------------------------------------------------------------
+cmListFileParser::~cmListFileParser()
+{
+ cmListFileLexer_Delete(this->Lexer);
+}
+//----------------------------------------------------------------------------
+bool cmListFileParser::ParseFile()
+{
// Open the file.
- if(!cmListFileLexer_SetFileName(lexer, filename))
+ if(!cmListFileLexer_SetFileName(this->Lexer, this->FileName))
{
- cmListFileLexer_Delete(lexer);
cmSystemTools::Error("cmListFileCache: error can not open file ",
- filename);
+ this->FileName);
return false;
}
// Use a simple recursive-descent parser to process the token
// stream.
- this->ModifiedTime = cmSystemTools::ModifiedTime(filename);
- bool parseError = false;
bool haveNewline = true;
- cmListFileLexer_Token* token;
- while(!parseError && (token = cmListFileLexer_Scan(lexer)))
+ while(cmListFileLexer_Token* token =
+ cmListFileLexer_Scan(this->Lexer))
{
if(token->type == cmListFileLexer_Token_Newline)
{
@@ -69,50 +78,65 @@ bool cmListFile::ParseFile(const char* filename,
if(haveNewline)
{
haveNewline = false;
- cmListFileFunction inFunction;
- inFunction.Name = token->text;
- inFunction.FilePath = filename;
- inFunction.Line = token->line;
- if(cmListFileCacheParseFunction(lexer, inFunction, filename))
+ if(this->ParseFunction(token->text, token->line))
{
- this->Functions.push_back(inFunction);
+ this->ListFile->Functions.push_back(this->Function);
}
else
{
- parseError = true;
+ return false;
}
}
else
{
cmOStringStream error;
error << "Error in cmake code at\n"
- << filename << ":" << token->line << ":\n"
+ << this->FileName << ":" << token->line << ":\n"
<< "Parse error. Expected a newline, got "
- << cmListFileLexer_GetTypeAsString(lexer, token->type)
+ << cmListFileLexer_GetTypeAsString(this->Lexer, token->type)
<< " with text \"" << token->text << "\".";
cmSystemTools::Error(error.str().c_str());
- parseError = true;
+ return false;
}
}
else
{
cmOStringStream error;
error << "Error in cmake code at\n"
- << filename << ":" << token->line << ":\n"
+ << this->FileName << ":" << token->line << ":\n"
<< "Parse error. Expected a command name, got "
- << cmListFileLexer_GetTypeAsString(lexer, token->type)
+ << cmListFileLexer_GetTypeAsString(this->Lexer, token->type)
<< " with text \""
<< token->text << "\".";
cmSystemTools::Error(error.str().c_str());
- parseError = true;
+ return false;
}
}
- if (parseError)
+ return true;
+}
+
+//----------------------------------------------------------------------------
+bool cmListFile::ParseFile(const char* filename,
+ bool topLevel,
+ cmMakefile *mf)
+{
+ if(!cmSystemTools::FileExists(filename))
{
- this->ModifiedTime = 0;
+ return false;
}
- cmListFileLexer_Delete(lexer);
+ bool parseError = false;
+ this->ModifiedTime = cmSystemTools::ModifiedTime(filename);
+
+ {
+ cmListFileParser parser(this, mf, filename);
+ parseError = !parser.ParseFile();
+ }
+
+ if(parseError)
+ {
+ this->ModifiedTime = 0;
+ }
// do we need a cmake_policy(VERSION call?
if(topLevel)
@@ -209,17 +233,22 @@ bool cmListFile::ParseFile(const char* filename,
return true;
}
-bool cmListFileCacheParseFunction(cmListFileLexer* lexer,
- cmListFileFunction& function,
- const char* filename)
+//----------------------------------------------------------------------------
+bool cmListFileParser::ParseFunction(const char* name, long line)
{
+ // Inintialize a new function call.
+ this->Function = cmListFileFunction();
+ this->Function.FilePath = this->FileName;
+ this->Function.Name = name;
+ this->Function.Line = line;
+
// Command name has already been parsed. Read the left paren.
cmListFileLexer_Token* token;
- if(!(token = cmListFileLexer_Scan(lexer)))
+ if(!(token = cmListFileLexer_Scan(this->Lexer)))
{
cmOStringStream error;
- error << "Error in cmake code at\n"
- << filename << ":" << cmListFileLexer_GetCurrentLine(lexer) << ":\n"
+ error << "Error in cmake code at\n" << this->FileName << ":"
+ << cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n"
<< "Parse error. Function missing opening \"(\".";
cmSystemTools::Error(error.str().c_str());
return false;
@@ -227,26 +256,24 @@ bool cmListFileCacheParseFunction(cmListFileLexer* lexer,
if(token->type != cmListFileLexer_Token_ParenLeft)
{
cmOStringStream error;
- error << "Error in cmake code at\n"
- << filename << ":" << cmListFileLexer_GetCurrentLine(lexer) << ":\n"
+ error << "Error in cmake code at\n" << this->FileName << ":"
+ << cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n"
<< "Parse error. Expected \"(\", got "
- << cmListFileLexer_GetTypeAsString(lexer, token->type)
+ << cmListFileLexer_GetTypeAsString(this->Lexer, token->type)
<< " with text \"" << token->text << "\".";
cmSystemTools::Error(error.str().c_str());
return false;
}
// Arguments.
- unsigned long lastLine = cmListFileLexer_GetCurrentLine(lexer);
+ unsigned long lastLine = cmListFileLexer_GetCurrentLine(this->Lexer);
unsigned long parenDepth = 0;
- while((token = cmListFileLexer_Scan(lexer)))
+ while((token = cmListFileLexer_Scan(this->Lexer)))
{
if(token->type == cmListFileLexer_Token_ParenLeft)
{
parenDepth++;
- cmListFileArgument a("(", cmListFileArgument::Unquoted,
- filename, token->line);
- function.Arguments.push_back(a);
+ this->AddArgument(token, cmListFileArgument::Unquoted);
}
else if(token->type == cmListFileLexer_Token_ParenRight)
{
@@ -255,43 +282,36 @@ bool cmListFileCacheParseFunction(cmListFileLexer* lexer,
return true;
}
parenDepth--;
- cmListFileArgument a(")", cmListFileArgument::Unquoted,
- filename, token->line);
- function.Arguments.push_back(a);
+ this->AddArgument(token, cmListFileArgument::Unquoted);
}
else if(token->type == cmListFileLexer_Token_Identifier ||
token->type == cmListFileLexer_Token_ArgumentUnquoted)
{
- cmListFileArgument a(token->text, cmListFileArgument::Unquoted,
- filename, token->line);
- function.Arguments.push_back(a);
+ this->AddArgument(token, cmListFileArgument::Unquoted);
}
else if(token->type == cmListFileLexer_Token_ArgumentQuoted)
{
- cmListFileArgument a(token->text, cmListFileArgument::Quoted,
- filename, token->line);
- function.Arguments.push_back(a);
+ this->AddArgument(token, cmListFileArgument::Quoted);
}
else if(token->type != cmListFileLexer_Token_Newline)
{
// Error.
cmOStringStream error;
- error << "Error in cmake code at\n"
- << filename << ":" << cmListFileLexer_GetCurrentLine(lexer)
- << ":\n"
+ error << "Error in cmake code at\n" << this->FileName << ":"
+ << cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n"
<< "Parse error. Function missing ending \")\". "
<< "Instead found "
- << cmListFileLexer_GetTypeAsString(lexer, token->type)
+ << cmListFileLexer_GetTypeAsString(this->Lexer, token->type)
<< " with text \"" << token->text << "\".";
cmSystemTools::Error(error.str().c_str());
return false;
}
- lastLine = cmListFileLexer_GetCurrentLine(lexer);
+ lastLine = cmListFileLexer_GetCurrentLine(this->Lexer);
}
cmOStringStream error;
error << "Error in cmake code at\n"
- << filename << ":" << lastLine << ":\n"
+ << this->FileName << ":" << lastLine << ":\n"
<< "Parse error. Function missing ending \")\". "
<< "End of file reached.";
cmSystemTools::Error(error.str().c_str());
@@ -300,6 +320,14 @@ bool cmListFileCacheParseFunction(cmListFileLexer* lexer,
}
//----------------------------------------------------------------------------
+void cmListFileParser::AddArgument(cmListFileLexer_Token* token,
+ cmListFileArgument::Delimiter delim)
+{
+ cmListFileArgument a(token->text, delim, this->FileName, token->line);
+ this->Function.Arguments.push_back(a);
+}
+
+//----------------------------------------------------------------------------
std::ostream& operator<<(std::ostream& os, cmListFileContext const& lfc)
{
os << lfc.FilePath;
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5d155d2df32b63bbc98c3cd112ea3edb4f0a55cf
commit 5d155d2df32b63bbc98c3cd112ea3edb4f0a55cf
Author: Brad King <brad.king at kitware.com>
AuthorDate: Sat Feb 16 20:10:21 2013 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Aug 6 15:20:08 2013 -0400
Add RunCMake.Syntax test cases for command invocation styles
Cover commands with whitespace present in allowed combinations.
Also cover command error cases such as two on one line.
diff --git a/Tests/RunCMake/Syntax/.gitattributes b/Tests/RunCMake/Syntax/.gitattributes
new file mode 100644
index 0000000..fc9ebff
--- /dev/null
+++ b/Tests/RunCMake/Syntax/.gitattributes
@@ -0,0 +1 @@
+CommandTabs.cmake whitespace=-tab-in-indent
diff --git a/Tests/RunCMake/Syntax/CommandComments-stderr.txt b/Tests/RunCMake/Syntax/CommandComments-stderr.txt
new file mode 100644
index 0000000..df72cc5
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CommandComments-stderr.txt
@@ -0,0 +1,4 @@
+Example Message
+Example Message
+Example Message
+Second Line of Example
diff --git a/Tests/RunCMake/Syntax/CommandComments.cmake b/Tests/RunCMake/Syntax/CommandComments.cmake
new file mode 100644
index 0000000..0fd7484
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CommandComments.cmake
@@ -0,0 +1,6 @@
+message("Example Message"#)
+ )
+message ("Example Message" # )
+ )
+message( "Example Message\n" # "Commented" )
+ "Second Line of Example")
diff --git a/Tests/RunCMake/Syntax/CommandError0-result.txt b/Tests/RunCMake/Syntax/CommandError0-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CommandError0-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/CommandError0-stderr.txt b/Tests/RunCMake/Syntax/CommandError0-stderr.txt
new file mode 100644
index 0000000..24d7997
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CommandError0-stderr.txt
@@ -0,0 +1,8 @@
+CMake Error: Error in cmake code at
+.*/Tests/RunCMake/Syntax/CommandError0.cmake:2:
+Parse error. Expected "\(", got newline with text "
+".
+CMake Error at CMakeLists.txt:3 \(include\):
+ include could not find load file:
+
+ CommandError0.cmake
diff --git a/Tests/RunCMake/Syntax/CommandError0.cmake b/Tests/RunCMake/Syntax/CommandError0.cmake
new file mode 100644
index 0000000..3222a97
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CommandError0.cmake
@@ -0,0 +1,2 @@
+message
+ ("Example Message")
diff --git a/Tests/RunCMake/Syntax/CommandError1-result.txt b/Tests/RunCMake/Syntax/CommandError1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CommandError1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/CommandError1-stderr.txt b/Tests/RunCMake/Syntax/CommandError1-stderr.txt
new file mode 100644
index 0000000..599f600
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CommandError1-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error: Error in cmake code at
+.*/Tests/RunCMake/Syntax/CommandError1.cmake:1:
+Parse error. Expected a newline, got identifier with text "message".
+CMake Error at CMakeLists.txt:3 \(include\):
+ include could not find load file:
+
+ CommandError1.cmake
diff --git a/Tests/RunCMake/Syntax/CommandError1.cmake b/Tests/RunCMake/Syntax/CommandError1.cmake
new file mode 100644
index 0000000..f8661a1
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CommandError1.cmake
@@ -0,0 +1 @@
+message("Example Message") message("Second Message")
diff --git a/Tests/RunCMake/Syntax/CommandNewlines-stderr.txt b/Tests/RunCMake/Syntax/CommandNewlines-stderr.txt
new file mode 100644
index 0000000..571b152
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CommandNewlines-stderr.txt
@@ -0,0 +1,3 @@
+Example Message
+Example Message
+Example Message
diff --git a/Tests/RunCMake/Syntax/CommandNewlines.cmake b/Tests/RunCMake/Syntax/CommandNewlines.cmake
new file mode 100644
index 0000000..0587afb
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CommandNewlines.cmake
@@ -0,0 +1,10 @@
+message(
+ "Example Message")
+message (
+ "Example Message"
+ )
+message(
+
+ "Example Message"
+
+ )
diff --git a/Tests/RunCMake/Syntax/CommandSpaces-stderr.txt b/Tests/RunCMake/Syntax/CommandSpaces-stderr.txt
new file mode 100644
index 0000000..54a8b38
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CommandSpaces-stderr.txt
@@ -0,0 +1,6 @@
+Example Message
+Example Message
+Example Message
+Example Message
+Example Message
+Example Message
diff --git a/Tests/RunCMake/Syntax/CommandSpaces.cmake b/Tests/RunCMake/Syntax/CommandSpaces.cmake
new file mode 100644
index 0000000..5bd4294
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CommandSpaces.cmake
@@ -0,0 +1,6 @@
+message("Example Message")
+message ("Example Message")
+message( "Example Message" )
+message( "Example Message")
+ message ( "Example Message")
+message ( Example " " Message )
diff --git a/Tests/RunCMake/Syntax/CommandTabs-stderr.txt b/Tests/RunCMake/Syntax/CommandTabs-stderr.txt
new file mode 100644
index 0000000..54a8b38
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CommandTabs-stderr.txt
@@ -0,0 +1,6 @@
+Example Message
+Example Message
+Example Message
+Example Message
+Example Message
+Example Message
diff --git a/Tests/RunCMake/Syntax/CommandTabs.cmake b/Tests/RunCMake/Syntax/CommandTabs.cmake
new file mode 100644
index 0000000..93876f8
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CommandTabs.cmake
@@ -0,0 +1,6 @@
+message("Example Message")
+message ("Example Message")
+message( "Example Message" )
+message( "Example Message")
+ message ( "Example Message")
+message ( Example " " Message )
diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
index f2424c9..b1eeff9 100644
--- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
@@ -1,5 +1,11 @@
include(RunCMake)
+run_cmake(CommandSpaces)
+run_cmake(CommandTabs)
+run_cmake(CommandNewlines)
+run_cmake(CommandComments)
+run_cmake(CommandError0)
+run_cmake(CommandError1)
run_cmake(String0)
run_cmake(String1)
run_cmake(StringNoSpace)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=95c04da78dac218cd346a3a4c905754a79a7c42d
commit 95c04da78dac218cd346a3a4c905754a79a7c42d
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Aug 6 10:07:58 2012 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Aug 6 15:20:08 2013 -0400
cmListFileArgument: Generalize 'Quoted' bool to 'Delimeter' enum
Replace the boolean value that indicates whether an argument is unquoted
or quoted with a generalized enumeration of possible argument types.
For now "Quoted" and "Unquoted" remain the only types.
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index 48ae50e..cb62f21 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -422,8 +422,9 @@ int CCONV cmExecuteCommand(void *arg, const char *name,
for(int i = 0; i < numArgs; ++i)
{
// Assume all arguments are quoted.
- lff.Arguments.push_back(cmListFileArgument(args[i], true,
- "[CMake-Plugin]", 0));
+ lff.Arguments.push_back(
+ cmListFileArgument(args[i], cmListFileArgument::Quoted,
+ "[CMake-Plugin]", 0));
}
cmExecutionStatus status;
return mf->ExecuteCommand(lff,status);
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 36d84f3..7b25351 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -196,7 +196,8 @@ bool cmListFile::ParseFile(const char* filename,
{
cmListFileFunction project;
project.Name = "PROJECT";
- cmListFileArgument prj("Project", false, filename, 0);
+ cmListFileArgument prj("Project", cmListFileArgument::Unquoted,
+ filename, 0);
project.Arguments.push_back(prj);
this->Functions.insert(this->Functions.begin(),project);
}
@@ -243,8 +244,8 @@ bool cmListFileCacheParseFunction(cmListFileLexer* lexer,
if(token->type == cmListFileLexer_Token_ParenLeft)
{
parenDepth++;
- cmListFileArgument a("(",
- false, filename, token->line);
+ cmListFileArgument a("(", cmListFileArgument::Unquoted,
+ filename, token->line);
function.Arguments.push_back(a);
}
else if(token->type == cmListFileLexer_Token_ParenRight)
@@ -254,21 +255,21 @@ bool cmListFileCacheParseFunction(cmListFileLexer* lexer,
return true;
}
parenDepth--;
- cmListFileArgument a(")",
- false, filename, token->line);
+ cmListFileArgument a(")", cmListFileArgument::Unquoted,
+ filename, token->line);
function.Arguments.push_back(a);
}
else if(token->type == cmListFileLexer_Token_Identifier ||
token->type == cmListFileLexer_Token_ArgumentUnquoted)
{
- cmListFileArgument a(token->text,
- false, filename, token->line);
+ cmListFileArgument a(token->text, cmListFileArgument::Unquoted,
+ filename, token->line);
function.Arguments.push_back(a);
}
else if(token->type == cmListFileLexer_Token_ArgumentQuoted)
{
- cmListFileArgument a(token->text,
- true, filename, token->line);
+ cmListFileArgument a(token->text, cmListFileArgument::Quoted,
+ filename, token->line);
function.Arguments.push_back(a);
}
else if(token->type != cmListFileLexer_Token_Newline)
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index fec3d07..7bb3b34 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -25,22 +25,27 @@ class cmMakefile;
struct cmListFileArgument
{
- cmListFileArgument(): Value(), Quoted(false), FilePath(0), Line(0) {}
+ enum Delimiter
+ {
+ Unquoted,
+ Quoted
+ };
+ cmListFileArgument(): Value(), Delim(Unquoted), FilePath(0), Line(0) {}
cmListFileArgument(const cmListFileArgument& r):
- Value(r.Value), Quoted(r.Quoted), FilePath(r.FilePath), Line(r.Line) {}
- cmListFileArgument(const std::string& v, bool q, const char* file,
- long line): Value(v), Quoted(q),
+ Value(r.Value), Delim(r.Delim), FilePath(r.FilePath), Line(r.Line) {}
+ cmListFileArgument(const std::string& v, Delimiter d, const char* file,
+ long line): Value(v), Delim(d),
FilePath(file), Line(line) {}
bool operator == (const cmListFileArgument& r) const
{
- return (this->Value == r.Value) && (this->Quoted == r.Quoted);
+ return (this->Value == r.Value) && (this->Delim == r.Delim);
}
bool operator != (const cmListFileArgument& r) const
{
return !(*this == r);
}
std::string Value;
- bool Quoted;
+ Delimiter Delim;
const char* FilePath;
long Line;
};
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index bd7ec00..8ba612c 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -227,7 +227,7 @@ bool cmMacroHelperCommand::InvokeInitialPass
}
arg.Value = tmps;
- arg.Quoted = k->Quoted;
+ arg.Delim = k->Delim;
arg.FilePath = k->FilePath;
arg.Line = k->Line;
newLFF.Arguments.push_back(arg);
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index aae92dd..c4859b6 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2799,7 +2799,7 @@ bool cmMakefile::ExpandArguments(
// If the argument is quoted, it should be one argument.
// Otherwise, it may be a list of arguments.
- if(i->Quoted)
+ if(i->Delim == cmListFileArgument::Quoted)
{
outArgs.push_back(value);
}
diff --git a/Source/cmVariableWatchCommand.cxx b/Source/cmVariableWatchCommand.cxx
index 297a92b..70c6524 100644
--- a/Source/cmVariableWatchCommand.cxx
+++ b/Source/cmVariableWatchCommand.cxx
@@ -86,15 +86,20 @@ void cmVariableWatchCommand::VariableAccessed(const std::string& variable,
std::string command = *it;
newLFF.Arguments.clear();
newLFF.Arguments.push_back(
- cmListFileArgument(variable, true, "unknown", 9999));
+ cmListFileArgument(variable, cmListFileArgument::Quoted,
+ "unknown", 9999));
newLFF.Arguments.push_back(
- cmListFileArgument(accessString, true, "unknown", 9999));
+ cmListFileArgument(accessString, cmListFileArgument::Quoted,
+ "unknown", 9999));
newLFF.Arguments.push_back(
- cmListFileArgument(newValue?newValue:"", true, "unknown", 9999));
+ cmListFileArgument(newValue?newValue:"", cmListFileArgument::Quoted,
+ "unknown", 9999));
newLFF.Arguments.push_back(
- cmListFileArgument(currentListFile, true, "unknown", 9999));
+ cmListFileArgument(currentListFile, cmListFileArgument::Quoted,
+ "unknown", 9999));
newLFF.Arguments.push_back(
- cmListFileArgument(stack, true, "unknown", 9999));
+ cmListFileArgument(stack, cmListFileArgument::Quoted,
+ "unknown", 9999));
newLFF.Name = command;
newLFF.FilePath = "Some weird path";
newLFF.Line = 9999;
diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx
index 4000345..7d2eead 100644
--- a/Source/cmWhileCommand.cxx
+++ b/Source/cmWhileCommand.cxx
@@ -49,9 +49,9 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
unsigned int i;
for(i =0; i < this->Args.size(); ++i)
{
- err += (this->Args[i].Quoted?"\"":"");
+ err += (this->Args[i].Delim?"\"":"");
err += this->Args[i].Value;
- err += (this->Args[i].Quoted?"\"":"");
+ err += (this->Args[i].Delim?"\"":"");
err += " ";
}
err += "(";
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2362ea01974b96ca14b72a6e494eceac603f0b0a
commit 2362ea01974b96ca14b72a6e494eceac603f0b0a
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Aug 6 09:53:03 2012 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Aug 6 15:20:03 2013 -0400
cmListFileLexer: Split normal and legacy unquoted arguments
Match legacy arguments separately. Add macros to simplify and clarify
matching rules.
diff --git a/Source/cmListFileLexer.c b/Source/cmListFileLexer.c
index ff54d04..a256b9b 100644
--- a/Source/cmListFileLexer.c
+++ b/Source/cmListFileLexer.c
@@ -369,8 +369,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
-#define YY_NUM_RULES 15
-#define YY_END_OF_BUFFER 16
+#define YY_NUM_RULES 16
+#define YY_END_OF_BUFFER 17
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -378,12 +378,13 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[40] =
+static yyconst flex_int16_t yy_accept[44] =
{ 0,
- 0, 0, 0, 0, 16, 6, 13, 1, 7, 2,
- 6, 3, 4, 6, 14, 8, 10, 11, 12, 6,
- 0, 6, 0, 2, 0, 5, 6, 8, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 0, 0
+ 0, 0, 0, 0, 17, 6, 14, 1, 8, 2,
+ 6, 3, 4, 6, 15, 9, 11, 12, 13, 6,
+ 0, 6, 0, 2, 0, 5, 6, 9, 0, 10,
+ 0, 7, 0, 0, 0, 7, 0, 7, 0, 0,
+ 0, 0, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
@@ -424,58 +425,64 @@ static yyconst flex_int32_t yy_meta[13] =
4, 1
} ;
-static yyconst flex_int16_t yy_base[49] =
+static yyconst flex_int16_t yy_base[54] =
{ 0,
- 0, 0, 10, 20, 35, 32, 86, 86, 86, 0,
- 26, 86, 86, 35, 0, 19, 86, 86, 44, 0,
- 49, 22, 0, 0, 20, 0, 0, 16, 22, 86,
- 0, 18, 0, 15, 12, 11, 10, 9, 86, 61,
- 65, 69, 73, 77, 13, 81, 12, 10
+ 0, 0, 10, 20, 36, 32, 102, 102, 102, 0,
+ 27, 102, 102, 35, 0, 22, 102, 102, 44, 0,
+ 49, 23, 0, 0, 21, 0, 0, 17, 23, 102,
+ 0, 61, 19, 0, 17, 0, 15, 13, 0, 11,
+ 10, 9, 102, 73, 77, 81, 85, 89, 13, 93,
+ 12, 97, 10
} ;
-static yyconst flex_int16_t yy_def[49] =
+static yyconst flex_int16_t yy_def[54] =
{ 0,
- 39, 1, 40, 40, 39, 39, 39, 39, 39, 41,
- 6, 39, 39, 6, 42, 43, 39, 39, 43, 6,
- 39, 6, 44, 41, 45, 14, 6, 43, 43, 39,
- 21, 21, 46, 47, 45, 48, 47, 48, 0, 39,
- 39, 39, 39, 39, 39, 39, 39, 39
+ 43, 1, 44, 44, 43, 43, 43, 43, 43, 45,
+ 6, 43, 43, 6, 46, 47, 43, 43, 47, 6,
+ 43, 6, 48, 45, 49, 14, 6, 47, 47, 43,
+ 21, 43, 21, 50, 51, 32, 49, 32, 52, 53,
+ 51, 53, 0, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43
} ;
-static yyconst flex_int16_t yy_nxt[99] =
+static yyconst flex_int16_t yy_nxt[115] =
{ 0,
6, 7, 8, 7, 9, 10, 11, 12, 13, 6,
- 14, 15, 17, 38, 18, 37, 35, 31, 20, 31,
- 27, 19, 17, 20, 18, 36, 28, 29, 27, 34,
- 29, 19, 20, 25, 39, 39, 21, 39, 22, 39,
- 39, 20, 20, 23, 26, 26, 30, 39, 28, 31,
- 31, 39, 39, 20, 39, 32, 39, 39, 31, 31,
- 33, 16, 16, 16, 16, 24, 39, 24, 24, 27,
- 39, 27, 27, 28, 39, 39, 28, 20, 39, 20,
- 20, 31, 39, 31, 31, 5, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39
-
+ 14, 15, 17, 42, 18, 41, 37, 31, 32, 31,
+ 35, 19, 17, 36, 18, 32, 40, 28, 29, 36,
+ 35, 19, 20, 29, 25, 43, 21, 43, 22, 43,
+ 43, 20, 20, 23, 26, 26, 30, 43, 28, 31,
+ 31, 43, 43, 32, 43, 33, 43, 43, 31, 31,
+ 34, 32, 43, 43, 43, 21, 43, 38, 43, 43,
+ 32, 32, 39, 16, 16, 16, 16, 24, 43, 24,
+ 24, 27, 43, 27, 27, 28, 43, 43, 28, 20,
+ 43, 20, 20, 31, 43, 31, 31, 32, 43, 32,
+
+ 32, 5, 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43
} ;
-static yyconst flex_int16_t yy_chk[99] =
+static yyconst flex_int16_t yy_chk[115] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 3, 48, 3, 47, 45, 38, 37, 36,
- 35, 3, 4, 34, 4, 32, 29, 28, 25, 22,
- 16, 4, 6, 11, 5, 0, 6, 0, 6, 0,
+ 1, 1, 3, 53, 3, 51, 49, 42, 41, 40,
+ 38, 3, 4, 37, 4, 35, 33, 29, 28, 25,
+ 22, 4, 6, 16, 11, 5, 6, 0, 6, 0,
0, 6, 6, 6, 14, 14, 19, 0, 19, 21,
21, 0, 0, 21, 0, 21, 0, 0, 21, 21,
- 21, 40, 40, 40, 40, 41, 0, 41, 41, 42,
- 0, 42, 42, 43, 0, 0, 43, 44, 0, 44,
- 44, 46, 0, 46, 46, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39
+ 21, 32, 0, 0, 0, 32, 0, 32, 0, 0,
+ 32, 32, 32, 44, 44, 44, 44, 45, 0, 45,
+ 45, 46, 0, 46, 46, 47, 0, 0, 47, 48,
+ 0, 48, 48, 50, 0, 50, 50, 52, 0, 52,
+ 52, 43, 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43
} ;
/* Table of booleans, true if rule could match eol. */
-static yyconst flex_int32_t yy_rule_can_match_eol[16] =
+static yyconst flex_int32_t yy_rule_can_match_eol[17] =
{ 0,
-1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, };
+1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, };
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
@@ -554,7 +561,7 @@ static void cmListFileLexerDestroy(cmListFileLexer* lexer);
/*--------------------------------------------------------------------------*/
-#line 560 "cmListFileLexer.c"
+#line 567 "cmListFileLexer.c"
#define INITIAL 0
#define STRING 1
@@ -783,10 +790,10 @@ YY_DECL
int yy_act;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-#line 79 "cmListFileLexer.in.l"
+#line 81 "cmListFileLexer.in.l"
-#line 794 "cmListFileLexer.c"
+#line 801 "cmListFileLexer.c"
if ( !yyg->yy_init )
{
@@ -839,13 +846,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 40 )
+ if ( yy_current_state >= 44 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
- while ( yy_base[yy_current_state] != 86 );
+ while ( yy_base[yy_current_state] != 102 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
@@ -884,7 +891,7 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
/* rule 1 can match eol */
YY_RULE_SETUP
-#line 81 "cmListFileLexer.in.l"
+#line 83 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_Newline;
cmListFileLexerSetToken(lexer, yytext, yyleng);
@@ -894,14 +901,14 @@ YY_RULE_SETUP
}
case 2:
YY_RULE_SETUP
-#line 89 "cmListFileLexer.in.l"
+#line 91 "cmListFileLexer.in.l"
{
lexer->column += yyleng;
}
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 93 "cmListFileLexer.in.l"
+#line 95 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_ParenLeft;
cmListFileLexerSetToken(lexer, yytext, yyleng);
@@ -910,7 +917,7 @@ YY_RULE_SETUP
}
case 4:
YY_RULE_SETUP
-#line 100 "cmListFileLexer.in.l"
+#line 102 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_ParenRight;
cmListFileLexerSetToken(lexer, yytext, yyleng);
@@ -919,7 +926,7 @@ YY_RULE_SETUP
}
case 5:
YY_RULE_SETUP
-#line 107 "cmListFileLexer.in.l"
+#line 109 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_Identifier;
cmListFileLexerSetToken(lexer, yytext, yyleng);
@@ -928,7 +935,7 @@ YY_RULE_SETUP
}
case 6:
YY_RULE_SETUP
-#line 114 "cmListFileLexer.in.l"
+#line 116 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_ArgumentUnquoted;
cmListFileLexerSetToken(lexer, yytext, yyleng);
@@ -937,7 +944,16 @@ YY_RULE_SETUP
}
case 7:
YY_RULE_SETUP
-#line 121 "cmListFileLexer.in.l"
+#line 123 "cmListFileLexer.in.l"
+{
+ lexer->token.type = cmListFileLexer_Token_ArgumentUnquoted;
+ cmListFileLexerSetToken(lexer, yytext, yyleng);
+ lexer->column += yyleng;
+ return 1;
+}
+case 8:
+YY_RULE_SETUP
+#line 130 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_ArgumentQuoted;
cmListFileLexerSetToken(lexer, "", 0);
@@ -945,67 +961,67 @@ YY_RULE_SETUP
BEGIN(STRING);
}
YY_BREAK
-case 8:
+case 9:
YY_RULE_SETUP
-#line 128 "cmListFileLexer.in.l"
+#line 137 "cmListFileLexer.in.l"
{
cmListFileLexerAppend(lexer, yytext, yyleng);
lexer->column += yyleng;
}
YY_BREAK
-case 9:
-/* rule 9 can match eol */
+case 10:
+/* rule 10 can match eol */
YY_RULE_SETUP
-#line 133 "cmListFileLexer.in.l"
+#line 142 "cmListFileLexer.in.l"
{
cmListFileLexerAppend(lexer, yytext, yyleng);
++lexer->line;
lexer->column = 1;
}
YY_BREAK
-case 10:
-/* rule 10 can match eol */
+case 11:
+/* rule 11 can match eol */
YY_RULE_SETUP
-#line 139 "cmListFileLexer.in.l"
+#line 148 "cmListFileLexer.in.l"
{
cmListFileLexerAppend(lexer, yytext, yyleng);
++lexer->line;
lexer->column = 1;
}
YY_BREAK
-case 11:
+case 12:
YY_RULE_SETUP
-#line 145 "cmListFileLexer.in.l"
+#line 154 "cmListFileLexer.in.l"
{
lexer->column += yyleng;
BEGIN(INITIAL);
return 1;
}
-case 12:
+case 13:
YY_RULE_SETUP
-#line 151 "cmListFileLexer.in.l"
+#line 160 "cmListFileLexer.in.l"
{
cmListFileLexerAppend(lexer, yytext, yyleng);
lexer->column += yyleng;
}
YY_BREAK
case YY_STATE_EOF(STRING):
-#line 156 "cmListFileLexer.in.l"
+#line 165 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_BadString;
BEGIN(INITIAL);
return 1;
}
-case 13:
+case 14:
YY_RULE_SETUP
-#line 162 "cmListFileLexer.in.l"
+#line 171 "cmListFileLexer.in.l"
{
lexer->column += yyleng;
}
YY_BREAK
-case 14:
+case 15:
YY_RULE_SETUP
-#line 166 "cmListFileLexer.in.l"
+#line 175 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_BadCharacter;
cmListFileLexerSetToken(lexer, yytext, yyleng);
@@ -1013,18 +1029,18 @@ YY_RULE_SETUP
return 1;
}
case YY_STATE_EOF(INITIAL):
-#line 173 "cmListFileLexer.in.l"
+#line 182 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_None;
cmListFileLexerSetToken(lexer, 0, 0);
return 0;
}
-case 15:
+case 16:
YY_RULE_SETUP
-#line 179 "cmListFileLexer.in.l"
+#line 188 "cmListFileLexer.in.l"
ECHO;
YY_BREAK
-#line 1041 "cmListFileLexer.c"
+#line 1058 "cmListFileLexer.c"
case YY_END_OF_BUFFER:
{
@@ -1316,7 +1332,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 40 )
+ if ( yy_current_state >= 44 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1345,11 +1361,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 40 )
+ if ( yy_current_state >= 44 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 39);
+ yy_is_jam = (yy_current_state == 43);
return yy_is_jam ? 0 : yy_current_state;
}
@@ -2146,7 +2162,7 @@ void cmListFileLexer_yyfree (void * ptr , yyscan_t yyscanner)
#define YYTABLES_NAME "yytables"
-#line 179 "cmListFileLexer.in.l"
+#line 188 "cmListFileLexer.in.l"
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;
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a7786a1d5c4b27889be1d6a25b0c180051f2cbc
commit 0a7786a1d5c4b27889be1d6a25b0c180051f2cbc
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Aug 6 09:41:10 2012 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Aug 6 15:14:19 2013 -0400
cmListFileLexer: Fix line number after backslash in string
If a line inside a string ends in a backslash count the following
newline character as a line increment. Add a test covering this case to
verify that subsequent line numbers are correct.
diff --git a/Source/cmListFileLexer.c b/Source/cmListFileLexer.c
index e7965b5..ff54d04 100644
--- a/Source/cmListFileLexer.c
+++ b/Source/cmListFileLexer.c
@@ -9,7 +9,7 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 31
+#define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@@ -31,7 +31,15 @@
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
-#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types.
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
#include <inttypes.h>
typedef int8_t flex_int8_t;
typedef uint8_t flex_uint8_t;
@@ -46,7 +54,6 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
@@ -77,6 +84,8 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
+#endif /* ! C99 */
+
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@@ -86,11 +95,12 @@ typedef unsigned int flex_uint32_t;
#else /* ! __cplusplus */
-#if __STDC__
+/* C99 requires __STDC__ to be defined as 1. */
+#if defined (__STDC__)
#define YY_USE_CONST
-#endif /* __STDC__ */
+#endif /* defined (__STDC__) */
#endif /* ! __cplusplus */
#ifdef YY_USE_CONST
@@ -126,8 +136,6 @@ typedef void* yyscan_t;
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
#define yy_flex_debug yyg->yy_flex_debug_r
-int cmListFileLexer_yylex_init (yyscan_t* scanner);
-
/* Enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
@@ -151,9 +159,21 @@ int cmListFileLexer_yylex_init (yyscan_t* scanner);
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
#endif
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
#define YY_TYPEDEF_YY_BUFFER_STATE
typedef struct yy_buffer_state *YY_BUFFER_STATE;
@@ -192,14 +212,9 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
} \
while ( 0 )
-/* The following is because we cannot portably get our hands on size_t
- * (without autoconf's help, which isn't available because we want
- * flex-generated scanners to compile on their own).
- */
-
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
-typedef unsigned int yy_size_t;
+typedef size_t yy_size_t;
#endif
#ifndef YY_STRUCT_YY_BUFFER_STATE
@@ -354,8 +369,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
-#define YY_NUM_RULES 14
-#define YY_END_OF_BUFFER 15
+#define YY_NUM_RULES 15
+#define YY_END_OF_BUFFER 16
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -363,12 +378,12 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[39] =
+static yyconst flex_int16_t yy_accept[40] =
{ 0,
- 0, 0, 0, 0, 15, 6, 12, 1, 7, 2,
- 6, 3, 4, 6, 13, 8, 9, 10, 11, 6,
- 0, 6, 0, 2, 0, 5, 6, 8, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0
+ 0, 0, 0, 0, 16, 6, 13, 1, 7, 2,
+ 6, 3, 4, 6, 14, 8, 10, 11, 12, 6,
+ 0, 6, 0, 2, 0, 5, 6, 8, 0, 9,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
@@ -409,60 +424,58 @@ static yyconst flex_int32_t yy_meta[13] =
4, 1
} ;
-static yyconst flex_int16_t yy_base[48] =
+static yyconst flex_int16_t yy_base[49] =
{ 0,
- 0, 0, 10, 20, 34, 32, 89, 89, 89, 0,
- 23, 89, 89, 35, 0, 18, 89, 89, 44, 0,
- 49, 21, 0, 0, 19, 0, 0, 15, 59, 0,
- 18, 0, 15, 12, 11, 10, 9, 89, 64, 68,
- 72, 76, 80, 13, 84, 12, 10
+ 0, 0, 10, 20, 35, 32, 86, 86, 86, 0,
+ 26, 86, 86, 35, 0, 19, 86, 86, 44, 0,
+ 49, 22, 0, 0, 20, 0, 0, 16, 22, 86,
+ 0, 18, 0, 15, 12, 11, 10, 9, 86, 61,
+ 65, 69, 73, 77, 13, 81, 12, 10
} ;
-static yyconst flex_int16_t yy_def[48] =
+static yyconst flex_int16_t yy_def[49] =
{ 0,
- 38, 1, 39, 39, 38, 38, 38, 38, 38, 40,
- 6, 38, 38, 6, 41, 42, 38, 38, 42, 6,
- 38, 6, 43, 40, 44, 14, 6, 42, 42, 21,
- 21, 45, 46, 44, 47, 46, 47, 0, 38, 38,
- 38, 38, 38, 38, 38, 38, 38
+ 39, 1, 40, 40, 39, 39, 39, 39, 39, 41,
+ 6, 39, 39, 6, 42, 43, 39, 39, 43, 6,
+ 39, 6, 44, 41, 45, 14, 6, 43, 43, 39,
+ 21, 21, 46, 47, 45, 48, 47, 48, 0, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39
} ;
-static yyconst flex_int16_t yy_nxt[102] =
+static yyconst flex_int16_t yy_nxt[99] =
{ 0,
6, 7, 8, 7, 9, 10, 11, 12, 13, 6,
- 14, 15, 17, 37, 18, 36, 34, 30, 20, 30,
- 27, 19, 17, 20, 18, 35, 29, 27, 33, 29,
- 25, 19, 20, 38, 38, 38, 21, 38, 22, 38,
- 38, 20, 20, 23, 26, 26, 28, 38, 28, 30,
- 30, 38, 38, 20, 38, 31, 38, 38, 30, 30,
- 32, 28, 38, 28, 16, 16, 16, 16, 24, 38,
- 24, 24, 27, 38, 27, 27, 28, 38, 38, 28,
- 20, 38, 20, 20, 30, 38, 30, 30, 5, 38,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
-
- 38
+ 14, 15, 17, 38, 18, 37, 35, 31, 20, 31,
+ 27, 19, 17, 20, 18, 36, 28, 29, 27, 34,
+ 29, 19, 20, 25, 39, 39, 21, 39, 22, 39,
+ 39, 20, 20, 23, 26, 26, 30, 39, 28, 31,
+ 31, 39, 39, 20, 39, 32, 39, 39, 31, 31,
+ 33, 16, 16, 16, 16, 24, 39, 24, 24, 27,
+ 39, 27, 27, 28, 39, 39, 28, 20, 39, 20,
+ 20, 31, 39, 31, 31, 5, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39
+
} ;
-static yyconst flex_int16_t yy_chk[102] =
+static yyconst flex_int16_t yy_chk[99] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 3, 47, 3, 46, 44, 37, 36, 35,
- 34, 3, 4, 33, 4, 31, 28, 25, 22, 16,
- 11, 4, 6, 5, 0, 0, 6, 0, 6, 0,
+ 1, 1, 3, 48, 3, 47, 45, 38, 37, 36,
+ 35, 3, 4, 34, 4, 32, 29, 28, 25, 22,
+ 16, 4, 6, 11, 5, 0, 6, 0, 6, 0,
0, 6, 6, 6, 14, 14, 19, 0, 19, 21,
21, 0, 0, 21, 0, 21, 0, 0, 21, 21,
- 21, 29, 0, 29, 39, 39, 39, 39, 40, 0,
- 40, 40, 41, 0, 41, 41, 42, 0, 0, 42,
- 43, 0, 43, 43, 45, 0, 45, 45, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
+ 21, 40, 40, 40, 40, 41, 0, 41, 41, 42,
+ 0, 42, 42, 43, 0, 0, 43, 44, 0, 44,
+ 44, 46, 0, 46, 46, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39
- 38
} ;
/* Table of booleans, true if rule could match eol. */
-static yyconst flex_int32_t yy_rule_can_match_eol[15] =
+static yyconst flex_int32_t yy_rule_can_match_eol[16] =
{ 0,
-1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, };
+1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, };
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
@@ -494,6 +507,7 @@ Run flex like this:
Modify cmListFileLexer.c:
- remove TABs
+ - remove use of the 'register' storage class specifier
- remove the yyunput function
- add a statement "(void)yyscanner;" to the top of these methods:
yy_fatal_error, cmListFileLexer_yyalloc, cmListFileLexer_yyrealloc, cmListFileLexer_yyfree
@@ -540,7 +554,7 @@ static void cmListFileLexerDestroy(cmListFileLexer* lexer);
/*--------------------------------------------------------------------------*/
-#line 568 "cmListFileLexer.c"
+#line 560 "cmListFileLexer.c"
#define INITIAL 0
#define STRING 1
@@ -591,6 +605,12 @@ struct yyguts_t
}; /* end struct yyguts_t */
+static int yy_init_globals (yyscan_t yyscanner );
+
+int cmListFileLexer_yylex_init (yyscan_t* scanner);
+
+int cmListFileLexer_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
@@ -620,6 +640,10 @@ int cmListFileLexer_yyget_lineno (yyscan_t yyscanner );
void cmListFileLexer_yyset_lineno (int line_number ,yyscan_t yyscanner );
+int cmListFileLexer_yyget_column (yyscan_t yyscanner );
+
+void cmListFileLexer_yyset_column (int column_no ,yyscan_t yyscanner );
+
/* Macros after this point can all be overridden by user definitions in
* section 1.
*/
@@ -652,7 +676,12 @@ static int input (yyscan_t yyscanner );
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
#endif
/* Copy whatever the last rule matched to the standard output. */
@@ -660,7 +689,7 @@ static int input (yyscan_t yyscanner );
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -754,14 +783,14 @@ YY_DECL
int yy_act;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-#line 100 "cmListFileLexer.in.l"
+#line 79 "cmListFileLexer.in.l"
-#line 787 "cmListFileLexer.c"
+#line 794 "cmListFileLexer.c"
- if ( yyg->yy_init )
+ if ( !yyg->yy_init )
{
- yyg->yy_init = 0;
+ yyg->yy_init = 1;
#ifdef YY_USER_INIT
YY_USER_INIT;
@@ -810,13 +839,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 39 )
+ if ( yy_current_state >= 40 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
- while ( yy_base[yy_current_state] != 89 );
+ while ( yy_base[yy_current_state] != 86 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
@@ -855,7 +884,7 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
/* rule 1 can match eol */
YY_RULE_SETUP
-#line 102 "cmListFileLexer.in.l"
+#line 81 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_Newline;
cmListFileLexerSetToken(lexer, yytext, yyleng);
@@ -865,14 +894,14 @@ YY_RULE_SETUP
}
case 2:
YY_RULE_SETUP
-#line 110 "cmListFileLexer.in.l"
+#line 89 "cmListFileLexer.in.l"
{
lexer->column += yyleng;
}
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 114 "cmListFileLexer.in.l"
+#line 93 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_ParenLeft;
cmListFileLexerSetToken(lexer, yytext, yyleng);
@@ -881,7 +910,7 @@ YY_RULE_SETUP
}
case 4:
YY_RULE_SETUP
-#line 121 "cmListFileLexer.in.l"
+#line 100 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_ParenRight;
cmListFileLexerSetToken(lexer, yytext, yyleng);
@@ -890,7 +919,7 @@ YY_RULE_SETUP
}
case 5:
YY_RULE_SETUP
-#line 128 "cmListFileLexer.in.l"
+#line 107 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_Identifier;
cmListFileLexerSetToken(lexer, yytext, yyleng);
@@ -899,7 +928,7 @@ YY_RULE_SETUP
}
case 6:
YY_RULE_SETUP
-#line 135 "cmListFileLexer.in.l"
+#line 114 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_ArgumentUnquoted;
cmListFileLexerSetToken(lexer, yytext, yyleng);
@@ -908,7 +937,7 @@ YY_RULE_SETUP
}
case 7:
YY_RULE_SETUP
-#line 142 "cmListFileLexer.in.l"
+#line 121 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_ArgumentQuoted;
cmListFileLexerSetToken(lexer, "", 0);
@@ -917,9 +946,8 @@ YY_RULE_SETUP
}
YY_BREAK
case 8:
-/* rule 8 can match eol */
YY_RULE_SETUP
-#line 149 "cmListFileLexer.in.l"
+#line 128 "cmListFileLexer.in.l"
{
cmListFileLexerAppend(lexer, yytext, yyleng);
lexer->column += yyleng;
@@ -928,7 +956,7 @@ YY_RULE_SETUP
case 9:
/* rule 9 can match eol */
YY_RULE_SETUP
-#line 154 "cmListFileLexer.in.l"
+#line 133 "cmListFileLexer.in.l"
{
cmListFileLexerAppend(lexer, yytext, yyleng);
++lexer->line;
@@ -936,38 +964,48 @@ YY_RULE_SETUP
}
YY_BREAK
case 10:
+/* rule 10 can match eol */
+YY_RULE_SETUP
+#line 139 "cmListFileLexer.in.l"
+{
+ cmListFileLexerAppend(lexer, yytext, yyleng);
+ ++lexer->line;
+ lexer->column = 1;
+}
+ YY_BREAK
+case 11:
YY_RULE_SETUP
-#line 160 "cmListFileLexer.in.l"
+#line 145 "cmListFileLexer.in.l"
{
lexer->column += yyleng;
BEGIN(INITIAL);
return 1;
}
-case 11:
+case 12:
YY_RULE_SETUP
-#line 166 "cmListFileLexer.in.l"
+#line 151 "cmListFileLexer.in.l"
{
cmListFileLexerAppend(lexer, yytext, yyleng);
lexer->column += yyleng;
}
YY_BREAK
case YY_STATE_EOF(STRING):
-#line 171 "cmListFileLexer.in.l"
+#line 156 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_BadString;
BEGIN(INITIAL);
return 1;
}
-case 12:
+case 13:
YY_RULE_SETUP
-#line 177 "cmListFileLexer.in.l"
+#line 162 "cmListFileLexer.in.l"
{
lexer->column += yyleng;
}
YY_BREAK
-case 13:
+case 14:
YY_RULE_SETUP
-#line 181 "cmListFileLexer.in.l"
+#line 166 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_BadCharacter;
cmListFileLexerSetToken(lexer, yytext, yyleng);
@@ -975,18 +1013,18 @@ YY_RULE_SETUP
return 1;
}
case YY_STATE_EOF(INITIAL):
-#line 188 "cmListFileLexer.in.l"
+#line 173 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_None;
cmListFileLexerSetToken(lexer, 0, 0);
return 0;
}
-case 14:
+case 15:
YY_RULE_SETUP
-#line 194 "cmListFileLexer.in.l"
+#line 179 "cmListFileLexer.in.l"
ECHO;
YY_BREAK
-#line 1025 "cmListFileLexer.c"
+#line 1041 "cmListFileLexer.c"
case YY_END_OF_BUFFER:
{
@@ -1171,7 +1209,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
{
- size_t num_to_read =
+ int num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
@@ -1216,7 +1254,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- yyg->yy_n_chars, num_to_read );
+ yyg->yy_n_chars, (size_t) num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
}
@@ -1240,6 +1278,14 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
ret_val = EOB_ACT_CONTINUE_SCAN;
+ if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ /* Extend the array by 50%, plus the number we really need. */
+ yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) cmListFileLexer_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
+ if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ }
+
yyg->yy_n_chars += number_to_move;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
@@ -1270,7 +1316,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 39 )
+ if ( yy_current_state >= 40 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1287,7 +1333,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
{
int yy_is_jam;
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
char *yy_cp = yyg->yy_c_buf_p;
YY_CHAR yy_c = 1;
@@ -1299,11 +1345,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 39 )
+ if ( yy_current_state >= 40 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 38);
+ yy_is_jam = (yy_current_state == 39);
return yy_is_jam ? 0 : yy_current_state;
}
@@ -1633,6 +1679,8 @@ static void cmListFileLexer_yyensure_buffer_stack (yyscan_t yyscanner)
yyg->yy_buffer_stack = (struct yy_buffer_state**)cmListFileLexer_yyalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
+ if ( ! yyg->yy_buffer_stack )
+ YY_FATAL_ERROR( "out of dynamic memory in cmListFileLexer_yyensure_buffer_stack()" );
memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
@@ -1651,6 +1699,8 @@ static void cmListFileLexer_yyensure_buffer_stack (yyscan_t yyscanner)
(yyg->yy_buffer_stack,
num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
+ if ( ! yyg->yy_buffer_stack )
+ YY_FATAL_ERROR( "out of dynamic memory in cmListFileLexer_yyensure_buffer_stack()" );
/* zero only the new slots.*/
memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
@@ -1695,26 +1745,26 @@ YY_BUFFER_STATE cmListFileLexer_yy_scan_buffer (char * base, yy_size_t size ,
/** Setup the input buffer state to scan a string. The next call to cmListFileLexer_yylex() will
* scan from a @e copy of @a str.
- * @param str a NUL-terminated string to scan
+ * @param yystr a NUL-terminated string to scan
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
* cmListFileLexer_yy_scan_bytes() instead.
*/
-YY_BUFFER_STATE cmListFileLexer_yy_scan_string (yyconst char * yy_str , yyscan_t yyscanner)
+YY_BUFFER_STATE cmListFileLexer_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
{
- return cmListFileLexer_yy_scan_bytes(yy_str,strlen(yy_str) ,yyscanner);
+ return cmListFileLexer_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
}
/** Setup the input buffer state to scan the given bytes. The next call to cmListFileLexer_yylex() will
* scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE cmListFileLexer_yy_scan_bytes (yyconst char * bytes, int len , yyscan_t yyscanner)
+YY_BUFFER_STATE cmListFileLexer_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
char *buf;
@@ -1722,15 +1772,15 @@ YY_BUFFER_STATE cmListFileLexer_yy_scan_bytes (yyconst char * bytes, int len ,
int i;
/* Get memory for full buffer, including space for trailing EOB's. */
- n = len + 2;
+ n = _yybytes_len + 2;
buf = (char *) cmListFileLexer_yyalloc(n ,yyscanner );
if ( ! buf )
YY_FATAL_ERROR( "out of dynamic memory in cmListFileLexer_yy_scan_bytes()" );
- for ( i = 0; i < len; ++i )
- buf[i] = bytes[i];
+ for ( i = 0; i < _yybytes_len; ++i )
+ buf[i] = yybytes[i];
- buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+ buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
b = cmListFileLexer_yy_scan_buffer(buf,n ,yyscanner);
if ( ! b )
@@ -1918,21 +1968,87 @@ void cmListFileLexer_yyset_debug (int bdebug , yyscan_t yyscanner)
/* Accessor methods for yylval and yylloc */
+/* User-visible API */
+
+/* cmListFileLexer_yylex_init is special because it creates the scanner itself, so it is
+ * the ONLY reentrant function that doesn't take the scanner as the last argument.
+ * That's why we explicitly handle the declaration, instead of using our macros.
+ */
+
+int cmListFileLexer_yylex_init(yyscan_t* ptr_yy_globals)
+
+{
+ if (ptr_yy_globals == NULL){
+ errno = EINVAL;
+ return 1;
+ }
+
+ *ptr_yy_globals = (yyscan_t) cmListFileLexer_yyalloc ( sizeof( struct yyguts_t ), NULL );
+
+ if (*ptr_yy_globals == NULL){
+ errno = ENOMEM;
+ return 1;
+ }
+
+ /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
+ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
+
+ return yy_init_globals ( *ptr_yy_globals );
+}
+
+/* cmListFileLexer_yylex_init_extra has the same functionality as cmListFileLexer_yylex_init, but follows the
+ * convention of taking the scanner as the last argument. Note however, that
+ * this is a *pointer* to a scanner, as it will be allocated by this call (and
+ * is the reason, too, why this function also must handle its own declaration).
+ * The user defined value in the first argument will be available to cmListFileLexer_yyalloc in
+ * the yyextra field.
+ */
+
+int cmListFileLexer_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
+
+{
+ struct yyguts_t dummy_yyguts;
+
+ cmListFileLexer_yyset_extra (yy_user_defined, &dummy_yyguts);
+
+ if (ptr_yy_globals == NULL){
+ errno = EINVAL;
+ return 1;
+ }
+
+ *ptr_yy_globals = (yyscan_t) cmListFileLexer_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
+
+ if (*ptr_yy_globals == NULL){
+ errno = ENOMEM;
+ return 1;
+ }
+
+ /* By setting to 0xAA, we expose bugs in
+ yy_init_globals. Leave at 0x00 for releases. */
+ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
+
+ cmListFileLexer_yyset_extra (yy_user_defined, *ptr_yy_globals);
+
+ return yy_init_globals ( *ptr_yy_globals );
+}
+
static int yy_init_globals (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* Initialization is the same as for the non-reentrant scanner.
- This function is called once per scanner lifetime. */
+ * This function is called from cmListFileLexer_yylex_destroy(), so don't allocate here.
+ */
yyg->yy_buffer_stack = 0;
yyg->yy_buffer_stack_top = 0;
yyg->yy_buffer_stack_max = 0;
yyg->yy_c_buf_p = (char *) 0;
- yyg->yy_init = 1;
+ yyg->yy_init = 0;
yyg->yy_start = 0;
+
yyg->yy_start_stack_ptr = 0;
yyg->yy_start_stack_depth = 0;
- yyg->yy_start_stack = (int *) 0;
+ yyg->yy_start_stack = NULL;
/* Defined in main.c */
#ifdef YY_STDINIT
@@ -1949,33 +2065,6 @@ static int yy_init_globals (yyscan_t yyscanner)
return 0;
}
-/* User-visible API */
-
-/* cmListFileLexer_yylex_init is special because it creates the scanner itself, so it is
- * the ONLY reentrant function that doesn't take the scanner as the last argument.
- * That's why we explicitly handle the declaration, instead of using our macros.
- */
-
-int cmListFileLexer_yylex_init(yyscan_t* ptr_yy_globals)
-
-{
- if (ptr_yy_globals == NULL){
- errno = EINVAL;
- return 1;
- }
-
- *ptr_yy_globals = (yyscan_t) cmListFileLexer_yyalloc ( sizeof( struct yyguts_t ), NULL );
-
- if (*ptr_yy_globals == NULL){
- errno = ENOMEM;
- return 1;
- }
-
- memset(*ptr_yy_globals,0,sizeof(struct yyguts_t));
-
- return yy_init_globals ( *ptr_yy_globals );
-}
-
/* cmListFileLexer_yylex_destroy is for both reentrant and non-reentrant scanners. */
int cmListFileLexer_yylex_destroy (yyscan_t yyscanner)
{
@@ -1996,8 +2085,13 @@ int cmListFileLexer_yylex_destroy (yyscan_t yyscanner)
cmListFileLexer_yyfree(yyg->yy_start_stack ,yyscanner );
yyg->yy_start_stack = NULL;
+ /* Reset the globals. This is important in a non-reentrant scanner so the next time
+ * cmListFileLexer_yylex() is called, initialization will occur. */
+ yy_init_globals( yyscanner);
+
/* Destroy the main struct (reentrant only). */
cmListFileLexer_yyfree ( yyscanner , yyscanner );
+ yyscanner = NULL;
return 0;
}
@@ -2009,7 +2103,6 @@ int cmListFileLexer_yylex_destroy (yyscan_t yyscanner)
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
{
int i;
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
for ( i = 0; i < n; ++i )
s1[i] = s2[i];
}
@@ -2019,7 +2112,6 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yysca
static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
{
int n;
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
for ( n = 0; s[n]; ++n )
;
@@ -2054,19 +2146,7 @@ void cmListFileLexer_yyfree (void * ptr , yyscan_t yyscanner)
#define YYTABLES_NAME "yytables"
-#undef YY_NEW_FILE
-#undef YY_FLUSH_BUFFER
-#undef yy_set_bol
-#undef yy_new_buffer
-#undef yy_set_interactive
-#undef yytext_ptr
-#undef YY_DO_BEFORE_ACTION
-
-#ifdef YY_DECL_IS_OURS
-#undef YY_DECL_IS_OURS
-#undef YY_DECL
-#endif
-#line 194 "cmListFileLexer.in.l"
+#line 179 "cmListFileLexer.in.l"
@@ -2122,7 +2202,7 @@ static void cmListFileLexerAppend(cmListFileLexer* lexer, const char* text,
}
/* We need to extend the buffer. */
- temp = (char*)malloc(newSize);
+ temp = malloc(newSize);
if(lexer->token.text)
{
memcpy(temp, lexer->token.text, lexer->token.length);
diff --git a/Source/cmListFileLexer.in.l b/Source/cmListFileLexer.in.l
index eedf494..4459c7b 100644
--- a/Source/cmListFileLexer.in.l
+++ b/Source/cmListFileLexer.in.l
@@ -125,11 +125,17 @@ MAKEVAR \$\([A-Za-z0-9_]*\)
BEGIN(STRING);
}
-<STRING>([^\\\n\"]|\\(.|\n))+ {
+<STRING>([^\\\n\"]|\\.)+ {
cmListFileLexerAppend(lexer, yytext, yyleng);
lexer->column += yyleng;
}
+<STRING>\\\n {
+ cmListFileLexerAppend(lexer, yytext, yyleng);
+ ++lexer->line;
+ lexer->column = 1;
+}
+
<STRING>\n {
cmListFileLexerAppend(lexer, yytext, yyleng);
++lexer->line;
diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
index 4a3d462..f2424c9 100644
--- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
@@ -6,4 +6,5 @@ run_cmake(StringNoSpace)
run_cmake(Unquoted0)
run_cmake(Unquoted1)
run_cmake(UnterminatedCall1)
+run_cmake(UnterminatedCall2)
run_cmake(UnterminatedString)
diff --git a/Tests/RunCMake/Syntax/UnterminatedCall2-result.txt b/Tests/RunCMake/Syntax/UnterminatedCall2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedCall2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/UnterminatedCall2-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedCall2-stderr.txt
new file mode 100644
index 0000000..065de30
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedCall2-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error: Error in cmake code at
+.*/Syntax/UnterminatedCall2.cmake:4:
+Parse error. Function missing ending "\)". End of file reached.
+CMake Error at CMakeLists.txt:3 \(include\):
+ include could not find load file:
+
+ UnterminatedCall2.cmake
diff --git a/Tests/RunCMake/Syntax/UnterminatedCall2.cmake b/Tests/RunCMake/Syntax/UnterminatedCall2.cmake
new file mode 100644
index 0000000..26e9e62
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedCall2.cmake
@@ -0,0 +1,3 @@
+set(var "\
+")
+message(
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6db5c8c353ce3618c0e58274caf572187a1eeb2b
commit 6db5c8c353ce3618c0e58274caf572187a1eeb2b
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Aug 6 09:29:20 2012 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Aug 6 15:09:08 2013 -0400
Add RunCMake.Syntax test to cover argument parsing
Test basic unquoted and quoted argument parsing cases including failure
on an unterminated string and an unterminated command invocation. Also
cover arguments not separated by any spaces, which is accidentally
allowed by the current parser.
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 1b9c17b..e45aba3 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -85,6 +85,7 @@ if(NOT WIN32)
endif()
endif()
add_RunCMake_test(CompatibleInterface)
+add_RunCMake_test(Syntax)
add_RunCMake_test(add_dependencies)
add_RunCMake_test(build_command)
diff --git a/Tests/RunCMake/Syntax/CMakeLists.txt b/Tests/RunCMake/Syntax/CMakeLists.txt
new file mode 100644
index 0000000..e8db6b0
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
new file mode 100644
index 0000000..4a3d462
--- /dev/null
+++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
@@ -0,0 +1,9 @@
+include(RunCMake)
+
+run_cmake(String0)
+run_cmake(String1)
+run_cmake(StringNoSpace)
+run_cmake(Unquoted0)
+run_cmake(Unquoted1)
+run_cmake(UnterminatedCall1)
+run_cmake(UnterminatedString)
diff --git a/Tests/RunCMake/Syntax/String0-stderr.txt b/Tests/RunCMake/Syntax/String0-stderr.txt
new file mode 100644
index 0000000..8eea069
--- /dev/null
+++ b/Tests/RunCMake/Syntax/String0-stderr.txt
@@ -0,0 +1 @@
+^1 2;3 4$
diff --git a/Tests/RunCMake/Syntax/String0.cmake b/Tests/RunCMake/Syntax/String0.cmake
new file mode 100644
index 0000000..95281d7
--- /dev/null
+++ b/Tests/RunCMake/Syntax/String0.cmake
@@ -0,0 +1,2 @@
+set(var 2 3)
+message("1 ${var} 4")
diff --git a/Tests/RunCMake/Syntax/String1-stderr.txt b/Tests/RunCMake/Syntax/String1-stderr.txt
new file mode 100644
index 0000000..07e98da
--- /dev/null
+++ b/Tests/RunCMake/Syntax/String1-stderr.txt
@@ -0,0 +1,3 @@
+^
+ 1 \${var} 4
+ $
diff --git a/Tests/RunCMake/Syntax/String1.cmake b/Tests/RunCMake/Syntax/String1.cmake
new file mode 100644
index 0000000..a94c9ff
--- /dev/null
+++ b/Tests/RunCMake/Syntax/String1.cmake
@@ -0,0 +1,3 @@
+message("
+ 1 \${var} 4
+ ")
diff --git a/Tests/RunCMake/Syntax/StringNoSpace-stderr.txt b/Tests/RunCMake/Syntax/StringNoSpace-stderr.txt
new file mode 100644
index 0000000..2d111aa
--- /dev/null
+++ b/Tests/RunCMake/Syntax/StringNoSpace-stderr.txt
@@ -0,0 +1,3 @@
+^\[1 \${var} \\n 4\]
+\[x\]
+\[y\]$
diff --git a/Tests/RunCMake/Syntax/StringNoSpace.cmake b/Tests/RunCMake/Syntax/StringNoSpace.cmake
new file mode 100644
index 0000000..76f22db
--- /dev/null
+++ b/Tests/RunCMake/Syntax/StringNoSpace.cmake
@@ -0,0 +1,4 @@
+# Quoted arguments may be immediately followed by another argument.
+foreach(x "1 \${var} \\n 4""x"y)
+ message("[${x}]")
+endforeach()
diff --git a/Tests/RunCMake/Syntax/Unquoted0-stderr.txt b/Tests/RunCMake/Syntax/Unquoted0-stderr.txt
new file mode 100644
index 0000000..ea68ebf
--- /dev/null
+++ b/Tests/RunCMake/Syntax/Unquoted0-stderr.txt
@@ -0,0 +1 @@
+^1234$
diff --git a/Tests/RunCMake/Syntax/Unquoted0.cmake b/Tests/RunCMake/Syntax/Unquoted0.cmake
new file mode 100644
index 0000000..c5314c9
--- /dev/null
+++ b/Tests/RunCMake/Syntax/Unquoted0.cmake
@@ -0,0 +1,2 @@
+set(var 2 3)
+message(1 ${var} 4)
diff --git a/Tests/RunCMake/Syntax/Unquoted1-stderr.txt b/Tests/RunCMake/Syntax/Unquoted1-stderr.txt
new file mode 100644
index 0000000..ff8194a
--- /dev/null
+++ b/Tests/RunCMake/Syntax/Unquoted1-stderr.txt
@@ -0,0 +1 @@
+^\[\]\[=\]\[\$\$\(MV\)-DSTR=" \[="\[;\]$
diff --git a/Tests/RunCMake/Syntax/Unquoted1.cmake b/Tests/RunCMake/Syntax/Unquoted1.cmake
new file mode 100644
index 0000000..0344fbd
--- /dev/null
+++ b/Tests/RunCMake/Syntax/Unquoted1.cmake
@@ -0,0 +1 @@
+message([] [=] [$ $(MV) -DSTR=" [=" [;])
diff --git a/Tests/RunCMake/Syntax/UnterminatedCall1-result.txt b/Tests/RunCMake/Syntax/UnterminatedCall1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedCall1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/UnterminatedCall1-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedCall1-stderr.txt
new file mode 100644
index 0000000..281ce0d
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedCall1-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error: Error in cmake code at
+.*/Syntax/UnterminatedCall1.cmake:2:
+Parse error. Function missing ending "\)". End of file reached.
+CMake Error at CMakeLists.txt:3 \(include\):
+ include could not find load file:
+
+ UnterminatedCall1.cmake
diff --git a/Tests/RunCMake/Syntax/UnterminatedCall1.cmake b/Tests/RunCMake/Syntax/UnterminatedCall1.cmake
new file mode 100644
index 0000000..1166109
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedCall1.cmake
@@ -0,0 +1 @@
+message(
diff --git a/Tests/RunCMake/Syntax/UnterminatedString-result.txt b/Tests/RunCMake/Syntax/UnterminatedString-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedString-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/UnterminatedString-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedString-stderr.txt
new file mode 100644
index 0000000..d925032
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedString-stderr.txt
@@ -0,0 +1,8 @@
+CMake Error: Error in cmake code at
+.*/Syntax/UnterminatedString.cmake:2:
+Parse error. Function missing ending "\)". Instead found unterminated string with text "\)
+".
+CMake Error at CMakeLists.txt:3 \(include\):
+ include could not find load file:
+
+ UnterminatedString.cmake$
diff --git a/Tests/RunCMake/Syntax/UnterminatedString.cmake b/Tests/RunCMake/Syntax/UnterminatedString.cmake
new file mode 100644
index 0000000..721ae75
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedString.cmake
@@ -0,0 +1 @@
+set(var ")
-----------------------------------------------------------------------
Summary of changes:
Source/cmCPluginAPI.cxx | 5 +-
Source/cmListFileCache.cxx | 222 +++++++----
Source/cmListFileCache.h | 17 +-
Source/cmListFileLexer.c | 411 ++++++++++++--------
Source/cmListFileLexer.h | 1 +
Source/cmListFileLexer.in.l | 25 +-
Source/cmMacroCommand.cxx | 2 +-
Source/cmMakefile.cxx | 2 +-
Source/cmVariableWatchCommand.cxx | 15 +-
Source/cmWhileCommand.cxx | 4 +-
Tests/RunCMake/CMakeLists.txt | 1 +
Tests/RunCMake/Syntax/.gitattributes | 1 +
Tests/RunCMake/Syntax/BracketWarn-stderr.txt | 35 ++
Tests/RunCMake/Syntax/BracketWarn-stdout.txt | 1 +
Tests/RunCMake/Syntax/BracketWarn.cmake | 1 +
Tests/RunCMake/{CMP0004 => Syntax}/CMakeLists.txt | 0
Tests/RunCMake/Syntax/CommandComments-stderr.txt | 4 +
Tests/RunCMake/Syntax/CommandComments.cmake | 6 +
.../CommandError0-result.txt} | 0
Tests/RunCMake/Syntax/CommandError0-stderr.txt | 8 +
Tests/RunCMake/Syntax/CommandError0.cmake | 2 +
.../CommandError1-result.txt} | 0
Tests/RunCMake/Syntax/CommandError1-stderr.txt | 7 +
Tests/RunCMake/Syntax/CommandError1.cmake | 1 +
Tests/RunCMake/Syntax/CommandNewlines-stderr.txt | 3 +
Tests/RunCMake/Syntax/CommandNewlines.cmake | 10 +
Tests/RunCMake/Syntax/CommandSpaces-stderr.txt | 6 +
Tests/RunCMake/Syntax/CommandSpaces.cmake | 6 +
Tests/RunCMake/Syntax/CommandTabs-stderr.txt | 6 +
Tests/RunCMake/Syntax/CommandTabs.cmake | 6 +
Tests/RunCMake/Syntax/RunCMakeTest.cmake | 17 +
Tests/RunCMake/Syntax/String0-stderr.txt | 1 +
Tests/RunCMake/Syntax/String0.cmake | 2 +
Tests/RunCMake/Syntax/String1-stderr.txt | 3 +
Tests/RunCMake/Syntax/String1.cmake | 3 +
Tests/RunCMake/Syntax/StringNoSpace-stderr.txt | 19 +
Tests/RunCMake/Syntax/StringNoSpace.cmake | 4 +
Tests/RunCMake/Syntax/Unquoted0-stderr.txt | 1 +
Tests/RunCMake/Syntax/Unquoted0.cmake | 2 +
Tests/RunCMake/Syntax/Unquoted1-stderr.txt | 1 +
Tests/RunCMake/Syntax/Unquoted1.cmake | 1 +
.../UnterminatedCall1-result.txt} | 0
Tests/RunCMake/Syntax/UnterminatedCall1-stderr.txt | 7 +
Tests/RunCMake/Syntax/UnterminatedCall1.cmake | 1 +
.../UnterminatedCall2-result.txt} | 0
Tests/RunCMake/Syntax/UnterminatedCall2-stderr.txt | 7 +
Tests/RunCMake/Syntax/UnterminatedCall2.cmake | 3 +
.../UnterminatedString-result.txt} | 0
.../RunCMake/Syntax/UnterminatedString-stderr.txt | 8 +
Tests/RunCMake/Syntax/UnterminatedString.cmake | 1 +
50 files changed, 642 insertions(+), 247 deletions(-)
create mode 100644 Tests/RunCMake/Syntax/.gitattributes
create mode 100644 Tests/RunCMake/Syntax/BracketWarn-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/BracketWarn-stdout.txt
create mode 100644 Tests/RunCMake/Syntax/BracketWarn.cmake
copy Tests/RunCMake/{CMP0004 => Syntax}/CMakeLists.txt (100%)
create mode 100644 Tests/RunCMake/Syntax/CommandComments-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/CommandComments.cmake
copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => Syntax/CommandError0-result.txt} (100%)
create mode 100644 Tests/RunCMake/Syntax/CommandError0-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/CommandError0.cmake
copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => Syntax/CommandError1-result.txt} (100%)
create mode 100644 Tests/RunCMake/Syntax/CommandError1-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/CommandError1.cmake
create mode 100644 Tests/RunCMake/Syntax/CommandNewlines-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/CommandNewlines.cmake
create mode 100644 Tests/RunCMake/Syntax/CommandSpaces-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/CommandSpaces.cmake
create mode 100644 Tests/RunCMake/Syntax/CommandTabs-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/CommandTabs.cmake
create mode 100644 Tests/RunCMake/Syntax/RunCMakeTest.cmake
create mode 100644 Tests/RunCMake/Syntax/String0-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/String0.cmake
create mode 100644 Tests/RunCMake/Syntax/String1-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/String1.cmake
create mode 100644 Tests/RunCMake/Syntax/StringNoSpace-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/StringNoSpace.cmake
create mode 100644 Tests/RunCMake/Syntax/Unquoted0-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/Unquoted0.cmake
create mode 100644 Tests/RunCMake/Syntax/Unquoted1-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/Unquoted1.cmake
copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => Syntax/UnterminatedCall1-result.txt} (100%)
create mode 100644 Tests/RunCMake/Syntax/UnterminatedCall1-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/UnterminatedCall1.cmake
copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => Syntax/UnterminatedCall2-result.txt} (100%)
create mode 100644 Tests/RunCMake/Syntax/UnterminatedCall2-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/UnterminatedCall2.cmake
copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => Syntax/UnterminatedString-result.txt} (100%)
create mode 100644 Tests/RunCMake/Syntax/UnterminatedString-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/UnterminatedString.cmake
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list