You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Comment after a heredoc-word: echo x <<EOF>#comment treats the # tail as heredoc/word text (GNU: syntax error near newline) #305
Found by wt11/lexmix during #304 (no comsub needed to reproduce). After the heredoc word, GNU's tokenizer reports a syntax error near the newline; we swallow the # tail as heredoc-trailer/word text. Adjacent to the just-landed <<< operator consumption — likely the same heredoc-word collection not enforcing the token boundary. GNU anchor: parse.y:3630-3643 token-boundary rules + the heredoc word grammar (only the next NEWLINE may follow the delimiter word).
Fixed by wt12/heredocfix (71866dcd, master 6e8aebe): is_redirect_target_token still admitted TokenKind::HereDocBody as a redirect operand (a leftover from 6747ed3), so the > after <<EOF opened the heredoc first BODY line as a filename. Class-level fix in three places: the admission removed (covers all redirect operator positions at once); missing_redirect_target_node gained the HereDocBody-to-newline branch with the physical close line carried on the token (per GNU parse.y:5305/5688 word ends at meta chars, :3648-3654 newline to yacc only after gather_here_documents:3651, line numbering make_cmd.c:512/580, error shape parse.y:6833/6814); compound-command tails route dangling redirect operators to the same diagnostic.
Verification: 41-case matrix byte-identical to WSL GNU Bash 5.3.0; 14 new regressions; heredoc suite 0 diff both sides; cli_tests A/B vs base identical 19 pre-existing failures, zero new. Leftovers filed separately: in-comsub heredoc delimiter swallow (lexmix family) and eval rc=2 continuation.
Activity
fix(#305): heredoc-word `#` tail - dangling redirect after `<<WORD` i…
caomengxuan666 commentedon Sep 29, 2026
Fixed by wt12/heredocfix (71866dcd, master 6e8aebe): is_redirect_target_token still admitted TokenKind::HereDocBody as a redirect operand (a leftover from 6747ed3), so the > after <<EOF opened the heredoc first BODY line as a filename. Class-level fix in three places: the admission removed (covers all redirect operator positions at once); missing_redirect_target_node gained the HereDocBody-to-newline branch with the physical close line carried on the token (per GNU parse.y:5305/5688 word ends at meta chars, :3648-3654 newline to yacc only after gather_here_documents:3651, line numbering make_cmd.c:512/580, error shape parse.y:6833/6814); compound-command tails route dangling redirect operators to the same diagnostic.
Verification: 41-case matrix byte-identical to WSL GNU Bash 5.3.0; 14 new regressions; heredoc suite 0 diff both sides; cli_tests A/B vs base identical 19 pre-existing failures, zero new. Leftovers filed separately: in-comsub heredoc delimiter swallow (lexmix family) and eval rc=2 continuation.
fix(#305 lexmix): in-comsub heredoc delimiter ends at shell metachars