Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: README.md

Issue 1712793002: Add the content of the package. (Closed) Base URL: git@github.com:dart-lang/boolean_selector@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | codereview.settings » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 The `boolean_selector` package defines a simple and flexible syntax for boolean
2 expressions. It can be used for filtering based on user-defined expressions. For
3 example, the [`test`][test] package uses boolean selectors to allow users to
4 define what platforms their tests support.
5
6 [test]: http://github.com/dart-lang/test
7
8 The boolean selector syntax is based on a simplified version of Dart's
9 expression syntax. Selectors can contain identifiers, parentheses, and boolean
10 operators, including `||`, `&&`, `!`, and `? :`. Any valid Dart identifier is
11 allowed, and identifiers may also contain hyphens. For example, `chrome`,
12 `chrome || content-shell`, and `js || (vm && linux)` are all valid boolean
13 selectors.
14
15 A boolean selector is parsed from a string using
16 [`new BooleanSelector.parse()`][parse], and evaluated against a set of variables
17 using [`BooleanSelector.evaluate()`][evaluate]. The variables may be supplied as
18 a list of strings, or as a function that takes a variable name and returns its
19 value. For example:
20
21 [parse]: https://www.dartdocs.org/documentation/boolean_selector/latest/boolean_ selector/BooleanSelector/BooleanSelector.parse.html
22
23 [evaluate]: https://www.dartdocs.org/documentation/boolean_selector/latest/boole an_selector/BooleanSelector/evaluate.html
24
25 ```dart
26 import 'package:boolean_selector/boolean_selector.dart';
27
28 void main(List<String> args) {
29 var selector = new BooleanSelector.parse("(x && y) || z");
30 print(selector.evaluate((variable) => args.contains(variable)));
31 }
32 ```
33
34 ## Versioning
35
36 If this package adds new features to the boolean selector syntax, it will
37 increment its major version number. This ensures that packages that expose the
38 syntax to their users will be able to update their own minor versions, so their
39 users can indicate that they rely on the new syntax.
OLDNEW
« no previous file with comments | « no previous file | codereview.settings » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698