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

Return line no in SyntaxError when parsing Regexp #4056

Closed
cburgmer opened this issue Aug 9, 2016 · 0 comments
Closed

Return line no in SyntaxError when parsing Regexp #4056

cburgmer opened this issue Aug 9, 2016 · 0 comments
Labels
Milestone

Comments

@cburgmer
Copy link

@cburgmer cburgmer commented Aug 9, 2016

Expected Behavior

Return line number the way Ruby does:

$ ruby --version
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin13]
$ echo "/1(/" | ruby
-:1: end pattern with unmatched parenthesis: /1(/

Actual Behavior

Does not follow the general SyntaxError fashion with a line number for Regex parse errors:

$ jruby.exe --version
jruby 9.1.2.0 (2.3.0) 2016-05-26 7357c8f Java HotSpot(TM) 64-Bit Server VM 25.51-b03 on 1.8.0_51-b16 [mswin32-x86_64]
$ echo "/1(/" | jruby.exe
SyntaxError: (RegexpError) end pattern with unmatched parenthesis: /1(/

Compare to

$ echo "(" | jruby.exe
SyntaxError: -:1: syntax error, unexpected end-of-file

Reasoning

We parse user provided Ruby code via eval and extract line numbers from errors to report back.

@enebo enebo added this to the JRuby 9.1.3.0 milestone Aug 9, 2016
@enebo enebo added the parser label Aug 9, 2016
@enebo enebo closed this in 41e4b34 Aug 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.