parser 3.1.3.0 → 3.2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/parser/current.rb +5 -5
- data/lib/parser/lexer-F0.rb +17642 -0
- data/lib/parser/{lexer.rb → lexer-F1.rb} +2738 -6576
- data/lib/parser/ruby32.rb +1034 -1023
- data/lib/parser/source/buffer.rb +12 -3
- data/lib/parser/source/range.rb +1 -1
- data/lib/parser/version.rb +1 -1
- data/lib/parser.rb +5 -1
- data/parser.gemspec +1 -1
- metadata +9 -8
data/lib/parser/source/buffer.rb
CHANGED
@@ -191,11 +191,20 @@ module Parser
|
|
191
191
|
end
|
192
192
|
end
|
193
193
|
|
194
|
-
def slice(
|
194
|
+
def slice(start, length = nil)
|
195
|
+
if length.nil?
|
196
|
+
if start.is_a?(::Range)
|
197
|
+
length = start.size
|
198
|
+
start = start.begin
|
199
|
+
else
|
200
|
+
length = 1
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
195
204
|
if @slice_source.nil?
|
196
|
-
@source[
|
205
|
+
@source[start, length]
|
197
206
|
else
|
198
|
-
@slice_source[
|
207
|
+
@slice_source[start, length].encode(@source.encoding)
|
199
208
|
end
|
200
209
|
end
|
201
210
|
|
data/lib/parser/source/range.rb
CHANGED
data/lib/parser/version.rb
CHANGED
data/lib/parser.rb
CHANGED
@@ -64,7 +64,11 @@ module Parser
|
|
64
64
|
|
65
65
|
require 'parser/static_environment'
|
66
66
|
|
67
|
-
|
67
|
+
if RUBY_ENGINE == 'truffleruby'
|
68
|
+
require 'parser/lexer-F0'
|
69
|
+
else
|
70
|
+
require 'parser/lexer-F1'
|
71
|
+
end
|
68
72
|
require 'parser/lexer/literal'
|
69
73
|
require 'parser/lexer/stack_state'
|
70
74
|
require 'parser/lexer/dedenter'
|
data/parser.gemspec
CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
|
31
31
|
spec.add_development_dependency 'bundler', '>= 1.15', '< 3.0.0'
|
32
32
|
spec.add_development_dependency 'rake', '~> 13.0.1'
|
33
|
-
spec.add_development_dependency 'racc', '= 1.6.
|
33
|
+
spec.add_development_dependency 'racc', '= 1.6.1'
|
34
34
|
spec.add_development_dependency 'cliver', '~> 0.3.2'
|
35
35
|
|
36
36
|
spec.add_development_dependency 'yard'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- whitequark
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ast
|
@@ -64,14 +64,14 @@ dependencies:
|
|
64
64
|
requirements:
|
65
65
|
- - '='
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: 1.6.
|
67
|
+
version: 1.6.1
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - '='
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: 1.6.
|
74
|
+
version: 1.6.1
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: cliver
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -183,7 +183,8 @@ files:
|
|
183
183
|
- lib/parser/deprecation.rb
|
184
184
|
- lib/parser/diagnostic.rb
|
185
185
|
- lib/parser/diagnostic/engine.rb
|
186
|
-
- lib/parser/lexer.rb
|
186
|
+
- lib/parser/lexer-F0.rb
|
187
|
+
- lib/parser/lexer-F1.rb
|
187
188
|
- lib/parser/lexer/dedenter.rb
|
188
189
|
- lib/parser/lexer/explanation.rb
|
189
190
|
- lib/parser/lexer/literal.rb
|
@@ -246,9 +247,9 @@ licenses:
|
|
246
247
|
- MIT
|
247
248
|
metadata:
|
248
249
|
bug_tracker_uri: https://github.com/whitequark/parser/issues
|
249
|
-
changelog_uri: https://github.com/whitequark/parser/blob/v3.
|
250
|
-
documentation_uri: https://www.rubydoc.info/gems/parser/3.
|
251
|
-
source_code_uri: https://github.com/whitequark/parser/tree/v3.
|
250
|
+
changelog_uri: https://github.com/whitequark/parser/blob/v3.2.0.0/CHANGELOG.md
|
251
|
+
documentation_uri: https://www.rubydoc.info/gems/parser/3.2.0.0
|
252
|
+
source_code_uri: https://github.com/whitequark/parser/tree/v3.2.0.0
|
252
253
|
post_install_message:
|
253
254
|
rdoc_options: []
|
254
255
|
require_paths:
|