module Psych
def self.parse yaml, filename: nil
end
ex.message # => "(file.txt): found character that cannot start any token"
ex.file # => 'file.txt'
rescue Psych::SyntaxError => ex
Psych.parse("--- `", filename: "file.txt")
begin
Psych.parse("---\n - a\n - b") # => #
Example:
Raises a Psych::SyntaxError when a YAML syntax error is detected.
raised.
+filename+ is used in the exception message if a Psych::SyntaxError is
Parse a YAML string in +yaml+. Returns the Psych::Nodes::Document.
##
def self.parse yaml, filename: nil parse_stream(yaml, filename: filename) do |node| return node end false end