Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YARP errors on %r#pound# in isolation #1128

Closed
eregon opened this issue Jul 5, 2023 · 0 comments · Fixed by #1177
Closed

YARP errors on %r#pound# in isolation #1128

eregon opened this issue Jul 5, 2023 · 0 comments · Fixed by #1177

Comments

@eregon
Copy link
Member

eregon commented Jul 5, 2023

$ bin/parse -e '%r#pound#' 
#<YARP::ParseResult:0x00007f768d813f20
 @comments=[],
 @errors=
  [#<YARP::ParseError:0x00007f768d6da910
    @location=(9...18),
    @message="Expected a closing delimiter for a regular expression.">],
 @value=
  ProgramNode(0...9)(
    [],
    StatementsNode(0...9)(
      [InterpolatedRegularExpressionNode(0...9)((0...3), [StringNode(3...9)(nil, (3...9), nil, "pound#")], (9...9), 0)]
    )
  ),
 @warnings=[]>

CRuby:

$ ruby --dump=insns -e '%r#pound#'
== disasm: #<ISeq:<main>@-e:1 (1,0)-(1,9)> (catch: FALSE)
0000 putobject                              /pound/                   (   1)[Li]
0002 leave

As a note YARP works fine with a newline after or a flag (e.g. i)

@eregon eregon changed the title YARP fails to parse %r#pound# in isolation YARP errors on %r#pound# in isolation Jul 5, 2023
eregon added a commit to eregon/yarp that referenced this issue Jul 5, 2023
eregon added a commit to eregon/yarp that referenced this issue Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant