Skip to content

Commit

Permalink
Cleanup parsing '*' tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Nov 21, 2013
1 parent 614bcff commit 8ebbaa2
Showing 1 changed file with 5 additions and 25 deletions.
30 changes: 5 additions & 25 deletions lib/opal/parser/lexer.rb
Expand Up @@ -532,38 +532,18 @@ def yylex
@lex_state = :expr_beg
return :tSEMI, ';'

elsif scan(/\*/)
if scan(/\*/)
if scan(/\=/)
@lex_state = :expr_beg
return :tOP_ASGN, '**'
end

self.set_arg_state
return :tPOW, '**'

else
if scan(/\=/)
@lex_state = :expr_beg
return :tOP_ASGN, '*'
end
end

if scan(/\*\=/)
elsif check(/\*/)
if scan(/\*\*\=/)
@lex_state = :expr_beg
return :tOP_ASGN, '**'
end

if scan(/\*/)
elsif scan(/\*\*/)
self.set_arg_state
return :tPOW, '**'
end

if scan(/\=/)
elsif scan(/\*\=/)
@lex_state = :expr_beg
return :tOP_ASGN, '*'
else
result = '*'
result = scan(/\*/)

if after_operator?
@lex_state = :expr_arg
Expand Down

0 comments on commit 8ebbaa2

Please sign in to comment.