Skip to content

fix(tcl) highlight Tcl 8.6 and 9.0 commands and namespaced keywords - #4562

Open
Gaalbu wants to merge 1 commit into
highlightjs:mainfrom
Gaalbu:fix/tcl-86-90-keywords
Open

Gaalbu wants to merge 1 commit into
highlightjs:mainfrom
Gaalbu:fix/tcl-86-90-keywords

Conversation

@Gaalbu

@Gaalbu Gaalbu commented Oct 15, 2026

Copy link
Copy Markdown

Resolves #4560

Changes

The Tcl grammar keyword list stopped at Tcl 8.5, so 8.6 and 9.0 commands such as try, throw, tailcall, lmap, lpop, and the TclOO commands were not highlighted. Namespaced keywords never matched either, because the default keyword pattern is \w+. That already affected pkg::create and platform::shell, and it blocks oo::class, tcl::prefix, and tcl::process.

This adds the commands listed in the issue, checked against the Tcl 9.0.4 command index. The keyword pattern is /(::)?[a-zA-Z_]\w*(::\w+)*/, so a namespaced command matches as one word. Variables still match first, so $ns::var is unchanged. Short generic names (my, self, next, link, const, try) use relevance 0 so they do not skew auto-detection. configure and property are left out, as the issue asked. A markup test covers the new commands, including namespaced forms.

Checklist

  • Added markup tests, or they don't apply here because...
  • I have read and followed our AI-assisted contributions policy (human review, no slop)

Assisted-by: Grok 4.7 (high)

Namespaced keywords never matched the default \w+ pattern, so commands
such as oo::class were not highlighted.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(tcl) Missing Tcl 8.6/9.0 commands and namespaced keywords never match

1 participant