sexpr 0.6.0 → 1.0.0
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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +7 -1
- data/Gemfile +1 -8
- data/README.md +26 -4
- data/lib/sexpr/version.rb +2 -2
- data/lib/sexpr.rb +11 -3
- data/spec/integration/bool_expr/test_validation.rb +4 -4
- data/spec/integration/test_readme_examples.rb +4 -4
- data/spec/spec_helper.rb +1 -0
- data/spec/unit/grammar/matching/test_compile_rule_defn.rb +2 -2
- data/spec/unit/grammar/matching/test_compile_rules.rb +1 -1
- data/spec/unit/grammar/tagging/test_looks_a_sexpr.rb +4 -4
- data/spec/unit/matcher/non_terminal/test_match_q.rb +2 -2
- data/spec/unit/matcher/reference/test_match_q.rb +1 -1
- data/spec/unit/matcher/terminal/test_match_q.rb +3 -3
- data/spec/unit/matcher/terminal/test_terminal_match.rb +28 -28
- data/spec/unit/parser/citrus/test_recognize.rb +1 -1
- data/spec/unit/test_sexpr.rb +1 -1
- data/tasks/test.rake +5 -20
- metadata +33 -141
- data/Gemfile.lock +0 -27
- data/LICENCE.md +0 -22
- data/Manifest.txt +0 -16
- data/examples/bool_expr/bool_expr.citrus +0 -72
- data/examples/bool_expr/bool_expr.rb +0 -59
- data/examples/bool_expr/bool_expr.sexp.yml +0 -23
- data/lib/sexpr/loader.rb +0 -1
- data/sexpr.gemspec +0 -189
- data/sexpr.noespec +0 -33
- data/tasks/debug_mail.rake +0 -75
- data/tasks/debug_mail.txt +0 -13
- data/tasks/yard.rake +0 -51
metadata
CHANGED
@@ -1,121 +1,90 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sexpr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Bernard Lambeau
|
9
|
-
autorequire:
|
8
|
+
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2021-12-11 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: path
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '1.3'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '1.3'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: citrus
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- - ~>
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version: '
|
33
|
+
version: '3.0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- - ~>
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
|
-
version: '
|
40
|
+
version: '3.0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rake
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- - ~>
|
45
|
+
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
47
|
+
version: '13.0'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- - ~>
|
52
|
+
- - "~>"
|
60
53
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
54
|
+
version: '13.0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: rspec
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- - ~>
|
59
|
+
- - "~>"
|
68
60
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
61
|
+
version: '3.10'
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- - ~>
|
66
|
+
- - "~>"
|
76
67
|
- !ruby/object:Gem::Version
|
77
|
-
version: '
|
78
|
-
- !ruby/object:Gem::Dependency
|
79
|
-
name: wlang
|
80
|
-
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
|
-
requirements:
|
83
|
-
- - ~>
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: 0.10.2
|
86
|
-
type: :development
|
87
|
-
prerelease: false
|
88
|
-
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
|
-
requirements:
|
91
|
-
- - ~>
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: 0.10.2
|
68
|
+
version: '3.10'
|
94
69
|
description: Sexpr helps manipulating s-expressions in ruby.
|
95
70
|
email:
|
96
71
|
- blambeau@gmail.com
|
97
72
|
executables: []
|
98
73
|
extensions: []
|
99
|
-
extra_rdoc_files:
|
100
|
-
- README.md
|
101
|
-
- CHANGELOG.md
|
102
|
-
- LICENCE.md
|
74
|
+
extra_rdoc_files: []
|
103
75
|
files:
|
104
|
-
- sexpr.gemspec
|
105
|
-
- sexpr.noespec
|
106
76
|
- CHANGELOG.md
|
107
77
|
- Gemfile
|
108
|
-
-
|
109
|
-
-
|
110
|
-
-
|
111
|
-
- examples/bool_expr/bool_expr.sexp.yml
|
78
|
+
- README.md
|
79
|
+
- Rakefile
|
80
|
+
- lib/sexpr.rb
|
112
81
|
- lib/sexpr/errors.rb
|
82
|
+
- lib/sexpr/grammar.rb
|
113
83
|
- lib/sexpr/grammar/matching.rb
|
114
84
|
- lib/sexpr/grammar/options.rb
|
115
85
|
- lib/sexpr/grammar/parsing.rb
|
116
86
|
- lib/sexpr/grammar/tagging.rb
|
117
|
-
- lib/sexpr/
|
118
|
-
- lib/sexpr/loader.rb
|
87
|
+
- lib/sexpr/matcher.rb
|
119
88
|
- lib/sexpr/matcher/alternative.rb
|
120
89
|
- lib/sexpr/matcher/many.rb
|
121
90
|
- lib/sexpr/matcher/non_terminal.rb
|
@@ -123,22 +92,16 @@ files:
|
|
123
92
|
- lib/sexpr/matcher/rule.rb
|
124
93
|
- lib/sexpr/matcher/sequence.rb
|
125
94
|
- lib/sexpr/matcher/terminal.rb
|
126
|
-
- lib/sexpr/matcher.rb
|
127
95
|
- lib/sexpr/node.rb
|
96
|
+
- lib/sexpr/parser.rb
|
128
97
|
- lib/sexpr/parser/citrus.rb
|
129
98
|
- lib/sexpr/parser/ext.rb
|
130
|
-
- lib/sexpr/
|
99
|
+
- lib/sexpr/processor.rb
|
131
100
|
- lib/sexpr/processor/helper.rb
|
132
101
|
- lib/sexpr/processor/null_helper.rb
|
133
102
|
- lib/sexpr/processor/sexpr_coercions.rb
|
134
|
-
- lib/sexpr/processor.rb
|
135
103
|
- lib/sexpr/rewriter.rb
|
136
104
|
- lib/sexpr/version.rb
|
137
|
-
- lib/sexpr.rb
|
138
|
-
- LICENCE.md
|
139
|
-
- Manifest.txt
|
140
|
-
- Rakefile
|
141
|
-
- README.md
|
142
105
|
- spec/fixtures/bar.rb
|
143
106
|
- spec/fixtures/foo.rb
|
144
107
|
- spec/fixtures/preprocessed.rb
|
@@ -202,99 +165,28 @@ files:
|
|
202
165
|
- spec/unit/test_load.rb
|
203
166
|
- spec/unit/test_rewriter.rb
|
204
167
|
- spec/unit/test_sexpr.rb
|
205
|
-
- tasks/debug_mail.rake
|
206
|
-
- tasks/debug_mail.txt
|
207
168
|
- tasks/gem.rake
|
208
169
|
- tasks/test.rake
|
209
|
-
- tasks/yard.rake
|
210
170
|
homepage: https://github.com/blambeau/sexp
|
211
171
|
licenses: []
|
212
|
-
|
172
|
+
metadata: {}
|
173
|
+
post_install_message:
|
213
174
|
rdoc_options: []
|
214
175
|
require_paths:
|
215
176
|
- lib
|
216
177
|
required_ruby_version: !ruby/object:Gem::Requirement
|
217
|
-
none: false
|
218
178
|
requirements:
|
219
|
-
- -
|
179
|
+
- - ">="
|
220
180
|
- !ruby/object:Gem::Version
|
221
181
|
version: '0'
|
222
|
-
segments:
|
223
|
-
- 0
|
224
|
-
hash: -1636299260156006054
|
225
182
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
226
|
-
none: false
|
227
183
|
requirements:
|
228
|
-
- -
|
184
|
+
- - ">="
|
229
185
|
- !ruby/object:Gem::Version
|
230
186
|
version: '0'
|
231
187
|
requirements: []
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
specification_version: 3
|
188
|
+
rubygems_version: 3.1.4
|
189
|
+
signing_key:
|
190
|
+
specification_version: 4
|
236
191
|
summary: A compilation framework around s-expressions
|
237
|
-
test_files:
|
238
|
-
- spec/fixtures/bar.rb
|
239
|
-
- spec/fixtures/foo.rb
|
240
|
-
- spec/fixtures/preprocessed.rb
|
241
|
-
- spec/fixtures/simple_processor.rb
|
242
|
-
- spec/integration/bool_expr/test_not_push.rb
|
243
|
-
- spec/integration/bool_expr/test_parsing.rb
|
244
|
-
- spec/integration/bool_expr/test_tagging.rb
|
245
|
-
- spec/integration/bool_expr/test_validation.rb
|
246
|
-
- spec/integration/test_readme_examples.rb
|
247
|
-
- spec/spec_helper.rb
|
248
|
-
- spec/unit/grammar/matching/test_compile_rule.rb
|
249
|
-
- spec/unit/grammar/matching/test_compile_rule_defn.rb
|
250
|
-
- spec/unit/grammar/matching/test_compile_rules.rb
|
251
|
-
- spec/unit/grammar/options/test_install_parser.rb
|
252
|
-
- spec/unit/grammar/options/test_install_path.rb
|
253
|
-
- spec/unit/grammar/options/test_install_root.rb
|
254
|
-
- spec/unit/grammar/tagging/test_looks_a_sexpr.rb
|
255
|
-
- spec/unit/grammar/tagging/test_mod2rulename.rb
|
256
|
-
- spec/unit/grammar/tagging/test_rule2modname.rb
|
257
|
-
- spec/unit/grammar/tagging/test_tag_sexpr.rb
|
258
|
-
- spec/unit/grammar/tagging/test_tagging_module_for.rb
|
259
|
-
- spec/unit/grammar/test_new.rb
|
260
|
-
- spec/unit/grammar/test_parse.rb
|
261
|
-
- spec/unit/grammar/test_sexpr.rb
|
262
|
-
- spec/unit/matcher/alternative/test_eat.rb
|
263
|
-
- spec/unit/matcher/alternative/test_match_q.rb
|
264
|
-
- spec/unit/matcher/many/test_eat.rb
|
265
|
-
- spec/unit/matcher/many/test_initialize.rb
|
266
|
-
- spec/unit/matcher/many/test_match_q.rb
|
267
|
-
- spec/unit/matcher/non_terminal/test_eat.rb
|
268
|
-
- spec/unit/matcher/non_terminal/test_match_q.rb
|
269
|
-
- spec/unit/matcher/reference/test_eat.rb
|
270
|
-
- spec/unit/matcher/reference/test_match_q.rb
|
271
|
-
- spec/unit/matcher/rule/test_eat.rb
|
272
|
-
- spec/unit/matcher/rule/test_match_q.rb
|
273
|
-
- spec/unit/matcher/sequence/test_eat.rb
|
274
|
-
- spec/unit/matcher/sequence/test_match_q.rb
|
275
|
-
- spec/unit/matcher/terminal/test_eat.rb
|
276
|
-
- spec/unit/matcher/terminal/test_match_q.rb
|
277
|
-
- spec/unit/matcher/terminal/test_terminal_match.rb
|
278
|
-
- spec/unit/node/test_sexpr_body.rb
|
279
|
-
- spec/unit/node/test_sexpr_copy.rb
|
280
|
-
- spec/unit/node/test_sexpr_type.rb
|
281
|
-
- spec/unit/node/test_tracking_markers.rb
|
282
|
-
- spec/unit/parser/citrus/test_new.rb
|
283
|
-
- spec/unit/parser/citrus/test_parse.rb
|
284
|
-
- spec/unit/parser/citrus/test_recognize.rb
|
285
|
-
- spec/unit/parser/citrus/test_registration.rb
|
286
|
-
- spec/unit/parser/citrus/test_to_sexpr.rb
|
287
|
-
- spec/unit/parser/test_factor.rb
|
288
|
-
- spec/unit/parser/test_input_text.rb
|
289
|
-
- spec/unit/processor/helper/test_call.rb
|
290
|
-
- spec/unit/processor/test_apply.rb
|
291
|
-
- spec/unit/processor/test_build_helper_chain.rb
|
292
|
-
- spec/unit/processor/test_call.rb
|
293
|
-
- spec/unit/processor/test_grammar.rb
|
294
|
-
- spec/unit/processor/test_helper.rb
|
295
|
-
- spec/unit/processor/test_sexpr_coercions.rb
|
296
|
-
- spec/unit/processor/test_use.rb
|
297
|
-
- spec/unit/rewriter/test_copy_and_apply.rb
|
298
|
-
- spec/unit/test_load.rb
|
299
|
-
- spec/unit/test_rewriter.rb
|
300
|
-
- spec/unit/test_sexpr.rb
|
192
|
+
test_files: []
|
data/Gemfile.lock
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
citrus (2.4.1)
|
5
|
-
diff-lcs (1.2.4)
|
6
|
-
path (1.3.3)
|
7
|
-
rake (10.1.0)
|
8
|
-
rspec (2.14.1)
|
9
|
-
rspec-core (~> 2.14.0)
|
10
|
-
rspec-expectations (~> 2.14.0)
|
11
|
-
rspec-mocks (~> 2.14.0)
|
12
|
-
rspec-core (2.14.5)
|
13
|
-
rspec-expectations (2.14.2)
|
14
|
-
diff-lcs (>= 1.1.3, < 2.0)
|
15
|
-
rspec-mocks (2.14.3)
|
16
|
-
wlang (0.10.2)
|
17
|
-
|
18
|
-
PLATFORMS
|
19
|
-
java
|
20
|
-
ruby
|
21
|
-
|
22
|
-
DEPENDENCIES
|
23
|
-
citrus (~> 2.4)
|
24
|
-
path (~> 1.3)
|
25
|
-
rake (~> 10.0)
|
26
|
-
rspec (~> 2.10)
|
27
|
-
wlang (~> 0.10.2)
|
data/LICENCE.md
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# The MIT Licence
|
2
|
-
|
3
|
-
Copyright (c) 2012 - Bernard Lambeau
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Manifest.txt
DELETED
@@ -1,72 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# This is a Citrus grammar for boolean expressions.
|
3
|
-
#
|
4
|
-
# The parser is automatically loaded under the BoolExpr::Parser constant by Citrus
|
5
|
-
# itself. It is also automatically registered under BoolExpr::Grammar.parser by
|
6
|
-
# `Sexpr.load` when invoked on the bool_expr.sexp.yml file.
|
7
|
-
#
|
8
|
-
# The coupon codes returns s-expressions that correctly refer to the abstract grammar
|
9
|
-
# definition in that file (AST).
|
10
|
-
#
|
11
|
-
grammar BoolExpr::Parser
|
12
|
-
|
13
|
-
rule bool_expr
|
14
|
-
bool_or
|
15
|
-
end
|
16
|
-
|
17
|
-
rule bool_or
|
18
|
-
(l:bool_and spaces 'or' spaces r:bool_or){
|
19
|
-
[:bool_or, l.sexpr, r.sexpr]
|
20
|
-
}
|
21
|
-
| bool_and
|
22
|
-
end
|
23
|
-
|
24
|
-
rule bool_and
|
25
|
-
(l:bool_not spaces 'and' spaces r:bool_and){
|
26
|
-
[:bool_and, l.sexpr, r.sexpr]
|
27
|
-
}
|
28
|
-
| bool_not
|
29
|
-
end
|
30
|
-
|
31
|
-
rule bool_not
|
32
|
-
('not' spacing e:bool_not){
|
33
|
-
[:bool_not, e.sexpr]
|
34
|
-
}
|
35
|
-
| bool_term
|
36
|
-
end
|
37
|
-
|
38
|
-
rule bool_term
|
39
|
-
bool_paren | bool_lit | var_ref
|
40
|
-
end
|
41
|
-
|
42
|
-
rule bool_paren
|
43
|
-
('(' spacing e:bool_or spacing ')'){
|
44
|
-
e.sexpr
|
45
|
-
}
|
46
|
-
end
|
47
|
-
|
48
|
-
rule bool_lit
|
49
|
-
("true" | "false"){
|
50
|
-
[:bool_lit, ::Kernel.eval(strip) ]
|
51
|
-
}
|
52
|
-
end
|
53
|
-
|
54
|
-
rule var_ref
|
55
|
-
(!(keyword (spaces | !.)) [a-z]+){
|
56
|
-
[:var_ref, strip]
|
57
|
-
}
|
58
|
-
end
|
59
|
-
|
60
|
-
rule spacing
|
61
|
-
[ \t]*
|
62
|
-
end
|
63
|
-
|
64
|
-
rule spaces
|
65
|
-
[ \t]+
|
66
|
-
end
|
67
|
-
|
68
|
-
rule keyword
|
69
|
-
"true" | "false" | "or" | "and" | "not"
|
70
|
-
end
|
71
|
-
|
72
|
-
end
|
@@ -1,59 +0,0 @@
|
|
1
|
-
require 'sexpr'
|
2
|
-
require 'citrus'
|
3
|
-
|
4
|
-
# Let load the grammar from the .yml definition file.
|
5
|
-
BoolExpr = Sexpr.load File.expand_path('../bool_expr.sexp.yml', __FILE__)
|
6
|
-
|
7
|
-
# A Sexpr grammar is simply a module. Ruby allows us to re-open it later.
|
8
|
-
module BoolExpr
|
9
|
-
|
10
|
-
# These are the modules automatically installed on the s-expressions
|
11
|
-
# that the grammar produces
|
12
|
-
module And; end
|
13
|
-
module Or; end
|
14
|
-
module Not; end
|
15
|
-
module Lit; end
|
16
|
-
module VarRef; end
|
17
|
-
|
18
|
-
# The two following methods allows converting rule names (e.g. bool_and)
|
19
|
-
# to module names (And). A default implementation is provided by Sexpr
|
20
|
-
# that enforces convention over configuration (BoolAnd <-> bool_and). We
|
21
|
-
# override the methods here for the sake of the example/documentation.
|
22
|
-
|
23
|
-
def rule2modname(rule)
|
24
|
-
(rule.to_s =~ /^bool_(.*)$/) ? $1.capitalize.to_sym : super
|
25
|
-
end
|
26
|
-
|
27
|
-
def mod2rulename(mod)
|
28
|
-
rule = super
|
29
|
-
(rule.to_s =~ /^bool_(.*)$/) ? const_get($1.to_sym) : rule
|
30
|
-
end
|
31
|
-
|
32
|
-
# This class pushes `[:not, ...]` as far as possible in boolean expressions.
|
33
|
-
# It provides an example of s-expression rewriter
|
34
|
-
class NotPushProcessor < Sexpr::Rewriter
|
35
|
-
|
36
|
-
# Let the default implementation know that we are working on the BoolExpr
|
37
|
-
# grammar. This way, all rewriting results will automatically be tagged
|
38
|
-
# with the correct modules above (And, Not, ...)
|
39
|
-
grammar BoolExpr
|
40
|
-
|
41
|
-
# The main rewriting rule, that pushes a NOT according to the different
|
42
|
-
# cases
|
43
|
-
def on_bool_not(sexpr)
|
44
|
-
case expr = sexpr.last
|
45
|
-
when And then apply [:bool_or, [:bool_not, expr[1]], [:bool_not, expr[2]] ]
|
46
|
-
when Or then apply [:bool_and, [:bool_not, expr[1]], [:bool_not, expr[2]] ]
|
47
|
-
when Not then apply expr.last
|
48
|
-
when Lit then [:bool_lit, !expr.last]
|
49
|
-
else
|
50
|
-
sexpr
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
# By default, we simply copy the node and apply rewriting rules on children
|
55
|
-
alias :on_missing :copy_and_apply
|
56
|
-
|
57
|
-
end # class NotPushProcessor
|
58
|
-
|
59
|
-
end # module BoolExpr
|
@@ -1,23 +0,0 @@
|
|
1
|
-
parser:
|
2
|
-
bool_expr.citrus
|
3
|
-
rules:
|
4
|
-
bool_expr:
|
5
|
-
- bool_and
|
6
|
-
- bool_or
|
7
|
-
- bool_not
|
8
|
-
- var_ref
|
9
|
-
- bool_lit
|
10
|
-
bool_and:
|
11
|
-
- [ bool_expr+ ]
|
12
|
-
bool_or:
|
13
|
-
- [ bool_expr+ ]
|
14
|
-
bool_not:
|
15
|
-
- [ bool_expr ]
|
16
|
-
bool_lit:
|
17
|
-
- [ literal ]
|
18
|
-
var_ref:
|
19
|
-
- [ var_name ]
|
20
|
-
var_name:
|
21
|
-
!ruby/regexp /^[a-z]+$/
|
22
|
-
literal:
|
23
|
-
[true, false]
|
data/lib/sexpr/loader.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
|
data/sexpr.gemspec
DELETED
@@ -1,189 +0,0 @@
|
|
1
|
-
# We require your library, mainly to have access to the VERSION number.
|
2
|
-
# Feel free to set $version manually.
|
3
|
-
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
|
4
|
-
require "sexpr/version"
|
5
|
-
$version = Sexpr::Version.to_s
|
6
|
-
|
7
|
-
#
|
8
|
-
# This is your Gem specification. Default values are provided so that your library
|
9
|
-
# should be correctly packaged given what you have described in the .noespec file.
|
10
|
-
#
|
11
|
-
Gem::Specification.new do |s|
|
12
|
-
|
13
|
-
################################################################### ABOUT YOUR GEM
|
14
|
-
|
15
|
-
# Gem name (required)
|
16
|
-
s.name = "sexpr"
|
17
|
-
|
18
|
-
# Gem version (required)
|
19
|
-
s.version = $version
|
20
|
-
|
21
|
-
# A short summary of this gem
|
22
|
-
#
|
23
|
-
# This is displayed in `gem list -d`.
|
24
|
-
s.summary = "A compilation framework around s-expressions"
|
25
|
-
|
26
|
-
# A long description of this gem (required)
|
27
|
-
#
|
28
|
-
# The description should be more detailed than the summary. For example,
|
29
|
-
# you might wish to copy the entire README into the description.
|
30
|
-
s.description = "Sexpr helps manipulating s-expressions in ruby."
|
31
|
-
|
32
|
-
# The URL of this gem home page (optional)
|
33
|
-
s.homepage = "https://github.com/blambeau/sexp"
|
34
|
-
|
35
|
-
# Gem publication date (required but auto)
|
36
|
-
#
|
37
|
-
# Today is automatically used by default, uncomment only if
|
38
|
-
# you know what you do!
|
39
|
-
#
|
40
|
-
# s.date = Time.now.strftime('%Y-%m-%d')
|
41
|
-
|
42
|
-
# The license(s) for the library. Each license must be a short name, no
|
43
|
-
# more than 64 characters.
|
44
|
-
#
|
45
|
-
# s.licences = %w{}
|
46
|
-
|
47
|
-
# The rubyforge project this gem lives under (optional)
|
48
|
-
#
|
49
|
-
# s.rubyforge_project = nil
|
50
|
-
|
51
|
-
################################################################### ABOUT THE AUTHORS
|
52
|
-
|
53
|
-
# The list of author names who wrote this gem.
|
54
|
-
#
|
55
|
-
# If you are providing multiple authors and multiple emails they should be
|
56
|
-
# in the same order.
|
57
|
-
#
|
58
|
-
s.authors = ["Bernard Lambeau"]
|
59
|
-
|
60
|
-
# Contact emails for this gem
|
61
|
-
#
|
62
|
-
# If you are providing multiple authors and multiple emails they should be
|
63
|
-
# in the same order.
|
64
|
-
#
|
65
|
-
# NOTE: Somewhat strangly this attribute is always singular!
|
66
|
-
# Don't replace by s.emails = ...
|
67
|
-
s.email = ["blambeau@gmail.com"]
|
68
|
-
|
69
|
-
################################################################### PATHS, FILES, BINARIES
|
70
|
-
|
71
|
-
# Paths in the gem to add to $LOAD_PATH when this gem is
|
72
|
-
# activated (required).
|
73
|
-
#
|
74
|
-
# The default 'lib' is typically sufficient.
|
75
|
-
s.require_paths = ["lib"]
|
76
|
-
|
77
|
-
# Files included in this gem.
|
78
|
-
#
|
79
|
-
# By default, we take all files included in the Manifest.txt file on root
|
80
|
-
# of the project. Entries of the manifest are interpreted as Dir[...]
|
81
|
-
# patterns so that lazy people may use wilcards like lib/**/*
|
82
|
-
#
|
83
|
-
here = File.expand_path(File.dirname(__FILE__))
|
84
|
-
s.files = File.readlines(File.join(here, 'Manifest.txt')).
|
85
|
-
inject([]){|files, pattern| files + Dir[File.join(here, pattern.strip)]}.
|
86
|
-
collect{|x| x[(1+here.size)..-1]}
|
87
|
-
|
88
|
-
# Test files included in this gem.
|
89
|
-
#
|
90
|
-
s.test_files = Dir["test/**/*"] + Dir["spec/**/*"]
|
91
|
-
|
92
|
-
# The path in the gem for executable scripts (optional)
|
93
|
-
#
|
94
|
-
s.bindir = "bin"
|
95
|
-
|
96
|
-
# Executables included in the gem.
|
97
|
-
#
|
98
|
-
s.executables = (Dir["bin/*"]).collect{|f| File.basename(f)}
|
99
|
-
|
100
|
-
################################################################### REQUIREMENTS & INSTALL
|
101
|
-
# Remember the gem version requirements operators and schemes:
|
102
|
-
# = Equals version
|
103
|
-
# != Not equal to version
|
104
|
-
# > Greater than version
|
105
|
-
# < Less than version
|
106
|
-
# >= Greater than or equal to
|
107
|
-
# <= Less than or equal to
|
108
|
-
# ~> Approximately greater than
|
109
|
-
#
|
110
|
-
# Don't forget to have a look at http://lmgtfy.com/?q=Ruby+Versioning+Policies
|
111
|
-
# for setting your gem version.
|
112
|
-
#
|
113
|
-
# For your requirements to other gems, remember that
|
114
|
-
# ">= 2.2.0" (optimistic: specify minimal version)
|
115
|
-
# ">= 2.2.0", "< 3.0" (pessimistic: not greater than the next major)
|
116
|
-
# "~> 2.2" (shortcut for ">= 2.2.0", "< 3.0")
|
117
|
-
# "~> 2.2.0" (shortcut for ">= 2.2.0", "< 2.3.0")
|
118
|
-
#
|
119
|
-
|
120
|
-
#
|
121
|
-
# One call to add_dependency('gem_name', 'gem version requirement') for each
|
122
|
-
# runtime dependency. These gems will be installed with your gem.
|
123
|
-
# One call to add_development_dependency('gem_name', 'gem version requirement')
|
124
|
-
# for each development dependency. These gems are required for developers
|
125
|
-
#
|
126
|
-
s.add_development_dependency("path", "~> 1.3")
|
127
|
-
s.add_development_dependency("citrus", "~> 2.4")
|
128
|
-
s.add_development_dependency("rake", "~> 10.0")
|
129
|
-
s.add_development_dependency("rspec", "~> 2.10")
|
130
|
-
s.add_development_dependency("wlang", "~> 0.10.2")
|
131
|
-
|
132
|
-
|
133
|
-
# The version of ruby required by this gem
|
134
|
-
#
|
135
|
-
# Uncomment and set this if your gem requires specific ruby versions.
|
136
|
-
#
|
137
|
-
# s.required_ruby_version = ">= 0"
|
138
|
-
|
139
|
-
# The RubyGems version required by this gem
|
140
|
-
#
|
141
|
-
# s.required_rubygems_version = ">= 0"
|
142
|
-
|
143
|
-
# The platform this gem runs on. See Gem::Platform for details.
|
144
|
-
#
|
145
|
-
# s.platform = nil
|
146
|
-
|
147
|
-
# Extensions to build when installing the gem.
|
148
|
-
#
|
149
|
-
# Valid types of extensions are extconf.rb files, configure scripts
|
150
|
-
# and rakefiles or mkrf_conf files.
|
151
|
-
#
|
152
|
-
s.extensions = []
|
153
|
-
|
154
|
-
# External (to RubyGems) requirements that must be met for this gem to work.
|
155
|
-
# It’s simply information for the user.
|
156
|
-
#
|
157
|
-
s.requirements = nil
|
158
|
-
|
159
|
-
# A message that gets displayed after the gem is installed
|
160
|
-
#
|
161
|
-
# Uncomment and set this if you want to say something to the user
|
162
|
-
# after gem installation
|
163
|
-
#
|
164
|
-
s.post_install_message = nil
|
165
|
-
|
166
|
-
################################################################### SECURITY
|
167
|
-
|
168
|
-
# The key used to sign this gem. See Gem::Security for details.
|
169
|
-
#
|
170
|
-
# s.signing_key = nil
|
171
|
-
|
172
|
-
# The certificate chain used to sign this gem. See Gem::Security for
|
173
|
-
# details.
|
174
|
-
#
|
175
|
-
# s.cert_chain = []
|
176
|
-
|
177
|
-
################################################################### RDOC
|
178
|
-
|
179
|
-
# An ARGV style array of options to RDoc
|
180
|
-
#
|
181
|
-
# See 'rdoc --help' about this
|
182
|
-
#
|
183
|
-
s.rdoc_options = []
|
184
|
-
|
185
|
-
# Extra files to add to RDoc such as README
|
186
|
-
#
|
187
|
-
s.extra_rdoc_files = Dir["README.md"] + Dir["CHANGELOG.md"] + Dir["LICENCE.md"]
|
188
|
-
|
189
|
-
end
|