diff options
author | Kevin Newton <[email protected]> | 2023-12-01 12:22:01 -0500 |
---|---|---|
committer | git <[email protected]> | 2023-12-01 20:53:34 +0000 |
commit | 492c82cb417a92d1941f10b52e77ec0c4b2cc8a6 () | |
tree | 3358d814456f46c6adb80921e968d1fb5258ce04 /lib/prism/ffi.rb | |
parent | b77551adee831302f22dc7d9fdccd597923511c4 (diff) |
[ruby/prism] Prism.parse_success?(source)
A lot of tools use Ripper/RubyVM::AbstractSyntaxTree to determine if a source is valid. These tools both create an AST instead of providing an API that will return a boolean only. This new API only creates the C structs, but doesn't bother reifying them into Ruby/the serialization API. Instead it only returns true/false, which is significantly more efficient. https://.com/ruby/prism/commit/7014740118
-rw-r--r-- | lib/prism/ffi.rb | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -72,7 +72,8 @@ module Prism "pm_serialize_parse", "pm_serialize_parse_comments", "pm_serialize_lex", - "pm_serialize_parse_lex" ) load_exported_functions_from( @@ -268,6 +269,18 @@ module Prism end end private # Convert the given options into a serialized options string. |