Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fix an error when using heredoc with non-word delimiters
I've found #986 regression in the following RuboCop CI matrix: https://github.com/rubocop/rubocop/actions/runs/7437077900/job/20234293932?pr=12598 So, #986 was not a sufficient fix. This PR fixes an error when using heredoc with non-word delimiters: ```ruby <<~'+' foo + ``` The following repro test have been newly added: ```console $ bundle exec ruby -Itest test/test_lexer.rb (snip) 1) Error: TestLexer#test_heredoc_plus_character: RegexpError: target of repeat operator is not specified: /+\z/ /Users/koic/src/github.com/whitequark/parser/lib/parser/lexer/literal.rb:250:in `delimiter?' /Users/koic/src/github.com/whitequark/parser/lib/parser/lexer/literal.rb:138:in `nest_and_try_closing' /Users/koic/src/github.com/whitequark/parser/lib/parser/lexer-strings.rb:4165:in `advance' /Users/koic/src/github.com/whitequark/parser/lib/parser/lexer-F1.rb:11369:in `advance' test/test_lexer.rb:81:in `assert_scanned' test/test_lexer.rb:1001:in `test_heredoc_plus_character' ```
- Loading branch information