Migrate to null safety (#110)

- *Breaking* The `Font.merge` and `BoxEdge.merge` factory constructors
  are now static methods since a factory constructor can't return null,
  but that was the entire point of these constructors.
- Add nullable return types on methods that have a branch returning
  `null`.
- Add a lot of `?` on parameters that can't provably be non-null.
- Add a lot of `!`.
- Add overrides of `TreeNode.clone` to tighten the return type in a few
  places and allow some skipped explicit casts.
- Remove some dead code on conditional branches that never would have
  been followed, even before the migration, but weren't obvious
  statically.
- Add explicit casts.
30 files changed
tree: 8485f7426e26969a9823af5a88f01e63fcb04002
  1. example/
  2. lib/
  3. test/
  4. .gitignore
  5. .test_config
  6. .travis.yml
  7. analysis_options.yaml
  8. CHANGELOG.md
  9. LICENSE
  10. pubspec.yaml
  11. README.md
README.md

A Dart CSS parser.

Usage

Parsing CSS is easy!

import 'package:csslib/parser.dart';

main() {
  var stylesheet = parse(
      '.foo { color: red; left: 20px; top: 20px; width: 100px; height:200px }');
  print(stylesheet.toDebugString());
}

You can pass a String or List<int> to parse.