commit | 1e96b6c329f77a3a972a5fca34c351fa11b90782 | [log] [tgz] |
---|---|---|
author | Nate Bosch <nbosch1@gmail.com> | Thu Aug 27 08:44:09 2020 -0700 |
committer | GitHub <noreply@github.com> | Thu Aug 27 08:44:09 2020 -0700 |
tree | d701bce85d0695dd11e4473a759c443794eee2c7 | |
parent | bd0f77f1893945f4bc56439e9038d28cb6962a89 [diff] |
Correct a misused putIfAbsent call (#109) There is no need to assign within the callback for a `putIfAbsent` default. Refactor to the most idiomatic version today which is to use `??=` (since we don't ever assign a null value so we don't care about the distinction between a missing key and a key assigned to null) and return the value directly rather than putting it in the Map and then pulling it back out.
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
.