pulled assignment as special case from the operators

This commit is contained in:
Torsten Ruger
2014-06-24 19:33:21 +03:00
parent 58064637cb
commit 0ed11b507f
9 changed files with 61 additions and 39 deletions

View File

@ -65,7 +65,12 @@ module Parser
end
rule(l: simple(:l), o: simple(:o) , r: simple(:r)) do
Ast::OperatorExpression.new( o.to_s.strip , l ,r)
op = o.to_s.strip
if op == "="
Ast::AssignmentExpression.new( l ,r)
else
Ast::OperatorExpression.new( op , l ,r)
end
end
#modules and classes are understandibly quite similar Class < Module