delorean_lang 0.3.30 → 0.3.31
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 +4 -4
- data/lib/delorean/nodes.rb +5 -3
- data/lib/delorean/version.rb +1 -1
- data/spec/parse_spec.rb +27 -0
- data/spec/spec_helper.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 259b9fc3a05240bbebb0c0a877d9a11c0f7401d0
|
|
4
|
+
data.tar.gz: ef2acc922ac850c8410bcb75eb4de62e4ab59e7b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ee6fcf4f8966abaa56a284bdd962445c656e57b29cfb320b58444f19dc902f50f78987774349c1bce18a4e9a92ef1f713b5e186cc3c2c731a2194564cc61dc6c
|
|
7
|
+
data.tar.gz: ac3d17bc10474283229de347bba7f3edd59ad6d59957c51a43b68ae83f1b7e4d93e6467a416091c69516d34325a2aa292ad2172ef92a2724ccd37602cfb4a5fd
|
data/lib/delorean/nodes.rb
CHANGED
|
@@ -533,8 +533,9 @@ eos
|
|
|
533
533
|
|
|
534
534
|
class KwArgs < SNode
|
|
535
535
|
def check(context, *)
|
|
536
|
-
arg0.check(context) + (
|
|
537
|
-
|
|
536
|
+
arg0.check(context) + (
|
|
537
|
+
defined?(args_rest.al) && !args_rest.al.empty? ?
|
|
538
|
+
args_rest.al.check(context) : [])
|
|
538
539
|
end
|
|
539
540
|
|
|
540
541
|
def rewrite(context)
|
|
@@ -559,7 +560,8 @@ eos
|
|
|
559
560
|
class HashArgs < SNode
|
|
560
561
|
def check(context, *)
|
|
561
562
|
e0.check(context) + e1.check(context) +
|
|
562
|
-
(defined?(args_rest.
|
|
563
|
+
(defined?(args_rest.al) && !args_rest.al.empty? ?
|
|
564
|
+
args_rest.al.check(context) : [])
|
|
563
565
|
end
|
|
564
566
|
|
|
565
567
|
def rewrite(context)
|
data/lib/delorean/version.rb
CHANGED
data/spec/parse_spec.rb
CHANGED
|
@@ -279,6 +279,33 @@ describe "Delorean" do
|
|
|
279
279
|
}.should raise_error(Delorean::UndefinedError)
|
|
280
280
|
end
|
|
281
281
|
|
|
282
|
+
it "should not be possible to use a forward definition in hash" do
|
|
283
|
+
lambda {
|
|
284
|
+
engine.parse defn("A:",
|
|
285
|
+
" c = {'b': 1, 'd' : d}",
|
|
286
|
+
" d = 789",
|
|
287
|
+
)
|
|
288
|
+
}.should raise_error(Delorean::UndefinedError)
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
it "should not be possible to use a forward definition in node call" do
|
|
292
|
+
lambda {
|
|
293
|
+
engine.parse defn("A:",
|
|
294
|
+
" c = A(b=1, d=d)",
|
|
295
|
+
" d = 789",
|
|
296
|
+
)
|
|
297
|
+
}.should raise_error(Delorean::UndefinedError)
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
it "should not be possible to use a forward definition in array" do
|
|
301
|
+
lambda {
|
|
302
|
+
engine.parse defn("A:",
|
|
303
|
+
" c = [123, 456, d]",
|
|
304
|
+
" d = 789",
|
|
305
|
+
)
|
|
306
|
+
}.should raise_error(Delorean::UndefinedError)
|
|
307
|
+
end
|
|
308
|
+
|
|
282
309
|
it "should be able to use ruby keywords as identifier" do
|
|
283
310
|
lambda {
|
|
284
311
|
engine.parse defn("A:",
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: delorean_lang
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.31
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Arman Bostani
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-10-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: treetop
|