delorean_lang 0.3.31 → 0.3.32
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/base.rb +1 -0
- data/lib/delorean/version.rb +1 -1
- data/spec/eval_spec.rb +21 -0
- data/spec/func_spec.rb +9 -0
- 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: 2f8aaf5a3557bf3e76a8f95f52534d055569c39c
|
|
4
|
+
data.tar.gz: 96660ba07840567867b368f423c49eca4268397d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c69132b1cb303b515947de4902605a9a2844a5ecf4779e77d1d8c12bd3fa688a6c378297c4132fedcb335104f4a9b50c26a5b1323836d1c9ca0ea187148d192c
|
|
7
|
+
data.tar.gz: 6bcad46448add879a392e473abd6b163864d3ff254ac566d1c819cfe3c4f6836d64655f790e88f4b1c9be0e2abde3c4a86525395b49d4674e7bcd6946b3b17da
|
data/lib/delorean/base.rb
CHANGED
data/lib/delorean/version.rb
CHANGED
data/spec/eval_spec.rb
CHANGED
|
@@ -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
|
data/spec/func_spec.rb
CHANGED
|
@@ -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.
|
|
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
|
+
date: 2017-10-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: treetop
|