FunctionToken constructor

FunctionToken(
  1. ComputeContext context, {
  2. required FunctionTokenType type,
  3. required String rawValue,
  4. 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);
}