Closed leeflix closed 3 months ago
Mhh, the following code works for me:
import 'package:petitparser/petitparser.dart';
extension on String {
operator &(Parser p) => string(this) & p;
}
void main(List<String> arguments) {
final parser = 'a' & string('b');
print(parser.parse('ab')); // Success[1:3]: [a, b]
}
Can you provide a minimally reproducible example?
fixed it
i would like to use the following extension:
but i get the error
NoSuchMethodError: Class 'SequenceParser<dynamic>' has no instance method '&'.
when using it. any ideas how to fix?