From: "ccmywish (Aoran Zeng) via ruby-core" Date: 2023-05-24T09:34:37+00:00 Subject: [ruby-core:113619] [Ruby master Bug#18738] IRB can't recognize heredoc after words Issue #18738 has been updated by ccmywish (Aoran Zeng). This has been fixed. Please close it. ---------------------------------------- Bug #18738: IRB can't recognize heredoc after words https://bugs.ruby-lang.org/issues/18738#change-103263 * Author: ccmywish (Aoran Zeng) * Status: Open * Priority: Normal * ruby -v: ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-linux] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- My irb_info ```ruby irb(main):001:0> irb_info => Ruby version: 3.1.1 IRB version: irb 1.4.1 (2021-12-25) InputMethod: ReidlineInputMethod with Reline 0.3.1 RUBY_PLATFORM: x86_64-linux LANG env: en_US.UTF-8 East Asian Ambiguous Width: 1 ``` See the code below please. ```ruby a, b = < $$ = nterm string_contents (1.12-1.12: ) Stack now 0 2 82 341 580 60 Entering state 301 Reading a token: Next token is token "literal content" (1.12-1.12: "thank you\nruby devs\n") Shifting token "literal content" (1.12-1.12: "thank you\nruby devs\n") Entering state 507 Reducing stack by rule 619 (line 4926): $1 = token "literal content" (1.12-1.12: "thank you\nruby devs\n") -> $$ = nterm string_content (1.12-1.12: ) Stack now 0 2 82 341 580 60 301 Entering state 511 Reducing stack by rule 614 (line 4840): $1 = nterm string_contents (1.12-1.12: ) $2 = nterm string_content (1.12-1.12: ) -> $$ = nterm string_contents (1.12-1.12: ) Stack now 0 2 82 341 580 60 Entering state 301 Reading a token: lex_state: BEG -> END at line 7453 Next token is token "terminator" (1.12-1.12: ) Shifting token "terminator" (1.12-1.12: ) Entering state 512 Reducing stack by rule 596 (line 4693): $1 = token "string literal" (1.7-1.12: ) $2 = nterm string_contents (1.12-1.12: ) $3 = token "terminator" (1.12-1.12: ) -> $$ = nterm string1 (1.7-1.12: ) Stack now 0 2 82 341 580 Entering state 109 Reducing stack by rule 594 (line 4683): $1 = nterm string1 (1.7-1.12: ) -> $$ = nterm string (1.7-1.12: ) Stack now 0 2 82 341 580 Entering state 108 Reading a token: lex_state: END -> BEG|LABEL at line 9814 Next token is token ',' (1.12-1.13: ) ``` -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/