delimitedIdentifierLexer top-level property

Parser<DelimitedIdentifierParser> delimitedIdentifierLexer
final

DelimitedIdentifier is signified by a backquote (`) on either end

Implementation

final Parser<DelimitedIdentifierParser> delimitedIdentifierLexer =
    (char('`') & (escLexer | char('`').neg()).star() & char('`')).map((value) {
  final middleValue = value[1]
      .map((e) => e is Token
          ? e.value.contains('u') as bool
              ? utf8.decode(
                  [int.parse(e.value.split('u').last as String, radix: 16)])
              : e.value.replaceAll(r'\\', r'\')
          : e == r'\'
              ? ''
              : e)
      .join('');
  return DelimitedIdentifierParser('${value[0]}$middleValue${value[2]}');
});