alphalang 0.2.1 → 0.2.3

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
  SHA256:
3
- metadata.gz: 9032649193942a6dda8f421a2e4cde4c106bf954516a4d980ddd82c8ff0adf6b
4
- data.tar.gz: 2db114a711be0899a041fe0b0a435f2790eb32e53c475be63820ec0dcd29c16a
3
+ metadata.gz: c46055bf730f2a26ce876fcc685a711359a5e80710da1e86e7eac6e7554af007
4
+ data.tar.gz: d2751a739b78101ce213c6b29db88fbcc57a0c33dad4282f5bf1d5e385ba7461
5
5
  SHA512:
6
- metadata.gz: 497b7ab960ef819497acf99eaedc1c3df627aa503b6265fda402f718dd86fb610ccf9a759cc437f6b6b66e7183ebdbc688e9ba967511cb097ce2aa8d3afcfba0
7
- data.tar.gz: c1ad4fc015e1226ad53e8ec1a3fbda5f17a39e245e552d88aac4f128552143c658bdc34b63f7331a7cc42f9de28d27f458d16df7185e35510d9499e612ac20d2
6
+ metadata.gz: c873cf09f9c0831cbfd15a9f7cdc01a29e2bbe035cf9b04033ea5b6c14be54a7b95d34ed278658892ce9c56e6b1ab81ed998e220ca8a21898c08efe8c4feb2e2
7
+ data.tar.gz: a34c736242f1b4ab7a5f42d1a3173ada74add81c83e1d6da106c91ccef75f457b2bb73e18bca3f81264c1f0a6ab1b3d09c8edd737ecb4d443623858ef4502674
@@ -131,6 +131,12 @@ class BinaryOperationNode < Node
131
131
  end
132
132
 
133
133
  def evaluate
134
+ if @rhs.evaluate.is_a?(ArrayNode) && @op == '+'
135
+ return @value = @rhs.evaluate + @lhs.evaluate
136
+ elsif @lhs.evaluate.is_a?(Array) && @op == '+'
137
+ return @value = @lhs.evaluate.append(@rhs.evaluate)
138
+ end
139
+
134
140
  if @op == '/'
135
141
  @value = @lhs.evaluate.to_f.send(@op, @rhs.evaluate)
136
142
  else
@@ -188,8 +188,10 @@ class PrintNode
188
188
 
189
189
  def evaluate
190
190
  if @value.evaluate.is_a?(ArrayNode)
191
+ print "Array #{@value.name}: "
191
192
  @value.evaluate.display_on_one_line
192
193
  elsif @value.evaluate.is_a?(Array)
194
+ print "Array #{@value.name}: "
193
195
  puts @value.evaluate.join(', ')
194
196
  else
195
197
  puts @value.evaluate
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alphalang
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - mattias, victor