evaluating pattern matching
This commit is contained in:
parent
7f94cfe8cd
commit
a85203bc94
4 changed files with 102 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue