delorean_lang 0.3.31 → 0.3.32

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: 259b9fc3a05240bbebb0c0a877d9a11c0f7401d0
4
- data.tar.gz: ef2acc922ac850c8410bcb75eb4de62e4ab59e7b
3
+ metadata.gz: 2f8aaf5a3557bf3e76a8f95f52534d055569c39c
4
+ data.tar.gz: 96660ba07840567867b368f423c49eca4268397d
5
5
  SHA512:
6
- metadata.gz: ee6fcf4f8966abaa56a284bdd962445c656e57b29cfb320b58444f19dc902f50f78987774349c1bce18a4e9a92ef1f713b5e186cc3c2c731a2194564cc61dc6c
7
- data.tar.gz: ac3d17bc10474283229de347bba7f3edd59ad6d59957c51a43b68ae83f1b7e4d93e6467a416091c69516d34325a2aa292ad2172ef92a2724ccd37602cfb4a5fd
6
+ metadata.gz: c69132b1cb303b515947de4902605a9a2844a5ecf4779e77d1d8c12bd3fa688a6c378297c4132fedcb335104f4a9b50c26a5b1323836d1c9ca0ea187148d192c
7
+ data.tar.gz: 6bcad46448add879a392e473abd6b163864d3ff254ac566d1c819cfe3c4f6836d64655f790e88f4b1c9be0e2abde3c4a86525395b49d4674e7bcd6946b3b17da
@@ -78,6 +78,7 @@ module Delorean
78
78
  abs: [Numeric],
79
79
  round: [Numeric, [nil, Integer]],
80
80
  ceil: [Numeric],
81
+ floor: [Numeric],
81
82
  }
82
83
 
83
84
  module BaseModule
@@ -1,3 +1,3 @@
1
1
  module Delorean
2
- VERSION = "0.3.31"
2
+ VERSION = "0.3.32"
3
3
  end
@@ -998,4 +998,25 @@ eof
998
998
  r = engine.evaluate("B", "x")
999
999
  expect(r).to eq 3
1000
1000
  end
1001
+
1002
+ xit "can use nodes as continuations" do
1003
+
1004
+ # FIME: This is actually a trivial exmaple. Ideally we should be
1005
+ # able to pass arguments to the nodes when evaluating ys. If the
1006
+ # arguments do not change the computation of "x" then "x" should
1007
+ # not be recomputed. This would need some flow analysis though.
1008
+
1009
+ engine.parse defn("A:",
1010
+ " a =?",
1011
+ " x = Dummy.side_effect",
1012
+ " y = x*a",
1013
+ "B:",
1014
+ " ns = [A(a=a) for a in [1, 1, 1]]",
1015
+ " xs = [n.x for n in ns]",
1016
+ " ys = [n.y for n in ns]",
1017
+ " res = [xs, ys]",
1018
+ )
1019
+ r = engine.evaluate("B", "res")
1020
+ expect(r[1]).to eq r[0]
1021
+ end
1001
1022
  end
@@ -35,6 +35,15 @@ describe "Delorean" do
35
35
  r.should == [12.35, 12.3, 12]
36
36
  end
37
37
 
38
+ it "should handle FLOOR" do
39
+ engine.parse defn("A:",
40
+ " a = [12.3456.floor(), 13.7890.floor()]",
41
+ )
42
+
43
+ r = engine.evaluate("A", "a")
44
+ r.should == [12, 13]
45
+ end
46
+
38
47
  it "should handle NUMBER" do
39
48
  engine.parse defn("A:",
40
49
  " a = 12.3456.to_f()",
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.31
4
+ version: 0.3.32
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-10-11 00:00:00.000000000 Z
11
+ date: 2017-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: treetop