parser 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -7
- data/.gitignore +1 -0
- data/README.md +1 -1
- data/Rakefile +12 -2
- data/bin/benchmark +3 -3
- data/lib/parser/builders/default.rb +46 -3
- data/lib/parser/current.rb +34 -0
- data/lib/parser/lexer.rb +2760 -2667
- data/lib/parser/lexer.rl +38 -14
- data/lib/parser/ruby18.rb +1956 -1957
- data/lib/parser/ruby19.rb +1962 -1969
- data/lib/parser/ruby19.y +2 -0
- data/lib/parser/ruby20.rb +2412 -2407
- data/lib/parser/ruby20.y +16 -2
- data/lib/parser/ruby21.rb +7310 -0
- data/lib/parser/ruby21.y +2352 -0
- data/lib/parser/source/buffer.rb +52 -2
- data/lib/parser.rb +16 -5
- data/parser.gemspec +2 -1
- data/test/helper.rb +1 -1
- data/test/parse_helper.rb +12 -4
- data/test/test_current.rb +17 -0
- data/test/test_encoding.rb +31 -0
- data/test/test_lexer.rb +5 -7
- data/test/test_parse_helper.rb +9 -4
- data/test/test_parser.rb +172 -10
- metadata +93 -125
- data/TODO.md +0 -9
data/lib/parser/ruby20.y
CHANGED
@@ -675,11 +675,23 @@ rule
|
|
675
675
|
}
|
676
676
|
| primary_value tCOLON2 tCONSTANT tOP_ASGN arg
|
677
677
|
{
|
678
|
-
|
678
|
+
if in_def?
|
679
|
+
diagnostic(:error, :dynamic_const, val[2], [ val[3] ])
|
680
|
+
end
|
681
|
+
|
682
|
+
const = @builder.assignable(
|
683
|
+
@builder.const_fetch(val[0], val[1], val[2]))
|
684
|
+
result = @builder.op_assign(const, val[3], val[4])
|
679
685
|
}
|
680
686
|
| tCOLON3 tCONSTANT tOP_ASGN arg
|
681
687
|
{
|
682
|
-
|
688
|
+
if in_def?
|
689
|
+
diagnostic(:error, :dynamic_const, val[1], [ val[2] ])
|
690
|
+
end
|
691
|
+
|
692
|
+
const = @builder.assignable(
|
693
|
+
@builder.const_global(val[0], val[1]))
|
694
|
+
result = @builder.op_assign(const, val[2], val[3])
|
683
695
|
}
|
684
696
|
| backref tOP_ASGN arg
|
685
697
|
{
|
@@ -2311,6 +2323,8 @@ end
|
|
2311
2323
|
|
2312
2324
|
require 'parser'
|
2313
2325
|
|
2326
|
+
Parser.check_for_encoding_support
|
2327
|
+
|
2314
2328
|
---- inner
|
2315
2329
|
|
2316
2330
|
def version
|