prism 0.27.0 → 0.28.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 +26 -1
- data/config.yml +39 -27
- data/docs/configuration.md +1 -0
- data/ext/prism/api_node.c +814 -807
- data/ext/prism/extension.c +5 -3
- data/ext/prism/extension.h +1 -1
- data/include/prism/ast.h +38 -16
- data/include/prism/diagnostic.h +12 -5
- data/include/prism/options.h +2 -2
- data/include/prism/parser.h +10 -0
- data/include/prism/static_literals.h +8 -6
- data/include/prism/version.h +2 -2
- data/lib/prism/dot_visitor.rb +22 -6
- data/lib/prism/dsl.rb +8 -8
- data/lib/prism/ffi.rb +3 -3
- data/lib/prism/inspect_visitor.rb +2156 -0
- data/lib/prism/lex_compat.rb +1 -1
- data/lib/prism/mutation_compiler.rb +2 -2
- data/lib/prism/node.rb +589 -1715
- data/lib/prism/node_ext.rb +34 -5
- data/lib/prism/parse_result.rb +78 -0
- data/lib/prism/pattern.rb +12 -6
- data/lib/prism/polyfill/byteindex.rb +13 -0
- data/lib/prism/polyfill/unpack1.rb +14 -0
- data/lib/prism/reflection.rb +13 -13
- data/lib/prism/serialize.rb +21 -14
- data/lib/prism/translation/parser/compiler.rb +2 -2
- data/lib/prism/translation/parser.rb +6 -6
- data/lib/prism/translation/ripper.rb +13 -9
- data/lib/prism/translation/ruby_parser.rb +4 -4
- data/lib/prism.rb +2 -1
- data/prism.gemspec +36 -38
- data/rbi/prism/compiler.rbi +3 -5
- data/rbi/prism/inspect_visitor.rbi +12 -0
- data/rbi/prism/node.rbi +354 -319
- data/rbi/prism/parse_result.rbi +23 -0
- data/rbi/prism/translation/ripper.rbi +1 -11
- data/sig/prism/dsl.rbs +3 -3
- data/sig/prism/inspect_visitor.rbs +22 -0
- data/sig/prism/node.rbs +64 -47
- data/sig/prism/parse_result.rbs +12 -0
- data/src/diagnostic.c +38 -24
- data/src/node.c +41 -16
- data/src/options.c +2 -2
- data/src/prettyprint.c +61 -18
- data/src/prism.c +607 -185
- data/src/serialize.c +5 -2
- data/src/static_literals.c +120 -34
- data/src/token_type.c +4 -4
- metadata +7 -9
- data/lib/prism/node_inspector.rb +0 -68
- data/lib/prism/polyfill/string.rb +0 -12
- data/rbi/prism/desugar_compiler.rbi +0 -5
- data/rbi/prism/mutation_compiler.rbi +0 -5
- data/rbi/prism/translation/parser/compiler.rbi +0 -13
- data/rbi/prism/translation/ripper/ripper_compiler.rbi +0 -5
- data/rbi/prism/translation/ruby_parser.rbi +0 -11
data/lib/prism/lex_compat.rb
CHANGED
@@ -861,7 +861,7 @@ module Prism
|
|
861
861
|
# We sort by location to compare against Ripper's output
|
862
862
|
tokens.sort_by!(&:location)
|
863
863
|
|
864
|
-
Result.new(tokens, result.comments, result.magic_comments, result.data_loc, result.errors, result.warnings, Source.
|
864
|
+
Result.new(tokens, result.comments, result.magic_comments, result.data_loc, result.errors, result.warnings, Source.for(source))
|
865
865
|
end
|
866
866
|
end
|
867
867
|
|
@@ -193,7 +193,7 @@ module Prism
|
|
193
193
|
|
194
194
|
# Copy a ConstantPathNode node
|
195
195
|
def visit_constant_path_node(node)
|
196
|
-
node.copy(parent: visit(node.parent)
|
196
|
+
node.copy(parent: visit(node.parent))
|
197
197
|
end
|
198
198
|
|
199
199
|
# Copy a ConstantPathOperatorWriteNode node
|
@@ -208,7 +208,7 @@ module Prism
|
|
208
208
|
|
209
209
|
# Copy a ConstantPathTargetNode node
|
210
210
|
def visit_constant_path_target_node(node)
|
211
|
-
node.copy(parent: visit(node.parent)
|
211
|
+
node.copy(parent: visit(node.parent))
|
212
212
|
end
|
213
213
|
|
214
214
|
# Copy a ConstantPathWriteNode node
|