class

Sheety::Tokens::Function

Inherits Sheety::Token < Reference < Object

Function name token (e.g., SUM, IF, AVERAGE in "SUM(A1:B5)")

Constants

FUNCTION_NAME_REGEX = /^\s*(?P<name>[A-Z_][A-Z0-9_.]*)/i

Regex for function names (letters, digits, underscore) Excel function names are typically uppercase letters only NOTE: We don't include the opening paren here - it's matched separately

Class methods

match?(s : String) : Regex::MatchData | Nil
Source

Instance methods

ast(tokens : Array(Token), stack : Array(Token), builder : AstBuilder) : Nil

Add this token to the AST - called during parsing

Source
compile

Compile the token to executable code

Source
create_function_call(arguments : Array(AST::Node)) : AST::FunctionCall

Create the function call AST node with its arguments

Source
function_name
Source
lbp

Functions act like left-parentheses in the shunting-yard algorithm They mark the start of a function call

Source
match(s : String) : Regex::MatchData | Nil

Try to match the token pattern against the input string

Source
process(match : Regex::MatchData) : Nil

Process the match result and populate attributes

Source