Changeset 55ba259e for src/Parser/parser.yy
- Timestamp:
- Jun 26, 2024, 10:25:26 AM (5 months ago)
- Branches:
- master
- Children:
- 01afd8d, 7552fde
- Parents:
- d5efcb7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
rd5efcb7 r55ba259e 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jun 25 18:44:14202413 // Update Count : 6 69212 // Last Modified On : Wed Jun 26 09:37:28 2024 13 // Update Count : 6700 14 14 // 15 15 … … 1607 1607 | comma_expression ';' enum_key // CFA, enum type 1608 1608 { 1609 $$ = enumRangeCtrl( $1, OperKinds::L Than, new ExpressionNode( new ast::TypeExpr( yylloc, $3->buildType() ) ) );1609 $$ = enumRangeCtrl( $1, OperKinds::LEThan, new ExpressionNode( new ast::TypeExpr( yylloc, $3->buildType() ) ) ); 1610 1610 } 1611 1611 | comma_expression ';' downupdowneq enum_key // CFA, enum type, reverse direction 1612 1612 { 1613 if ( $3 == OperKinds::LEThan || $3 == OperKinds::GEThan ) { 1614 SemanticError( yylloc, "illegal syntax, all enumeration ranges are equal (all values). Remove \"=~\"." ); $$ = nullptr; 1615 } 1613 if ( $3 == OperKinds::GThan ) { 1614 SemanticError( yylloc, "all enumeration ranges are equal (all values). Add an equal, e.g., ~=, -~=." ); $$ = nullptr; 1615 $3 = OperKinds::GEThan; 1616 } // if 1616 1617 $$ = enumRangeCtrl( $1, $3, new ExpressionNode( new ast::TypeExpr( yylloc, $4->buildType() ) ) ); 1617 1618 } … … 1627 1628 ; 1628 1629 1630 // This rule exists to handle the ambiguity with unary operator '~'. The rule is the same as updowneq minus the '~'. 1631 // Specifically, "for ( ~5 )" means the complement of 5, not loop 0..4. Hence, in this case "for ( ~= 5 )", i.e., 0..5, 1632 // it is not possible to just remove the '='. The entire '~=' must be removed. 1629 1633 downupdowneq: 1630 1634 ErangeDown
Note: See TracChangeset
for help on using the changeset viewer.