process method

TagserResult process(
  1. ProcessMessage msg,
  2. TagserContext context
)

Implementation

TagserResult process(ProcessMessage msg, TagserContext context) {
  switch (msg.charCode) {
    case charEos:
      return TagserResult(
        err: TagserError(
            code: errorUnexpectedEos,
            text: getError(errorUnexpectedEos, null)),
      );

    case charCloseBracket:
      return TagserResult(
        pop: true,
        message: NotifyMessage(
          charCode: msg.charCode,
          type: notifyCloseBracketFound,
        ),
      );

    default:
      return TagserResult(
        err: TagserError(
            code: errorWrongCharacterGiven,
            text: getError(errorWrongCharacterGiven,
                {'char': String.fromCharCode(msg.charCode!), 'await': '>'})),
      );
  }
}