# boolean_selector **Repository Path**: mirrors_chromium_googlesource/boolean_selector ## Basic Information - **Project Name**: boolean_selector - **Description**: No description available - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-03-19 - **Last Updated**: 2025-11-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README > [!IMPORTANT] > This repo has moved to https://github.com/dart-lang/tools/tree/main/pkgs/boolean_selector [![Dart](https://github.com/dart-lang/boolean_selector/actions/workflows/test-package.yml/badge.svg)](https://github.com/dart-lang/boolean_selector/actions/workflows/test-package.yml) [![Pub Package](https://img.shields.io/pub/v/boolean_selector.svg)](https://pub.dev/packages/boolean_selector) [![package publisher](https://img.shields.io/pub/publisher/boolean_selector.svg)](https://pub.dev/packages/boolean_selector/publisher) The `boolean_selector` package defines a simple and flexible syntax for boolean expressions. It can be used for filtering based on user-defined expressions. For example, the [`test`][test] package uses boolean selectors to allow users to define what platforms their tests support. [test]: https://github.com/dart-lang/test The boolean selector syntax is based on a simplified version of Dart's expression syntax. Selectors can contain identifiers, parentheses, and boolean operators, including `||`, `&&`, `!`, and `? :`. Any valid Dart identifier is allowed, and identifiers may also contain hyphens. For example, `chrome`, `chrome || content-shell`, and `js || (vm && linux)` are all valid boolean selectors. A boolean selector is parsed from a string using [`BooleanSelector.parse()`][parse], and evaluated against a set of variables using [`BooleanSelector.evaluate()`][evaluate]. The variables are supplied as a function that takes a variable name and returns its value. For example: [parse]: https://pub.dev/documentation/boolean_selector/latest/boolean_selector/BooleanSelector/BooleanSelector.parse.html [evaluate]: https://pub.dev/documentation/boolean_selector/latest/boolean_selector/BooleanSelector/evaluate.html ```dart import 'package:boolean_selector/boolean_selector.dart'; void main(List args) { var selector = BooleanSelector.parse("(x && y) || z"); print(selector.evaluate((variable) => args.contains(variable))); } ``` ## Versioning If this package adds new features to the boolean selector syntax, it will increment its major version number. This ensures that packages that expose the syntax to their users will be able to update their own minor versions, so their users can indicate that they rely on the new syntax.