evaluating pattern matching

This commit is contained in:
Dustin Swan 2026-02-01 19:22:50 -07:00
parent 7f94cfe8cd
commit a85203bc94
No known key found for this signature in database
GPG key ID: 30D46587E2100467
4 changed files with 102 additions and 9 deletions

View file

@ -179,7 +179,7 @@ export class Parser {
// Record
if (token.kind === 'open-brace') {
this.advance();
const fields: { [key: string]: Pattern }= [];
const fields: { [key: string]: Pattern } = {};
let first = true;
while (this.current().kind !== 'close-brace') {
@ -193,7 +193,7 @@ export class Parser {
}
this.expect('close-brace');
return { kind: 'list', fields };
return { kind: 'record', fields };
}
// Parens