Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77093 - trunk/tools/build/v2/engine
From: steven_at_[hidden]
Date: 2012-02-22 16:06:17


Author: steven_watanabe
Date: 2012-02-22 16:06:16 EST (Wed, 22 Feb 2012)
New Revision: 77093
URL: http://svn.boost.org/trac/boost/changeset/77093

Log:
Downgrade strict syntax checks to a warning for backwards compatibility.
Text files modified:
   trunk/tools/build/v2/engine/function.c | 44 +++++++++++++++++++++++++++++++--------
   1 files changed, 35 insertions(+), 9 deletions(-)

Modified: trunk/tools/build/v2/engine/function.c
==============================================================================
--- trunk/tools/build/v2/engine/function.c (original)
+++ trunk/tools/build/v2/engine/function.c 2012-02-22 16:06:16 EST (Wed, 22 Feb 2012)
@@ -529,7 +529,7 @@
             case 'T': edits->to_slashes = 1; continue;
             case 'W': edits->to_windows = 1; continue;
             default:
- break; /* Should complain, but so what... */
+ continue; /* Should complain, but so what... */
         }
 
     fileval:
@@ -1701,7 +1701,6 @@
 static void parse_error( const char * message )
 {
     printf( "%s:%d: %s\n", current_file, current_line, message );
- exit(1);
 }
 
 /*
@@ -1751,10 +1750,14 @@
                 else if ( s[0] == '[' )
                 {
                     parse_error("unexpected subscript");
+ ++s;
                 }
                 else if ( s[0] == '\0' )
                 {
                     parse_error( "unbalanced parentheses" );
+ var_parse_group_maybe_add_constant( mod, *string, s );
+ *string = s;
+ return (VAR_PARSE *)result;
                 }
                 else
                 {
@@ -1777,26 +1780,29 @@
                     var_parse_group_maybe_add_constant( subscript, *string, s );
                     ++s;
                     *string = s;
- if ( s[0] == '\0' )
- {
- parse_error( "unbalanced parentheses" );
- }
- else if ( s[0] == ')' || s[0] == ':' )
+ if ( s[0] == ')' || s[0] == ':' || s[0] == '\0')
                     {
                         break;
                     }
                     else
                     {
                         parse_error( "unexpected text following []" );
+ break;
                     }
                 }
                 else if ( isdigit( s[0] ) || s[0] == '-' )
                 {
                     ++s;
                 }
+ else if( s[0] == '\0' )
+ {
+ parse_error( "malformed subscript" );
+ break;
+ }
                 else
                 {
                     parse_error( "malformed subscript" );
+ ++s;
                 }
             }
         }
@@ -1815,6 +1821,9 @@
         else if ( s[0] == '\0' )
         {
             parse_error( "unbalanced parentheses" );
+ var_parse_group_maybe_add_constant( name, *string, s );
+ *string = s;
+ return (VAR_PARSE *)result;
         }
         else
         {
@@ -1901,9 +1910,15 @@
     for ( ; ; )
     {
         if ( try_parse_variable( &s, string, out ) ) { }
- else if(s[0] == ':' || s[0] == '[' || s[0] == '\0')
+ else if(s[0] == ':' || s[0] == '[')
         {
             parse_error( "unbalanced parentheses" );
+ ++s;
+ }
+ else if(s[0] == '\0')
+ {
+ parse_error( "unbalanced parentheses" );
+ break;
         }
         else if(s[0] == ')')
         {
@@ -2124,8 +2139,19 @@
         }
         else
         {
+ int f = compile_new_label( c );
+ int end = compile_new_label( c );
+
             printf( "%s:%d: Conditional used as list (check operator precedence).\n", object_str(parse->file), parse->line );
- exit( 1 );
+
+ /* Emit the condition */
+ compile_condition( parse, c, 0, f );
+ compile_emit( c, INSTR_PUSH_CONSTANT, compile_emit_constant( c, constant_true ) );
+ compile_emit_branch( c, INSTR_JUMP, end );
+ compile_set_label( c, f );
+ compile_emit( c, INSTR_PUSH_EMPTY, 0 );
+ compile_set_label( c, end );
+ adjust_result( c, RESULT_STACK, result_location );
         }
     }
     else if ( parse->type == PARSE_FOREACH )


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk