Installing the Wasm Grammar
The Wasm parser lets clackatoo recognize GCSL without loading a native shared object into the editor. A language pack combines the parser, query files, and a small language declaration.
Before you start #
You need a clackatoo version that supports Wasm language packs and the
grammar repository. To use the language server too, install gcsl on the
editor's command search path.
Build the portable parser from the grammar repository with pekit:
wasm=
The command keeps the built parser's path, which pekit prints indented
under the target name, in wasm.
Create the language pack #
-
Create the user language-pack directory:
pack="/clackatoo/languages/gcsl" -
Copy the parser and supported queries:
-
Save this declaration as
language.tomlin that directory:= "gcsl" = ["gcsl"] = [] = ["gcsl", "lsp"] = ["workspace.gcsl"] = "-"
The word entry keeps names such as build-root together during word
navigation. The server entry starts the separate GCSL language server;
omit it if you only want grammar features. The root marker selects the
workspace for language-server requests.
Check the result #
Open a .gcsl file in clackatoo and check that strings and function names
are highlighted. Use a function text object to select a function. If the
language server is enabled, hover over a declaration to check that the
server starts separately from the grammar.
The pack does not include folds.scm: this clackatoo integration does not
consume the folding query. The same query remains available for editors
that support it.