mini_kraken 0.1.12 → 0.1.13
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/mini_kraken/core/variable.rb +10 -4
- data/lib/mini_kraken/core/vocabulary.rb +2 -1
- data/lib/mini_kraken/version.rb +1 -1
- data/spec/glue/run_star_expression_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79ea33dd475e6dfbed71915177b1581abb5e1ca9a60db04133d11cda7dca9d42
|
4
|
+
data.tar.gz: 249bea4319183c929e4c291785c6b74e10606889c789c5e0f2b211197cc6f288
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '086bf0b30750e908dfee1b7e95eb3b0c0e54dff4f7bd700d54bbf28091aaf02080d458c14508ddcaa580248e0234d1da23553869480e3bea930d46708c115d82'
|
7
|
+
data.tar.gz: d3ada8d056819b2ae1af0d442056008600f82633ee52ca8aa672708943fdf517adb60522bfff6673f9cea86985c1bf5ce2a7a3ea73f07504945e660f31ebee49
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## [0.1.13] - 2020-07-01
|
2
|
+
- Cover all frames from Chapter One of "Reasoned Scheme" book.
|
3
|
+
- Fix defect for fused variables that remain fresh
|
4
|
+
|
5
|
+
### CHANGED
|
6
|
+
- Method `Variable#quote` now takes into account of cases when variables are fused.
|
7
|
+
- Method `Vocabulary#names_fused` now copes with cases where no variable with given name can be found.
|
8
|
+
|
1
9
|
## [0.1.12] - 2020-06-29
|
2
10
|
- Supports `conde`, that is, a relation that can take an arbitrary number of arguments.
|
3
11
|
- Cover all frames but one from Chapter One of "Reasoned Scheme" book.
|
@@ -24,11 +24,17 @@ module MiniKraken
|
|
24
24
|
name != i_name
|
25
25
|
end
|
26
26
|
|
27
|
-
def quote(
|
28
|
-
raise StandardError, "class #{
|
27
|
+
def quote(env)
|
28
|
+
raise StandardError, "class #{env}" unless env.kind_of?(Vocabulary)
|
29
29
|
|
30
|
-
val =
|
31
|
-
|
30
|
+
val = env.quote_ref(self)
|
31
|
+
unless val
|
32
|
+
result = AnyValue.new(name, env, env.names_fused(name))
|
33
|
+
else
|
34
|
+
result = val
|
35
|
+
end
|
36
|
+
|
37
|
+
result
|
32
38
|
end
|
33
39
|
end # class
|
34
40
|
end # module
|
@@ -331,8 +331,9 @@ module MiniKraken
|
|
331
331
|
# variable name.
|
332
332
|
# @param aName [String] User-defined variable name
|
333
333
|
def names_fused(aName)
|
334
|
+
# require 'debug'
|
334
335
|
var = name2var(aName)
|
335
|
-
return [] unless var
|
336
|
+
return [] unless var&.fused?
|
336
337
|
|
337
338
|
i_name = var.i_name
|
338
339
|
names = []
|
data/lib/mini_kraken/version.rb
CHANGED
@@ -126,6 +126,7 @@ module MiniKraken
|
|
126
126
|
|
127
127
|
it 'should return a null list with the succeed goal' do
|
128
128
|
instance = RunStarExpression.new('q', succeeds)
|
129
|
+
expect(instance.env.vars).to be_include('q')
|
129
130
|
|
130
131
|
# (display (run* q succeed)) ;; => (_0)
|
131
132
|
# Reasoned S2, frame 1:16
|
@@ -968,8 +969,7 @@ module MiniKraken
|
|
968
969
|
# ((== x y)))) ;; => ((_0 _1)(_0 _0))
|
969
970
|
result = instance.run
|
970
971
|
expect(result.car).to eq(cons(any_value(0), cons(any_value(1))))
|
971
|
-
|
972
|
-
# expect(result.cdr.car).to eq(cons(any_value(0), cons(any_value(0))))
|
972
|
+
expect(result.cdr.car).to eq(cons(any_value(0), cons(any_value(0))))
|
973
973
|
end
|
974
974
|
|
975
975
|
it 'accepts conde with more than two condition lines' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_kraken
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dimitri Geshef
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|