halunke 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/exe/halunke +1 -1
- data/lib/halunke/interpreter.rb +2 -1
- data/lib/halunke/nodes.rb +5 -0
- data/lib/halunke/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e392834f93d1e8a31556b550cd9a85f8746fbb1c
|
4
|
+
data.tar.gz: e9d9a8aed17f7c861bfc987df05d72a5e5dcd4b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b29f8e9324a0d33a245fd8ce6ee2b7c47d0ee0550bcc86cdd4f22610c596dd112aaf80f4f37b64bd8bf376faf5aaa657afec10c6a7cf89b4415369dcc7af4ced
|
7
|
+
data.tar.gz: 6ca3d129843dd9d774160f57fa4807677c2c3e84e08669fddc37bd749e99c60240b8ec68aa394071dafadd9e52e17546680e51b8f3c00a7f51d66ecd6530508d
|
data/Gemfile.lock
CHANGED
data/exe/halunke
CHANGED
data/lib/halunke/interpreter.rb
CHANGED
data/lib/halunke/nodes.rb
CHANGED
@@ -4,6 +4,10 @@ module Halunke
|
|
4
4
|
nodes.map { |node| node.eval(context) }.last
|
5
5
|
end
|
6
6
|
|
7
|
+
def empty?
|
8
|
+
nodes.empty?
|
9
|
+
end
|
10
|
+
|
7
11
|
def to_message
|
8
12
|
MessageNode.new(nodes)
|
9
13
|
end
|
@@ -43,6 +47,7 @@ module Halunke
|
|
43
47
|
|
44
48
|
FunctionNode = Struct.new(:params, :body) do
|
45
49
|
def eval(context)
|
50
|
+
raise "This function would not return anything. That's forbidden." if body.empty?
|
46
51
|
signature = params.nodes.map(&:node).map(&:value)
|
47
52
|
|
48
53
|
context["Function"].new(signature, lambda { |call_context|
|
data/lib/halunke/version.rb
CHANGED