Repository navigation
feat: Luau's own parser reads mission source - #1134
Merged
Merged
Conversation
Reading mission source back starts with parsing it, and Luau's own parser reads exactly the syntax the source is written in. A C++ shim calls it and writes its tree into flat arrays, which the new source_parser module copies into the library's syntax tree. Comptime checks keep both sides' layout and numbering the same. Constructs mission source doesn't use, such as loops, come back as unsupported nodes with their places, for the compiler to refuse. deps/luau builds the parser as its own library, luau-ast, as Luau's CMake splits it, so sltool links the parser without the VM. sltool dte check writes each mission as source and parses it, which every mission in the game folder passes. Closes #1132
…ition The C++ shim now reads like the platform's shims: their brace and pointer style, static_cast, and exports named openreliant_. Helpers add a name, a string or a list of expressions, and one message covers the 255-name limit for locals, targets and parameters. Bindings split in one place in the syntax tree. if expressions are named where they are refused, and tests show that type annotations change nothing, as the docs say. source.zig's module doc and its symbol table's comments are rewritten in plain English.
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.
Reading mission source back (#1126) starts here: Luau's own parser reads the text.
formats/dte/source/syntax.zig, in the library: the syntax tree as plain Zig types. Each statement and expression has its line and column, andTree.getgives a node with its parts as a tagged union.source_parser, a module of its own that links Luau's parser. A C++ shim callsLuau::Parser::parseand writes the tree into flat arrays (luau.h). Comptime checks keep both sides' node layout and numbering the same....and strings with values put into them, come back as unsupported nodes with their places, for the compiler to refuse.luau-ast, as Luau's CMake splits it, andluauon top of it. sltool links the parser without the VM.sltool dte checkwrites each mission as source and parses it. Every mission in the game folder passes.Left: the compiler and
sltool dte build, the next step of #1126.Closes #1132