parser_error 0.2.0
parser_error: ^0.2.0 copied to clipboard

Parser error formatter with support for the multiple source code parts.

example/example.dart

import 'package:parser_error/parser_error.dart';

void main() {
  final messages = <ParserErrorMessage>[];
  var message = ParserErrorMessage("Malformed 'type'", 25, 30);
  messages.add(message);
  message = ParserErrorMessage("Expected ']' but found '`'", 29, 29);
  messages.add(message);
  final strings = ParserErrorFormatter.format(source, messages);
  print(strings.join('\n'));
  throw FormatException();
}

String source = '''
#if defined(FOO)
typedef int[`
#endif
''';
2
likes
130
pub points
83%
popularity

Publisher

Unknown

Parser error formatter with support for the multiple source code parts.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD (LICENSE)

Dependencies

text

More

Packages that depend on parser_error