treetop 1.2.5 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +0 -1
- data/lib/treetop/compiler/grammar_compiler.rb +3 -1
- data/lib/treetop/compiler/metagrammar.rb +308 -166
- data/lib/treetop/compiler/metagrammar.treetop +6 -2
- data/lib/treetop/version.rb +1 -1
- metadata +8 -13
@@ -2,13 +2,17 @@ module Treetop
|
|
2
2
|
module Compiler
|
3
3
|
grammar Metagrammar
|
4
4
|
rule treetop_file
|
5
|
-
prefix:space? module_or_grammar:(module_declaration / grammar) suffix:space? {
|
5
|
+
requires:(space? require_statement)* prefix:space? module_or_grammar:(module_declaration / grammar) suffix:space? {
|
6
6
|
def compile
|
7
|
-
prefix.text_value + module_or_grammar.compile + suffix.text_value
|
7
|
+
requires.text_value + prefix.text_value + module_or_grammar.compile + suffix.text_value
|
8
8
|
end
|
9
9
|
}
|
10
10
|
end
|
11
11
|
|
12
|
+
rule require_statement
|
13
|
+
prefix:space? "require" [ \t]+ [^\n\r]+ [\n\r]
|
14
|
+
end
|
15
|
+
|
12
16
|
rule module_declaration
|
13
17
|
prefix:('module' space [A-Z] alphanumeric_char* space) module_contents:(module_declaration / grammar) suffix:(space 'end') {
|
14
18
|
def compile
|
data/lib/treetop/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: treetop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Sobo
|
@@ -9,7 +9,7 @@ autorequire: treetop
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-06-14 00:00:00 +10:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version:
|
23
|
+
version: 0.2.5
|
24
24
|
version:
|
25
25
|
description:
|
26
26
|
email: nathansobo@gmail.com
|
@@ -33,14 +33,11 @@ extra_rdoc_files: []
|
|
33
33
|
files:
|
34
34
|
- README
|
35
35
|
- Rakefile
|
36
|
-
- lib/treetop
|
37
36
|
- lib/treetop/bootstrap_gen_1_metagrammar.rb
|
38
|
-
- lib/treetop/compiler
|
39
37
|
- lib/treetop/compiler/grammar_compiler.rb
|
40
38
|
- lib/treetop/compiler/lexical_address_space.rb
|
41
39
|
- lib/treetop/compiler/metagrammar.rb
|
42
40
|
- lib/treetop/compiler/metagrammar.treetop
|
43
|
-
- lib/treetop/compiler/node_classes
|
44
41
|
- lib/treetop/compiler/node_classes/anything_symbol.rb
|
45
42
|
- lib/treetop/compiler/node_classes/atomic_expression.rb
|
46
43
|
- lib/treetop/compiler/node_classes/character_class.rb
|
@@ -62,12 +59,9 @@ files:
|
|
62
59
|
- lib/treetop/compiler/node_classes.rb
|
63
60
|
- lib/treetop/compiler/ruby_builder.rb
|
64
61
|
- lib/treetop/compiler.rb
|
65
|
-
- lib/treetop/ruby_extensions
|
66
62
|
- lib/treetop/ruby_extensions/string.rb
|
67
63
|
- lib/treetop/ruby_extensions.rb
|
68
|
-
- lib/treetop/runtime
|
69
64
|
- lib/treetop/runtime/compiled_parser.rb
|
70
|
-
- lib/treetop/runtime/interval_skip_list
|
71
65
|
- lib/treetop/runtime/interval_skip_list/head_node.rb
|
72
66
|
- lib/treetop/runtime/interval_skip_list/interval_skip_list.rb
|
73
67
|
- lib/treetop/runtime/interval_skip_list/node.rb
|
@@ -89,7 +83,6 @@ files:
|
|
89
83
|
- doc/sitegen.rb
|
90
84
|
- doc/syntactic_recognition.markdown
|
91
85
|
- doc/using_in_ruby.markdown
|
92
|
-
- examples/lambda_calculus
|
93
86
|
- examples/lambda_calculus/arithmetic.rb
|
94
87
|
- examples/lambda_calculus/arithmetic.treetop
|
95
88
|
- examples/lambda_calculus/arithmetic_node_classes.rb
|
@@ -100,8 +93,10 @@ files:
|
|
100
93
|
- examples/lambda_calculus/lambda_calculus_node_classes.rb
|
101
94
|
- examples/lambda_calculus/lambda_calculus_test.rb
|
102
95
|
- examples/lambda_calculus/test_helper.rb
|
103
|
-
has_rdoc:
|
96
|
+
has_rdoc: true
|
104
97
|
homepage: http://functionalform.blogspot.com
|
98
|
+
licenses: []
|
99
|
+
|
105
100
|
post_install_message:
|
106
101
|
rdoc_options: []
|
107
102
|
|
@@ -122,9 +117,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
117
|
requirements: []
|
123
118
|
|
124
119
|
rubyforge_project:
|
125
|
-
rubygems_version: 1.3.
|
120
|
+
rubygems_version: 1.3.4
|
126
121
|
signing_key:
|
127
|
-
specification_version:
|
122
|
+
specification_version: 3
|
128
123
|
summary: A Ruby-based text parsing and interpretation DSL
|
129
124
|
test_files: []
|
130
125
|
|