Track the LScript changes since the grammar was first written: - some, ok and err are reserved prefix operators and wrapper patterns; the old |.some/|.ok/|.err forms and postfix/prefix ! are rejected - function literal inputs may omit their type annotation, and tuple components may omit theirs; an empty typed tuple pattern is now just the unit pattern - migrate fixtures, corpus, queries, CST contract and Rust tests Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
20 lines
522 B
Plaintext
20 lines
522 B
Plaintext
use math.{pi, sqrt}
|
|
use math as m
|
|
use random.{Pcg32, pcg32, draw_u32}
|
|
use time.{Duration, TimeError, duration_neg}
|
|
use time as t
|
|
|
|
circle: f64: pi
|
|
root: f64: 4.0->sqrt
|
|
# Host overloads are selected by the operand, so the literal is typed first.
|
|
nine: f32: 9.0
|
|
qualified_root: f32: nine->m.sqrt
|
|
qualified_pi: f32: m.pi
|
|
|
|
seed: u64: 42
|
|
generator: Pcg32: seed->pcg32
|
|
draw: u32: generator->draw_u32
|
|
|
|
negate: Duration => Duration ! TimeError: duration_neg
|
|
qualified_negate: t.Duration => t.Duration ! t.TimeError: t.duration_neg
|