tobogganSe connecter

louise

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

Syntax: a construction's `(` touches its constructor (#319)

A constructor's parentheses opened its construction whenever they were
on the same line, so `go Pin (five ())` was `go Pin(five ())`.
`louise migrate` printed the first and its formatting pass turned it
into the second (`go(Pin, five())` became a construction), and
`louise fmt`, which only changes whitespace, changed a program's
meaning by joining `go Pin` and `(x)` written on two lines.

- The parser takes `C(` as construction only when the `(` touches the
  constructor (adjacency, like a template's tag, ADR 0048). After a space
  it is a parenthesised argument. ADR 0062 is amended; the grammar
  reference says so. Nothing in std, the tests, the examples or the
  packages wrote a construction with a space.
- `Some (1)` is now an application: E0216 says the parentheses touch
  the constructor.
- `louise migrate` reports a file that already parses in the new syntax
  as having nothing to migrate (`MigrateError::AlreadyMigrated`), so
  `migrate --check` passes on a migrated tree.
- The tree-sitter grammar: a construction's `(` is immediate; the
  scanner gives no argument marker for a touching `(`, and a touching
  parenthesised argument (`f(x)`, `f()`) stays an application, as in
  the parser. Two corpus trees recorded misparses (`{ Some(x) }` as a
  call, `list.map (add 1 _)` as a construction) and are corrected.
- The reference's links to ADR 0062 pointed at 0061.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

olivier · il y a 3 sem. · 8f2bb54a96bc53deb3cc57352c4de2ac719e8324

Parents 5b71efd

20 fichiers modifiés, 30828 ajouts, 28945 suppressions

Mcrates/louise_syntax/src/format.rs+14−0
Mcrates/louise_syntax/src/grammar/expr.rs+8−6
Mcrates/louise_syntax/src/migrate.rs+6−0
Mcrates/louise_syntax/tests/data/ok/exprs.lse+7−0
Mcrates/louise_syntax/tests/migrate.rs+29−0
Mcrates/louise_syntax/tests/snapshots/parser__ok_corpus_parses_cleanly@exprs.lse.snap+79−2
Mcrates/louise_types/src/infer/mod.rs+7−4
Mdocs/adr/0062-parens-free-functions.md+2−2
Meditors/tree-sitter-louise/README.md+1−1
Meditors/tree-sitter-louise/grammar.js+28−9
Meditors/tree-sitter-louise/src/grammar.json+206−86
Meditors/tree-sitter-louise/src/parser.c+30370−28815
Meditors/tree-sitter-louise/src/scanner.c+9−1
Meditors/tree-sitter-louise/test/corpus/expressions.txt+37−10