Failure to parse escaped single quote in a string

Issue #350 invalid
Former user created an issue

See https://github.com/jruby/jruby/issues/2199

Here's the example run from JRuby IRB:

irb(main):002:0> YAML.load('"foo\\\'bar"')
Psych::SyntaxError: (<unknown>): found unknown escape character '(39) while scanning a double-quoted scalar at line 1 column 6
    from org/jruby/ext/psych/PsychParser.java:227:in `parse'

This is Ruby code, but it should be simple enough to reproduce in SnakeYAML directly. The error message is from SnakeYAML.

Comments (3)

  1. Andrey Somov

    What is the expected result ? Why does Ruby expect

     \\\
    

    to be ignored ? Is it a way to include single quote in the result ?

  2. Log in to comment