ret 0.0.2 copy "ret: ^0.0.2" to clipboard
ret: ^0.0.2 copied to clipboard

Tokenizes a string that represents a regular expression. Dart port of ret.js

example/example.dart

import 'package:ret/ret.dart';

void main() {
  final tokens = tokenizer('foo|bar');

  print(tokens);
  // Root(null, [[Char(102), Char(111), Char(111)], [Char(98), Char(97), Char(114)]], null)

  final setToken = Set(
    set: [
      Char(97),
      Char(98),
      Char(99),
    ],
    not: true,
  );

  reconstruct(tokens); // 'foo|bar'
  reconstruct(Char(102)); // 'f'
  reconstruct(setToken); // '^abc'
}
0
likes
130
pub points
5%
popularity

Publisher

unverified uploader

Tokenizes a string that represents a regular expression. Dart port of ret.js

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

equatable

More

Packages that depend on ret