keisan 0.8.9 → 0.8.10

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: '0817ad5c7f153f93b34fd0c3861a1b4d9afcb49ad325310f2258f6ea020e444d'
4
- data.tar.gz: 2d1601371bf02fdacdcbd6f29cf72ce9ec15d46a402579dc89418825fde97a5c
3
+ metadata.gz: 9f97e020e01a4789ca6f181ac1cd2556d4338297d0d59ed89e4c6e29cf90fe27
4
+ data.tar.gz: 3b06e9483c5f7ac0f38b32ce925a27b06c0de2e8df8cbe5b45b5262c341bdf80
5
5
  SHA512:
6
- metadata.gz: 4faa11222178814693fb58d9db1ddafa7097e49a15e5c59aa8132c26a56e8fc8f69487057ad11e2a37d6dd84d1bb7afa9af4b536ed898d9cd082f357e226098d
7
- data.tar.gz: ba57a649fbaf1fec6dc29495f86921141c627ea1e652cccd884f30edf4f9e70096803f1ed36acab4b010930abb75dc01cb09cdd5f399c2bec0b03c6c27d1d449
6
+ metadata.gz: d2814acec39cba71faa5c9e3ce924ff17361b826fd092c01a82a54097992be7d28238ee127ada33f5577496ce573cd3da9947c65a6a09956ece8f66a524dd58a
7
+ data.tar.gz: a64666d0b022ca0352054b2a8c2c9d1e7cd0b01b4a569e52f28d86fd034103360a854d7eef60da0d0f8452c959b6859a051446762059457f6bf155b2ac6868f5
@@ -30,7 +30,11 @@ module Keisan
30
30
  private
31
31
 
32
32
  def lhs_evaluate_and_check_modifiable
33
- lhs.evaluate(context)
33
+ res = lhs.evaluate(context)
34
+ if res.frozen?
35
+ raise Exceptions::UnmodifiableError.new("Cannot modify frozen variables")
36
+ end
37
+ res
34
38
  rescue RuntimeError => e
35
39
  raise Exceptions::UnmodifiableError.new("Cannot modify frozen variables") if e.message =~ /can't modify frozen/
36
40
  raise
@@ -34,6 +34,7 @@ module Keisan
34
34
  end
35
35
 
36
36
  def evaluate(context = nil)
37
+ return self if frozen?
37
38
  context ||= Context.new
38
39
 
39
40
  @hash = ::Hash[
@@ -6,6 +6,7 @@ module Keisan
6
6
  end
7
7
 
8
8
  def evaluate(context = nil)
9
+ return self if frozen?
9
10
  context ||= Context.new
10
11
  @children = children.map {|child| child.is_a?(Cell) ? child : child.evaluate(context)}
11
12
  self
@@ -1,3 +1,3 @@
1
1
  module Keisan
2
- VERSION = "0.8.9"
2
+ VERSION = "0.8.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keisan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.9
4
+ version: 0.8.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Locke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-17 00:00:00.000000000 Z
11
+ date: 2021-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cmath