Incompatibility in syntax error when blank heredoc delimiters
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
Research direction
Start by reproducing the examples in example.rb and compare Ruby 3.3's syntax error with ruby-parse --33 example.rb. Check the parser's handling of <<~'', <<'', and <<-''; done means these blank heredoc delimiters are rejected consistently with Ruby.
Written by the indexing model from the issue text.
Description
There is an incompatibility in syntax error between Parser gem and Ruby:
$ cat example.rb
<<~''
Expected
<<~'' has been a syntax error since at least Ruby 2.0:
$ ruby -v example.rb
ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-darwin13.0.2]
example.rb:1: syntax error, unexpected <<
<<~''
^
The same goes for Ruby 3.3:
$ ruby -v example.rb
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-darwin22]
example.rb:1: warning: possibly useless use of a literal in void context
example.rb: --> /tmp/h.rb
could not find a terminator for the heredoc
> 1 <<~''
Actual
Although the Parser gem is able to parse it, this is likely an unexpected behavior:
$ ruby-parse --33 example.rb
(dstr)
The same goes for <<'' and <<-''.
- Dominant language
- Yacc
- Stars
- 1.6k
- Forks
- 205
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from whitequark/parser
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
whitequark/parser#1084 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
whitequark/parser#1075 · 5 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
whitequark/parser#1063 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 50/100
whitequark/parser#1059 ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
whitequark/parser#1046 · 36 comments · 1 reaction ·
All issues in whitequark/parser
Similar issues
-
mlir
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
llvm/llvm-project#224908 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
area-CodeGen-coreclr untriaged
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
secondlife/sl-vscode-plugin#147 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
objectionary/phie#149 ·