Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed typo

  • Loading branch information...
commit 7d03bcbeda0958a9bcdcbd7a3704ab156fdf515f 1 parent a9ba0b6
@mjackson authored
Showing with 17 additions and 17 deletions.
  1. +14 −14 README
  2. +3 −3 doc/syntax.markdown
View
28 README
@@ -245,14 +245,14 @@ same name as a rule in the parent also have access to the `super` keyword to
invoke the parent rule.
grammar Number
- def number
+ rule number
[0-9]+
end
end
-
+
grammar FloatingPoint
include Number
-
+
rule number
super ('.' super)?
end
@@ -310,15 +310,15 @@ integers separated by any amount of white space and a `+` symbol.
rule additive
number plus (additive | number)
end
-
+
rule number
[0-9]+ space
end
-
+
rule plus
'+' space
end
-
+
rule space
[ \t]*
end
@@ -358,17 +358,17 @@ blocks. Let's extend the `Addition` grammar using this technique.
number.value + term.value
}
end
-
+
rule number
([0-9]+ space) {
to_i
}
end
-
+
rule plus
'+' space
end
-
+
rule space
[ \t]*
end
@@ -440,11 +440,11 @@ this:
def lhs
number.value
end
-
+
def rhs
term.value
end
-
+
def value
lhs + rhs
end
@@ -474,11 +474,11 @@ define the following module.
def lhs
number.value
end
-
+
def rhs
term.value
end
-
+
def value
lhs + rhs
end
@@ -510,7 +510,7 @@ case that could be used to test that our grammar works properly.
assert_equal('23 + 12', match)
assert_equal(35, match.value)
end
-
+
def test_number
match = Addition.parse('23', :root => :number)
assert(match)
View
6 doc/syntax.markdown
@@ -143,14 +143,14 @@ same name as a rule in the parent also have access to the `super` keyword to
invoke the parent rule.
grammar Number
- def number
+ rule number
[0-9]+
end
end
-
+
grammar FloatingPoint
include Number
-
+
rule number
super ('.' super)?
end
Please sign in to comment.
Something went wrong with that request. Please try again.