jruby-prism-parser 0.24.0-java → 1.4.0-java

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.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/BSDmakefile +58 -0
  3. data/CHANGELOG.md +269 -1
  4. data/CONTRIBUTING.md +0 -4
  5. data/Makefile +25 -18
  6. data/README.md +57 -6
  7. data/config.yml +1724 -140
  8. data/docs/build_system.md +39 -11
  9. data/docs/configuration.md +4 -0
  10. data/docs/cruby_compilation.md +1 -1
  11. data/docs/fuzzing.md +1 -1
  12. data/docs/parser_translation.md +14 -9
  13. data/docs/parsing_rules.md +4 -1
  14. data/docs/releasing.md +8 -10
  15. data/docs/relocation.md +34 -0
  16. data/docs/ripper_translation.md +72 -0
  17. data/docs/ruby_api.md +2 -1
  18. data/docs/serialization.md +29 -5
  19. data/ext/prism/api_node.c +3395 -1999
  20. data/ext/prism/api_pack.c +9 -0
  21. data/ext/prism/extconf.rb +55 -34
  22. data/ext/prism/extension.c +597 -346
  23. data/ext/prism/extension.h +6 -5
  24. data/include/prism/ast.h +2612 -455
  25. data/include/prism/defines.h +160 -2
  26. data/include/prism/diagnostic.h +188 -76
  27. data/include/prism/encoding.h +22 -4
  28. data/include/prism/node.h +89 -17
  29. data/include/prism/options.h +224 -12
  30. data/include/prism/pack.h +11 -0
  31. data/include/prism/parser.h +267 -66
  32. data/include/prism/prettyprint.h +8 -0
  33. data/include/prism/regexp.h +18 -8
  34. data/include/prism/static_literals.h +121 -0
  35. data/include/prism/util/pm_buffer.h +75 -2
  36. data/include/prism/util/pm_char.h +1 -2
  37. data/include/prism/util/pm_constant_pool.h +18 -9
  38. data/include/prism/util/pm_integer.h +126 -0
  39. data/include/prism/util/pm_list.h +1 -1
  40. data/include/prism/util/pm_newline_list.h +19 -0
  41. data/include/prism/util/pm_string.h +48 -8
  42. data/include/prism/version.h +3 -3
  43. data/include/prism.h +99 -5
  44. data/jruby-prism.jar +0 -0
  45. data/lib/prism/compiler.rb +11 -1
  46. data/lib/prism/desugar_compiler.rb +113 -74
  47. data/lib/prism/dispatcher.rb +45 -1
  48. data/lib/prism/dot_visitor.rb +201 -77
  49. data/lib/prism/dsl.rb +673 -461
  50. data/lib/prism/ffi.rb +233 -45
  51. data/lib/prism/inspect_visitor.rb +2389 -0
  52. data/lib/prism/lex_compat.rb +35 -16
  53. data/lib/prism/mutation_compiler.rb +24 -8
  54. data/lib/prism/node.rb +7731 -8460
  55. data/lib/prism/node_ext.rb +328 -32
  56. data/lib/prism/pack.rb +4 -0
  57. data/lib/prism/parse_result/comments.rb +34 -24
  58. data/lib/prism/parse_result/errors.rb +65 -0
  59. data/lib/prism/parse_result/newlines.rb +102 -12
  60. data/lib/prism/parse_result.rb +448 -44
  61. data/lib/prism/pattern.rb +28 -10
  62. data/lib/prism/polyfill/append_as_bytes.rb +15 -0
  63. data/lib/prism/polyfill/byteindex.rb +13 -0
  64. data/lib/prism/polyfill/unpack1.rb +14 -0
  65. data/lib/prism/reflection.rb +413 -0
  66. data/lib/prism/relocation.rb +504 -0
  67. data/lib/prism/serialize.rb +1940 -1198
  68. data/lib/prism/string_query.rb +30 -0
  69. data/lib/prism/translation/parser/builder.rb +61 -0
  70. data/lib/prism/translation/parser/compiler.rb +569 -195
  71. data/lib/prism/translation/parser/lexer.rb +516 -39
  72. data/lib/prism/translation/parser.rb +177 -12
  73. data/lib/prism/translation/parser33.rb +1 -1
  74. data/lib/prism/translation/parser34.rb +1 -1
  75. data/lib/prism/translation/parser35.rb +12 -0
  76. data/lib/prism/translation/ripper/sexp.rb +125 -0
  77. data/lib/prism/translation/ripper/shim.rb +5 -0
  78. data/lib/prism/translation/ripper.rb +3224 -462
  79. data/lib/prism/translation/ruby_parser.rb +194 -69
  80. data/lib/prism/translation.rb +4 -1
  81. data/lib/prism/version.rb +1 -1
  82. data/lib/prism/visitor.rb +13 -0
  83. data/lib/prism.rb +17 -27
  84. data/prism.gemspec +57 -17
  85. data/rbi/prism/compiler.rbi +12 -0
  86. data/rbi/prism/dsl.rbi +524 -0
  87. data/rbi/prism/inspect_visitor.rbi +12 -0
  88. data/rbi/prism/node.rbi +8722 -0
  89. data/rbi/prism/node_ext.rbi +107 -0
  90. data/rbi/prism/parse_result.rbi +404 -0
  91. data/rbi/prism/reflection.rbi +58 -0
  92. data/rbi/prism/string_query.rbi +12 -0
  93. data/rbi/prism/translation/parser.rbi +11 -0
  94. data/rbi/prism/translation/parser33.rbi +6 -0
  95. data/rbi/prism/translation/parser34.rbi +6 -0
  96. data/rbi/prism/translation/parser35.rbi +6 -0
  97. data/rbi/prism/translation/ripper.rbi +15 -0
  98. data/rbi/prism/visitor.rbi +473 -0
  99. data/rbi/prism.rbi +44 -7745
  100. data/sig/prism/compiler.rbs +9 -0
  101. data/sig/prism/dispatcher.rbs +16 -0
  102. data/sig/prism/dot_visitor.rbs +6 -0
  103. data/sig/prism/dsl.rbs +351 -0
  104. data/sig/prism/inspect_visitor.rbs +22 -0
  105. data/sig/prism/lex_compat.rbs +10 -0
  106. data/sig/prism/mutation_compiler.rbs +159 -0
  107. data/sig/prism/node.rbs +3614 -0
  108. data/sig/prism/node_ext.rbs +82 -0
  109. data/sig/prism/pack.rbs +43 -0
  110. data/sig/prism/parse_result.rbs +192 -0
  111. data/sig/prism/pattern.rbs +13 -0
  112. data/sig/prism/reflection.rbs +50 -0
  113. data/sig/prism/relocation.rbs +185 -0
  114. data/sig/prism/serialize.rbs +8 -0
  115. data/sig/prism/string_query.rbs +11 -0
  116. data/sig/prism/visitor.rbs +169 -0
  117. data/sig/prism.rbs +248 -4767
  118. data/src/diagnostic.c +672 -230
  119. data/src/encoding.c +211 -108
  120. data/src/node.c +7541 -1653
  121. data/src/options.c +135 -20
  122. data/src/pack.c +33 -17
  123. data/src/prettyprint.c +1543 -1485
  124. data/src/prism.c +7813 -3050
  125. data/src/regexp.c +225 -73
  126. data/src/serialize.c +101 -77
  127. data/src/static_literals.c +617 -0
  128. data/src/token_type.c +14 -13
  129. data/src/util/pm_buffer.c +187 -20
  130. data/src/util/pm_char.c +5 -5
  131. data/src/util/pm_constant_pool.c +39 -19
  132. data/src/util/pm_integer.c +670 -0
  133. data/src/util/pm_list.c +1 -1
  134. data/src/util/pm_newline_list.c +43 -5
  135. data/src/util/pm_string.c +213 -33
  136. data/src/util/pm_strncasecmp.c +13 -1
  137. data/src/util/pm_strpbrk.c +32 -6
  138. metadata +55 -19
  139. data/docs/ripper.md +0 -36
  140. data/include/prism/util/pm_state_stack.h +0 -42
  141. data/include/prism/util/pm_string_list.h +0 -44
  142. data/lib/prism/debug.rb +0 -206
  143. data/lib/prism/node_inspector.rb +0 -68
  144. data/lib/prism/translation/parser/rubocop.rb +0 -45
  145. data/rbi/prism_static.rbi +0 -207
  146. data/sig/prism_static.rbs +0 -201
  147. data/src/util/pm_state_stack.c +0 -25
  148. data/src/util/pm_string_list.c +0 -28
data/prism.gemspec CHANGED
@@ -13,12 +13,13 @@ Gem::Specification.new do |spec|
13
13
  spec.homepage = "https://github.com/jruby/jruby-prism"
14
14
  spec.license = "MIT"
15
15
 
16
- spec.required_ruby_version = ">= 2.7.0"
16
+ spec.required_ruby_version = ">= 3.4.0"
17
17
 
18
18
  spec.requirements << "jar org.jruby, jruby-prism, #{Prism::VERSION}, :scope => :runtime"
19
19
 
20
20
  spec.require_paths = ["lib"]
21
21
  spec.files = [
22
+ "BSDmakefile",
22
23
  "CHANGELOG.md",
23
24
  "CODE_OF_CONDUCT.md",
24
25
  "CONTRIBUTING.md",
@@ -39,7 +40,8 @@ Gem::Specification.new do |spec|
39
40
  "docs/parser_translation.md",
40
41
  "docs/parsing_rules.md",
41
42
  "docs/releasing.md",
42
- "docs/ripper.md",
43
+ "docs/relocation.md",
44
+ "docs/ripper_translation.md",
43
45
  "docs/ruby_api.md",
44
46
  "docs/ruby_parser_translation.md",
45
47
  "docs/serialization.md",
@@ -59,74 +61,112 @@ Gem::Specification.new do |spec|
59
61
  "include/prism/parser.h",
60
62
  "include/prism/prettyprint.h",
61
63
  "include/prism/regexp.h",
64
+ "include/prism/static_literals.h",
62
65
  "include/prism/util/pm_buffer.h",
63
66
  "include/prism/util/pm_char.h",
64
67
  "include/prism/util/pm_constant_pool.h",
68
+ "include/prism/util/pm_integer.h",
65
69
  "include/prism/util/pm_list.h",
66
70
  "include/prism/util/pm_memchr.h",
67
71
  "include/prism/util/pm_newline_list.h",
68
- "include/prism/util/pm_state_stack.h",
69
72
  "include/prism/util/pm_strncasecmp.h",
70
73
  "include/prism/util/pm_string.h",
71
- "include/prism/util/pm_string_list.h",
72
74
  "include/prism/util/pm_strpbrk.h",
73
75
  "include/prism/version.h",
74
76
  "lib/prism.rb",
75
77
  "lib/prism/compiler.rb",
76
- "lib/prism/debug.rb",
77
78
  "lib/prism/desugar_compiler.rb",
78
79
  "lib/prism/dispatcher.rb",
79
80
  "lib/prism/dot_visitor.rb",
80
81
  "lib/prism/dsl.rb",
81
82
  "lib/prism/ffi.rb",
83
+ "lib/prism/inspect_visitor.rb",
82
84
  "lib/prism/lex_compat.rb",
83
85
  "lib/prism/mutation_compiler.rb",
84
86
  "lib/prism/node_ext.rb",
85
- "lib/prism/node_inspector.rb",
86
87
  "lib/prism/node.rb",
87
88
  "lib/prism/pack.rb",
88
89
  "lib/prism/parse_result.rb",
89
90
  "lib/prism/parse_result/comments.rb",
91
+ "lib/prism/parse_result/errors.rb",
90
92
  "lib/prism/parse_result/newlines.rb",
91
93
  "lib/prism/pattern.rb",
94
+ "lib/prism/polyfill/append_as_bytes.rb",
95
+ "lib/prism/polyfill/byteindex.rb",
96
+ "lib/prism/polyfill/unpack1.rb",
97
+ "lib/prism/reflection.rb",
98
+ "lib/prism/relocation.rb",
92
99
  "lib/prism/serialize.rb",
100
+ "lib/prism/string_query.rb",
93
101
  "lib/prism/translation.rb",
94
102
  "lib/prism/translation/parser.rb",
95
103
  "lib/prism/translation/parser33.rb",
96
104
  "lib/prism/translation/parser34.rb",
105
+ "lib/prism/translation/parser35.rb",
106
+ "lib/prism/translation/parser/builder.rb",
97
107
  "lib/prism/translation/parser/compiler.rb",
98
108
  "lib/prism/translation/parser/lexer.rb",
99
- "lib/prism/translation/parser/rubocop.rb",
100
109
  "lib/prism/translation/ripper.rb",
110
+ "lib/prism/translation/ripper/sexp.rb",
111
+ "lib/prism/translation/ripper/shim.rb",
101
112
  "lib/prism/translation/ruby_parser.rb",
113
+ "lib/prism/version.rb",
102
114
  "lib/prism/visitor.rb",
115
+ "prism.gemspec",
116
+ "rbi/prism.rbi",
117
+ "rbi/prism/compiler.rbi",
118
+ "rbi/prism/dsl.rbi",
119
+ "rbi/prism/inspect_visitor.rbi",
120
+ "rbi/prism/node_ext.rbi",
121
+ "rbi/prism/node.rbi",
122
+ "rbi/prism/parse_result.rbi",
123
+ "rbi/prism/reflection.rbi",
124
+ "rbi/prism/string_query.rbi",
125
+ "rbi/prism/translation/parser.rbi",
126
+ "rbi/prism/translation/parser33.rbi",
127
+ "rbi/prism/translation/parser34.rbi",
128
+ "rbi/prism/translation/parser35.rbi",
129
+ "rbi/prism/translation/ripper.rbi",
130
+ "rbi/prism/visitor.rbi",
131
+ "sig/prism.rbs",
132
+ "sig/prism/compiler.rbs",
133
+ "sig/prism/dispatcher.rbs",
134
+ "sig/prism/dot_visitor.rbs",
135
+ "sig/prism/dsl.rbs",
136
+ "sig/prism/inspect_visitor.rbs",
137
+ "sig/prism/lex_compat.rbs",
138
+ "sig/prism/mutation_compiler.rbs",
139
+ "sig/prism/node_ext.rbs",
140
+ "sig/prism/node.rbs",
141
+ "sig/prism/pack.rbs",
142
+ "sig/prism/parse_result.rbs",
143
+ "sig/prism/pattern.rbs",
144
+ "sig/prism/reflection.rbs",
145
+ "sig/prism/relocation.rbs",
146
+ "sig/prism/serialize.rbs",
147
+ "sig/prism/string_query.rbs",
148
+ "sig/prism/visitor.rbs",
103
149
  "src/diagnostic.c",
104
150
  "src/encoding.c",
105
151
  "src/node.c",
152
+ "src/options.c",
106
153
  "src/pack.c",
107
154
  "src/prettyprint.c",
155
+ "src/prism.c",
108
156
  "src/regexp.c",
109
157
  "src/serialize.c",
158
+ "src/static_literals.c",
110
159
  "src/token_type.c",
111
160
  "src/util/pm_buffer.c",
112
161
  "src/util/pm_char.c",
113
162
  "src/util/pm_constant_pool.c",
163
+ "src/util/pm_integer.c",
114
164
  "src/util/pm_list.c",
115
165
  "src/util/pm_memchr.c",
116
166
  "src/util/pm_newline_list.c",
117
- "src/util/pm_state_stack.c",
118
167
  "src/util/pm_string.c",
119
- "src/util/pm_string_list.c",
120
168
  "src/util/pm_strncasecmp.c",
121
169
  "src/util/pm_strpbrk.c",
122
- "src/options.c",
123
- "src/prism.c",
124
- "prism.gemspec",
125
- "sig/prism.rbs",
126
- "sig/prism_static.rbs",
127
- "rbi/prism.rbi",
128
- "rbi/prism_static.rbi",
129
- "lib/prism/version.rb",
130
170
  "jruby-prism.jar"
131
171
  ]
132
172
 
@@ -0,0 +1,12 @@
1
+ # typed: strict
2
+
3
+ class Prism::Compiler
4
+ sig { params(node: T.nilable(Prism::Node)).returns(T.untyped) }
5
+ def visit(node); end
6
+
7
+ sig { params(nodes: T::Array[T.nilable(Prism::Node)]).returns(T::Array[T.untyped]) }
8
+ def visit_all(nodes); end
9
+
10
+ sig { params(node: Prism::Node).returns(T::Array[T.untyped]) }
11
+ def visit_child_nodes(node); end
12
+ end