Permalink
Browse files

Tweaked Calc example

  • Loading branch information...
1 parent 99cab24 commit 7c011e5df8f3aacf41d010e6e181dab8b226dd2d @mjackson committed Jan 27, 2011
Showing with 3 additions and 8 deletions.
  1. +3 −8 examples/calc.citrus
View
@@ -65,20 +65,15 @@ grammar Calc
end
rule float
- (digits '.' digits space*) {
- strip.to_f
- }
+ (digits '.' digits space*) { to_f }
end
rule integer
- (digits space*) {
- strip.to_i
- }
+ (digits space*) { to_i }
end
rule digits
- # Numbers may contain underscores in Ruby.
- [0-9]+ ('_' [0-9]+)*
+ [0-9]+ ('_' [0-9]+)* # Numbers may contain underscores.
end
rule lparen '(' space* end

0 comments on commit 7c011e5

Please sign in to comment.