textmate

package
v0.2.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package textmate turns the annotated grammar into a TextMate grammar for VS Code.

It is the second emitter beside internal/treesitter, and it reads the same file: internal/ebnf reads docs/grammar.ebnf and knows nothing about either target. What it writes is a lexical approximation rather than a translation, because TextMate is regular expressions over lines and cannot express the grammar's structure; docs/design/editors.md says why that is the right trade.

The whole input is the lexical layer lex already states for a program: the token shapes docs/grammar.ebnf binds by annotation, lex.Keywords, lex.Punctuation, and the quoted terminals the grammar spells that the lexer scans as identifiers. Nothing here is restated, so a keyword added to lex reaches the colors or fails the golden check.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Emit

func Emit(file *ebnf.File) ([]byte, error)

Emit writes the tmLanguage for a grammar internal/ebnf has already read and found clean.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL