diff options
author | Aaron Patterson <tenderlove@ruby-lang.org> | 2022-09-15 17:48:52 -0700 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-09-20 00:44:30 +0900 |
commit | 26135312f61014967ef223dd16ad6577ebd9c5d8 (patch) | |
tree | 3672d96f9524c3f8d9b249fd840b8e00e1edc36d /ext/psych/lib | |
parent | 12889fad4100569c212c9813243db5ec5380b5fb (diff) |
[ruby/psych] Convert some of Parser#parse to Ruby
This commit just converts some of the parse method to Ruby
https://github.com/ruby/psych/commit/bca7d2c549
Diffstat (limited to 'ext/psych/lib')
-rw-r--r-- | ext/psych/lib/psych/parser.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/psych/lib/psych/parser.rb b/ext/psych/lib/psych/parser.rb index 39bc8289be..2181c730e5 100644 --- a/ext/psych/lib/psych/parser.rb +++ b/ext/psych/lib/psych/parser.rb @@ -48,5 +48,18 @@ module Psych @handler = handler @external_encoding = ANY end + + ### + # call-seq: + # parser.parse(yaml) + # + # Parse the YAML document contained in +yaml+. Events will be called on + # the handler set on the parser instance. + # + # See Psych::Parser and Psych::Parser#handler + + def parse yaml, path = yaml.respond_to?(:path) ? yaml.path : "<unknown>" + _native_parse @handler, yaml, path + end end end |