parser 3.0.3.2 → 3.1.2.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/all.rb +1 -0
- data/lib/parser/builders/default.rb +1 -1
- data/lib/parser/context.rb +19 -45
- data/lib/parser/current.rb +16 -7
- data/lib/parser/lexer/explanation.rb +1 -1
- data/lib/parser/lexer.rb +10655 -10668
- data/lib/parser/macruby.rb +2476 -2448
- data/lib/parser/max_numparam_stack.rb +5 -5
- data/lib/parser/ruby18.rb +2155 -2114
- data/lib/parser/ruby19.rb +2458 -2424
- data/lib/parser/ruby20.rb +2634 -2598
- data/lib/parser/ruby21.rb +2700 -2667
- data/lib/parser/ruby22.rb +2533 -2491
- data/lib/parser/ruby23.rb +2616 -2571
- data/lib/parser/ruby24.rb +2651 -2609
- data/lib/parser/ruby25.rb +2545 -2513
- data/lib/parser/ruby26.rb +2669 -2624
- data/lib/parser/ruby27.rb +3181 -3133
- data/lib/parser/ruby30.rb +3476 -3444
- data/lib/parser/ruby31.rb +3848 -3786
- data/lib/parser/ruby32.rb +8334 -0
- data/lib/parser/rubymotion.rb +2454 -2415
- data/lib/parser/runner.rb +6 -0
- data/lib/parser/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99a2cb2ef9fe58be50862176d8ee8b7fc1f3e616e16360b6777c7f0a366c37fb
|
4
|
+
data.tar.gz: ec7f0703c68564fdc55fc5a402ead6978da0bc3af9650dbc5d93127ce458b2d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3474317cdd46eb6085244fc57c91d7bcc7a157550fe834e5d58792d472861fa3420d381535554dfaba5fd30142c60040cbc59973694e241ee8aa5ba7a9655690
|
7
|
+
data.tar.gz: 3a7cbfec0dfe94ea448930357d2692806080c033f3ccc0d2af472d7abc18d2e3c72d1bd163852310f5e852f188bc4ed7f2336a178bcbdcb2a1f7b79d438dbcf7
|
data/lib/parser/all.rb
CHANGED
data/lib/parser/context.rb
CHANGED
@@ -16,60 +16,34 @@ module Parser
|
|
16
16
|
# + :lambda - in the lambda body (-> {})
|
17
17
|
#
|
18
18
|
class Context
|
19
|
-
|
19
|
+
FLAGS = %i[
|
20
|
+
in_defined
|
21
|
+
in_kwarg
|
22
|
+
in_argdef
|
23
|
+
in_def
|
24
|
+
in_class
|
25
|
+
in_block
|
26
|
+
in_lambda
|
27
|
+
]
|
20
28
|
|
21
29
|
def initialize
|
22
|
-
|
23
|
-
freeze
|
24
|
-
end
|
25
|
-
|
26
|
-
def push(state)
|
27
|
-
@stack << state
|
28
|
-
end
|
29
|
-
|
30
|
-
def pop
|
31
|
-
@stack.pop
|
30
|
+
reset
|
32
31
|
end
|
33
32
|
|
34
33
|
def reset
|
35
|
-
@
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
@
|
40
|
-
|
41
|
-
|
42
|
-
def in_class?
|
43
|
-
@stack.last == :class
|
44
|
-
end
|
45
|
-
|
46
|
-
def indirectly_in_def?
|
47
|
-
@stack.include?(:def) || @stack.include?(:defs)
|
34
|
+
@in_defined = false
|
35
|
+
@in_kwarg = false
|
36
|
+
@in_argdef = false
|
37
|
+
@in_def = false
|
38
|
+
@in_class = false
|
39
|
+
@in_block = false
|
40
|
+
@in_lambda = false
|
48
41
|
end
|
49
42
|
|
50
|
-
|
51
|
-
def_index = stack.rindex { |item| [:def, :defs].include?(item) }
|
52
|
-
sclass_index = stack.rindex(:sclass)
|
53
|
-
|
54
|
-
def_index.nil? || (!sclass_index.nil? && sclass_index > def_index)
|
55
|
-
end
|
56
|
-
alias module_definition_allowed? class_definition_allowed?
|
57
|
-
alias dynamic_const_definition_allowed? class_definition_allowed?
|
58
|
-
|
59
|
-
def in_block?
|
60
|
-
@stack.last == :block
|
61
|
-
end
|
62
|
-
|
63
|
-
def in_lambda?
|
64
|
-
@stack.last == :lambda
|
65
|
-
end
|
43
|
+
attr_accessor(*FLAGS)
|
66
44
|
|
67
45
|
def in_dynamic_block?
|
68
|
-
in_block
|
69
|
-
end
|
70
|
-
|
71
|
-
def in_def_open_args?
|
72
|
-
@stack.last == :def_open_args
|
46
|
+
in_block || in_lambda
|
73
47
|
end
|
74
48
|
end
|
75
49
|
end
|
data/lib/parser/current.rb
CHANGED
@@ -66,7 +66,7 @@ module Parser
|
|
66
66
|
CurrentRuby = Ruby25
|
67
67
|
|
68
68
|
when /^2\.6\./
|
69
|
-
current_version = '2.6.
|
69
|
+
current_version = '2.6.10'
|
70
70
|
if RUBY_VERSION != current_version
|
71
71
|
warn_syntax_deviation 'parser/ruby26', current_version
|
72
72
|
end
|
@@ -75,7 +75,7 @@ module Parser
|
|
75
75
|
CurrentRuby = Ruby26
|
76
76
|
|
77
77
|
when /^2\.7\./
|
78
|
-
current_version = '2.7.
|
78
|
+
current_version = '2.7.6'
|
79
79
|
if RUBY_VERSION != current_version
|
80
80
|
warn_syntax_deviation 'parser/ruby27', current_version
|
81
81
|
end
|
@@ -84,7 +84,7 @@ module Parser
|
|
84
84
|
CurrentRuby = Ruby27
|
85
85
|
|
86
86
|
when /^3\.0\./
|
87
|
-
current_version = '3.0.
|
87
|
+
current_version = '3.0.4'
|
88
88
|
if RUBY_VERSION != current_version
|
89
89
|
warn_syntax_deviation 'parser/ruby30', current_version
|
90
90
|
end
|
@@ -93,7 +93,7 @@ module Parser
|
|
93
93
|
CurrentRuby = Ruby30
|
94
94
|
|
95
95
|
when /^3\.1\./
|
96
|
-
current_version = '3.1.
|
96
|
+
current_version = '3.1.2'
|
97
97
|
if RUBY_VERSION != current_version
|
98
98
|
warn_syntax_deviation 'parser/ruby31', current_version
|
99
99
|
end
|
@@ -101,10 +101,19 @@ module Parser
|
|
101
101
|
require 'parser/ruby31'
|
102
102
|
CurrentRuby = Ruby31
|
103
103
|
|
104
|
+
when /^3\.2\./
|
105
|
+
current_version = '3.2.0-dev'
|
106
|
+
if RUBY_VERSION != current_version
|
107
|
+
warn_syntax_deviation 'parser/ruby32', current_version
|
108
|
+
end
|
109
|
+
|
110
|
+
require 'parser/ruby32'
|
111
|
+
CurrentRuby = Ruby32
|
112
|
+
|
104
113
|
else # :nocov:
|
105
114
|
# Keep this in sync with released Ruby.
|
106
|
-
warn_syntax_deviation 'parser/
|
107
|
-
require 'parser/
|
108
|
-
CurrentRuby =
|
115
|
+
warn_syntax_deviation 'parser/ruby31', '3.1.x'
|
116
|
+
require 'parser/ruby31'
|
117
|
+
CurrentRuby = Ruby31
|
109
118
|
end
|
110
119
|
end
|