ruby-next-parser 2.8.0.1 → 2.8.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/parser/ruby-next/AST_FORMAT.md +23 -0
- data/lib/parser/ruby-next/ast/processor.rb +26 -0
- data/lib/parser/ruby-next/builder.rb +16 -7
- data/lib/parser/ruby-next/meta.rb +1 -1
- data/lib/parser/ruby-next/parser_ext.rb +2 -1
- data/lib/parser/ruby-next/version.rb +1 -1
- data/lib/parser/rubynext.rb +3885 -3746
- data/lib/parser/rubynext.y +55 -2
- metadata +4 -3
data/lib/parser/rubynext.y
CHANGED
@@ -206,8 +206,26 @@ rule
|
|
206
206
|
{
|
207
207
|
result = @builder.multi_assign(val[0], val[1], val[2])
|
208
208
|
}
|
209
|
+
| rassign
|
209
210
|
| expr
|
210
211
|
|
212
|
+
rassign: arg_value tASSOC lhs
|
213
|
+
{
|
214
|
+
result = @builder.rassign(val[0], val[1], val[2])
|
215
|
+
}
|
216
|
+
| arg_value tASSOC mlhs
|
217
|
+
{
|
218
|
+
result = @builder.multi_rassign(val[0], val[1], val[2])
|
219
|
+
}
|
220
|
+
| rassign tASSOC lhs
|
221
|
+
{
|
222
|
+
result = @builder.rassign(val[0], val[1], val[2])
|
223
|
+
}
|
224
|
+
| rassign tASSOC mlhs
|
225
|
+
{
|
226
|
+
result = @builder.multi_rassign(val[0], val[1], val[2])
|
227
|
+
}
|
228
|
+
|
211
229
|
command_asgn: lhs tEQL command_rhs
|
212
230
|
{
|
213
231
|
result = @builder.assign(val[0], val[1], val[2])
|
@@ -851,6 +869,23 @@ rule
|
|
851
869
|
result = @builder.def_endless_method(*val[0],
|
852
870
|
val[1], val[2], val[3])
|
853
871
|
|
872
|
+
@lexer.cmdarg.pop
|
873
|
+
@lexer.cond.pop
|
874
|
+
@static_env.unextend
|
875
|
+
@context.pop
|
876
|
+
@current_arg_stack.pop
|
877
|
+
}
|
878
|
+
| defn_head f_paren_args tEQL arg kRESCUE_MOD arg
|
879
|
+
{
|
880
|
+
rescue_body = @builder.rescue_body(val[4],
|
881
|
+
nil, nil, nil,
|
882
|
+
nil, val[5])
|
883
|
+
|
884
|
+
method_body = @builder.begin_body(val[3], [ rescue_body ])
|
885
|
+
|
886
|
+
result = @builder.def_endless_method(*val[0],
|
887
|
+
val[1], val[2], method_body)
|
888
|
+
|
854
889
|
@lexer.cmdarg.pop
|
855
890
|
@lexer.cond.pop
|
856
891
|
@static_env.unextend
|
@@ -862,6 +897,23 @@ rule
|
|
862
897
|
result = @builder.def_endless_singleton(*val[0],
|
863
898
|
val[1], val[2], val[3])
|
864
899
|
|
900
|
+
@lexer.cmdarg.pop
|
901
|
+
@lexer.cond.pop
|
902
|
+
@static_env.unextend
|
903
|
+
@context.pop
|
904
|
+
@current_arg_stack.pop
|
905
|
+
}
|
906
|
+
| defs_head f_paren_args tEQL arg kRESCUE_MOD arg
|
907
|
+
{
|
908
|
+
rescue_body = @builder.rescue_body(val[4],
|
909
|
+
nil, nil, nil,
|
910
|
+
nil, val[5])
|
911
|
+
|
912
|
+
method_body = @builder.begin_body(val[3], [ rescue_body ])
|
913
|
+
|
914
|
+
result = @builder.def_endless_singleton(*val[0],
|
915
|
+
val[1], val[2], method_body)
|
916
|
+
|
865
917
|
@lexer.cmdarg.pop
|
866
918
|
@lexer.cond.pop
|
867
919
|
@static_env.unextend
|
@@ -2553,10 +2605,9 @@ keyword_variable: kNIL
|
|
2553
2605
|
f_paren_args: tLPAREN2 f_args rparen
|
2554
2606
|
{
|
2555
2607
|
result = @builder.args(val[0], val[1], val[2])
|
2608
|
+
|
2556
2609
|
@lexer.state = :expr_value
|
2557
2610
|
}
|
2558
|
-
|
2559
|
-
f_arglist: f_paren_args
|
2560
2611
|
| tLPAREN2 args_forward rparen
|
2561
2612
|
{
|
2562
2613
|
result = @builder.forward_args(val[0], val[1], val[2])
|
@@ -2564,6 +2615,8 @@ keyword_variable: kNIL
|
|
2564
2615
|
|
2565
2616
|
@lexer.state = :expr_value
|
2566
2617
|
}
|
2618
|
+
|
2619
|
+
f_arglist: f_paren_args
|
2567
2620
|
| {
|
2568
2621
|
result = @lexer.in_kwarg
|
2569
2622
|
@lexer.in_kwarg = true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-next-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.8.0.
|
4
|
+
version: 2.8.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Dementyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -33,6 +33,7 @@ extensions: []
|
|
33
33
|
extra_rdoc_files: []
|
34
34
|
files:
|
35
35
|
- lib/parser/ruby-next/AST_FORMAT.md
|
36
|
+
- lib/parser/ruby-next/ast/processor.rb
|
36
37
|
- lib/parser/ruby-next/builder.rb
|
37
38
|
- lib/parser/ruby-next/lexer.rb
|
38
39
|
- lib/parser/ruby-next/lexer.rl
|
@@ -56,7 +57,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
56
57
|
requirements:
|
57
58
|
- - ">="
|
58
59
|
- !ruby/object:Gem::Version
|
59
|
-
version: 2.
|
60
|
+
version: 2.0.0
|
60
61
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
62
|
requirements:
|
62
63
|
- - ">="
|