Module full_moon::ast

source ·
Expand description

Utilities for ASTs (Abstract Syntax Trees). Contains all nodes used by Full Moon (such as blocks).

Modules

  • lua52lua52
    Contains the nodes necessary to parse Lua 5.2. Only usable when the “lua52” feature flag is enabled.
  • lua54lua54
    Contains the nodes necessary to parse Lua 5.4. Only usable when the “lua54” feature flag is enabled.
  • A punctuated sequence of syntax tree nodes separated by punctuation (tokens).
  • A representation of a “contained span”, or a span within specific bounds.
  • typesroblox
    Contains the types necessary to parse Luau. The module name is a misnomer from when Luau was just types. It will be renamed to “luau” in the future.

Structs

  • An assignment, such as x = y. Not used for LocalAssignments
  • An abstract syntax tree, contains all the nodes used in the code
  • A block of statements, such as in if/do/etc block
  • A do block, such as do ... end This is not used for things like while true do end, only those on their own
  • An elseif block in a bigger If statement
  • A function body, everything except function x in function x(a, b, c) call() end
  • A function being called, such as call()
  • A normal function declaration, supports simple declarations like function x() end as well as complicated declarations such as function x.y.z:a() end
  • A function name when being declared as FunctionDeclaration
  • A generic for loop, such as for index, value in pairs(list) do end
  • An if statement
  • An assignment to a local variable, such as local x = 1
  • A declaration of a local function, such as local function x() end
  • A method call, such as x:y()
  • A numeric for loop, such as for index = 1, 10 do end
  • A repeat loop
  • A return statement
  • A table being constructed, such as { 1, 2, 3 } or { a = 1 }
  • A complex expression used by Var, consisting of both a prefix and suffixes
  • A while loop

Enums

  • An error that occurs when creating the ast after tokenizing
  • Operators that require two operands, such as X + Y or X - Y
  • Something being called
  • An expression, mostly useful for getting values
  • Fields of a TableConstructor
  • Arguments used for a function
  • The indexing of something, such as x.y or x["y"] Values of variants are the keys, such as "y"
  • The last statement of a Block
  • A parameter in a function declaration
  • A node used before another in cases such as function calling The ("foo") part of ("foo"):upper()
  • A statement that stands alone
  • A suffix in certain cases, such as :y() in x:y() Can be stacked on top of each other, such as in x()()()
  • Operators that require just one operand, such as #X
  • Used in Assignments and Values