alphalang 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nodes/basenodes.rb +6 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9032649193942a6dda8f421a2e4cde4c106bf954516a4d980ddd82c8ff0adf6b
4
- data.tar.gz: 2db114a711be0899a041fe0b0a435f2790eb32e53c475be63820ec0dcd29c16a
3
+ metadata.gz: ab47be57b758b60ecfd23d623f079f39cad75aff9e55d44abbcb848bf981892f
4
+ data.tar.gz: 722308d6394542dc4afc4cf6ea88b6403e0ed7db5a3ccf39e891b14eb6505526
5
5
  SHA512:
6
- metadata.gz: 497b7ab960ef819497acf99eaedc1c3df627aa503b6265fda402f718dd86fb610ccf9a759cc437f6b6b66e7183ebdbc688e9ba967511cb097ce2aa8d3afcfba0
7
- data.tar.gz: c1ad4fc015e1226ad53e8ec1a3fbda5f17a39e245e552d88aac4f128552143c658bdc34b63f7331a7cc42f9de28d27f458d16df7185e35510d9499e612ac20d2
6
+ metadata.gz: 8cfd7fabcd48b1b5b50e12c9f24c42e6e25bd464a36d47954af1c9401de63b5832cb3ca063b6dde1bd3fe575ae761c8da9507b6eb185ef1ae3a1e593436b8add
7
+ data.tar.gz: d4b0aa62aac244dad17fe2898fc4e21a1dbc0fa54a0bb51e980a80d15f2491dd42fdf6e6ed17574e4761a4e1e7b5a491565048610acfa4a43f1dffc73fd81055
@@ -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
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.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - mattias, victor