Skip to content

Commit c2fd751

Browse files
edmundmillerclaude
andcommitted
feat: allow " inside triple-quoted GStrings
76.1% -> 77.2% parse rate. interpolated_triple_quoted_string used string_content (/[^$"\\]+/), which stopped at any double quote, so a YAML-style versions block inside a script string broke: """ "${task.process}": tool: ... """ New triple_string_content token only stops at the closing """, $ and \\, so lone/doubled quotes are ordinary content. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XaTroL9k3feq3MTAptE9bD
1 parent ccb73c3 commit c2fd751

9 files changed

Lines changed: 31043 additions & 30935 deletions

File tree

ROADMAP.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ NEXTFLOW_TS_LIB=lib/<platform>/libnextflow.<ext> \
2424
| 2026-07-02 | 0% (effectively) | before directive/expression support |
2525
| 2026-07-02 | 50.0% (1035/2070) | after PR #22 (directives, ternary, …) |
2626
| 2026-07-02 | 66.4% (1374/2070) | Phase 1 lexer items (floats, escapes, …) |
27-
| 2026-07-03 | **76.1% (1575/2070)** | newline-terminator external scanner |
27+
| 2026-07-03 | 76.1% (1575/2070) | newline-terminator external scanner |
28+
| 2026-07-03 | **77.2% (1598/2070)** | " inside triple-quoted GStrings |
2829

2930
A file counts only if it has **zero** ERROR nodes — that is the bar
3031
nf-core/tools uses to trust structural matching over regex fallback

grammar.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,13 +903,17 @@ module.exports = grammar({
903903
interpolated_triple_quoted_string: $ => seq(
904904
'"""',
905905
repeat(choice(
906-
$.string_content,
906+
$.triple_string_content,
907907
$.escape_sequence,
908908
$.interpolation
909909
)),
910910
'"""'
911911
),
912912

913+
// Content inside a triple-quoted GString: any run avoiding $ (interpolation),
914+
// backslash (escape) and the closing """, but a lone or doubled " is fine.
915+
triple_string_content: $ => token(prec(-1, /([^$"\\]|"[^"$\\]|""[^"$\\])+/)),
916+
913917
// Plain triple-quoted strings (heredoc without interpolation)
914918
// Single quotes: '''literal text''' (never interpolated)
915919
// Double quotes: """literal text""" (only if no $ present)

lib/macos-arm64/libnextflow.dylib

16.1 KB
Binary file not shown.

src/grammar.json

Lines changed: 12 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/node-types.json

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)