parser 2.6.2.0 → 2.6.2.1
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/.travis.yml +2 -2
- data/CHANGELOG.md +8 -1
- data/lib/parser/base.rb +4 -1
- data/lib/parser/current.rb +4 -4
- data/lib/parser/lexer.rl +2 -1
- data/lib/parser/meta.rb +3 -0
- data/lib/parser/version.rb +1 -1
- data/test/helper.rb +7 -0
- 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: '079e9a23e1c61dbd3964edff00120c9d9df0993aee3b1a0070a64c1b717a1450'
|
4
|
+
data.tar.gz: f42199a0777690e615515ca481ee2bf56aa3c5090d9702e65ae19c1db8fb499a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca3de4d39f2c9e67366c22c9a2c5640efcbbee28cb3b0ed030425de55806dd03580d9111195eb9e66f65189638ee5935adb94441a4018e2e0901c66d450e18a7
|
7
|
+
data.tar.gz: c29b708ab12eef3c14f2f472b152e1adf090481a3127a10c9bdb4a24cb34849e4f00bbdf14f97e71916157dce66c6d74faa9658603a95db82e246c92d68bf15b
|
data/.travis.yml
CHANGED
@@ -11,8 +11,8 @@ matrix:
|
|
11
11
|
- name: 2.3.8 / Parser tests
|
12
12
|
rvm: 2.3.8
|
13
13
|
script: bundle exec rake test_cov
|
14
|
-
- name: 2.4.
|
15
|
-
rvm: 2.4.
|
14
|
+
- name: 2.4.6 / Parser tests
|
15
|
+
rvm: 2.4.6
|
16
16
|
script: bundle exec rake test_cov
|
17
17
|
- name: 2.5.5 / Parser tests
|
18
18
|
rvm: 2.5.5
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,16 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
3
|
|
4
|
-
Not released (2019-
|
4
|
+
Not released (2019-04-05)
|
5
5
|
-------------------------
|
6
6
|
|
7
|
+
API modifications:
|
8
|
+
* Bump 2.4 branch to 2.4.6. (#569) (Ilya Bylich)
|
9
|
+
* Lexer should know about current parsing context. (#566) (Ilya Bylich)
|
10
|
+
|
11
|
+
v2.6.2.0 (2019-03-21)
|
12
|
+
---------------------
|
13
|
+
|
7
14
|
API modifications:
|
8
15
|
* Bump ruby versions to 2.5.5 and 2.6.2. (#563) (Ilya Bylich)
|
9
16
|
* Bump Ruby version to 2.6.1. (#554) (Ilya Bylich)
|
data/lib/parser/base.rb
CHANGED
@@ -123,13 +123,16 @@ module Parser
|
|
123
123
|
|
124
124
|
@static_env = StaticEnvironment.new
|
125
125
|
|
126
|
+
# Stack that holds current parsing context
|
127
|
+
@context = Context.new
|
128
|
+
|
126
129
|
@lexer = Lexer.new(version)
|
127
130
|
@lexer.diagnostics = @diagnostics
|
128
131
|
@lexer.static_env = @static_env
|
132
|
+
@lexer.context = @context
|
129
133
|
|
130
134
|
@builder = builder
|
131
135
|
@builder.parser = self
|
132
|
-
@context = Context.new
|
133
136
|
|
134
137
|
# Last emitted token
|
135
138
|
@last_token = nil
|
data/lib/parser/current.rb
CHANGED
@@ -48,7 +48,7 @@ module Parser
|
|
48
48
|
CurrentRuby = Ruby23
|
49
49
|
|
50
50
|
when /^2\.4\./
|
51
|
-
current_version = '2.4.
|
51
|
+
current_version = '2.4.6'
|
52
52
|
if RUBY_VERSION != current_version
|
53
53
|
warn_syntax_deviation 'parser/ruby24', current_version
|
54
54
|
end
|
@@ -85,8 +85,8 @@ module Parser
|
|
85
85
|
|
86
86
|
else # :nocov:
|
87
87
|
# Keep this in sync with released Ruby.
|
88
|
-
warn_syntax_deviation 'parser/
|
89
|
-
require 'parser/
|
90
|
-
CurrentRuby =
|
88
|
+
warn_syntax_deviation 'parser/ruby26', '2.6.x'
|
89
|
+
require 'parser/ruby26'
|
90
|
+
CurrentRuby = Ruby26
|
91
91
|
end
|
92
92
|
end
|
data/lib/parser/lexer.rl
CHANGED
@@ -95,13 +95,14 @@ class Parser::Lexer
|
|
95
95
|
attr_accessor :static_env
|
96
96
|
attr_accessor :force_utf32
|
97
97
|
|
98
|
-
attr_accessor :cond, :cmdarg, :in_kwarg
|
98
|
+
attr_accessor :cond, :cmdarg, :in_kwarg, :context
|
99
99
|
|
100
100
|
attr_accessor :tokens, :comments
|
101
101
|
|
102
102
|
def initialize(version)
|
103
103
|
@version = version
|
104
104
|
@static_env = nil
|
105
|
+
@context = nil
|
105
106
|
|
106
107
|
@tokens = nil
|
107
108
|
@comments = nil
|
data/lib/parser/meta.rb
CHANGED
@@ -23,6 +23,9 @@ module Parser
|
|
23
23
|
until_post for break next redo return resbody
|
24
24
|
kwbegin begin retry preexe postexe iflipflop eflipflop
|
25
25
|
shadowarg complex rational __FILE__ __LINE__ __ENCODING__
|
26
|
+
ident root lambda indexasgn index procarg0
|
27
|
+
meth_ref restarg_expr blockarg_expr
|
28
|
+
objc_kwarg objc_restarg objc_varargs
|
26
29
|
).map(&:to_sym).to_set.freeze
|
27
30
|
|
28
31
|
end # Meta
|
data/lib/parser/version.rb
CHANGED
data/test/helper.rb
CHANGED
@@ -50,3 +50,10 @@ require 'minitest/autorun'
|
|
50
50
|
|
51
51
|
$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
|
52
52
|
require 'parser'
|
53
|
+
|
54
|
+
class Parser::AST::Node
|
55
|
+
def initialize(type, *)
|
56
|
+
raise "Type #{type} missing from Parser::Meta::NODE_TYPES" unless Parser::Meta::NODE_TYPES.include?(type)
|
57
|
+
super
|
58
|
+
end
|
59
|
+
end
|
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: 2.6.2.
|
4
|
+
version: 2.6.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- whitequark
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ast
|