Skip to content

Commit

Permalink
Used lazy terminal nodes in the Treetop metagrammar
Browse files Browse the repository at this point in the history
  • Loading branch information
cjheath committed Aug 21, 2009
1 parent 5afde4d commit 341d725
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/treetop/compiler/metagrammar.rb
Expand Up @@ -162,7 +162,7 @@ def _nt_require_statement
s4, i4 = [], index
loop do
if has_terminal?('\G[ \\t]', true, index)
r5 = instantiate_node(SyntaxNode,input, index...(index + 1))
r5 = true
@index += 1
else
r5 = nil
Expand All @@ -184,7 +184,7 @@ def _nt_require_statement
s6, i6 = [], index
loop do
if has_terminal?('\G[^\\n\\r]', true, index)
r7 = instantiate_node(SyntaxNode,input, index...(index + 1))
r7 = true
@index += 1
else
r7 = nil
Expand All @@ -204,7 +204,7 @@ def _nt_require_statement
s0 << r6
if r6
if has_terminal?('\G[\\n\\r]', true, index)
r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
r8 = true
@index += 1
else
r8 = nil
Expand Down Expand Up @@ -287,7 +287,7 @@ def _nt_module_declaration
s1 << r3
if r3
if has_terminal?('\G[A-Z]', true, index)
r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
r4 = true
@index += 1
else
r4 = nil
Expand Down Expand Up @@ -504,7 +504,7 @@ def _nt_grammar_name

i0, s0 = index, []
if has_terminal?('\G[A-Z]', true, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
r1 = true
@index += 1
else
r1 = nil
Expand Down Expand Up @@ -703,7 +703,7 @@ def _nt_include_declaration
s0 << r2
if r2
if has_terminal?('\G[A-Z]', true, index)
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
r3 = true
@index += 1
else
r3 = nil
Expand Down Expand Up @@ -2722,7 +2722,7 @@ def _nt_inline_module
i5, s5 = index, []
i6 = index
if has_terminal?('\G[{}]', true, index)
r7 = instantiate_node(SyntaxNode,input, index...(index + 1))
r7 = true
@index += 1
else
r7 = nil
Expand Down Expand Up @@ -2930,7 +2930,7 @@ def _nt_alphanumeric_char
r0 = r1
else
if has_terminal?('\G[0-9]', true, index)
r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
r2 = true
@index += 1
else
r2 = nil
Expand Down

0 comments on commit 341d725

Please sign in to comment.