From f89cef07ff4697ee551374d29752acfdb2a08acb Mon Sep 17 00:00:00 2001 From: rimuy <46044567+rimuy@users.noreply.github.com> Date: Wed, 7 Feb 2024 16:19:53 -0300 Subject: [PATCH] Use `luau.SyntaxKind.MixedTable` where necessary (#418) `LastExpression` enum member currently points to `Set` while `MixedTable` holds the actual last expression position number. --- src/LuauAST/impl/enums.ts | 2 +- src/LuauAST/impl/typeGuards.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/LuauAST/impl/enums.ts b/src/LuauAST/impl/enums.ts index 64163f1..d8e580b 100644 --- a/src/LuauAST/impl/enums.ts +++ b/src/LuauAST/impl/enums.ts @@ -51,7 +51,7 @@ export enum SyntaxKind { FirstIndexableExpression = Identifier, LastIndexableExpression = ParenthesizedExpression, FirstExpression = Identifier, - LastExpression = Set, + LastExpression = MixedTable, FirstStatement = Assignment, LastStatement = Comment, FirstField = MapField, diff --git a/src/LuauAST/impl/typeGuards.ts b/src/LuauAST/impl/typeGuards.ts index 270abba..901956e 100644 --- a/src/LuauAST/impl/typeGuards.ts +++ b/src/LuauAST/impl/typeGuards.ts @@ -104,7 +104,12 @@ export const isSimplePrimitive = makeGuard( luau.SyntaxKind.StringLiteral, ); -export const isTable = makeGuard(luau.SyntaxKind.Array, luau.SyntaxKind.Set, luau.SyntaxKind.Map); +export const isTable = makeGuard( + luau.SyntaxKind.Array, + luau.SyntaxKind.Set, + luau.SyntaxKind.Map, + luau.SyntaxKind.MixedTable, +); export const isFinalStatement = makeGuard( luau.SyntaxKind.BreakStatement,