feat: add Luau language support (#153)#165
Open
azizur100389 wants to merge 1 commit intotirth8205:mainfrom
Open
feat: add Luau language support (#153)#165azizur100389 wants to merge 1 commit intotirth8205:mainfrom
azizur100389 wants to merge 1 commit intotirth8205:mainfrom
Conversation
Add Luau (Roblox Lua) as a supported language. Luau shares most AST node types with Lua (function_declaration, function_call, variable_declaration, dot/method_index_expression) so the existing Lua constructs handler is reused. Luau-specific additions include type_definition mapped as a Class node for Luau's type aliases. Changes: - Add .luau extension mapping in EXTENSION_TO_LANGUAGE - Add luau entries to _CLASS_TYPES, _FUNCTION_TYPES, _IMPORT_TYPES, _CALL_TYPES - Extend all language == "lua" checks to include "luau" - Add type_definition as a Luau-specific class type - Add comprehensive Luau fixture file (sample.luau) - Add 14 Luau parsing tests in test_multilang.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
type_definitionnodes are mapped asClassnodes to capture type aliases (type Vector3 = { ... }).Changes
code_review_graph/parser.py:.luauextension mapping inEXTENSION_TO_LANGUAGE"luau"entries to_CLASS_TYPES(withtype_definition),_FUNCTION_TYPES,_IMPORT_TYPES,_CALL_TYPESlanguage == "lua"checks tolanguage in ("lua", "luau")tests/fixtures/sample.luau: Comprehensive fixture exercising type aliases, typed functions, table-based OOP (dot + colon syntax), require imports, and test functionstests/test_multilang.py: 14 new tests inTestLuauParsingWhat Luau parsing supports
require()import detectionTest Plan
ruff checkclean on changed Python files