delorean_lang 0.3.30 → 0.3.31

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6533974257ae71867de5f7237d671a74c5df653c
4
- data.tar.gz: 0be5b0053ac67c03e22b4d79f8ff6ca6699edbfc
3
+ metadata.gz: 259b9fc3a05240bbebb0c0a877d9a11c0f7401d0
4
+ data.tar.gz: ef2acc922ac850c8410bcb75eb4de62e4ab59e7b
5
5
  SHA512:
6
- metadata.gz: 61f051c79ce4219de27151c228ef8f997f6caffe5a30af7f53e7e3ace82e92803b6221a34bd5eb13677a697d63d7ff7e5b12df8da96c32e9979709b02042cb8b
7
- data.tar.gz: 6e1e789f69566b2c526b6a7f84da419588963e419664ead313a5cfcad8c9bd8edaf5e56417df46dc6f988e743b83adcd1f6c00401cc623f52dbba1d022565f3c
6
+ metadata.gz: ee6fcf4f8966abaa56a284bdd962445c656e57b29cfb320b58444f19dc902f50f78987774349c1bce18a4e9a92ef1f713b5e186cc3c2c731a2194564cc61dc6c
7
+ data.tar.gz: ac3d17bc10474283229de347bba7f3edd59ad6d59957c51a43b68ae83f1b7e4d93e6467a416091c69516d34325a2aa292ad2172ef92a2724ccd37602cfb4a5fd
@@ -533,8 +533,9 @@ eos
533
533
 
534
534
  class KwArgs < SNode
535
535
  def check(context, *)
536
- arg0.check(context) + (defined?(args_rest.args) ?
537
- args_rest.args.check(context) : [])
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.args) ? args_rest.args.check(context) : [])
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)
@@ -1,3 +1,3 @@
1
1
  module Delorean
2
- VERSION = "0.3.30"
2
+ VERSION = "0.3.31"
3
3
  end
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
@@ -57,7 +57,7 @@ class Dummy < ActiveRecord::Base
57
57
  MISS_YOU_SO_BAD_SIG = [0, 0]
58
58
 
59
59
  delorean_fn :all_of_me, sig: 0 do
60
- self.all
60
+ [ {"name" => "hello", "foo" => "bar"} ]
61
61
  end
62
62
 
63
63
  def self.i_threw_a_hash_in_the_well
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.30
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-09-18 00:00:00.000000000 Z
11
+ date: 2017-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: treetop