Skip to content

Enhance TextMate grammar of Tolk #220

@novusnota

Description

@novusnota

tolk-vm wrote there:

I fine-tuned grammar and palette the way I prefer it (for example, structures and variables have different colors, because of the capital letter). The current VS Code tmLanguage file is not suitable for this — it must be updated.

Currently, colors are a bit mangled, you can see it in the preview of this PR. In addition to the notes above, we should also remove or override the colors of regular identifiers and focus on built-in types and capitalized identifiers. Plus, it's easy to colorize function identifiers well since they are always followed by optional spaces and a required ( — both in definition and at the call site.

IIRC, TextMate grammars use a "first-win" strategy: only the first matching pattern is used, with no overrides later. See the Tact's grammar, where comments or strings are captured first, while regular identifiers are captured very last.

Changes would be beneficial both for users of the VSCode extension and the documentation users, since docs support TextMate-based highlighting with Shiki.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions