prism 0.19.0 → 0.24.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +102 -1
- data/Makefile +5 -0
- data/README.md +9 -6
- data/config.yml +236 -38
- data/docs/build_system.md +19 -2
- data/docs/cruby_compilation.md +27 -0
- data/docs/parser_translation.md +34 -0
- data/docs/parsing_rules.md +19 -0
- data/docs/releasing.md +84 -16
- data/docs/ruby_api.md +1 -1
- data/docs/ruby_parser_translation.md +19 -0
- data/docs/serialization.md +19 -5
- data/ext/prism/api_node.c +1989 -1525
- data/ext/prism/extension.c +130 -30
- data/ext/prism/extension.h +2 -2
- data/include/prism/ast.h +1700 -505
- data/include/prism/defines.h +8 -0
- data/include/prism/diagnostic.h +49 -7
- data/include/prism/encoding.h +17 -0
- data/include/prism/options.h +40 -14
- data/include/prism/parser.h +34 -18
- data/include/prism/util/pm_buffer.h +9 -0
- data/include/prism/util/pm_constant_pool.h +18 -0
- data/include/prism/util/pm_newline_list.h +4 -14
- data/include/prism/util/pm_strpbrk.h +4 -1
- data/include/prism/version.h +2 -2
- data/include/prism.h +19 -2
- data/lib/prism/debug.rb +11 -5
- data/lib/prism/desugar_compiler.rb +225 -80
- data/lib/prism/dot_visitor.rb +36 -14
- data/lib/prism/dsl.rb +302 -299
- data/lib/prism/ffi.rb +107 -76
- data/lib/prism/lex_compat.rb +17 -1
- data/lib/prism/node.rb +4580 -2607
- data/lib/prism/node_ext.rb +27 -4
- data/lib/prism/parse_result.rb +75 -29
- data/lib/prism/serialize.rb +633 -305
- data/lib/prism/translation/parser/compiler.rb +1838 -0
- data/lib/prism/translation/parser/lexer.rb +335 -0
- data/lib/prism/translation/parser/rubocop.rb +45 -0
- data/lib/prism/translation/parser.rb +190 -0
- data/lib/prism/translation/parser33.rb +12 -0
- data/lib/prism/translation/parser34.rb +12 -0
- data/lib/prism/translation/ripper.rb +696 -0
- data/lib/prism/translation/ruby_parser.rb +1521 -0
- data/lib/prism/translation.rb +11 -0
- data/lib/prism.rb +1 -1
- data/prism.gemspec +18 -7
- data/rbi/prism.rbi +150 -88
- data/rbi/prism_static.rbi +15 -3
- data/sig/prism.rbs +996 -961
- data/sig/prism_static.rbs +123 -46
- data/src/diagnostic.c +264 -219
- data/src/encoding.c +21 -26
- data/src/node.c +2 -6
- data/src/options.c +29 -5
- data/src/prettyprint.c +176 -44
- data/src/prism.c +1499 -564
- data/src/serialize.c +35 -21
- data/src/token_type.c +353 -4
- data/src/util/pm_buffer.c +11 -0
- data/src/util/pm_constant_pool.c +37 -11
- data/src/util/pm_newline_list.c +6 -15
- data/src/util/pm_string.c +0 -7
- data/src/util/pm_strpbrk.c +122 -14
- metadata +16 -5
- data/docs/building.md +0 -29
- data/lib/prism/ripper_compat.rb +0 -207
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Prism
|
4
|
+
# This module is responsible for converting the prism syntax tree into other
|
5
|
+
# syntax trees.
|
6
|
+
module Translation
|
7
|
+
autoload :Parser, "prism/translation/parser"
|
8
|
+
autoload :Ripper, "prism/translation/ripper"
|
9
|
+
autoload :RubyParser, "prism/translation/ruby_parser"
|
10
|
+
end
|
11
|
+
end
|
data/lib/prism.rb
CHANGED
@@ -22,10 +22,10 @@ module Prism
|
|
22
22
|
autoload :LexRipper, "prism/lex_compat"
|
23
23
|
autoload :MutationCompiler, "prism/mutation_compiler"
|
24
24
|
autoload :NodeInspector, "prism/node_inspector"
|
25
|
-
autoload :RipperCompat, "prism/ripper_compat"
|
26
25
|
autoload :Pack, "prism/pack"
|
27
26
|
autoload :Pattern, "prism/pattern"
|
28
27
|
autoload :Serialize, "prism/serialize"
|
28
|
+
autoload :Translation, "prism/translation"
|
29
29
|
autoload :Visitor, "prism/visitor"
|
30
30
|
|
31
31
|
# Some of these constants are not meant to be exposed, so marking them as
|
data/prism.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "prism"
|
5
|
-
spec.version = "0.
|
5
|
+
spec.version = "0.24.0"
|
6
6
|
spec.authors = ["Shopify"]
|
7
7
|
spec.email = ["ruby@shopify.com"]
|
8
8
|
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.homepage = "https://github.com/ruby/prism"
|
11
11
|
spec.license = "MIT"
|
12
12
|
|
13
|
-
spec.required_ruby_version = ">=
|
13
|
+
spec.required_ruby_version = ">= 2.7.0"
|
14
14
|
|
15
15
|
spec.require_paths = ["lib"]
|
16
16
|
spec.files = [
|
@@ -22,8 +22,8 @@ Gem::Specification.new do |spec|
|
|
22
22
|
"README.md",
|
23
23
|
"config.yml",
|
24
24
|
"docs/build_system.md",
|
25
|
-
"docs/building.md",
|
26
25
|
"docs/configuration.md",
|
26
|
+
"docs/cruby_compilation.md",
|
27
27
|
"docs/design.md",
|
28
28
|
"docs/encoding.md",
|
29
29
|
"docs/fuzzing.md",
|
@@ -31,9 +31,12 @@ Gem::Specification.new do |spec|
|
|
31
31
|
"docs/javascript.md",
|
32
32
|
"docs/local_variable_depth.md",
|
33
33
|
"docs/mapping.md",
|
34
|
+
"docs/parser_translation.md",
|
35
|
+
"docs/parsing_rules.md",
|
34
36
|
"docs/releasing.md",
|
35
37
|
"docs/ripper.md",
|
36
38
|
"docs/ruby_api.md",
|
39
|
+
"docs/ruby_parser_translation.md",
|
37
40
|
"docs/serialization.md",
|
38
41
|
"docs/testing.md",
|
39
42
|
"ext/prism/api_node.c",
|
@@ -73,16 +76,24 @@ Gem::Specification.new do |spec|
|
|
73
76
|
"lib/prism/ffi.rb",
|
74
77
|
"lib/prism/lex_compat.rb",
|
75
78
|
"lib/prism/mutation_compiler.rb",
|
76
|
-
"lib/prism/node.rb",
|
77
79
|
"lib/prism/node_ext.rb",
|
78
80
|
"lib/prism/node_inspector.rb",
|
81
|
+
"lib/prism/node.rb",
|
79
82
|
"lib/prism/pack.rb",
|
80
83
|
"lib/prism/parse_result.rb",
|
81
|
-
"lib/prism/pattern.rb",
|
82
|
-
"lib/prism/ripper_compat.rb",
|
83
|
-
"lib/prism/serialize.rb",
|
84
84
|
"lib/prism/parse_result/comments.rb",
|
85
85
|
"lib/prism/parse_result/newlines.rb",
|
86
|
+
"lib/prism/pattern.rb",
|
87
|
+
"lib/prism/serialize.rb",
|
88
|
+
"lib/prism/translation.rb",
|
89
|
+
"lib/prism/translation/parser.rb",
|
90
|
+
"lib/prism/translation/parser33.rb",
|
91
|
+
"lib/prism/translation/parser34.rb",
|
92
|
+
"lib/prism/translation/parser/compiler.rb",
|
93
|
+
"lib/prism/translation/parser/lexer.rb",
|
94
|
+
"lib/prism/translation/parser/rubocop.rb",
|
95
|
+
"lib/prism/translation/ripper.rb",
|
96
|
+
"lib/prism/translation/ruby_parser.rb",
|
86
97
|
"lib/prism/visitor.rb",
|
87
98
|
"src/diagnostic.c",
|
88
99
|
"src/encoding.c",
|