Skip to content

Commit ccb73c3

Browse files
edmundmillerclaude
andcommitted
fix: preserve comment nodes at statement boundaries
The scanner previously folded comments into the terminator token, which removed line_comment/block_comment nodes from the tree and broke comment-based lint rules (TODO detection missed TODOs in script sections). Now the scanner returns false when a comment follows the newline run, so the comment is lexed as an ordinary extra and the terminator is emitted after it — one terminator between statements, and the comment survives as a node. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XaTroL9k3feq3MTAptE9bD
1 parent e8ae7ee commit ccb73c3

5 files changed

Lines changed: 35700 additions & 35715 deletions

File tree

grammar.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ module.exports = grammar({
198198
$.output_declaration,
199199
$.when_declaration
200200
)),
201-
repeat($.script_declaration),
201+
repeat(seq($.script_declaration, optional($._terminator))),
202202
'}'
203203
),
204204

@@ -296,8 +296,7 @@ module.exports = grammar({
296296
optional($._terminator),
297297
repeat(seq($.script_statement, $._terminator)), // Groovy prelude, each terminated
298298
// exec: sections are Groovy-only; script/shell/stub end in a string.
299-
optional($.script_content),
300-
optional($._terminator)
299+
optional($.script_content)
301300
)),
302301

303302
// Groovy statements allowed before the script string.

lib/macos-arm64/libnextflow.dylib

-16.1 KB
Binary file not shown.

src/grammar.json

Lines changed: 19 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)