build method

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

Implementation

@override
String build(Context context, ParserResult? result) {
  final keys = table.keys;
  // TODO: Dart compiler cannot infer type `toList()`
  return SwitchTag<O>(
    Map.fromEntries(keys.map((k) => MapEntry(
          k,
          Value(table[k] as O, Advance(k.length)),
        ))),
    keys.map((k) => FailExpected<String, O>(PositionAction(), k)).toList(),
  ).build(context, result);
}