Adding spread operator. starting to build a stdlib. omg

This commit is contained in:
Dustin Swan 2026-02-02 21:20:39 -07:00
parent 216fe6bd30
commit 9edee10508
No known key found for this signature in database
GPG key ID: 30D46587E2100467
7 changed files with 102 additions and 14 deletions

View file

@ -59,13 +59,14 @@ export type Pattern =
| { kind: 'literal', value: number | string }
| { kind: 'constructor', name: string, args: Pattern[] }
| { kind: 'list', elements: Pattern[] }
| { kind: 'list-spread', head: Pattern[], spread: string }
| { kind: 'record', fields: { [key: string]: Pattern } }
// Data Structures
export type List = {
kind: 'list'
elements: AST[]
elements: (AST | { spread: AST })[]
}
export type Record = {