Skip to content

Commit

Permalink
Use luau.SyntaxKind.MixedTable where necessary (#418)
Browse files Browse the repository at this point in the history
`LastExpression` enum member currently points to `Set` while
`MixedTable` holds the actual last expression position number.
  • Loading branch information
rimuy authored Feb 7, 2024
1 parent 10c5c64 commit f89cef0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/LuauAST/impl/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export enum SyntaxKind {
FirstIndexableExpression = Identifier,
LastIndexableExpression = ParenthesizedExpression,
FirstExpression = Identifier,
LastExpression = Set,
LastExpression = MixedTable,
FirstStatement = Assignment,
LastStatement = Comment,
FirstField = MapField,
Expand Down
7 changes: 6 additions & 1 deletion src/LuauAST/impl/typeGuards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f89cef0

Please sign in to comment.