All work

Metasyntax

A grammar for writing Sublime grammars.

Source on GitLab Sublime Text · MPL-2.0 · v0.7.0
Stock Sublime
Lines 410 to 436 of a .sublime-syntax file in stock YAML highlighting: match, push, meta_scope, and include rules with the scope names after them, keys in one color and values in another.
Metasyntax
The same lines with Metasyntax: match, push, meta_scope, and include each in their own color, and the dotted scope names after meta_scope set apart in purple and yellow.

A grammar for writing grammars. Metasyntax highlights .sublime-syntax files so that contexts, push/pop/set operations, scopes, and embedded regexes stand out from the surrounding YAML.

It borrows myRegex for the patterns themselves rather than reimplementing regex parsing.

How the fleet's Sublime syntaxes embed and extend one another. Five syntax repos are drawn as panels: python, myst, regex, metasyntax, and yaml. Cyan arrows are embeds or pushes into another syntax, labelled with the number of sites in the source; violet arrows are extends, and each name carries the stock package it extends. myPython pushes into myRegex at 12 sites and embeds MystDocstrings at 3; the MyST Typst grammar embeds myPython and myRegex, MystMarkdown pushes into myRegex at 3 sites, and HTML (Jinja) embeds the TOML_Jinja grammar from the python repo. Metasyntax pushes into the double-brace variant of myRegex at 3 sites. myRegex is extended by a templates variant, which a double-brace variant extends. In the yaml repo BashYAML embeds EmbeddedBash at 2 sites and EmbeddedFlowBash at 1, EmbeddedFlowBash and myZsh both extend EmbeddedBash, and nothing else in the fleet references the yaml syntaxes. The project this copy belongs to is drawn in amber. sublime-python-syntax sublime-myst-syntax sublime-regex-syntax sublime-meta-syntax sublime-yaml-syntax TOML_Jinja extends TOML myPython extends Python HTML (Jinja) extends HTML MystDocstrings extends MystMarkdown Typst no extends MystMarkdown extends Markdown myRegex no extends _MyRegexTemplates extends myRegex _MyRegexDoubleBraces extends _MyRegexTemplates Metasyntax extends YAML BashYAML extends YAML EmbeddedFlowBash extends EmbeddedBash EmbeddedBash extends Bash myZsh extends Zsh, EmbeddedBash extends ×1 ×3 ×1 ×12 ×1 ×3 ×3 ×1 ×2 embeds or pushes into another syntax, ×N sites extends a parent syntax