Adding spread operator. starting to build a stdlib. omg
This commit is contained in:
parent
216fe6bd30
commit
9edee10508
7 changed files with 102 additions and 14 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue