build method

  1. @override
String build(
  1. Context context,
  2. ParserResult? result
)
override

Implementation

@override
String build(Context context, ParserResult? result) {
  if (!(char >= 0 && char <= 0xd7ff || char >= 0xe000 && char <= 0x10ffff)) {
    throw ArgumentError.value(char, 'char', 'Invalid character code');
  }

  context.refersToStateSource = true;
  final fast = result == null;
  final values = {
    'cc': helper.getAsCode(char),
  };
  final isUnicode = char > 0xffff;
  final String template;
  if (isUnicode) {
    if (fast) {
      template = _template32Fast;
    } else {
      template = _template32;
    }
  } else {
    if (fast) {
      template = _template16Fast;
    } else {
      template = _template16;
    }
  }

  return render(template, values, [result]);
}