Changes in src/Parser/parser.yy [7991c7d:d8454b9]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r7991c7d rd8454b9 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 1 15:35:08202213 // Update Count : 540 512 // Last Modified On : Sat May 14 09:16:22 2022 13 // Update Count : 5401 14 14 // 15 15 … … 56 56 57 57 #include "SynTree/Attribute.h" // for Attribute 58 59 // lex uses __null in a boolean context, it's fine.60 #pragma GCC diagnostic ignored "-Wparentheses-equality"61 58 62 59 extern DeclarationNode * parseTree; … … 1243 1240 { 1244 1241 $$ = new StatementNode( build_while( new CondCtl( nullptr, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ), maybe_build_compound( $4 ) ) ); 1245 SemanticWarning( yylloc, Warning::SuperfluousElse , "");1242 SemanticWarning( yylloc, Warning::SuperfluousElse ); 1246 1243 } 1247 1244 | WHILE '(' conditional_declaration ')' statement %prec THEN … … 1254 1251 { 1255 1252 $$ = new StatementNode( build_do_while( new ExpressionNode( build_constantInteger( *new string( "1" ) ) ), maybe_build_compound( $2 ) ) ); 1256 SemanticWarning( yylloc, Warning::SuperfluousElse , "");1253 SemanticWarning( yylloc, Warning::SuperfluousElse ); 1257 1254 } 1258 1255 | DO statement WHILE '(' comma_expression ')' ';' … … 1265 1262 { 1266 1263 $$ = new StatementNode( build_for( new ForCtrl( (ExpressionNode * )nullptr, (ExpressionNode * )nullptr, (ExpressionNode * )nullptr ), maybe_build_compound( $4 ) ) ); 1267 SemanticWarning( yylloc, Warning::SuperfluousElse , "");1264 SemanticWarning( yylloc, Warning::SuperfluousElse ); 1268 1265 } 1269 1266 | FOR '(' for_control_expression_list ')' statement %prec THEN … … 2397 2394 | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt '{' enumerator_list comma_opt '}' 2398 2395 { 2399 if ( $3->storageClasses.val != 0 || $3->type->qualifiers.val != 0 ) 2396 if ( $3->storageClasses.val != 0 || $3->type->qualifiers.val != 0 ) 2400 2397 { SemanticError( yylloc, "storage-class and CV qualifiers are not meaningful for enumeration constants, which are const." ); } 2401 2398 … … 2441 2438 // empty 2442 2439 { $$ = nullptr; } 2443 | '=' constant_expression { $$ = new InitializerNode( $2 ); }2444 | '=' '{' initializer_list_opt comma_opt '}' { $$ = new InitializerNode( $3, true ); }2445 //| simple_assignment_operator initializer2446 //{ $$ = $1 == OperKinds::Assign ? $2 : $2->set_maybeConstructed( false ); }2440 // | '=' constant_expression 2441 // { $$ = $2; } 2442 | simple_assignment_operator initializer 2443 { $$ = $1 == OperKinds::Assign ? $2 : $2->set_maybeConstructed( false ); } 2447 2444 ; 2448 2445 … … 2844 2841 linkage = LinkageSpec::update( yylloc, linkage, $2 ); 2845 2842 } 2846 up external_definition down 2843 up external_definition down 2847 2844 { 2848 2845 linkage = linkageStack.top();
Note:
See TracChangeset
for help on using the changeset viewer.