sequitur 0.1.19 → 0.1.20
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/.rubocop.yml +3 -0
- data/.travis.yml +8 -7
- data/CHANGELOG.md +7 -0
- data/LICENSE.txt +1 -1
- data/README.md +0 -1
- data/appveyor.yml +7 -5
- data/lib/sequitur/constants.rb +1 -1
- data/lib/sequitur/dynamic_grammar.rb +1 -1
- data/lib/sequitur/formatter/base_formatter.rb +1 -1
- data/lib/sequitur/formatter/debug.rb +1 -1
- data/lib/sequitur/grammar_visitor.rb +1 -0
- data/lib/sequitur/production.rb +2 -0
- data/lib/sequitur/production_ref.rb +2 -2
- data/lib/sequitur/sequitur_grammar.rb +1 -0
- data/lib/sequitur/symbol_sequence.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8193a64b5b2c9a7d8b73f86db45f4209f9fa2f0a
|
4
|
+
data.tar.gz: 30286f7b8424bfd1e6b4479a25d5d68b38cd1228
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63cc43d00ceb0f58ab8865e747182b59fd2b6d579de9381e54a195f945817977dccefe2fb428182b9c17fa88afeabf765cb008eeb5fdce3aeaccb8e07cdfdc29
|
7
|
+
data.tar.gz: 5123a46113267d7e88a5f05cb813d65ee6a31ed0300440ef65281e703129f99cb2d5e65e88ecc434843d319bbf3a11a9ff469b14fddf39d95138c067082694ab
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
-
|
4
|
-
-
|
5
|
-
- 2.5
|
6
|
-
- 2.
|
7
|
-
- 2.3.7
|
3
|
+
- 2.6.0
|
4
|
+
- 2.5.3
|
5
|
+
- 2.4.5
|
6
|
+
- 2.3.8
|
8
7
|
- 2.2.10
|
9
8
|
- 2.1.10
|
10
|
-
- 2.0.0
|
11
|
-
-
|
9
|
+
- 2.0.0-p648
|
10
|
+
- ruby-head
|
11
|
+
- jruby-9.1.9.0
|
12
|
+
- jruby-head
|
12
13
|
|
13
14
|
matrix:
|
14
15
|
allow_failures:
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
### 0.1.20 / 2019-01-03
|
2
|
+
Maintenance release.
|
3
|
+
* [CHANGE] File `.travis.yml`: updated Ruby versions.
|
4
|
+
* [CHANGE] File `appveyor.yml` updated Ruby versions.
|
5
|
+
* [CHANGE] File 'Gemfile' Code re-styling to please Rubocop 0.62.0.
|
6
|
+
* [CHANGE] File `LICENSE.txt` Updated copyright years.
|
7
|
+
|
1
8
|
### 0.1.19 / 2018-05-16
|
2
9
|
Maintenance release.
|
3
10
|
* [CHANGE] File `.travis.yml`: updated Ruby versions.
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -7,7 +7,6 @@ _Ruby gem implementing the Sequitur algorithm_
|
|
7
7
|
[](https://ci.appveyor.com/project/famished-tiger/sequitur)
|
8
8
|
[](https://coveralls.io/r/famished-tiger/Sequitur)
|
9
9
|
[](http://badge.fury.io/rb/sequitur)
|
10
|
-
[](https://gemnasium.com/famished-tiger/Sequitur)
|
11
10
|
[](http://inch-ci.org/github/famished-tiger/Sequitur)
|
12
11
|
[](https://codeclimate.com/github/famished-tiger/Sequitur)
|
13
12
|
[](https://github.com/famished-tiger/Sequitur/blob/master/LICENSE.txt)
|
data/appveyor.yml
CHANGED
@@ -2,16 +2,18 @@ version: '{build}'
|
|
2
2
|
max_jobs: 3
|
3
3
|
environment:
|
4
4
|
matrix:
|
5
|
-
- Ruby_version:
|
5
|
+
- Ruby_version: 25-x64
|
6
6
|
- Ruby_version: 24-x64
|
7
|
-
- Ruby_version: 23
|
8
7
|
- Ruby_version: 23-x64
|
9
|
-
- Ruby_version: 22
|
10
8
|
- Ruby_version: 22-x64
|
11
|
-
- Ruby_version: 21
|
12
9
|
- Ruby_version: 21-x64
|
13
|
-
- Ruby_version: 200
|
14
10
|
- Ruby_version: 200-x64
|
11
|
+
- Ruby_version: 25
|
12
|
+
- Ruby_version: 24
|
13
|
+
- Ruby_version: 23
|
14
|
+
- Ruby_version: 22
|
15
|
+
- Ruby_version: 21
|
16
|
+
- Ruby_version: 200
|
15
17
|
|
16
18
|
install:
|
17
19
|
- set PATH=C:\Ruby%Ruby_version%\bin;%PATH%
|
data/lib/sequitur/constants.rb
CHANGED
@@ -18,7 +18,7 @@ module Sequitur # Module for classes implementing the Sequitur algorithm
|
|
18
18
|
attr_reader(:productions)
|
19
19
|
|
20
20
|
# nodoc Trace the execution of the algorithm.
|
21
|
-
|
21
|
+
attr_accessor(:trace)
|
22
22
|
|
23
23
|
# Constructor.
|
24
24
|
# Build a grammar with one empty rule as start/start rule.
|
@@ -4,7 +4,7 @@ module Sequitur
|
|
4
4
|
# Superclass for grammar formatters.
|
5
5
|
class BaseFormatter
|
6
6
|
# The IO output stream in which the formatter's result will be sent.
|
7
|
-
|
7
|
+
attr_accessor(:output)
|
8
8
|
|
9
9
|
# Constructor.
|
10
10
|
# @param anIO [IO] an output IO where the formatter's result will
|
@@ -13,7 +13,7 @@ module Sequitur
|
|
13
13
|
# formatter.run(some_grammar.visitor)
|
14
14
|
class Debug < BaseFormatter
|
15
15
|
# Current indentation level
|
16
|
-
|
16
|
+
attr_accessor(:indentation)
|
17
17
|
|
18
18
|
# Constructor.
|
19
19
|
# @param anIO [IO] The output stream to which the rendered grammar
|
data/lib/sequitur/production.rb
CHANGED
@@ -58,6 +58,7 @@ class Production
|
|
58
58
|
# Decrement the reference count by one.
|
59
59
|
def decr_refcount
|
60
60
|
raise StandardError, 'Internal error' if @refcount.zero?
|
61
|
+
|
61
62
|
@refcount -= 1
|
62
63
|
end
|
63
64
|
|
@@ -164,6 +165,7 @@ class Production
|
|
164
165
|
indices = [-2] # Dummy index!
|
165
166
|
(0...rhs.size).each do |i|
|
166
167
|
next if i == indices.last + 1
|
168
|
+
|
167
169
|
indices << i if (rhs[i] == symb1) && (rhs[i + 1] == symb2)
|
168
170
|
end
|
169
171
|
|
@@ -1,5 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
1
|
module Sequitur # Module for classes implementing the Sequitur algorithm
|
4
2
|
# A production reference is a grammar symbol that may appear in the right-hand
|
5
3
|
# side of a production P1 and that refers to a production P2.
|
@@ -73,6 +71,7 @@ module Sequitur # Module for classes implementing the Sequitur algorithm
|
|
73
71
|
# @return [Fixnum] the hash value
|
74
72
|
def hash
|
75
73
|
raise StandardError, 'Nil production' if production.nil?
|
74
|
+
|
76
75
|
return production.hash
|
77
76
|
end
|
78
77
|
|
@@ -86,6 +85,7 @@ module Sequitur # Module for classes implementing the Sequitur algorithm
|
|
86
85
|
unless aProduction.kind_of?(Production)
|
87
86
|
raise StandardError, "Illegal production type #{aProduction.class}"
|
88
87
|
end
|
88
|
+
|
89
89
|
@production = aProduction
|
90
90
|
production.incr_refcount
|
91
91
|
end
|
@@ -88,6 +88,7 @@ module Sequitur # Module for classes implementing the Sequitur algorithm
|
|
88
88
|
# @return [Array of ProductionRef]
|
89
89
|
def references_of(aProduction)
|
90
90
|
return [] if references.empty?
|
91
|
+
|
91
92
|
result = references.select { |a_ref| a_ref == aProduction }
|
92
93
|
return result
|
93
94
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequitur
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dimitri Geshef
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coveralls
|