Skip to content
  • Kevin Newton's avatar
    3eb42054
    [ruby/prism] Pass Unicode escapes on to onigmo · 3eb42054
    Kevin Newton authored
    When we encounter an invalid unicode escape within a regular
    expression, we now pass that error on to Onigmo as if it didn't
    exist in the parser (which matches the upstream parser's behavior).
    
    We do this because there are tests that specify that you are
    allowed to have invalid Unicode escapes if they are within the
    context of a regular expression comment for a regular expression
    in extended mode. That looks like:
    
        /# \u /x
    
    Note that this _only_ applies to Unicode escapes (as opposed to
    applying to hex or meta/control escapes as well). Importantly it
    also only applies if the regular expression is terminated. An
    unterminated regular expression will still get error handling done
    in the parser. That would look like:
    
        /# \u
    
    that would result in the same error handling we have today.
    
    https://github.com/ruby/prism/commit/fb98034806
    3eb42054
    [ruby/prism] Pass Unicode escapes on to onigmo
    Kevin Newton authored
    When we encounter an invalid unicode escape within a regular
    expression, we now pass that error on to Onigmo as if it didn't
    exist in the parser (which matches the upstream parser's behavior).
    
    We do this because there are tests that specify that you are
    allowed to have invalid Unicode escapes if they are within the
    context of a regular expression comment for a regular expression
    in extended mode. That looks like:
    
        /# \u /x
    
    Note that this _only_ applies to Unicode escapes (as opposed to
    applying to hex or meta/control escapes as well). Importantly it
    also only applies if the regular expression is terminated. An
    unterminated regular expression will still get error handling done
    in the parser. That would look like:
    
        /# \u
    
    that would result in the same error handling we have today.
    
    https://github.com/ruby/prism/commit/fb98034806
Loading