diff options
Diffstat (limited to 'lib/prism')
-rw-r--r-- | lib/prism/ffi.rb | 10 | ||||
-rw-r--r-- | lib/prism/prism.gemspec | 3 |
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/prism/ffi.rb b/lib/prism/ffi.rb index 0a064a5c94..1fd053f902 100644 --- a/lib/prism/ffi.rb +++ b/lib/prism/ffi.rb @@ -286,12 +286,22 @@ module Prism LibRubyParser::PrismString.with_string(code) { |string| parse_file_success_common(string, options) } end + # Mirror the Prism.parse_failure? API by using the serialization API. + def parse_failure?(code, **options) + !parse_success?(code, **options) + end + # Mirror the Prism.parse_file_success? API by using the serialization API. def parse_file_success?(filepath, **options) options[:filepath] = filepath LibRubyParser::PrismString.with_file(filepath) { |string| parse_file_success_common(string, options) } end + # Mirror the Prism.parse_file_failure? API by using the serialization API. + def parse_file_failure?(filepath, **options) + !parse_file_success?(filepath, **options) + end + private def dump_common(string, options) # :nodoc: diff --git a/lib/prism/prism.gemspec b/lib/prism/prism.gemspec index f4be1b36bb..c0f3db5594 100644 --- a/lib/prism/prism.gemspec +++ b/lib/prism/prism.gemspec @@ -87,6 +87,7 @@ Gem::Specification.new do |spec| "lib/prism/parse_result/newlines.rb", "lib/prism/pattern.rb", "lib/prism/polyfill/string.rb", + "lib/prism/reflection.rb", "lib/prism/serialize.rb", "lib/prism/translation.rb", "lib/prism/translation/parser.rb", @@ -134,6 +135,7 @@ Gem::Specification.new do |spec| "sig/prism/pack.rbs", "sig/prism/parse_result.rbs", "sig/prism/pattern.rbs", + "sig/prism/reflection.rbs", "sig/prism/serialize.rbs", "sig/prism/visitor.rbs", "rbi/prism.rbi", @@ -143,6 +145,7 @@ Gem::Specification.new do |spec| "rbi/prism/node_ext.rbi", "rbi/prism/node.rbi", "rbi/prism/parse_result.rbi", + "rbi/prism/reflection.rbi", "rbi/prism/translation/parser/compiler.rbi", "rbi/prism/translation/ripper.rbi", "rbi/prism/translation/ripper/ripper_compiler.rbi", |