The readable way to build strings, as you noted `{a} {b}` beats `a + " " + b`.
A backtick string embeds any expression in `{…}` and desugars to the Phase-7c
`+` chain, wrapping each hole in `str(...)`:
`hello {name}, n={count + 1}`
== "hello " + name + ", n=" + str(count + 1)
- Lexer: a backtick captures its content raw as TK_INTERP.
- Parser: parse_interp splits literal runs from `{…}` holes (brace-depth aware,
`{{`/`}}` escape to literal braces), re-lexes each hole as a full expression
(save/restore toks/pi like an import), and folds it all into E_BIN(+) nodes —
so no new AST or runtime beyond the existing concat.
- str(x): a string passes through; int/bool/fixed convert via a small emitted
@fn_int_str prelude (digits from the end of a buffer, '-' for negatives),
emitted once into any program that uses it.
examples/strings.ludic gains interpolation cases (now prints 1..7); the smoke
covers it. Grammar + ludic_syntax.h tokenize backtick strings (holes highlighted
as embedded code). LANGUAGE.md documents it as the preferred form.
Reseeded (22530 lines); C-free fixpoint holds; goldens identical; 18/18; vocab +
doc-fences clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| icons | ||
| snippets | ||
| src | ||
| syntaxes | ||
| .vscodeignore | ||
| language-configuration.json | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
Ludic for VS Code
Syntax highlighting, formatting, and full language-server support for Ludic,
the AI-first, ECS-native game language. See LANGUAGE.md in the Ludic repository
for the language reference.
What you get
| Source | |
|---|---|
| Syntax highlighting | TextMate grammar, works with no build |
| Semantic highlighting | ludic-lsp — real name resolution, so a component reads differently from a local |
| Diagnostics | structural errors as you type; ludicc's own errors on save |
| Completion | context-aware: fields after ., components inside query [...], phases after phase, widgets inside ui |
| Hover | signatures and docs for builtins, intrinsics, and everything you declared |
| Go to definition / references / rename | across every file in the compilation unit, following import |
| Formatting | format-on-save, comment-preserving |
| Outline, folding, inlay hints, signature help | |
```ludic fences in Markdown |
highlighted, checked, and formatted |
Setup
Build the toolchain once, from the repository root:
./tools/build-tools.sh
That produces build/ludic-lsp and build/ludic-fmt, which the extension finds
on its own. If you keep them elsewhere, set ludic.server.path.
Format on save:
"[ludic]": { "editor.formatOnSave": true }
Settings
ludic.server.path— whereludic-lsplives. Empty = searchbuild/, thenPATH.ludic.server.enabled— turn the server off and keep only static highlighting.ludic.compilerPath— whereludicclives, for on-save diagnostics.ludic.compilerDiagnostics— whether to run the compiler at all.ludic.indentSize— spaces per level for the formatter.ludic.trace.server— log LSP traffic (Ludic: Show Language Server Log).
Installing without publishing
cd tools/editors/vscode
npm install
npx @vscode/vsce package
code --install-extension ludic-1.0.0.vsix