Skip to content

Commit de313b6

Browse files
Lexer support for the "free" statement
1 parent 719f674 commit de313b6

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/lexer/lexer.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,9 @@ export class Lexer
411411
case 'new':
412412
kind = TokenKind.NewKeyword;
413413
break;
414+
case 'free':
415+
kind = TokenKind.FreeKeyword;
416+
break;
414417
case 'variable':
415418
kind = TokenKind.VariableKeyword;
416419
break;

src/lexer/tokenKind.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export enum TokenKind
4646
FalseKeyword,
4747
ImportKeyword,
4848
NewKeyword,
49+
FreeKeyword,
4950
VariableKeyword,
5051
ConstantKeyword,
5152
FieldKeyword,

tests/compiler/lexer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ describe('Lexer',
107107
new InputToTokenKind('true', TokenKind.TrueKeyword, 'the true keyword'),
108108
new InputToTokenKind('false', TokenKind.FalseKeyword, 'the false keyword'),
109109
new InputToTokenKind('new', TokenKind.NewKeyword, 'the new keyword'),
110+
new InputToTokenKind('free', TokenKind.FreeKeyword, 'the free keyword'),
110111
new InputToTokenKind('module', TokenKind.ModuleKeyword, 'the module keyword'),
111112
new InputToTokenKind('class', TokenKind.ClassKeyword, 'the class keyword'),
112113
new InputToTokenKind('import', TokenKind.ImportKeyword, 'the import keyword'),

0 commit comments

Comments
 (0)