Changeset 0c327ce for src/Parser


Ignore:
Timestamp:
Jul 12, 2024, 3:30:06 PM (7 days ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
76b507d
Parents:
9c447e2
Message:
  1. Add bound check to Serial function: now compiler generates the unchecked functions in ImplementEnumFunc?, and enum.hfa implements the bound check on top. Todo: Wrapped the checked version into a trait; 2. countof is now works on any type that implement Countof(). Because Countof() is implemented in enum.hfa for all CfaEnum?, we can call countof on { T | CfaEnum?(T) }
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r9c447e2 r0c327ce  
    970970                        // $$ = new ExpressionNode( build_offsetOf( $3, build_varref( $5 ) ) );
    971971                }
     972        | COUNTOF unary_expression
     973                {  $$ = new ExpressionNode( new ast::CountExpr( yylloc, maybeMoveBuild( $2 ) ) ); }
    972974        | COUNTOF '(' type_no_function ')'
    973975                { $$ = new ExpressionNode( new ast::CountExpr( yylloc, maybeMoveBuildType( $3 ) ) ); }
    974         | COUNTOF unary_expression
    975                 { SemanticError( yylloc, "countof for expressions is currently unimplemented. "); $$ = nullptr; }
    976976        ;
    977977
Note: See TracChangeset for help on using the changeset viewer.