FunctionToken constructor
FunctionToken(
- ComputeContext context, {
- required FunctionTokenType type,
- required String rawValue,
- int globalOffset = -1,
Creates the token.
Implementation
FunctionToken(ComputeContext context,
{required super.type, required super.rawValue, super.globalOffset}) {
for (final f in context.registeredFunctions) {
if (f.name == rawValue) {
function = f;
return;
}
}
throw ComputationError(ComputationStep.lexing,
message: 'Unknown function "$rawValue"', globalPosition: globalOffset);
}