kalc 0.5.2 → 0.5.3

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.
Files changed (3) hide show
  1. data/lib/kalc/ast.rb +7 -2
  2. data/lib/kalc/version.rb +1 -1
  3. metadata +2 -2
data/lib/kalc/ast.rb CHANGED
@@ -84,8 +84,13 @@ module Kalc
84
84
 
85
85
  def eval(context)
86
86
  @ops.inject(@left.eval(context)) { |x, op|
87
- a = Arithmetic.new(x, op[:right].eval(context), op[:operator])
88
- a.eval(context)
87
+ if op[:right].kind_of? Kalc::Ast::Ops
88
+ a = Arithmetic.new(x, op[:right].left.eval(context), op[:operator])
89
+ Ops.new(a, op[:right].ops).eval(context)
90
+ else
91
+ a = Arithmetic.new(x, op[:right].eval(context), op[:operator])
92
+ a.eval(context)
93
+ end
89
94
  }
90
95
  end
91
96
 
data/lib/kalc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kalc
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kalc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-18 00:00:00.000000000 Z
12
+ date: 2012-03-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake