parsers library

Parser utilities used by LuaLike's format, binary, string, and pattern implementations.

Import this library when you want the reusable parser implementations behind features such as string.format, string.pack, or Lua pattern handling, but do not need the full runtime bridge from package:lualike/lualike.dart.

For parsing LuaLike source code into AST nodes, use the parse() and parseExpression() helpers from package:lualike/lualike.dart.

Classes

BinaryFormatOption
Represents a single directive inside a Lua 5.4 string.pack format.
BinaryFormatParser
Parser that turns a Lua 5.4 binary-format string into a list of BinaryFormatOptions, performing the same validation that the Lua VM does.
FormatPart
Represents a parsed format specifier or a literal string segment.
FormatStringParser
LiteralPart
LuaMatch
Result of a single Lua pattern match.
LuaPattern
Compiled Lua pattern that can search within strings.
LuaPatternCompiler
LuaStringParser
A PetitParser-based parser for Lua string literals that handles escape sequences correctly
SpecifierPart
Utf8DecodeResult
Internal helper result for UTF-8 decode routines.

Functions

compileLuaPattern(String pattern) → Parser<String>

Exceptions / Errors

LuaPatternTooComplex
Thrown when a Lua pattern would exceed Lua's recursive matcher depth.