Changeset 861799c for src/Parser


Ignore:
Timestamp:
Mar 10, 2017, 11:00:13 AM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
c857ad3
Parents:
0e7ea335
Message:

fix 0,1 member access, fix autogenerated routines missing size for sized generic types

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r0e7ea335 r861799c  
    410410                { $$ = new ExpressionNode( build_fieldSel( $1, build_field_name_REALFRACTIONconstant( *$2 ) ) ); }
    411411        | postfix_expression ARROW no_attr_identifier
    412                 { $$ = new ExpressionNode( build_pfieldSel( $1, build_varref( $3 ) ) ); }
     412                {
     413                        $$ = new ExpressionNode( build_pfieldSel( $1, *$3 == "0" || *$3 == "1" ? build_constantInteger( *$3 ) : build_varref( $3 ) ) );
     414                }
    413415        | postfix_expression ARROW '[' push field_list pop ']' // CFA, tuple field selector
    414416                        { $$ = new ExpressionNode( build_pfieldSel( $1, build_tuple( $5 ) ) ); }
     417        | postfix_expression ARROW INTEGERconstant                      // CFA, tuple index
     418                { $$ = new ExpressionNode( build_pfieldSel( $1, build_constantInteger( *$3 ) ) ); }
    415419        | postfix_expression ICR
    416420                { $$ = new ExpressionNode( build_unary_ptr( OperKinds::IncrPost, $1 ) ); }
Note: See TracChangeset for help on using the changeset viewer.