commit | 75a88e827194ec51730cc58e662cca98cc9df488 | [log] [tgz] |
---|---|---|
author | Nate Bosch <nbosch1@gmail.com> | Thu Jan 02 13:35:40 2020 -0800 |
committer | GitHub <noreply@github.com> | Thu Jan 02 13:35:40 2020 -0800 |
tree | ab9885e8f474fdca47c7c17d4711c80bdf34abcb | |
parent | c9528fc6f66dfa732e54d6c6cfd258c29ddc134f [diff] |
Use explicit dynamic over void return types (#99) Some implementations are relying on passing values through the visit methods. Make return types explicitly `dynamic` to match their implicit types from before. This highlights that extending the `Visitor` class and expecting to return useful values is inherently risky. Not only will usages fall through to dynamic and have no static errors for things like typos, there are also places where the values will be silently discarded by the implementation in` Visitor`.
A Dart CSS parser.
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
.