Skip to content

Repository files navigation

language-jass

A TextMate grammar for JASS, the original scripting language of Warcraft III.

The grammar highlights comments, every literal form (strings, character and FourCC literals, decimal/octal/hex/real numbers), declarations, statements, operators, and keywords, and flags invalid tokens. It works directly as a VS Code extension (see below). Registering it with GitHub Linguist, for syntax highlighting on GitHub itself, is proposed in linguist#8096 and waiting for approval.

JASS, not vJASS

The grammar targets original JASS only — the language the game accepts and the World Editor emits. vJASS/JassHelper, Zinc, Wurst and C-style preprocessor dialects are deliberately out of scope. vJASS is not a strict superset of JASS (for example, debug applies to the entire following statement in JASS, but only to its own line in vJASS), so the two are best served by separate grammars.

Working on the extension

The repository is a complete VS Code extension — package.json declares the language and grammar, and there is no build step.

  • Run it: open the folder in VS Code and press F5 (or run code --extensionDevelopmentPath="$PWD"). An Extension Development Host window opens with the extension loaded; open any .j, .ai or .jass file to see the highlighting.
  • Inspect highlighting: run Developer: Inspect Editor Tokens and Scopes from the Command Palette and hover a token to see its scope stack and the theme rule that coloured it. After editing the grammar, run Developer: Reload Window in the host window to pick up the change.
  • Install locally: package with npx @vscode/vsce package and install the resulting .vsix through code --install-extension language-jass-<version>.vsix (or Extensions: Install from VSIX… in the Extensions view).
  • The browser highlighter: syntax-highlighter.html needs the grammar over HTTP, so serve the repository root (python3 -m http.server) and open http://localhost:8000/syntax-highlighter.html. Opened straight from disk it falls back to a load grammar… file picker. Pushing a change to it or to the grammar redeploys the live page via .github/workflows/pages.yml.

Licence

MIT — Copyright (c) Drake53 and Contributors.

About

TextMate grammar for JASS, the Warcraft III scripting language.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages