Changeset 2019

Show
Ignore:
Timestamp:
06/19/08 15:26:30 (5 months ago)
Author:
nbeckman
Message:

I replaced the Op in Assignment with an OpRef? so that it could be disambiguated. This required changes in both the ast and the parser.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ProjectFortress/astgen/Fortress.ast

    r2017 r2019  
    720720         * e.g.) x += 1 
    721721         */ 
    722         Assignment(List<LHS> lhs, Option<Op> opr, Expr rhs); 
     722        Assignment(List<LHS> lhs, Option<OpRef> opr, Expr rhs); 
    723723        /** 
    724724         * expressions beginning and ending with reserved words 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/TypeChecker.java

    r2017 r2019  
    18371837                                // successful 
    18381838                                all_results.add(new TypeCheckerResult(that, application_result.unwrap().second())); 
     1839                                // wrong: Type should still be void. 
    18391840                                result = TypeCheckerResult.compose(that, application_result.unwrap().first(), subtypeChecker, all_results); 
    18401841                        } 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/Evaluator.java

    r2017 r2019  
    262262    // the operator case. Might this cause the world to break? 
    263263    public FValue forAssignment(Assignment x) { 
    264         Option<Op> possOp = x.getOpr(); 
     264        Option<OpRef> possOp = x.getOpr(); 
    265265        LHSToLValue getLValue = new LHSToLValue(this); 
    266266        List<? extends LHS> lhses = getLValue.inParallel(x.getLhs()); 
     
    271271            // We created an lvalue for lhses above, so there should 
    272272            // be no fear of duplicate evaluation. 
    273             Op opr = possOp.unwrap(); 
     273            OpRef opr_ = possOp.unwrap(); 
     274            OpName opr = opr_.getOriginalName(); 
    274275            Fcn fcn = (Fcn) opr.accept(this); 
    275276            FValue lhsValue; 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/Symbol.rats

    r1874 r2019  
    168168   / singleOp ; 
    169169 
    170 Op CompoundOp = 
     170OpRef CompoundOp = 
    171171     a1:(encloser / op) equalsOp 
    172      { yyValue = NodeFactory.makeOpInfix(createSpan(yyStart, yyCount), a1); }; 
     172     { yyValue = ExprFactory.makeOpRef(NodeFactory.makeOpInfix(createSpan(yyStart, yyCount), a1)); }; 
    173173 
    174174/* The operator "=>" should not be in the left-hand sides of 
     
    229229 
    230230/* AssignOp ::= := | Op= */ 
    231 Option<Op> AssignOp = 
     231Option<OpRef> AssignOp = 
    232232     colonequals   { yyValue = Option.none(); } 
    233233   / a1:CompoundOp { yyValue = Option.some(a1); };