Skip to content

Colour match, guard and enum as Visual X# keywords - #19

Merged
Leitwolf11 merged 1 commit into
mainfrom
feature/vxs-current-keywords
Oct 6, 2026
Merged

Leitwolf11 merged 1 commit into
mainfrom
feature/vxs-current-keywords

Conversation

@Leitwolf11

Copy link
Copy Markdown
Contributor

The compiler's lexer reserves match, guard and enum; the Visual X# tokenizer of the editor still had the older list and coloured the three words as names.

  • VisualXSharpTokenizer.keywords now equals the keyword list of the compiler's lexer.
  • A test pins the whole set against that list, written out in the test. The two repositories are separate, so the test cannot read the compiler's file; when the language reserves another word, the list here has to be updated by hand.
  • Tests cover each new keyword in a statement of its kind, and words that only contain a keyword (matcher, guarded, enumerate) stay names.

The outline parser needed no change: it already treats enum Name { ... } as a type with an opaque body.

./gradlew check passes locally on Windows.

The compiler's lexer reserves `match`, `guard` and `enum` since the language
gained match, guard and classic enums. The tokenizer still listed the older
set, so the editor coloured the three words as names.

The list now equals the one in the compiler's lexer, and a test pins the
whole set so that a difference shows as a failure here instead of as a
wrongly coloured word. Further tests cover each new keyword in a statement
of its kind and words that only contain one.
@Leitwolf11
Leitwolf11 marked this pull request as ready for review October 6, 2026 19:29
@Leitwolf11
Leitwolf11 merged commit 41ad70e into main Oct 6, 2026
6 checks passed
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.

1 participant