Skip to content

Commit

Permalink
Tweaked Calc example
Browse files Browse the repository at this point in the history
  • Loading branch information
mjackson committed Jan 27, 2011
1 parent 99cab24 commit 7c011e5
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions examples/calc.citrus
Expand Up @@ -65,20 +65,15 @@ grammar Calc
end end


rule float rule float
(digits '.' digits space*) { (digits '.' digits space*) { to_f }
strip.to_f
}
end end


rule integer rule integer
(digits space*) { (digits space*) { to_i }
strip.to_i
}
end end


rule digits rule digits
# Numbers may contain underscores in Ruby. [0-9]+ ('_' [0-9]+)* # Numbers may contain underscores.
[0-9]+ ('_' [0-9]+)*
end end


rule lparen '(' space* end rule lparen '(' space* end
Expand Down

0 comments on commit 7c011e5

Please sign in to comment.