srl_ruby 0.4.3 → 0.4.4

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: 996f3e835881b14fb61b339d58be1739333461a0
4
- data.tar.gz: f3d79e1fa587c578a5456e2434e7075a621320b5
3
+ metadata.gz: 3fb6ab4f66212ea614cfbfab2f7b17049425844e
4
+ data.tar.gz: 634718cf4229710eed018512b44f29781acebc4a
5
5
  SHA512:
6
- metadata.gz: 2833ec0d9d7449ce112f225daf31c224bf9cc7ab99d442d91e92052d71c397cda0732e543af2f622a2a117d823260459a4ac41c94953a2d55e73c8cebba1b3ee
7
- data.tar.gz: e439c0cba8d16d8d61f3c5299976894a31088af189bd6501bc397da8adf1f9f6de4e14c4d3b7375c6200c78dc67843f1090ac319e348d3733b8a57ceeec2f33b
6
+ metadata.gz: 51ef6aead6683f95d965f2b9882f929af3d1b4f73cc8948982161d8f05843e196b39e21868c2620bab825f88697174b4b82378fc548e5f0f21b920717685378a
7
+ data.tar.gz: bb3c755844c7ad3e655d423de9956c3ccafde8c9efc2df5841b995546f0cf83b7b3880afa8ded4cd888944eaae53d7c889e96e7e09b743ece728aa7041734727
data/CHANGELOG.md CHANGED
@@ -1,4 +1,16 @@
1
- ## [0.4.2] - 2018-06-24
1
+ ## [0.4.4] - 2018-11-24
2
+ ### Changed
3
+ - File `srl_ruby.gemspec` Updated Rley dependency.
4
+
5
+ ### Removed
6
+ - Class `SrlRuby::SrlToken` since it became completely redundant with `Token` class from Rley.
7
+ - Class `Acceptance::RuleFileToken` since it became completely redundant with `Token` class from Rley.
8
+
9
+ ### Fixed
10
+ - Method `SrlRuby::Tokenizer#build_token` now instantiates a `Rley::Lexical::Token`
11
+ - Method `Acceptance::RuleFileTokenizer#build_token` now instantiates a `Rley::Lexical::Token`
12
+
13
+ ## [0.4.3] - 2018-06-24
2
14
  ### Changed
3
15
  - File `srl_ruby.gemspec` Updated Rley dependency.
4
16
 
@@ -1,7 +1,7 @@
1
1
  # File: srl_tokenizer.rb
2
2
  # Tokenizer for SRL (Simple Regex Language)
3
3
  require 'strscan'
4
- require_relative 'srl_token'
4
+ require 'rley'
5
5
 
6
6
 
7
7
  module SrlRuby
@@ -149,8 +149,8 @@ module SrlRuby
149
149
  def build_token(aSymbolName, aLexeme)
150
150
  begin
151
151
  col = scanner.pos - aLexeme.size - @line_start + 1
152
- pos = Position.new(@lineno, col)
153
- token = SrlToken.new(aLexeme, aSymbolName, pos)
152
+ pos = Rley::Lexical::Position.new(@lineno, col)
153
+ token = Rley::Lexical::Token.new(aLexeme, aSymbolName, pos)
154
154
  rescue StandardError => exc
155
155
  puts "Failing with '#{aSymbolName}' and '#{aLexeme}'"
156
156
  raise exc
@@ -1,3 +1,3 @@
1
1
  module SrlRuby
2
- VERSION = '0.4.3'.freeze
2
+ VERSION = '0.4.4'.freeze
3
3
  end
@@ -3,7 +3,7 @@
3
3
  # [File format](https://github.com/SimpleRegex/Test-Rules/blob/master/README.md)
4
4
  require 'strscan'
5
5
  require 'pp'
6
- require_relative 'rule_file_token'
6
+ require 'rley'
7
7
 
8
8
  module Acceptance
9
9
  # The tokenizer should recognize:
@@ -74,7 +74,6 @@ module Acceptance
74
74
  curr_ch = scanner.peek(1)
75
75
  token = nil
76
76
 
77
-
78
77
  if '-:'.include? curr_ch
79
78
  # Delimiters, separators => single character token
80
79
  token = build_token(@@lexeme2name[curr_ch], scanner.getch)
@@ -110,8 +109,8 @@ module Acceptance
110
109
  def build_token(aSymbolName, aLexeme)
111
110
  begin
112
111
  col = scanner.pos - aLexeme.size - @line_start + 1
113
- pos = Position.new(@lineno, col)
114
- token = RuleFileToken.new(aLexeme, aSymbolName, pos)
112
+ pos = Rley::Lexical::Position.new(@lineno, col)
113
+ token = Rley::Lexical::Token.new(aLexeme, aSymbolName, pos)
115
114
  rescue StandardError => exc
116
115
  puts "Failing with '#{aSymbolName}' and '#{aLexeme}'"
117
116
  raise exc
@@ -14,7 +14,7 @@ module SrlRuby
14
14
  subject { Tokenizer.new('') }
15
15
 
16
16
  context 'Initialization:' do
17
- it 'should be initialized with a text to tokenize and a grammar' do
17
+ it 'should be initialized with a text to tokenize' do
18
18
  expect { Tokenizer.new('anything') }.not_to raise_error
19
19
  end
20
20
 
data/srl_ruby.gemspec CHANGED
@@ -66,7 +66,7 @@ SUMMARY
66
66
  spec.required_ruby_version = '>= 2.1.0'
67
67
 
68
68
  # Runtime dependencies
69
- spec.add_dependency 'rley', '~> 0.6'
69
+ spec.add_dependency 'rley', '~> 0.7'
70
70
 
71
71
  # Development dependencies
72
72
  spec.add_development_dependency 'bundler', '~> 1.16'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: srl_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
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-06-24 00:00:00.000000000 Z
11
+ date: 2018-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rley
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.6'
19
+ version: '0.7'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.6'
26
+ version: '0.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -146,7 +146,6 @@ files:
146
146
  - lib/srl_ruby/ast_builder.rb
147
147
  - lib/srl_ruby/grammar.rb
148
148
  - lib/srl_ruby/regex_repr.rb
149
- - lib/srl_ruby/srl_token.rb
150
149
  - lib/srl_ruby/tokenizer.rb
151
150
  - lib/srl_ruby/version.rb
152
151
  - spec/acceptance/srl_test_suite_spec.rb
@@ -154,7 +153,6 @@ files:
154
153
  - spec/acceptance/support/rule_file_grammar.rb
155
154
  - spec/acceptance/support/rule_file_nodes.rb
156
155
  - spec/acceptance/support/rule_file_parser.rb
157
- - spec/acceptance/support/rule_file_token.rb
158
156
  - spec/acceptance/support/rule_file_tokenizer.rb
159
157
  - spec/regex/atomic_expression_spec.rb
160
158
  - spec/regex/character_spec.rb
@@ -1,23 +0,0 @@
1
- require 'rley' # Load the Rley gem
2
-
3
-
4
- module SrlRuby
5
- Position = Struct.new(:line, :column) do
6
- def to_s
7
- "line #{line}, column #{column}"
8
- end
9
- end
10
-
11
- # Specialization of Token class.
12
- # It stores the position in (line, row) of the token
13
- class SrlToken < Rley::Lexical::Token
14
- attr_reader(:position)
15
-
16
- def initialize(theLexeme, aTerminal, aPosition)
17
- super(theLexeme, aTerminal)
18
- @position = aPosition
19
- end
20
- end # class
21
- end # module
22
-
23
- # End of file
@@ -1,22 +0,0 @@
1
- require 'rley' # Load the Rley gem
2
-
3
- module Acceptance
4
- Position = Struct.new(:line, :column) do
5
- def to_s
6
- "line #{line}, column #{column}"
7
- end
8
- end
9
-
10
- # Specialization of Token class.
11
- # It stores the position in (line, row) of the token
12
- class RuleFileToken < Rley::Lexical::Token
13
- attr_reader(:position)
14
-
15
- def initialize(theLexeme, aTerminal, aPosition)
16
- super(theLexeme, aTerminal)
17
- @position = aPosition
18
- end
19
- end # class
20
- end # module
21
-
22
- # End of file