ruby_parser 3.20.2 → 3.21.0
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
- checksums.yaml.gz.sig +0 -0
- data/History.rdoc +44 -0
- data/Manifest.txt +14 -24
- data/README.rdoc +3 -3
- data/Rakefile +113 -115
- data/compare/normalize.rb +2 -0
- data/lib/ruby_lexer.rb +22 -23
- data/lib/ruby_lexer.rex.rb +1 -2
- data/lib/ruby_parser.rb +15 -13
- data/lib/{ruby_parser.yy → ruby_parser2.yy} +3 -10
- data/lib/{ruby20_parser.rb → ruby_parser20.rb} +9 -12
- data/lib/{ruby21_parser.rb → ruby_parser21.rb} +9 -12
- data/lib/{ruby22_parser.rb → ruby_parser22.rb} +9 -12
- data/lib/{ruby23_parser.rb → ruby_parser23.rb} +9 -12
- data/lib/{ruby24_parser.rb → ruby_parser24.rb} +9 -12
- data/lib/{ruby25_parser.rb → ruby_parser25.rb} +9 -12
- data/lib/{ruby26_parser.rb → ruby_parser26.rb} +9 -12
- data/lib/{ruby27_parser.rb → ruby_parser27.rb} +9 -12
- data/lib/{ruby3_parser.yy → ruby_parser3.yy} +32 -36
- data/lib/{ruby30_parser.rb → ruby_parser30.rb} +38 -39
- data/lib/{ruby31_parser.rb → ruby_parser31.rb} +2788 -2704
- data/lib/{ruby32_parser.rb → ruby_parser32.rb} +2735 -2741
- data/lib/ruby_parser33.rb +13577 -0
- data/lib/ruby_parser_extras.rb +36 -18
- data/test/test_ruby_lexer.rb +5 -5
- data/test/test_ruby_parser.rb +29 -19
- data/tools/munge.rb +8 -2
- data/tools/ripper.rb +14 -12
- data.tar.gz.sig +0 -0
- metadata +41 -51
- metadata.gz.sig +0 -0
- data/lib/ruby20_parser.y +0 -2707
- data/lib/ruby21_parser.y +0 -2724
- data/lib/ruby22_parser.y +0 -2735
- data/lib/ruby23_parser.y +0 -2737
- data/lib/ruby24_parser.y +0 -2745
- data/lib/ruby25_parser.y +0 -2745
- data/lib/ruby26_parser.y +0 -2760
- data/lib/ruby27_parser.y +0 -3360
- data/lib/ruby30_parser.y +0 -3486
- data/lib/ruby31_parser.y +0 -3520
- data/lib/ruby32_parser.y +0 -3521
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
#
|
|
2
4
|
# DO NOT MODIFY!!!!
|
|
3
|
-
# This file is automatically generated by Racc 1.
|
|
4
|
-
# from Racc grammar file "".
|
|
5
|
+
# This file is automatically generated by Racc 1.7.3
|
|
6
|
+
# from Racc grammar file "stdin".
|
|
5
7
|
#
|
|
6
8
|
|
|
7
9
|
require 'racc/parser.rb'
|
|
@@ -8057,6 +8059,7 @@ Racc_arg = [
|
|
|
8057
8059
|
racc_shift_n,
|
|
8058
8060
|
racc_reduce_n,
|
|
8059
8061
|
racc_use_result_var ]
|
|
8062
|
+
Ractor.make_shareable(Racc_arg) if defined?(Ractor)
|
|
8060
8063
|
|
|
8061
8064
|
Racc_token_to_s_table = [
|
|
8062
8065
|
"$end",
|
|
@@ -8459,6 +8462,7 @@ Racc_token_to_s_table = [
|
|
|
8459
8462
|
"blkarg_mark",
|
|
8460
8463
|
"@43",
|
|
8461
8464
|
"assoc" ]
|
|
8465
|
+
Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
|
|
8462
8466
|
|
|
8463
8467
|
Racc_debug_parser = false
|
|
8464
8468
|
|
|
@@ -10369,7 +10373,6 @@ end
|
|
|
10369
10373
|
def _reduce_336(val, _values, result)
|
|
10370
10374
|
result = new_class val
|
|
10371
10375
|
self.env.unextend
|
|
10372
|
-
self.lexer.ignore_body_comments
|
|
10373
10376
|
|
|
10374
10377
|
result
|
|
10375
10378
|
end
|
|
@@ -10392,7 +10395,6 @@ end
|
|
|
10392
10395
|
def _reduce_339(val, _values, result)
|
|
10393
10396
|
result = new_sclass val
|
|
10394
10397
|
self.env.unextend
|
|
10395
|
-
self.lexer.ignore_body_comments
|
|
10396
10398
|
|
|
10397
10399
|
result
|
|
10398
10400
|
end
|
|
@@ -10409,7 +10411,6 @@ end
|
|
|
10409
10411
|
def _reduce_341(val, _values, result)
|
|
10410
10412
|
result = new_module val
|
|
10411
10413
|
self.env.unextend
|
|
10412
|
-
self.lexer.ignore_body_comments
|
|
10413
10414
|
|
|
10414
10415
|
result
|
|
10415
10416
|
end
|
|
@@ -10433,8 +10434,6 @@ def _reduce_343(val, _values, result)
|
|
|
10433
10434
|
self.env.unextend
|
|
10434
10435
|
self.in_def = in_def
|
|
10435
10436
|
|
|
10436
|
-
self.lexer.ignore_body_comments
|
|
10437
|
-
|
|
10438
10437
|
result
|
|
10439
10438
|
end
|
|
10440
10439
|
|
|
@@ -10478,8 +10477,6 @@ def _reduce_346(val, _values, result)
|
|
|
10478
10477
|
|
|
10479
10478
|
# TODO: restore cur_arg ? what's cur_arg?
|
|
10480
10479
|
|
|
10481
|
-
self.lexer.ignore_body_comments
|
|
10482
|
-
|
|
10483
10480
|
result
|
|
10484
10481
|
end
|
|
10485
10482
|
|
|
@@ -10532,19 +10529,19 @@ end
|
|
|
10532
10529
|
# reduce 358 omitted
|
|
10533
10530
|
|
|
10534
10531
|
def _reduce_359(val, _values, result)
|
|
10535
|
-
|
|
10532
|
+
result << self.lexer.comment
|
|
10536
10533
|
|
|
10537
10534
|
result
|
|
10538
10535
|
end
|
|
10539
10536
|
|
|
10540
10537
|
def _reduce_360(val, _values, result)
|
|
10541
|
-
|
|
10538
|
+
result << self.lexer.comment
|
|
10542
10539
|
|
|
10543
10540
|
result
|
|
10544
10541
|
end
|
|
10545
10542
|
|
|
10546
10543
|
def _reduce_361(val, _values, result)
|
|
10547
|
-
|
|
10544
|
+
result << self.lexer.comment
|
|
10548
10545
|
|
|
10549
10546
|
result
|
|
10550
10547
|
end
|
|
@@ -6,6 +6,8 @@ class Ruby30Parser
|
|
|
6
6
|
class Ruby31Parser
|
|
7
7
|
#elif V == 32
|
|
8
8
|
class Ruby32Parser
|
|
9
|
+
#elif V == 33
|
|
10
|
+
class Ruby33Parser
|
|
9
11
|
#else
|
|
10
12
|
fail "version not specified or supported on code generation"
|
|
11
13
|
#endif
|
|
@@ -420,12 +422,12 @@ rule
|
|
|
420
422
|
}
|
|
421
423
|
defn_head: k_def def_name
|
|
422
424
|
{
|
|
423
|
-
|
|
424
|
-
result = name
|
|
425
|
+
result = val
|
|
425
426
|
}
|
|
426
427
|
defs_head: k_def singleton dot_or_colon
|
|
427
428
|
{
|
|
428
429
|
lexer.lex_state = EXPR_FNAME
|
|
430
|
+
self.in_argdef = true
|
|
429
431
|
}
|
|
430
432
|
def_name
|
|
431
433
|
{
|
|
@@ -437,9 +439,7 @@ rule
|
|
|
437
439
|
# lexer.cmdarg.push false
|
|
438
440
|
# lexer.cond.push false
|
|
439
441
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
result = [recv, name]
|
|
442
|
+
result = val
|
|
443
443
|
}
|
|
444
444
|
|
|
445
445
|
expr_value: expr
|
|
@@ -1519,7 +1519,6 @@ rule
|
|
|
1519
1519
|
{
|
|
1520
1520
|
result = new_class val
|
|
1521
1521
|
self.env.unextend
|
|
1522
|
-
self.lexer.ignore_body_comments
|
|
1523
1522
|
}
|
|
1524
1523
|
| k_class tLSHFT
|
|
1525
1524
|
expr
|
|
@@ -1538,7 +1537,6 @@ rule
|
|
|
1538
1537
|
{
|
|
1539
1538
|
result = new_sclass val
|
|
1540
1539
|
self.env.unextend
|
|
1541
|
-
self.lexer.ignore_body_comments
|
|
1542
1540
|
}
|
|
1543
1541
|
| k_module
|
|
1544
1542
|
cpath
|
|
@@ -1552,39 +1550,18 @@ rule
|
|
|
1552
1550
|
{
|
|
1553
1551
|
result = new_module val
|
|
1554
1552
|
self.env.unextend
|
|
1555
|
-
self.lexer.ignore_body_comments
|
|
1556
1553
|
}
|
|
1557
1554
|
| defn_head f_arglist bodystmt k_end
|
|
1558
1555
|
{
|
|
1559
|
-
# [ [:f, 1, false], s(:args)...]
|
|
1560
|
-
# =>
|
|
1561
|
-
# [[:k_def, 666], [:f, 1], false, s(:args)...]
|
|
1562
|
-
val.insert 1, val.first.pop
|
|
1563
|
-
val.insert 0, [:k_def, 666]
|
|
1564
|
-
|
|
1565
1556
|
result, in_def = new_defn val
|
|
1566
1557
|
|
|
1567
1558
|
lexer.cond.pop # group = local_pop
|
|
1568
1559
|
lexer.cmdarg.pop
|
|
1569
1560
|
self.env.unextend
|
|
1570
1561
|
self.in_def = in_def
|
|
1571
|
-
|
|
1572
|
-
self.lexer.ignore_body_comments
|
|
1573
1562
|
}
|
|
1574
1563
|
| defs_head f_arglist bodystmt k_end
|
|
1575
1564
|
{
|
|
1576
|
-
# [ [recv, [:name, 1, false]], s(:args...]
|
|
1577
|
-
# =>
|
|
1578
|
-
# [ recv, [:name, 1, false], s(:args...]
|
|
1579
|
-
# =>
|
|
1580
|
-
# [ recv, [:name, 1], false, s(:args...]
|
|
1581
|
-
# =>
|
|
1582
|
-
# [ :k_def, recv, [:name, 1], false, s(:args...]
|
|
1583
|
-
|
|
1584
|
-
val.prepend(*val.shift)
|
|
1585
|
-
val.insert 2, val[1].pop
|
|
1586
|
-
val.insert 0, [:k_def, 666]
|
|
1587
|
-
|
|
1588
1565
|
result, in_def = new_defs val
|
|
1589
1566
|
|
|
1590
1567
|
lexer.cond.pop # group = local_pop
|
|
@@ -1595,8 +1572,6 @@ rule
|
|
|
1595
1572
|
self.in_single -= 1
|
|
1596
1573
|
|
|
1597
1574
|
# TODO: restore cur_arg ? what's cur_arg?
|
|
1598
|
-
|
|
1599
|
-
self.lexer.ignore_body_comments
|
|
1600
1575
|
}
|
|
1601
1576
|
| kBREAK
|
|
1602
1577
|
{
|
|
@@ -1634,15 +1609,16 @@ rule
|
|
|
1634
1609
|
k_for: kFOR
|
|
1635
1610
|
k_class: kCLASS
|
|
1636
1611
|
{
|
|
1637
|
-
|
|
1612
|
+
result << self.lexer.comment
|
|
1638
1613
|
}
|
|
1639
1614
|
k_module: kMODULE
|
|
1640
1615
|
{
|
|
1641
|
-
|
|
1616
|
+
result << self.lexer.comment
|
|
1642
1617
|
}
|
|
1643
1618
|
k_def: kDEF
|
|
1644
1619
|
{
|
|
1645
|
-
self.
|
|
1620
|
+
self.in_argdef = true
|
|
1621
|
+
result << self.lexer.comment
|
|
1646
1622
|
}
|
|
1647
1623
|
k_do: kDO
|
|
1648
1624
|
k_do_block: kDO_BLOCK
|
|
@@ -1759,7 +1735,7 @@ rule
|
|
|
1759
1735
|
| f_no_kwarg
|
|
1760
1736
|
|
|
1761
1737
|
#if V > 30
|
|
1762
|
-
f_eq:
|
|
1738
|
+
f_eq: { self.in_argdef = false } tEQL
|
|
1763
1739
|
#endif
|
|
1764
1740
|
|
|
1765
1741
|
block_args_tail: f_block_kwarg tCOMMA f_kwrest opt_f_block_arg
|
|
@@ -1864,6 +1840,7 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
|
1864
1840
|
{
|
|
1865
1841
|
# TODO: current_arg = 0
|
|
1866
1842
|
result = args val
|
|
1843
|
+
self.in_argdef = false
|
|
1867
1844
|
}
|
|
1868
1845
|
| tOROP
|
|
1869
1846
|
{
|
|
@@ -1875,6 +1852,7 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
|
1875
1852
|
{
|
|
1876
1853
|
# TODO: current_arg = 0
|
|
1877
1854
|
result = args val
|
|
1855
|
+
self.in_argdef = false
|
|
1878
1856
|
}
|
|
1879
1857
|
|
|
1880
1858
|
opt_bv_decl: opt_nl
|
|
@@ -1924,10 +1902,12 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
|
1924
1902
|
|
|
1925
1903
|
f_larglist: tLPAREN2 f_args opt_bv_decl rparen
|
|
1926
1904
|
{
|
|
1905
|
+
self.in_argdef = false
|
|
1927
1906
|
result = args val
|
|
1928
1907
|
}
|
|
1929
1908
|
| f_args
|
|
1930
1909
|
{
|
|
1910
|
+
self.in_argdef = false
|
|
1931
1911
|
result = val[0]
|
|
1932
1912
|
result = 0 if result == s(:args)
|
|
1933
1913
|
}
|
|
@@ -3134,11 +3114,13 @@ keyword_variable: kNIL { (_, line), = val; result = s(:nil).line line }
|
|
|
3134
3114
|
f_opt_paren_args: f_paren_args
|
|
3135
3115
|
| none
|
|
3136
3116
|
{
|
|
3117
|
+
self.in_argdef = false
|
|
3137
3118
|
result = end_args val
|
|
3138
3119
|
}
|
|
3139
3120
|
|
|
3140
3121
|
f_paren_args: tLPAREN2 f_args rparen
|
|
3141
3122
|
{
|
|
3123
|
+
self.in_argdef = false
|
|
3142
3124
|
result = end_args val
|
|
3143
3125
|
}
|
|
3144
3126
|
#if V == 30
|
|
@@ -3156,10 +3138,12 @@ f_opt_paren_args: f_paren_args
|
|
|
3156
3138
|
| {
|
|
3157
3139
|
result = self.in_kwarg
|
|
3158
3140
|
self.in_kwarg = true
|
|
3141
|
+
self.in_argdef = true
|
|
3159
3142
|
self.lexer.lex_state |= EXPR_LABEL
|
|
3160
3143
|
}
|
|
3161
3144
|
f_args term
|
|
3162
3145
|
{
|
|
3146
|
+
self.in_argdef = false
|
|
3163
3147
|
result = end_args val
|
|
3164
3148
|
}
|
|
3165
3149
|
|
|
@@ -3318,6 +3302,14 @@ f_opt_paren_args: f_paren_args
|
|
|
3318
3302
|
}
|
|
3319
3303
|
|
|
3320
3304
|
f_label: tLABEL
|
|
3305
|
+
{
|
|
3306
|
+
label, = val
|
|
3307
|
+
# arg_var(p, formal_argument(p, $1));
|
|
3308
|
+
# p->cur_arg = get_id($1);
|
|
3309
|
+
# p->max_numparam = ORDINAL_PARAM;
|
|
3310
|
+
self.in_argdef = false
|
|
3311
|
+
result = label
|
|
3312
|
+
}
|
|
3321
3313
|
|
|
3322
3314
|
f_kw: f_label arg_value
|
|
3323
3315
|
{
|
|
@@ -3326,6 +3318,7 @@ f_opt_paren_args: f_paren_args
|
|
|
3326
3318
|
|
|
3327
3319
|
identifier = label.to_sym
|
|
3328
3320
|
self.env[identifier] = :lvar
|
|
3321
|
+
self.in_argdef = true
|
|
3329
3322
|
|
|
3330
3323
|
kwarg = s(:kwarg, identifier, arg).line line
|
|
3331
3324
|
result = s(:array, kwarg).line line
|
|
@@ -3336,6 +3329,7 @@ f_opt_paren_args: f_paren_args
|
|
|
3336
3329
|
|
|
3337
3330
|
id = label.to_sym
|
|
3338
3331
|
self.env[id] = :lvar
|
|
3332
|
+
self.in_argdef = true
|
|
3339
3333
|
|
|
3340
3334
|
result = s(:array, s(:kwarg, id).line(line)).line line
|
|
3341
3335
|
}
|
|
@@ -3346,6 +3340,7 @@ f_opt_paren_args: f_paren_args
|
|
|
3346
3340
|
(label, line), expr = val
|
|
3347
3341
|
id = label.to_sym
|
|
3348
3342
|
self.env[id] = :lvar
|
|
3343
|
+
self.in_argdef = true
|
|
3349
3344
|
|
|
3350
3345
|
result = s(:array, s(:kwarg, id, expr).line(line)).line line
|
|
3351
3346
|
}
|
|
@@ -3355,6 +3350,7 @@ f_opt_paren_args: f_paren_args
|
|
|
3355
3350
|
(label, line), = val
|
|
3356
3351
|
id = label.to_sym
|
|
3357
3352
|
self.env[id] = :lvar
|
|
3353
|
+
self.in_argdef = true
|
|
3358
3354
|
|
|
3359
3355
|
result = s(:array, s(:kwarg, id).line(line)).line line
|
|
3360
3356
|
}
|
|
@@ -3406,10 +3402,10 @@ f_opt_paren_args: f_paren_args
|
|
|
3406
3402
|
arg_value
|
|
3407
3403
|
{
|
|
3408
3404
|
lhs, _, rhs = val
|
|
3405
|
+
self.in_argdef = true
|
|
3409
3406
|
result = self.assignable lhs, rhs
|
|
3410
3407
|
# TODO: detect duplicate names
|
|
3411
3408
|
# TODO? p->cur_arg = 0;
|
|
3412
|
-
# TODO? p->ctxt.in_argdef = 1;
|
|
3413
3409
|
}
|
|
3414
3410
|
|
|
3415
3411
|
f_block_opt: f_arg_asgn
|
|
@@ -3421,9 +3417,9 @@ f_opt_paren_args: f_paren_args
|
|
|
3421
3417
|
primary_value
|
|
3422
3418
|
{
|
|
3423
3419
|
lhs, _, rhs = val
|
|
3420
|
+
self.in_argdef = true
|
|
3424
3421
|
result = self.assignable lhs, rhs
|
|
3425
3422
|
# TODO? p->cur_arg = 0;
|
|
3426
|
-
# TODO? p->ctxt.in_argdef = 1;
|
|
3427
3423
|
}
|
|
3428
3424
|
|
|
3429
3425
|
f_block_optarg: f_block_opt
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
#
|
|
2
4
|
# DO NOT MODIFY!!!!
|
|
3
|
-
# This file is automatically generated by Racc 1.
|
|
4
|
-
# from Racc grammar file "".
|
|
5
|
+
# This file is automatically generated by Racc 1.7.3
|
|
6
|
+
# from Racc grammar file "stdin".
|
|
5
7
|
#
|
|
6
8
|
|
|
7
9
|
require 'racc/parser.rb'
|
|
@@ -8013,7 +8015,7 @@ racc_reduce_table = [
|
|
|
8013
8015
|
3, 395, :_reduce_692,
|
|
8014
8016
|
1, 309, :_reduce_693,
|
|
8015
8017
|
3, 309, :_reduce_694,
|
|
8016
|
-
1, 396, :
|
|
8018
|
+
1, 396, :_reduce_695,
|
|
8017
8019
|
2, 397, :_reduce_696,
|
|
8018
8020
|
1, 397, :_reduce_697,
|
|
8019
8021
|
2, 398, :_reduce_698,
|
|
@@ -8259,6 +8261,7 @@ Racc_arg = [
|
|
|
8259
8261
|
racc_shift_n,
|
|
8260
8262
|
racc_reduce_n,
|
|
8261
8263
|
racc_use_result_var ]
|
|
8264
|
+
Ractor.make_shareable(Racc_arg) if defined?(Ractor)
|
|
8262
8265
|
|
|
8263
8266
|
Racc_token_to_s_table = [
|
|
8264
8267
|
"$end",
|
|
@@ -8666,6 +8669,7 @@ Racc_token_to_s_table = [
|
|
|
8666
8669
|
"blkarg_mark",
|
|
8667
8670
|
"@38",
|
|
8668
8671
|
"assoc" ]
|
|
8672
|
+
Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
|
|
8669
8673
|
|
|
8670
8674
|
Racc_debug_parser = false
|
|
8671
8675
|
|
|
@@ -9101,14 +9105,14 @@ def _reduce_62(val, _values, result)
|
|
|
9101
9105
|
end
|
|
9102
9106
|
|
|
9103
9107
|
def _reduce_63(val, _values, result)
|
|
9104
|
-
|
|
9105
|
-
result = name
|
|
9108
|
+
result = val
|
|
9106
9109
|
|
|
9107
9110
|
result
|
|
9108
9111
|
end
|
|
9109
9112
|
|
|
9110
9113
|
def _reduce_64(val, _values, result)
|
|
9111
9114
|
lexer.lex_state = EXPR_FNAME
|
|
9115
|
+
self.in_argdef = true
|
|
9112
9116
|
|
|
9113
9117
|
result
|
|
9114
9118
|
end
|
|
@@ -9122,9 +9126,7 @@ def _reduce_65(val, _values, result)
|
|
|
9122
9126
|
# lexer.cmdarg.push false
|
|
9123
9127
|
# lexer.cond.push false
|
|
9124
9128
|
|
|
9125
|
-
|
|
9126
|
-
|
|
9127
|
-
result = [recv, name]
|
|
9129
|
+
result = val
|
|
9128
9130
|
|
|
9129
9131
|
result
|
|
9130
9132
|
end
|
|
@@ -10651,7 +10653,6 @@ end
|
|
|
10651
10653
|
def _reduce_344(val, _values, result)
|
|
10652
10654
|
result = new_class val
|
|
10653
10655
|
self.env.unextend
|
|
10654
|
-
self.lexer.ignore_body_comments
|
|
10655
10656
|
|
|
10656
10657
|
result
|
|
10657
10658
|
end
|
|
@@ -10674,7 +10675,6 @@ end
|
|
|
10674
10675
|
def _reduce_347(val, _values, result)
|
|
10675
10676
|
result = new_sclass val
|
|
10676
10677
|
self.env.unextend
|
|
10677
|
-
self.lexer.ignore_body_comments
|
|
10678
10678
|
|
|
10679
10679
|
result
|
|
10680
10680
|
end
|
|
@@ -10691,18 +10691,11 @@ end
|
|
|
10691
10691
|
def _reduce_349(val, _values, result)
|
|
10692
10692
|
result = new_module val
|
|
10693
10693
|
self.env.unextend
|
|
10694
|
-
self.lexer.ignore_body_comments
|
|
10695
10694
|
|
|
10696
10695
|
result
|
|
10697
10696
|
end
|
|
10698
10697
|
|
|
10699
10698
|
def _reduce_350(val, _values, result)
|
|
10700
|
-
# [ [:f, 1, false], s(:args)...]
|
|
10701
|
-
# =>
|
|
10702
|
-
# [[:k_def, 666], [:f, 1], false, s(:args)...]
|
|
10703
|
-
val.insert 1, val.first.pop
|
|
10704
|
-
val.insert 0, [:k_def, 666]
|
|
10705
|
-
|
|
10706
10699
|
result, in_def = new_defn val
|
|
10707
10700
|
|
|
10708
10701
|
lexer.cond.pop # group = local_pop
|
|
@@ -10710,24 +10703,10 @@ def _reduce_350(val, _values, result)
|
|
|
10710
10703
|
self.env.unextend
|
|
10711
10704
|
self.in_def = in_def
|
|
10712
10705
|
|
|
10713
|
-
self.lexer.ignore_body_comments
|
|
10714
|
-
|
|
10715
10706
|
result
|
|
10716
10707
|
end
|
|
10717
10708
|
|
|
10718
10709
|
def _reduce_351(val, _values, result)
|
|
10719
|
-
# [ [recv, [:name, 1, false]], s(:args...]
|
|
10720
|
-
# =>
|
|
10721
|
-
# [ recv, [:name, 1, false], s(:args...]
|
|
10722
|
-
# =>
|
|
10723
|
-
# [ recv, [:name, 1], false, s(:args...]
|
|
10724
|
-
# =>
|
|
10725
|
-
# [ :k_def, recv, [:name, 1], false, s(:args...]
|
|
10726
|
-
|
|
10727
|
-
val.prepend(*val.shift)
|
|
10728
|
-
val.insert 2, val[1].pop
|
|
10729
|
-
val.insert 0, [:k_def, 666]
|
|
10730
|
-
|
|
10731
10710
|
result, in_def = new_defs val
|
|
10732
10711
|
|
|
10733
10712
|
lexer.cond.pop # group = local_pop
|
|
@@ -10739,8 +10718,6 @@ def _reduce_351(val, _values, result)
|
|
|
10739
10718
|
|
|
10740
10719
|
# TODO: restore cur_arg ? what's cur_arg?
|
|
10741
10720
|
|
|
10742
|
-
self.lexer.ignore_body_comments
|
|
10743
|
-
|
|
10744
10721
|
result
|
|
10745
10722
|
end
|
|
10746
10723
|
|
|
@@ -10793,19 +10770,20 @@ end
|
|
|
10793
10770
|
# reduce 363 omitted
|
|
10794
10771
|
|
|
10795
10772
|
def _reduce_364(val, _values, result)
|
|
10796
|
-
|
|
10773
|
+
result << self.lexer.comment
|
|
10797
10774
|
|
|
10798
10775
|
result
|
|
10799
10776
|
end
|
|
10800
10777
|
|
|
10801
10778
|
def _reduce_365(val, _values, result)
|
|
10802
|
-
|
|
10779
|
+
result << self.lexer.comment
|
|
10803
10780
|
|
|
10804
10781
|
result
|
|
10805
10782
|
end
|
|
10806
10783
|
|
|
10807
10784
|
def _reduce_366(val, _values, result)
|
|
10808
|
-
self.
|
|
10785
|
+
self.in_argdef = true
|
|
10786
|
+
result << self.lexer.comment
|
|
10809
10787
|
|
|
10810
10788
|
result
|
|
10811
10789
|
end
|
|
@@ -11105,6 +11083,7 @@ end
|
|
|
11105
11083
|
def _reduce_424(val, _values, result)
|
|
11106
11084
|
# TODO: current_arg = 0
|
|
11107
11085
|
result = args val
|
|
11086
|
+
self.in_argdef = false
|
|
11108
11087
|
|
|
11109
11088
|
result
|
|
11110
11089
|
end
|
|
@@ -11120,6 +11099,7 @@ end
|
|
|
11120
11099
|
def _reduce_426(val, _values, result)
|
|
11121
11100
|
# TODO: current_arg = 0
|
|
11122
11101
|
result = args val
|
|
11102
|
+
self.in_argdef = false
|
|
11123
11103
|
|
|
11124
11104
|
result
|
|
11125
11105
|
end
|
|
@@ -11182,12 +11162,14 @@ def _reduce_435(val, _values, result)
|
|
|
11182
11162
|
end
|
|
11183
11163
|
|
|
11184
11164
|
def _reduce_436(val, _values, result)
|
|
11165
|
+
self.in_argdef = false
|
|
11185
11166
|
result = args val
|
|
11186
11167
|
|
|
11187
11168
|
result
|
|
11188
11169
|
end
|
|
11189
11170
|
|
|
11190
11171
|
def _reduce_437(val, _values, result)
|
|
11172
|
+
self.in_argdef = false
|
|
11191
11173
|
result = val[0]
|
|
11192
11174
|
result = 0 if result == s(:args)
|
|
11193
11175
|
|
|
@@ -12678,12 +12660,14 @@ end
|
|
|
12678
12660
|
# reduce 654 omitted
|
|
12679
12661
|
|
|
12680
12662
|
def _reduce_655(val, _values, result)
|
|
12663
|
+
self.in_argdef = false
|
|
12681
12664
|
result = end_args val
|
|
12682
12665
|
|
|
12683
12666
|
result
|
|
12684
12667
|
end
|
|
12685
12668
|
|
|
12686
12669
|
def _reduce_656(val, _values, result)
|
|
12670
|
+
self.in_argdef = false
|
|
12687
12671
|
result = end_args val
|
|
12688
12672
|
|
|
12689
12673
|
result
|
|
@@ -12706,12 +12690,14 @@ end
|
|
|
12706
12690
|
def _reduce_660(val, _values, result)
|
|
12707
12691
|
result = self.in_kwarg
|
|
12708
12692
|
self.in_kwarg = true
|
|
12693
|
+
self.in_argdef = true
|
|
12709
12694
|
self.lexer.lex_state |= EXPR_LABEL
|
|
12710
12695
|
|
|
12711
12696
|
result
|
|
12712
12697
|
end
|
|
12713
12698
|
|
|
12714
12699
|
def _reduce_661(val, _values, result)
|
|
12700
|
+
self.in_argdef = false
|
|
12715
12701
|
result = end_args val
|
|
12716
12702
|
|
|
12717
12703
|
result
|
|
@@ -12921,7 +12907,16 @@ def _reduce_694(val, _values, result)
|
|
|
12921
12907
|
result
|
|
12922
12908
|
end
|
|
12923
12909
|
|
|
12924
|
-
|
|
12910
|
+
def _reduce_695(val, _values, result)
|
|
12911
|
+
label, = val
|
|
12912
|
+
# arg_var(p, formal_argument(p, $1));
|
|
12913
|
+
# p->cur_arg = get_id($1);
|
|
12914
|
+
# p->max_numparam = ORDINAL_PARAM;
|
|
12915
|
+
self.in_argdef = false
|
|
12916
|
+
result = label
|
|
12917
|
+
|
|
12918
|
+
result
|
|
12919
|
+
end
|
|
12925
12920
|
|
|
12926
12921
|
def _reduce_696(val, _values, result)
|
|
12927
12922
|
# TODO: new_kw_arg
|
|
@@ -12929,6 +12924,7 @@ def _reduce_696(val, _values, result)
|
|
|
12929
12924
|
|
|
12930
12925
|
identifier = label.to_sym
|
|
12931
12926
|
self.env[identifier] = :lvar
|
|
12927
|
+
self.in_argdef = true
|
|
12932
12928
|
|
|
12933
12929
|
kwarg = s(:kwarg, identifier, arg).line line
|
|
12934
12930
|
result = s(:array, kwarg).line line
|
|
@@ -12941,6 +12937,7 @@ def _reduce_697(val, _values, result)
|
|
|
12941
12937
|
|
|
12942
12938
|
id = label.to_sym
|
|
12943
12939
|
self.env[id] = :lvar
|
|
12940
|
+
self.in_argdef = true
|
|
12944
12941
|
|
|
12945
12942
|
result = s(:array, s(:kwarg, id).line(line)).line line
|
|
12946
12943
|
|
|
@@ -12952,6 +12949,7 @@ def _reduce_698(val, _values, result)
|
|
|
12952
12949
|
(label, line), expr = val
|
|
12953
12950
|
id = label.to_sym
|
|
12954
12951
|
self.env[id] = :lvar
|
|
12952
|
+
self.in_argdef = true
|
|
12955
12953
|
|
|
12956
12954
|
result = s(:array, s(:kwarg, id, expr).line(line)).line line
|
|
12957
12955
|
|
|
@@ -12963,6 +12961,7 @@ def _reduce_699(val, _values, result)
|
|
|
12963
12961
|
(label, line), = val
|
|
12964
12962
|
id = label.to_sym
|
|
12965
12963
|
self.env[id] = :lvar
|
|
12964
|
+
self.in_argdef = true
|
|
12966
12965
|
|
|
12967
12966
|
result = s(:array, s(:kwarg, id).line(line)).line line
|
|
12968
12967
|
|
|
@@ -13018,19 +13017,19 @@ end
|
|
|
13018
13017
|
|
|
13019
13018
|
def _reduce_709(val, _values, result)
|
|
13020
13019
|
lhs, _, rhs = val
|
|
13020
|
+
self.in_argdef = true
|
|
13021
13021
|
result = self.assignable lhs, rhs
|
|
13022
13022
|
# TODO: detect duplicate names
|
|
13023
13023
|
# TODO? p->cur_arg = 0;
|
|
13024
|
-
# TODO? p->ctxt.in_argdef = 1;
|
|
13025
13024
|
|
|
13026
13025
|
result
|
|
13027
13026
|
end
|
|
13028
13027
|
|
|
13029
13028
|
def _reduce_710(val, _values, result)
|
|
13030
13029
|
lhs, _, rhs = val
|
|
13030
|
+
self.in_argdef = true
|
|
13031
13031
|
result = self.assignable lhs, rhs
|
|
13032
13032
|
# TODO? p->cur_arg = 0;
|
|
13033
|
-
# TODO? p->ctxt.in_argdef = 1;
|
|
13034
13033
|
|
|
13035
13034
|
result
|
|
13036
13035
|
end
|