fix assignment with this
This commit is contained in:
parent
2d6c7b1a06
commit
e4693729dc
@ -206,7 +206,10 @@ testExpressionConstructorCall = TestCase $
|
||||
|
||||
testExpresssionExternalMethodCall = TestCase $
|
||||
assertEqual "expect method call on sub" (StatementExpressionExpression (MethodCall (Reference "Obj") "foo" [])) $
|
||||
parseExpression [IDENTIFIER "Obj",IDENTIFIER "foo",LBRACE,RBRACE]
|
||||
parseExpression [IDENTIFIER "Obj",DOT,IDENTIFIER "foo",LBRACE,RBRACE]
|
||||
testExpressionAssignWithThis = TestCase $
|
||||
assertEqual "expect assignment on Field" (StatementExpressionExpression (Assignment (BinaryOperation NameResolution (Reference "this") (Reference "x")) (Reference "y"))) $
|
||||
parseExpression [THIS,DOT,IDENTIFIER "x",ASSIGN,IDENTIFIER "y"]
|
||||
|
||||
testStatementIfThen = TestCase $
|
||||
assertEqual "expect empty ifthen" [If (Reference "a") (Block [Block []]) Nothing] $
|
||||
@ -296,6 +299,8 @@ tests = TestList [
|
||||
testExpressionSimpleFieldAccess,
|
||||
testExpressionFieldSubAccess,
|
||||
testExpressionConstructorCall,
|
||||
testExpresssionExternalMethodCall,
|
||||
testExpressionAssignWithThis,
|
||||
testStatementIfThen,
|
||||
testStatementIfThenElse,
|
||||
testStatementWhile,
|
||||
|
@ -265,6 +265,7 @@ conditionalorexpression : conditionalandexpression { $1 }
|
||||
-- | conditionalorexpression LOGICALOR conditionalandexpression{ }
|
||||
|
||||
lefthandside : name { $1 }
|
||||
| primary DOT IDENTIFIER { BinaryOperation NameResolution $1 (Reference $3) }
|
||||
|
||||
assignmentoperator : ASSIGN { Nothing }
|
||||
| TIMESEQUAL { Just Multiplication }
|
||||
|
Loading…
Reference in New Issue
Block a user