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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c5c6dfc81b67a8d8d53a1e33717bd32d187697aa
4
- data.tar.gz: 92e35b2c2bdaa0978066d7606e8d0306aae9f648
3
+ metadata.gz: 8193a64b5b2c9a7d8b73f86db45f4209f9fa2f0a
4
+ data.tar.gz: 30286f7b8424bfd1e6b4479a25d5d68b38cd1228
5
5
  SHA512:
6
- metadata.gz: 4d5c93785c161cddeafc8dcf580ad16653558664b0c7f78c2c24a9e441db2ca27341059cf78b8e32c64659eafb3dac41d47af27e8253de138500e7422ab571c8
7
- data.tar.gz: 8c7d05b82b0e8a6a5d71138cfdadda049f5284c7ea1da04d033040acb6bb90c931808fa9dcfbaf1ae2df6ceee534eb65ff388f8031300f1efe7f1cd7ea61c2f0
6
+ metadata.gz: 63cc43d00ceb0f58ab8865e747182b59fd2b6d579de9381e54a195f945817977dccefe2fb428182b9c17fa88afeabf765cb008eeb5fdce3aeaccb8e07cdfdc29
7
+ data.tar.gz: 5123a46113267d7e88a5f05cb813d65ee6a31ed0300440ef65281e703129f99cb2d5e65e88ecc434843d319bbf3a11a9ff469b14fddf39d95138c067082694ab
@@ -5,6 +5,9 @@ AllCops:
5
5
 
6
6
  Layout/CaseIndentation:
7
7
  Enabled: false
8
+
9
+ Layout/ClosingHeredocIndentation:
10
+ Enabled: false
8
11
 
9
12
  Layout/CommentIndentation:
10
13
  Enabled: false
@@ -1,14 +1,15 @@
1
1
  language: ruby
2
2
  rvm:
3
- - ruby-head
4
- - jruby-head
5
- - 2.5.1
6
- - 2.4.4
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
- - jruby
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:
@@ -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.
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2018 Dimitri Geshef
1
+ Copyright (c) 2014-2019 Dimitri Geshef
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -7,7 +7,6 @@ _Ruby gem implementing the Sequitur algorithm_
7
7
  [![Windows Build status](https://ci.appveyor.com/api/projects/status/nvi1be8mb0494dqw?svg=true)](https://ci.appveyor.com/project/famished-tiger/sequitur)
8
8
  [![Coverage Status](https://coveralls.io/repos/famished-tiger/Sequitur/badge.png?branch=master)](https://coveralls.io/r/famished-tiger/Sequitur)
9
9
  [![Gem Version](https://badge.fury.io/rb/sequitur.svg)](http://badge.fury.io/rb/sequitur)
10
- [![Dependency Status](https://gemnasium.com/famished-tiger/Sequitur.png)](https://gemnasium.com/famished-tiger/Sequitur)
11
10
  [![Inline docs](http://inch-ci.org/github/famished-tiger/Sequitur.svg?branch=master)](http://inch-ci.org/github/famished-tiger/Sequitur)
12
11
  [![Code Climate](https://codeclimate.com/github/famished-tiger/Sequitur.png)](https://codeclimate.com/github/famished-tiger/Sequitur)
13
12
  [![License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://github.com/famished-tiger/Sequitur/blob/master/LICENSE.txt)
@@ -2,16 +2,18 @@ version: '{build}'
2
2
  max_jobs: 3
3
3
  environment:
4
4
  matrix:
5
- - Ruby_version: 24
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%
@@ -3,7 +3,7 @@
3
3
 
4
4
  module Sequitur # Module used as a namespace
5
5
  # The version number of the gem.
6
- Version = '0.1.19'.freeze
6
+ Version = '0.1.20'.freeze
7
7
 
8
8
  # Brief description of the gem.
9
9
  Description = 'Ruby implementation of the Sequitur algorithm'.freeze
@@ -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
- attr(:trace)
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
- attr(:output)
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
- attr(:indentation)
16
+ attr_accessor(:indentation)
17
17
 
18
18
  # Constructor.
19
19
  # @param anIO [IO] The output stream to which the rendered grammar
@@ -93,6 +93,7 @@ module Sequitur # Module for classes implementing the Sequitur algorithm
93
93
  def broadcast(msg, *args)
94
94
  subscribers.each do |a_subscriber|
95
95
  next unless a_subscriber.respond_to?(msg)
96
+
96
97
  a_subscriber.send(msg, *args)
97
98
  end
98
99
  end
@@ -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
@@ -131,6 +131,7 @@ class SequiturGrammar < DynamicGrammar
131
131
 
132
132
  refs = a_prod.references_of(useless_prod)
133
133
  next if refs.empty?
134
+
134
135
  referencing = a_prod
135
136
  break
136
137
  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.19
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: 2018-05-16 00:00:00.000000000 Z
11
+ date: 2019-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coveralls