louise
The Louise language: compiler, runtime, std, tooling
Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.
Dernier runÉchoué#94 · main · 15 min 28 s
0Étoiles
0Forks
40Issues
Syntax: string interpolation through Show; ADR 0034 (issue #152)
In every string literal, `{e}` is the prelude's `show(e)` and `{e:?}` is
`debug(e)`; any expression may fill a hole, and the parts are joined in
one tl_string_join call. `\{` and `\}` are literal braces, and a lone `}`
is E0111 (four existing literals escaped). No implicit Show-to-String
conversion: each hole only wants Show (or Debug) of its type.
A string with holes lexes as STRING_START, STRING_TEXT and STRING_END
around INTERP_HOLE nodes (a StringText lexer mode, as HTML text has);
others stay one STRING token. HTML text holes now take any type with
Show, shown then escaped, so E0601 is no longer reported (ADR 0009
note). The tree-sitter grammar gives strings content, escape and
interpolation children; highlighting and semantic tokens follow.
http_demo builds its log lines and messages with interpolation, and
shows a Username as the name itself.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>Parents 388899b
35 fichiers modifiés, 11145 ajouts, 9530 suppressions
crates/louise_core/src/lower/html.rs+19−4crates/louise_core/src/lower/mod.rs+52−2crates/louise_db/src/ide/tokens.rs+1−1crates/louise_hir/src/body.rs+12−0crates/louise_hir/src/lower/mod.rs+56−1crates/louise_syntax/src/ast.rs+38−0crates/louise_syntax/src/grammar/expr.rs+56−2crates/louise_syntax/src/lexer.rs+53−3crates/louise_syntax/src/syntax_kind.rs+14−1crates/louise_types/src/infer/mod.rs+24−16crates/louise_types/src/lib.rs+1−0docs/adr/0009-html-literals.md+5−0docs/adr/0034-string-interpolation.md+56−0docs/adr/README.md+1−0docs/reference/diagnostics.md+1−1docs/reference/grammar.md+1−1docs/reference/language.md+11−3editors/tree-sitter-louise/grammar.js+10−1editors/tree-sitter-louise/queries/helix/generate.py+1−0editors/tree-sitter-louise/queries/helix/highlights.scm+5−0editors/tree-sitter-louise/queries/highlights.scm+3−0editors/tree-sitter-louise/src/grammar.json+84−21editors/tree-sitter-louise/src/node-types.json+127−1editors/tree-sitter-louise/src/parser.c+10412−9450editors/tree-sitter-louise/test/corpus/effects.txt+2−1editors/tree-sitter-louise/test/corpus/expressions.txt+25−0examples/http_demo/src/app.lse+6−6examples/http_demo/src/credentials.lse+14−3examples/http_demo/src/main.lse+4−4examples/http_demo/src/store.lse+2−2examples/http_demo/test/app_test.lse+2−2std/prelude.lse+1−1tests/run/interpolation.lse+38−0tests/run/user_derive.lse+1−1tests/ui/html.lse+7−2