Added support for the dynamic keyword, reserved for future use

This commit is contained in:
nocturn9x 2021-08-24 15:14:16 +02:00
parent 15774586f8
commit 00dda45e48
3 changed files with 5 additions and 3 deletions

View File

@ -79,7 +79,8 @@ const reserved = to_table({
"let": TokenType.Let, "const": TokenType.Const, "let": TokenType.Let, "const": TokenType.Const,
"assert": TokenType.Assert, "or": TokenType.LogicalOr, "assert": TokenType.Assert, "or": TokenType.LogicalOr,
"and": TokenType.LogicalAnd, "del": TokenType.Del, "and": TokenType.LogicalAnd, "del": TokenType.Del,
"async": TokenType.Async, "await": TokenType.Await "async": TokenType.Async, "await": TokenType.Await,
"dynamyc": TokenType.Dynamic
}) })
type type

View File

@ -35,7 +35,8 @@ type
Function, Break, Lambda, Function, Break, Lambda,
Continue, Var, Let, Const, Is, Continue, Var, Let, Const, Is,
Return, Async, Class, Import, From, Return, Async, Class, Import, From,
IsNot, Raise, Assert, Del, Await IsNot, Raise, Assert, Del, Await,
Dynamic
# Basic types # Basic types

View File

@ -390,7 +390,7 @@ proc statement(self: Parser): ASTNode =
of TokenType.Assert: of TokenType.Assert:
discard self.step() discard self.step()
result = self.assertStmt() result = self.assertStmt()
of TokenType.Async, TokenType.Await: of TokenType.Async, TokenType.Await, TokenType.Dynamic:
discard # TODO discard # TODO
of TokenType.LeftBrace: of TokenType.LeftBrace:
discard self.step() discard self.step()