Commit 915e85be authored by Bill Hoffman's avatar Bill Hoffman
Browse files

ENH: merge in changes from main tree that fix at only parsing

parent cb408079
......@@ -7,7 +7,7 @@ SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 4)
SET(CMake_VERSION_PATCH 7)
# for an actual release this should not be defined
SET(CMake_VERSION_RC 8)
SET(CMake_VERSION_RC 9)
SET(CMake_VERSION "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
SET(CMake_VERSION_FULL "${CMake_VERSION}.${CMake_VERSION_PATCH}")
......
Changes in CMake 2.4.7
--- RC 9 ---
* Fix problem with \@ in configure files bug# 5130
--- RC 8 ---
* Fix bug 5121 crash with build test on and vs
......
This diff is collapsed.
......@@ -2,10 +2,6 @@
#define cmCommandArgument_yyHEADER_H 1
#define cmCommandArgument_yyIN_HEADER 1
#define YY_INT_ALIGNED short int
/* A lexical scanner generated by flex */
......@@ -35,7 +31,7 @@
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
#if __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.
......@@ -96,7 +92,7 @@ typedef unsigned int flex_uint32_t;
/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST
#else /* ! __cplusplus */
#else /* ! __cplusplus */
#if __STDC__
......@@ -148,73 +144,65 @@ typedef unsigned int yy_size_t;
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
{
FILE *yy_input_file;
char *yy_ch_buf; /* input buffer */
char *yy_buf_pos; /* current position in input buffer */
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
yy_size_t yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
int yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
* delete it.
*/
int yy_is_our_buffer;
/* Whether this is an "interactive" input source; if so, and
* if we're using stdio for input, then we want to use getc()
* instead of fread(), to make sure we stop fetching input after
* each newline.
*/
int yy_is_interactive;
/* Whether we're considered to be at the beginning of a line.
* If so, '^' rules will be active on the next match, otherwise
* not.
*/
int yy_at_bol;
{
FILE *yy_input_file;
char *yy_ch_buf; /* input buffer */
char *yy_buf_pos; /* current position in input buffer */
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
yy_size_t yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
int yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
* delete it.
*/
int yy_is_our_buffer;
/* Whether this is an "interactive" input source; if so, and
* if we're using stdio for input, then we want to use getc()
* instead of fread(), to make sure we stop fetching input after
* each newline.
*/
int yy_is_interactive;
/* Whether we're considered to be at the beginning of a line.
* If so, '^' rules will be active on the next match, otherwise
* not.
*/
int yy_at_bol;
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
int yy_fill_buffer;
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
int yy_fill_buffer;
int yy_buffer_status;
int yy_buffer_status;
};
};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
void cmCommandArgument_yyrestart (FILE *input_file ,yyscan_t yyscanner );
void cmCommandArgument_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,
yyscan_t yyscanner );
YY_BUFFER_STATE cmCommandArgument_yy_create_buffer (FILE *file,int size ,
yyscan_t yyscanner );
void cmCommandArgument_yy_delete_buffer (YY_BUFFER_STATE b ,
yyscan_t yyscanner );
void cmCommandArgument_yy_flush_buffer (YY_BUFFER_STATE b ,
yyscan_t yyscanner );
void cmCommandArgument_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,
yyscan_t yyscanner );
void cmCommandArgument_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
YY_BUFFER_STATE cmCommandArgument_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
void cmCommandArgument_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
void cmCommandArgument_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
void cmCommandArgument_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
void cmCommandArgument_yypop_buffer_state (yyscan_t yyscanner );
YY_BUFFER_STATE cmCommandArgument_yy_scan_buffer (char *base,yy_size_t size ,
yyscan_t yyscanner );
YY_BUFFER_STATE cmCommandArgument_yy_scan_string (yyconst char *yy_str ,
yyscan_t yyscanner );
YY_BUFFER_STATE cmCommandArgument_yy_scan_bytes (yyconst char *bytes,int len ,
yyscan_t yyscanner );
YY_BUFFER_STATE cmCommandArgument_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
YY_BUFFER_STATE cmCommandArgument_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
YY_BUFFER_STATE cmCommandArgument_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
void *cmCommandArgument_yyalloc (yy_size_t ,yyscan_t yyscanner );
void *cmCommandArgument_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
......@@ -229,6 +217,8 @@ void cmCommandArgument_yyfree (void * ,yyscan_t yyscanner );
#ifdef YY_HEADER_EXPORT_START_CONDITIONS
#define INITIAL 0
#define ESCAPES 1
#define NOESCAPES 2
#endif
......@@ -247,8 +237,7 @@ void cmCommandArgument_yyset_debug (int debug_flag ,yyscan_t yyscanner );
YY_EXTRA_TYPE cmCommandArgument_yyget_extra (yyscan_t yyscanner );
void cmCommandArgument_yyset_extra (YY_EXTRA_TYPE user_defined ,
yyscan_t yyscanner );
void cmCommandArgument_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
FILE *cmCommandArgument_yyget_in (yyscan_t yyscanner );
......@@ -311,15 +300,13 @@ extern int cmCommandArgument_yylex (yyscan_t yyscanner);
#define YY_DECL int cmCommandArgument_yylex (yyscan_t yyscanner)
#endif /* !YY_DECL */
/* yy_get_previous_state - get the state just before
the EOB char was reached */
/* yy_get_previous_state - get the state just before the EOB char was reached */
#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
......@@ -327,8 +314,5 @@ extern int cmCommandArgument_yylex (yyscan_t yyscanner);
#undef YY_DECL
#endif
#undef cmCommandArgument_yyIN_HEADER
#endif /* cmCommandArgument_yyHEADER_H */
......@@ -24,6 +24,7 @@ Run flex like this:
flex --prefix=cmCommandArgument_yy --header-file=cmCommandArgumentLexer.h -ocmCommandArgumentLexer.cxx cmCommandArgumentLexer.in.l
Modify cmCommandArgumentLexer.cxx:
- add #include "cmStandardIncludes.h" to top of file
- remove TABs
- remove "yyscanner" argument from these methods:
yy_fatal_error, cmCommandArgument_yyalloc, cmCommandArgument_yyrealloc, cmCommandArgument_yyfree
......@@ -56,6 +57,8 @@ Modify cmCommandArgumentLexer.h:
%option reentrant
%option noyywrap
%pointer
%s ESCAPES
%s NOESCAPES
%%
......@@ -98,7 +101,7 @@ Modify cmCommandArgumentLexer.h:
return cal_NAME;
}
\\. {
<ESCAPES>\\. {
if ( !yyextra->HandleEscapeSymbol(yylvalp, *(yytext+1)) )
{
return cal_ERROR;
......@@ -124,10 +127,31 @@ Modify cmCommandArgumentLexer.h:
return cal_LCURLY;
}
"\\" {
<ESCAPES>"\\" {
//yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
yylvalp->str = yyextra->BSLASHVariable;
return cal_BSLASH;
}
<NOESCAPES>"\\" {
//yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
yylvalp->str = yyextra->BSLASHVariable;
return cal_SYMBOL;
}
%%
/*--------------------------------------------------------------------------*/
void cmCommandArgument_SetupEscapes(yyscan_t yyscanner, bool noEscapes)
{
/* Hack into the internal flex-generated scanner to set the state. */
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if(noEscapes)
{
BEGIN(NOESCAPES);
}
else
{
BEGIN(ESCAPES);
}
}
......@@ -213,15 +213,6 @@ void cmCommandArgumentParserHelper::AllocateParserType
bool cmCommandArgumentParserHelper::HandleEscapeSymbol
(cmCommandArgumentParserHelper::ParserType* pt, char symbol)
{
if ( this->NoEscapeMode )
{
char buffer[3];
buffer[0] = '\\';
buffer[1] = symbol;
buffer[2] = 0;
this->AllocateParserType(pt, buffer, 2);
return true;
}
switch ( symbol )
{
case '\\':
......@@ -260,6 +251,8 @@ bool cmCommandArgumentParserHelper::HandleEscapeSymbol
return true;
}
void cmCommandArgument_SetupEscapes(yyscan_t yyscanner, bool noEscapes);
int cmCommandArgumentParserHelper::ParseString(const char* str, int verb)
{
if ( !str)
......@@ -276,6 +269,7 @@ int cmCommandArgumentParserHelper::ParseString(const char* str, int verb)
yyscan_t yyscanner;
cmCommandArgument_yylex_init(&yyscanner);
cmCommandArgument_yyset_extra(this, yyscanner);
cmCommandArgument_SetupEscapes(yyscanner, this->NoEscapeMode);
int res = cmCommandArgument_yyparse(yyscanner);
cmCommandArgument_yylex_destroy(yyscanner);
if ( res != 0 )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment