Parses a Yarn expression (as found inside {...} interpolation, <<if ...>>, <<set ... = ...>>, and command arguments) into a small, plain
data AST that Yarnspinnex.Interpreter evaluates against the cursor's
variables. Tokenizing is delegated to Yarnspinnex.Parser.Lexer; this
module only builds the AST from the resulting tokens.
Summary
Types
A bare number, string, or boolean evaluates to itself; everything else is a tagged tuple.
Functions
Parses expression source into an AST, raising on invalid syntax.
How tightly binary operator op binds: a higher number binds tighter.
ast and every expression nested inside it, outermost first.
Types
@type ast() :: number() | String.t() | boolean() | {:var, String.t()} | {:field, ast(), String.t()} | {:call, String.t(), [ast()]} | {:not, ast()} | {:neg, ast()} | {:binop, Yarnspinnex.Ops.operator(), ast(), ast()}
A bare number, string, or boolean evaluates to itself; everything else is a tagged tuple.
Functions
Parses expression source into an AST, raising on invalid syntax.
@spec precedence(Yarnspinnex.Ops.operator()) :: non_neg_integer()
How tightly binary operator op binds: a higher number binds tighter.
ast and every expression nested inside it, outermost first.