diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9136aad..192ee0c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,5 +22,16 @@ jobs: run: cargo check - name: Cargo Test run: cargo test + - name: Cargo Clippy + run: cargo clippy -- -D warnings - name: Cargo format run: cargo fmt --check + - name: Verify generated filter parser + run: | + cargo install lalrpop --version 0.23.1 + lalrpop src/filter_parser.lalrpop + git diff --exit-code src/filter_parser.rs || { + echo "::error::src/filter_parser.rs does not match regenerated output from src/filter_parser.lalrpop" + echo "Run 'lalrpop src/filter_parser.lalrpop' and commit the result." + exit 1 + } diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..adf2c98 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,20 @@ +# CHANGELOG + +## 0.4 + +### Breaking Changes +- Refactor `PatchOperation` into a tagged enum (`Add`, `Remove`, `Replace`) with `OperationTarget` variants (`WithPath`, `WithoutPath`), replacing the old `PatchOperations` struct. Paths are now parsed as `PatchPath` filter expressions instead of raw strings. +- Parameterize ID types on `User`, `Group`, `Member`, `Resource`, and `ListResponse` (default type parameter is `String`, so unparameterized usage is unchanged) +- `Member.type` changed from `Option` to `Option` enum +- Remove `TryFrom<&str>` impls on `User` and `Group`; use `serde_json::from_str` directly +- Remove `Default` impls on `Group`, `ListResponse`, and `PatchOp` + +### Added +- SCIM filter expression parser (`filter` module, RFC 7644 §3.4.2.2); `SearchRequest` and `ListQuery` now include an optional `filter` field +- Case-insensitive deserialization of `PatchOperation` ops and `MemberType` for Entra compatibility +- Lenient `bool` deserialization (accepts `"true"`/`"false"` strings) on fields like `Role.primary` + +## 0.3 + +- Add `externalId` to user and group entities +- **Breaking** - Uses raw identifiers, converting `type_` to `r#type` diff --git a/Cargo.toml b/Cargo.toml index c2337d6..425bd93 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "scim_v2" -version = "0.3.1" +version = "0.4.0" edition = "2024" authors = ["Dan Gericke "] description = "A crate that provides utilities for working with the System for Cross-domain Identity Management (SCIM) version 2.0 protocol. (rfc7642, rfc7643, rfc7644)" @@ -13,9 +13,14 @@ rust-version = "1.85" [dependencies] serde = { version = "1.0.228", features = ["derive"] } serde_json = "1.0.145" +lalrpop-util = { version = "0.23.1", features = ["lexer"] } +fluent-uri = "0.4.1" +thiserror = "2.0.18" [dev-dependencies] pretty_assertions = "1.4.1" +test-case = "3.3.1" +uuid = { version = "1.22.0", features = ["serde"]} [lib] doc-scrape-examples = true diff --git a/README.md b/README.md index 71cac2d..6c12a89 100644 --- a/README.md +++ b/README.md @@ -93,10 +93,25 @@ Err(e) => println !("Deserialization error: {}", e), For more examples and usage details, refer to the documentation of each function and struct. +## Regenerating the filter parser + +The SCIM filter parser (`src/filter_parser.rs`) is pre-generated from `src/filter_parser.lalrpop` +using [LALRPOP](https://github.com/lalrpop/lalrpop). The generated file is committed +to the repository so no build script is required. + +If you modify `src/filter_parser.lalrpop`, regenerate `src/filter_parser.rs` by running: + +```sh +cargo install lalrpop +lalrpop src/filter_parser.lalrpop +``` + +Commit both `src/filter_parser.lalrpop` and the updated `src/filter_parser.rs` together. + ## Contributing Contributions are welcome! Please feel free to submit a Pull Request. ## License -[MIT](https://choosealicense.com/licenses/mit/) \ No newline at end of file +[MIT](https://choosealicense.com/licenses/mit/) diff --git a/src/filter.rs b/src/filter.rs new file mode 100644 index 0000000..173e0aa --- /dev/null +++ b/src/filter.rs @@ -0,0 +1,1046 @@ +//! SCIM filter expressions (RFC 7644 §3.4.2.2) and PATCH paths (RFC 7644 §3.5.2). +//! +//! # Overview +//! +//! This module provides the AST types for SCIM filter expressions and PATCH operation +//! paths. The two main entry points are [`Filter`] and [`PatchPath`]. +//! +//! # SCIM server: evaluating an incoming filter +//! +//! Filters arrive already deserialized inside other SCIM message types: +//! +//! - [`SearchRequest::filter`](crate::models::others::SearchRequest::filter) — from a +//! `POST /.search` body. +//! - [`ListQuery::filter`](crate::models::others::ListQuery::filter) — from a `GET` +//! query string (`?filter=...`), parsed by your web framework into this struct. +//! - [`PatchOperation`](crate::models::others::PatchOperation) — each operation's +//! `path` field deserializes as a [`PatchPath`]. +//! +//! Once you have a [`Filter`], recursively `match` on its variants to evaluate it: +//! +//! ``` +//! # use scim_v2::filter::*; +//! fn matches_user(filter: &Filter, user_name: &str) -> bool { +//! match filter { +//! Filter::Attr(AttrExp::Comparison(path, CompareOp::Eq, CompValue::Str(v))) +//! if path.name == "userName" => +//! { +//! user_name == v +//! } +//! Filter::And(lhs, rhs) => matches_user(lhs, user_name) && matches_user(rhs, user_name), +//! Filter::Or(lhs, rhs) => matches_user(lhs, user_name) || matches_user(rhs, user_name), +//! Filter::Not(inner) => !matches_user(inner, user_name), +//! _ => false, +//! } +//! } +//! +//! let filter: Filter = r#"userName eq "bjensen""#.parse().unwrap(); +//! assert!(matches_user(&filter, "bjensen")); +//! assert!(!matches_user(&filter, "jsmith")); +//! ``` +//! +//! # SCIM client: building a filter to send in a request +//! +//! Construct the AST directly and assign it to the `filter` field of +//! [`SearchRequest`](crate::models::others::SearchRequest) or +//! [`ListQuery`](crate::models::others::ListQuery). Those types implement +//! `serde::Serialize`, so the filter is serialized automatically as a JSON +//! string when you serialize the containing struct. You can also call +//! `.to_string()` directly when you need the raw filter string for a query +//! parameter: +//! +//! ``` +//! # use scim_v2::filter::*; +//! let filter = Filter::And( +//! Box::new(Filter::Attr(AttrExp::Present(AttrPath::with_name("title")))), +//! Box::new(Filter::Attr(AttrExp::Comparison( +//! AttrPath::with_name("userType"), +//! CompareOp::Eq, +//! "Employee".into(), +//! ))), +//! ); +//! assert_eq!(filter.to_string(), r#"title pr and userType eq "Employee""#); +//! ``` + +use fluent_uri::Uri; +use lalrpop_util::ParseError as LalrParseError; +use serde::{Deserialize, Deserializer, Serialize, Serializer}; +use std::fmt::{Display, Formatter}; +use thiserror::Error; + +/// Error produced by fallible grammar actions (`=>?` rules in the LALRPOP grammar). +#[derive(Debug, Error)] +pub enum FilterActionError { + /// An `attrPath` token contained more than one sub-attribute segment. + #[error("attrPath '{0}' has more than one sub-attribute segment")] + InvalidAttrPath(String), + /// A comparison value contained an invalid JSON escape or format. + #[error("invalid comparison value: {0}")] + InvalidCompValue(#[from] serde_json::Error), +} + +/// Error returned by [`Filter::from_str`] and [`PatchPath::from_str`] when the +/// input is not a valid filter or path expression. +pub type ParseError = LalrParseError; + +/// A SCIM filter expression (RFC 7644 §3.4.2.2). +/// +/// Filters are used in SCIM `GET` requests (`?filter=...`) and in conditional +/// operations. The expression forms a tree of logical and comparison nodes. +/// +/// ## Operator precedence +/// +/// From highest to lowest: `not` > `and` > `or`. [`Display`] parenthesises +/// sub-expressions automatically so the output round-trips correctly. +/// +/// ## Construction +/// +/// Build filters from the enum variants and the supporting types: +/// +/// ``` +/// # use scim_v2::filter::*; +/// let work_emails = Filter::ValuePath(ValuePath { +/// attr: AttrPath::with_name("emails"), +/// filter: Box::new(ValFilter::Attr(AttrExp::Comparison( +/// AttrPath::with_name("type"), +/// CompareOp::Eq, +/// "work".into(), +/// ))), +/// }); +/// assert_eq!(work_emails.to_string(), r#"emails[type eq "work"]"#); +/// ``` +/// +/// ## Matching +/// +/// Use a recursive `match` to walk the tree when evaluating a filter against a +/// resource. See the [module-level examples](self) for a complete pattern. +/// +/// ## Serde +/// +/// [`Filter`] serializes as a JSON string (the filter expression) and +/// deserializes from a JSON string via [`FromStr`](std::str::FromStr). +#[derive(Debug, Clone, PartialEq)] +pub enum Filter { + /// A single attribute expression: a presence test or a comparison. + /// + /// Examples: `title pr`, `userName eq "bjensen"`. + Attr(AttrExp), + + /// An attribute path with a bracketed sub-filter applied to its values. + /// + /// Example: `emails[type eq "work" and value co "@example.com"]`. + /// + /// This form filters the elements of a multi-valued attribute; only elements + /// matching the inner [`ValFilter`] are considered. + ValuePath(ValuePath), + + /// Logical negation of the inner filter. + /// + /// Serializes as `not ()`. The inner filter is always parenthesised. + Not(Box), + + /// Logical conjunction — both operands must match. + /// + /// Binds more tightly than [`Or`](Filter::Or). + And(Box, Box), + + /// Logical disjunction — at least one operand must match. + /// + /// Lowest precedence operator. When an `Or` expression appears as a + /// direct child of an `And`, [`Display`] wraps it in parentheses to + /// preserve the original precedence on round-trip. + Or(Box, Box), +} + +impl Display for Filter { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self { + Filter::Attr(e) => write!(f, "{e}"), + Filter::ValuePath(vp) => write!(f, "{}[{}]", vp.attr, vp.filter), + Filter::Not(inner) => write!(f, "not ({inner})"), + Filter::And(lhs, rhs) => { + fmt_and_operand_filter(lhs, f)?; + write!(f, " and ")?; + fmt_and_operand_filter(rhs, f) + } + Filter::Or(lhs, rhs) => write!(f, "{lhs} or {rhs}"), + } + } +} + +fn fmt_and_operand_filter(operand: &Filter, f: &mut Formatter<'_>) -> std::fmt::Result { + if matches!(operand, Filter::Or(_, _)) { + write!(f, "({operand})") + } else { + write!(f, "{operand}") + } +} + +impl Serialize for Filter { + fn serialize(&self, serializer: S) -> Result { + serializer.serialize_str(&self.to_string()) + } +} + +impl<'de> Deserialize<'de> for Filter { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + s.parse().map_err(serde::de::Error::custom) + } +} + +impl std::str::FromStr for Filter { + type Err = ParseError; + + fn from_str(s: &str) -> Result { + crate::filter_parser::FilterParser::new() + .parse(s.trim()) + .map_err(|e| e.map_token(|t| t.to_string())) + } +} + +/// The `attrPath "[" valFilter "]"` form of a filter (RFC 7644 §3.4.2.2). +/// +/// Selects elements of a multi-valued attribute that satisfy the inner filter. +/// +/// ``` +/// # use scim_v2::filter::*; +/// let vp = ValuePath { +/// attr: AttrPath::with_name("emails"), +/// filter: Box::new(ValFilter::Attr(AttrExp::Comparison( +/// AttrPath::with_name("type"), +/// CompareOp::Eq, +/// "work".into(), +/// ))), +/// }; +/// assert_eq!(Filter::ValuePath(vp).to_string(), r#"emails[type eq "work"]"#); +/// ``` +#[derive(Debug, Clone, PartialEq)] +pub struct ValuePath { + /// The multi-valued attribute being filtered. + pub attr: AttrPath, + /// The filter applied to each element of the attribute's values. + pub filter: Box, +} + +/// A filter expression used inside `[...]` brackets (RFC 7644 §3.4.2.2). +/// +/// Structurally identical to [`Filter`] but does not allow nested +/// [`ValuePath`] expressions. The RFC specifies that the expression inside +/// square brackets must be a valid filter expression based on sub-attributes +/// of the parent attribute. +/// +/// Used as the inner filter of [`ValuePath`] and [`PatchValuePath`]. +#[derive(Debug, Clone, PartialEq)] +pub enum ValFilter { + /// A single attribute expression (presence test or comparison). + Attr(AttrExp), + /// Logical negation. Serializes as `not ()`. + Not(Box), + /// Logical conjunction — both operands must match. + And(Box, Box), + /// Logical disjunction — at least one operand must match. + Or(Box, Box), +} + +/// An atomic filter expression: a presence test or an attribute comparison. +/// +/// ``` +/// # use scim_v2::filter::*; +/// // "title pr" — attribute is present and non-null +/// let present = AttrExp::Present(AttrPath::with_name("title")); +/// assert_eq!(Filter::Attr(present).to_string(), "title pr"); +/// +/// // "userName eq \"bjensen\"" +/// let cmp = AttrExp::Comparison( +/// AttrPath::with_name("userName"), +/// CompareOp::Eq, +/// "bjensen".into(), +/// ); +/// assert_eq!(Filter::Attr(cmp).to_string(), r#"userName eq "bjensen""#); +/// ``` +#[derive(Debug, Clone, PartialEq)] +pub enum AttrExp { + /// The `pr` (present) operator. Matches when the attribute exists and is not null. + /// + /// Example: `title pr` + Present(AttrPath), + + /// A comparison operator with a value. + /// + /// Example: `userName eq "bjensen"`, `meta.lastModified gt "2024-01-01T00:00:00Z"` + Comparison(AttrPath, CompareOp, CompValue), +} + +/// A SCIM attribute path, optionally qualified with a schema URI and/or a sub-attribute. +/// +/// An attribute path can take three forms: +/// +/// | Form | Example string | Constructor | +/// |------|---------------|-------------| +/// | Simple name | `userName` | [`AttrPath::with_name("userName")`](AttrPath::with_name) | +/// | Sub-attribute | `name.familyName` | [`AttrPath::with_sub_attr("name", "familyName")`](AttrPath::with_sub_attr) | +/// | URI-prefixed | `urn:ietf:params:scim:schemas:core:2.0:User:userName` | struct literal with `uri: Some(...)` | +/// +/// ``` +/// # use scim_v2::filter::*; +/// assert_eq!(AttrPath::with_name("userName").to_string(), "userName"); +/// assert_eq!(AttrPath::with_sub_attr("name", "familyName").to_string(), "name.familyName"); +/// +/// // URI-prefixed form requires the struct literal +/// let path = AttrPath { +/// uri: Some("urn:ietf:params:scim:schemas:core:2.0:User".into()), +/// name: "userName".into(), +/// sub_attr: None, +/// }; +/// assert_eq!(path.to_string(), "urn:ietf:params:scim:schemas:core:2.0:User:userName"); +/// ``` +#[derive(Debug, Clone, PartialEq)] +pub struct AttrPath { + /// Optional schema URI prefix, e.g. `"urn:ietf:params:scim:schemas:core:2.0:User"`. + pub uri: Option, + /// Attribute name, e.g. `"userName"`. + pub name: String, + /// Sub-attribute, e.g. `"familyName"` from `"name.familyName"`. + pub sub_attr: Option, +} + +impl AttrPath { + /// Create an `AttrPath` for a simple attribute name (no URI prefix, no sub-attribute). + pub fn with_name(name: impl Into) -> Self { + Self { + uri: None, + name: name.into(), + sub_attr: None, + } + } + + /// Create an `AttrPath` for a dotted sub-attribute path (e.g. `name.familyName`). + pub fn with_sub_attr(name: impl Into, sub_attr: impl Into) -> Self { + Self { + uri: None, + name: name.into(), + sub_attr: Some(sub_attr.into()), + } + } +} + +/// SCIM comparison operators (RFC 7644 §3.4.2.2, Table 3). +/// +/// Operators are case-insensitive when parsed (`EQ`, `Eq`, and `eq` are all +/// accepted) but are always displayed in lowercase. +#[derive(Debug, Clone, PartialEq)] +pub enum CompareOp { + /// `eq` — equal. + Eq, + /// `ne` — not equal. + Ne, + /// `co` — contains (substring match). + Co, + /// `sw` — starts with. + Sw, + /// `ew` — ends with. + Ew, + /// `gt` — greater than. + Gt, + /// `lt` — less than. + Lt, + /// `ge` — greater than or equal to. + Ge, + /// `le` — less than or equal to. + Le, +} + +/// The comparison value (right-hand side of a filter comparison). +/// +/// Corresponds to the JSON scalar types allowed in SCIM filter expressions. +/// [`Display`] produces the JSON representation (e.g. `Str("foo")` → `"foo"` +/// with surrounding quotes and proper escaping). +/// +/// String values can be constructed with `.into()`: +/// +/// ``` +/// # use scim_v2::filter::*; +/// assert_eq!(CompValue::True.to_string(), "true"); +/// assert_eq!(CompValue::Null.to_string(), "null"); +/// let v: CompValue = "hello\nworld".into(); +/// assert_eq!(v.to_string(), r#""hello\nworld""#); +/// ``` +#[derive(Debug, Clone, PartialEq)] +pub enum CompValue { + /// JSON `false`. + False, + /// JSON `null`. + Null, + /// JSON `true`. + True, + /// A JSON number (integer or decimal), e.g. `42` or `3.14`. + Number(serde_json::Number), + /// An unescaped string value. [`Display`] produces the JSON string literal + /// (with surrounding double quotes and escape sequences). + Str(String), +} + +impl From for CompValue { + fn from(s: String) -> Self { + CompValue::Str(s) + } +} + +impl From<&str> for CompValue { + fn from(s: &str) -> Self { + CompValue::Str(s.to_owned()) + } +} + +/// Parse the raw attrPath token (e.g. "name.givenName" or +/// "urn:ietf:params:scim:schemas:core:2.0:User:userName") into an AttrPath. +pub(crate) fn parse_attr_path(s: &str) -> Result { + // Attempt to detect a URI prefix: a URI prefix contains ':' and the last + // colon-separated segment is a plain identifier (no further ':'). + let (uri, rest) = if let Some((before, after)) = s.rsplit_once(':') { + // Delegate URI parsing to fluent_uri to keep filter.lalrpop simple + if Uri::parse(before).is_ok() { + (Some(before.to_owned()), after) + } else { + (None, s) + } + } else { + (None, s) + }; + + // RFC 7644 §3.4.2.2: attrPath = [URI ":"] ATTRNAME *1subAttr + // "*1" means at most one sub-attribute segment. + if rest.chars().filter(|&c| c == '.').count() > 1 { + return Err(FilterActionError::InvalidAttrPath(s.to_string())); + } + + let (name, sub_attr) = rest + .split_once('.') + .map_or((rest, None), |(name, sub_attr)| { + (name, Some(sub_attr.to_string())) + }); + + Ok(AttrPath { + uri, + name: name.to_string(), + sub_attr, + }) +} + +/// A SCIM PATCH operation path (RFC 7644 §3.5.2). +/// +/// The `path` field of a PATCH operation identifies which attribute (or subset +/// of attribute values) to modify. It takes one of two forms: +/// +/// | Form | Example | Variant | +/// |------|---------|---------| +/// | Plain attribute path | `userName`, `name.familyName` | [`PatchPath::Attr`] | +/// | Value path with optional sub-attribute | `emails[type eq "work"]`, `emails[type eq "work"].value` | [`PatchPath::Value`] | +/// +/// ## SCIM server: inspecting an incoming PATCH path +/// +/// ``` +/// # use scim_v2::filter::*; +/// fn describe_path(path: &PatchPath) -> String { +/// match path { +/// PatchPath::Attr(attr) => format!("set attribute '{attr}'"), +/// PatchPath::Value(vp) => { +/// let sub = vp.sub_attr.as_deref().unwrap_or("(all fields)"); +/// format!("set '{}' on matching '{}' values", sub, vp.attr) +/// } +/// } +/// } +/// +/// let path: PatchPath = r#"emails[type eq "work"].value"#.parse().unwrap(); +/// assert_eq!(describe_path(&path), "set 'value' on matching 'emails' values"); +/// ``` +/// +/// ## SCIM client: building a PATCH path +/// +/// ``` +/// # use scim_v2::filter::*; +/// // emails[type eq "work"].value +/// let path = PatchPath::Value(PatchValuePath { +/// attr: AttrPath::with_name("emails"), +/// filter: ValFilter::Attr(AttrExp::Comparison( +/// AttrPath::with_name("type"), +/// CompareOp::Eq, +/// "work".into(), +/// )), +/// sub_attr: Some("value".into()), +/// }); +/// assert_eq!(path.to_string(), r#"emails[type eq "work"].value"#); +/// ``` +#[derive(Debug, Clone, PartialEq)] +pub enum PatchPath { + /// Plain attribute path (e.g. `"userName"`, `"name.familyName"`). + Attr(AttrPath), + /// Value path with optional trailing sub-attribute + /// (e.g. `emails[type eq "work"]` or `emails[type eq "work"].value`). + Value(PatchValuePath), +} + +/// The `valuePath [subAttr]` form of a PATCH path (RFC 7644 §3.5.2). +/// +/// Identifies a specific subset of a multi-valued attribute's elements, and +/// optionally a sub-attribute within those elements. +/// +/// ``` +/// # use scim_v2::filter::*; +/// let pvp = PatchValuePath { +/// attr: AttrPath::with_name("emails"), +/// filter: ValFilter::Attr(AttrExp::Comparison( +/// AttrPath::with_name("type"), +/// CompareOp::Eq, +/// "work".into(), +/// )), +/// sub_attr: Some("value".into()), +/// }; +/// assert_eq!(pvp.to_string(), r#"emails[type eq "work"].value"#); +/// ``` +#[derive(Debug, Clone, PartialEq)] +pub struct PatchValuePath { + /// The multi-valued attribute being targeted. + pub attr: AttrPath, + /// The filter that selects which elements of the attribute to modify. + pub filter: ValFilter, + /// Optional sub-attribute after the closing bracket (e.g. `"value"` in + /// `emails[type eq "work"].value`). When `None`, the operation targets + /// the entire matching element. + pub sub_attr: Option, +} + +impl Display for AttrPath { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + if let Some(uri) = &self.uri { + write!(f, "{uri}:")?; + } + write!(f, "{}", self.name)?; + if let Some(sub) = &self.sub_attr { + write!(f, ".{sub}")?; + } + Ok(()) + } +} + +impl Display for CompareOp { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + let s = match self { + CompareOp::Eq => "eq", + CompareOp::Ne => "ne", + CompareOp::Co => "co", + CompareOp::Sw => "sw", + CompareOp::Ew => "ew", + CompareOp::Gt => "gt", + CompareOp::Lt => "lt", + CompareOp::Ge => "ge", + CompareOp::Le => "le", + }; + write!(f, "{s}") + } +} + +impl Display for CompValue { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self { + CompValue::False => write!(f, "false"), + CompValue::Null => write!(f, "null"), + CompValue::True => write!(f, "true"), + CompValue::Number(n) => write!(f, "{n}"), + CompValue::Str(s) => { + // Produce a JSON-encoded string (with surrounding quotes and proper escaping) + let encoded = serde_json::to_string(s).expect("string serialization never fails"); + write!(f, "{encoded}") + } + } + } +} + +impl Display for AttrExp { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self { + AttrExp::Present(path) => write!(f, "{path} pr"), + AttrExp::Comparison(path, op, val) => write!(f, "{path} {op} {val}"), + } + } +} + +impl Display for ValFilter { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self { + ValFilter::Attr(e) => write!(f, "{e}"), + ValFilter::Not(inner) => write!(f, "not ({inner})"), + ValFilter::And(lhs, rhs) => { + fmt_and_operand_val_filter(lhs, f)?; + write!(f, " and ")?; + fmt_and_operand_val_filter(rhs, f) + } + ValFilter::Or(lhs, rhs) => write!(f, "{lhs} or {rhs}"), + } + } +} + +fn fmt_and_operand_val_filter(operand: &ValFilter, f: &mut Formatter<'_>) -> std::fmt::Result { + if matches!(operand, ValFilter::Or(_, _)) { + write!(f, "({operand})") + } else { + write!(f, "{operand}") + } +} + +impl Display for PatchValuePath { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, "{}[{}]", self.attr, self.filter)?; + if let Some(sub) = &self.sub_attr { + write!(f, ".{sub}")?; + } + Ok(()) + } +} + +impl Display for PatchPath { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self { + PatchPath::Attr(p) => write!(f, "{p}"), + PatchPath::Value(vp) => write!(f, "{vp}"), + } + } +} + +impl Serialize for PatchPath { + fn serialize(&self, serializer: S) -> Result { + serializer.serialize_str(&self.to_string()) + } +} + +impl<'de> Deserialize<'de> for PatchPath { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + s.parse().map_err(serde::de::Error::custom) + } +} + +impl std::str::FromStr for PatchPath { + type Err = ParseError; + + fn from_str(s: &str) -> Result { + crate::filter_parser::PathParser::new() + .parse(s.trim()) + .map_err(|e| e.map_token(|t| t.to_string())) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use test_case::test_case; + + #[test] + fn test_scim_filter_simple_eq() { + let f = crate::filter_parser::FilterParser::new() + .parse(r#"userName eq "bjensen""#) + .unwrap(); + assert_eq!( + f, + Filter::Attr(AttrExp::Comparison( + AttrPath { + uri: None, + name: "userName".into(), + sub_attr: None + }, + CompareOp::Eq, + CompValue::Str("bjensen".into()), + )) + ); + } + + #[test] + fn test_scim_filter_case_insensitive_op() { + // RFC: "Attribute names and attribute operators used in filters are case insensitive" + let f1 = crate::filter_parser::FilterParser::new() + .parse(r#"userName Eq "john""#) + .unwrap(); + let f2 = crate::filter_parser::FilterParser::new() + .parse(r#"userName eq "john""#) + .unwrap(); + assert_eq!(f1, f2); + } + + #[test] + fn test_scim_filter_pr() { + let f = crate::filter_parser::FilterParser::new() + .parse("title pr") + .unwrap(); + assert_eq!( + f, + Filter::Attr(AttrExp::Present(AttrPath { + uri: None, + name: "title".into(), + sub_attr: None, + })) + ); + } + + #[test] + fn test_scim_filter_sub_attr() { + let f = crate::filter_parser::FilterParser::new() + .parse(r#"name.familyName co "O'Malley""#) + .unwrap(); + assert_eq!( + f, + Filter::Attr(AttrExp::Comparison( + AttrPath { + uri: None, + name: "name".into(), + sub_attr: Some("familyName".into()), + }, + CompareOp::Co, + CompValue::Str("O'Malley".into()), + )) + ); + } + + #[test] + fn test_scim_filter_uri_prefix() { + let f = crate::filter_parser::FilterParser::new() + .parse(r#"urn:ietf:params:scim:schemas:core:2.0:User:userName sw "J""#) + .unwrap(); + assert_eq!( + f, + Filter::Attr(AttrExp::Comparison( + AttrPath { + uri: Some("urn:ietf:params:scim:schemas:core:2.0:User".into()), + name: "userName".into(), + sub_attr: None, + }, + CompareOp::Sw, + CompValue::Str("J".into()), + )) + ); + } + + #[test] + fn test_scim_filter_and() { + let f = crate::filter_parser::FilterParser::new() + .parse(r#"title pr and userType eq "Employee""#) + .unwrap(); + assert_eq!( + f, + Filter::And( + Box::new(Filter::Attr(AttrExp::Present(AttrPath { + uri: None, + name: "title".into(), + sub_attr: None, + }))), + Box::new(Filter::Attr(AttrExp::Comparison( + AttrPath { + uri: None, + name: "userType".into(), + sub_attr: None + }, + CompareOp::Eq, + CompValue::Str("Employee".into()), + ))), + ) + ); + } + + #[test] + fn test_scim_filter_or() { + let f = crate::filter_parser::FilterParser::new() + .parse(r#"title pr or userType eq "Intern""#) + .unwrap(); + assert_eq!( + f, + Filter::Or( + Box::new(Filter::Attr(AttrExp::Present(AttrPath { + uri: None, + name: "title".into(), + sub_attr: None, + }))), + Box::new(Filter::Attr(AttrExp::Comparison( + AttrPath { + uri: None, + name: "userType".into(), + sub_attr: None + }, + CompareOp::Eq, + CompValue::Str("Intern".into()), + ))), + ) + ); + } + + #[test] + fn test_scim_filter_and_precedence_over_or() { + // "A and B or C" should parse as "(A and B) or C" + let f = crate::filter_parser::FilterParser::new() + .parse(r#"title pr and userType eq "Employee" or emails pr"#) + .unwrap(); + + assert!(matches!(f, Filter::Or(_, _))); + if let Filter::Or(left, _) = f { + assert!(matches!(*left, Filter::And(_, _))); + } + } + + #[test] + fn test_scim_filter_not() { + let f = crate::filter_parser::FilterParser::new() + .parse(r#"not (emails co "example.com")"#) + .unwrap(); + assert!(matches!(f, Filter::Not(_))); + } + + #[test] + fn test_scim_filter_grouping() { + // Parens change precedence: "A or (B and C)" — inner group is And + let f = crate::filter_parser::FilterParser::new() + .parse(r#"userType eq "Employee" and (emails co "example.com" or emails.value co "example.org")"#) + .unwrap(); + assert!(matches!(f, Filter::And(_, _))); + } + + #[test] + fn test_scim_filter_value_path() { + let f = crate::filter_parser::FilterParser::new() + .parse(r#"emails[type eq "work" and value co "@example.com"]"#) + .unwrap(); + assert!(matches!(f, Filter::ValuePath(_))); + if let Filter::ValuePath(vp) = f { + assert_eq!(vp.attr.name, "emails"); + assert!(matches!(*vp.filter, ValFilter::And(_, _))); + } + } + + // All RFC Figure 2 examples: parse must succeed and display must round-trip. + #[test_case(r#"userName eq "bjensen""# ; "simple_eq")] + #[test_case(r#"name.familyName co "O'Malley""# ; "sub_attr_co")] + #[test_case(r#"userName sw "J""# ; "sw")] + #[test_case(r#"urn:ietf:params:scim:schemas:core:2.0:User:userName sw "J""# ; "uri_prefix_sw")] + #[test_case("title pr" ; "pr")] + #[test_case(r#"meta.lastModified gt "2011-05-13T04:42:34Z""# ; "datetime_gt")] + #[test_case(r#"meta.lastModified ge "2011-05-13T04:42:34Z""# ; "datetime_ge")] + #[test_case(r#"meta.lastModified lt "2011-05-13T04:42:34Z""# ; "datetime_lt")] + #[test_case(r#"meta.lastModified le "2011-05-13T04:42:34Z""# ; "datetime_le")] + #[test_case(r#"title pr and userType eq "Employee""# ; "and")] + #[test_case(r#"title pr or userType eq "Intern""# ; "or")] + #[test_case(r#"schemas eq "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User""# ; "urn_value")] + #[test_case(r#"userType eq "Employee" and (emails co "example.com" or emails.value co "example.org")"# ; "and_grouped_or")] + #[test_case(r#"userType ne "Employee" and not (emails co "example.com" or emails.value co "example.org")"# ; "and_not_grouped_or")] + #[test_case(r#"userType eq "Employee" and (emails.type eq "work")"# ; "and_grouped_sub_attr")] + #[test_case(r#"userType eq "Employee" and emails[type eq "work" and value co "@example.com"]"# ; "and_value_path")] + #[test_case(r#"emails[type eq "work" and value co "@example.com"] or ims[type eq "xmpp" and value co "@foo.com"]"# ; "two_value_paths_or")] + fn filter_parses_and_round_trips(s: &str) { + let f: Filter = s.parse().unwrap_or_else(|e| panic!("parse {s:?}: {e:?}")); + let displayed = f.to_string(); + let reparsed: Filter = displayed + .parse() + .unwrap_or_else(|e| panic!("re-parse of {displayed:?}: {e:?}")); + assert_eq!(f, reparsed, "round-trip mismatch for {s:?}"); + } + + // --------------------------------------------------------------------------- + // SCIM PATCH path tests (RFC 7644 §3.5.2) + // --------------------------------------------------------------------------- + + #[test] + fn test_scim_patch_path_attr() { + let p = crate::filter_parser::PathParser::new() + .parse("userName") + .unwrap(); + assert_eq!( + p, + PatchPath::Attr(AttrPath { + uri: None, + name: "userName".into(), + sub_attr: None + }) + ); + } + + #[test] + fn test_scim_patch_path_sub_attr() { + let p = crate::filter_parser::PathParser::new() + .parse("name.familyName") + .unwrap(); + assert_eq!( + p, + PatchPath::Attr(AttrPath { + uri: None, + name: "name".into(), + sub_attr: Some("familyName".into()), + }) + ); + } + + #[test] + fn test_scim_patch_path_value_path() { + let p = crate::filter_parser::PathParser::new() + .parse(r#"emails[type eq "work"]"#) + .unwrap(); + let PatchPath::Value(vp) = p else { + panic!("expected PatchPath::Value"); + }; + assert_eq!(vp.attr.name, "emails"); + assert!(vp.sub_attr.is_none()); + } + + #[test] + fn test_scim_patch_path_value_path_sub_attr() { + let p = crate::filter_parser::PathParser::new() + .parse(r#"emails[type eq "work"].value"#) + .unwrap(); + let PatchPath::Value(vp) = p else { + panic!("expected PatchPath::Value"); + }; + assert_eq!(vp.attr.name, "emails"); + assert_eq!(vp.sub_attr.as_deref(), Some("value")); + } + + // Patch paths that must be rejected by the parser. + #[test_case(r#"emails[type eq "work"].value.extra"# ; "dotted_sub_attr")] + #[test_case(r#"emails[type eq "work"].urn:foo:bar"# ; "trailing_urn")] + #[test_case("name.family.given" ; "too_many_sub_attrs")] + fn path_rejected(s: &str) { + assert!(crate::filter_parser::PathParser::new().parse(s).is_err()); + } + + // Filter strings with invalid comp-values that must be rejected. + #[test_case(r#"userName eq "\q""# ; "unknown_escape")] + #[test_case(r#"userName eq "\uGHIJ""# ; "invalid_unicode_escape")] + fn filter_comp_value_rejected(s: &str) { + assert!(crate::filter_parser::FilterParser::new().parse(s).is_err()); + } + + // Invalid attrPaths that do not conform to RFC 7644 Figure 1. + #[test_case("name." ; "empty_sub_attr")] + #[test_case("name.family.given pr" ; "too_many_sub_attrs")] + #[test_case(r#"emails[name.family.given eq "x"]"# ; "value_path_inner_too_many_sub_attrs")] + fn invalid_attr_path_rejected(s: &str) { + assert!(crate::filter_parser::FilterParser::new().parse(s).is_err()); + } + + // The RFC ABNF requires SP separators around compare/logical operators. + #[test_case(r#"userName eq"bjensen""# ; "missing_space_before_comp_value")] + #[test_case(r#"emails[type eq"work"]"# ; "missing_space_in_value_path")] + #[test_case(r#"title prand userType eq "Employee""# ; "missing_space_before_and")] + fn filter_requires_required_spaces(s: &str) { + assert!(crate::filter_parser::FilterParser::new().parse(s).is_err()); + } + + #[test] + fn test_comp_value_surrogate_pair_handled() { + // \uD800\uDC00 is a surrogate pair representing U+10000 + let f = crate::filter_parser::FilterParser::new() + .parse(r#"userName eq "\uD800\uDC00""#) + .unwrap(); + if let Filter::Attr(AttrExp::Comparison(_, _, CompValue::Str(s))) = f { + assert_eq!(s, "\u{10000}"); + } else { + panic!("unexpected parse result"); + } + } + + #[test] + fn test_scim_patch_path_complex_filter() { + let p = crate::filter_parser::PathParser::new() + .parse(r#"emails[type eq "work" and value co "@example.com"].value"#) + .unwrap(); + let PatchPath::Value(vp) = p else { + panic!("expected PatchPath::Value"); + }; + let ValFilter::And(_, _) = vp.filter else { + panic!("expected ValFilter::And, got {:?}", vp.filter); + }; + assert_eq!(vp.sub_attr.as_deref(), Some("value")); + } + + #[test] + fn test_val_filter_parenthesized_grouping() { + // Parenthesized grouping inside [...] should be accepted + let f = crate::filter_parser::FilterParser::new() + .parse(r#"emails[(type eq "work") and value pr]"#) + .unwrap(); + assert!(matches!(f, Filter::ValuePath(_))); + if let Filter::ValuePath(vp) = f { + assert!(matches!(*vp.filter, ValFilter::And(_, _))); + } + } + + #[test] + fn test_filter_from_str() { + let f: Filter = r#"userName eq "bjensen""#.parse().unwrap(); + assert!(matches!(f, Filter::Attr(AttrExp::Comparison(..)))); + } + + #[test] + fn test_patch_path_from_str() { + let p: PatchPath = r#"emails[type eq "work"].value"#.parse().unwrap(); + assert!(matches!(p, PatchPath::Value(_))); + } + + #[test] + fn test_filter_from_str_error() { + assert!(r#"not a valid filter !!!"#.parse::().is_err()); + } + + // --------------------------------------------------------------------------- + // Display / round-trip tests + // --------------------------------------------------------------------------- + + #[test_case("userName" ; "simple_attr")] + #[test_case("name.familyName" ; "sub_attr")] + #[test_case(r#"emails[type eq "work"]"# ; "value_path")] + #[test_case(r#"emails[type eq "work"].value"# ; "value_path_sub_attr")] + #[test_case(r#"emails[type eq "work" and value co "@example.com"].value"# ; "complex_filter")] + fn patch_path_round_trips(s: &str) { + let p: PatchPath = s.parse().unwrap_or_else(|e| panic!("parse {s:?}: {e:?}")); + let displayed = p.to_string(); + let reparsed: PatchPath = displayed + .parse() + .unwrap_or_else(|e| panic!("re-parse of {displayed:?}: {e:?}")); + assert_eq!(p, reparsed, "round-trip mismatch for {s:?}"); + } + + #[test] + fn test_display_attr_path() { + let p = AttrPath { + uri: Some("urn:ietf:params:scim:schemas:core:2.0:User".into()), + name: "userName".into(), + sub_attr: None, + }; + assert_eq!( + p.to_string(), + "urn:ietf:params:scim:schemas:core:2.0:User:userName" + ); + } + + #[test] + fn test_display_comp_value_string_escaping() { + // Newline in string must be JSON-escaped + let v = CompValue::Str("foo\nbar".into()); + assert_eq!(v.to_string(), r#""foo\nbar""#); + } + + #[test] + fn test_display_and_wraps_or_children() { + // "(A or B) and C" — Or child must be wrapped in parens + let f: Filter = r#"(title pr or userType eq "Intern") and emails pr"# + .parse() + .unwrap(); + let s = f.to_string(); + // Re-parse must yield the same tree + let reparsed: Filter = s.parse().unwrap(); + assert_eq!(f, reparsed); + // The output must contain parens around the Or + assert!(s.contains('('), "expected parens in {s:?}"); + } +} diff --git a/src/filter_parser.lalrpop b/src/filter_parser.lalrpop new file mode 100644 index 0000000..750208f --- /dev/null +++ b/src/filter_parser.lalrpop @@ -0,0 +1,179 @@ +// SCIM filter expression parser (RFC 7644 §3.4.2.2) +// +// Operator precedence (lowest → highest): +// or < and < not < grouping / attr expression / value path + + +use crate::filter::{ + AttrExp, AttrPath, CompareOp, CompValue, Filter, FilterActionError, + PatchPath, PatchValuePath, ValFilter, ValuePath, parse_attr_path, +}; + +grammar; + +extern { + type Error = FilterActionError; +} + +match { + // ---- Logical operators — include surrounding SP ---- + // Bare "and"/"or" without adjacent whitespace fall through to AttrNameTok. + r"\s+(?i:and)\s+" => "and", + r"\s+(?i:or)\s+" => "or", + // ---- "not" keyword — includes required trailing SP ---- + r"(?i:not)\s+" => "not", + // ---- Comparison operators — include required surrounding SP ---- + // Bare operators (no adjacent whitespace) fall through to AttrNameTok. + r"\s+(?i:eq)\s+" => "eq", + r"\s+(?i:ne)\s+" => "ne", + r"\s+(?i:co)\s+" => "co", + r"\s+(?i:sw)\s+" => "sw", + r"\s+(?i:ew)\s+" => "ew", + r"\s+(?i:pr)" => "pr", + r"\s+(?i:gt)\s+" => "gt", + r"\s+(?i:lt)\s+" => "lt", + r"\s+(?i:ge)\s+" => "ge", + r"\s+(?i:le)\s+" => "le", + // ---- JSON comparison values ---- + "false", + "null", + "true", + // ---- Grouping / value-path brackets and sub-attr separator ---- + "(", + ")", + "[", + "]", + ".", + // ---- JSON string literal (double-quoted, with escape sequences) ---- + r#""([^"\\]|\\.)*""# => StringLit, + // ---- JSON number literal ---- + r"-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?" => NumberLit, +} else { + // ---- Tier 2: attribute tokens ---- + // Placed in the else block so tier-1 keywords win on same-length ties, + // while a longer identifier like "andFoo" (len 6) still wins over "and" (len 3). + // + // The two patterns are non-overlapping: + // AttrNameTok — plain ATTRNAME only (no colon, no dot) + // AttrPathTok — name that contains at least one colon or dot (dotted or URN-prefixed) + // Longest-match ensures "value.extra" → AttrPathTok and "value" → AttrNameTok. + r"[a-zA-Z][a-zA-Z0-9_-]*" => AttrNameTok, + r"[a-zA-Z][a-zA-Z0-9_-]*[:.][a-zA-Z0-9_:.-]*" => AttrPathTok, +} + +// --------------------------------------------------------------------------- +// Top-level filter (unified rule with precedence-based disambiguation) +// --------------------------------------------------------------------------- + +pub Filter: Filter = { + #[precedence(level="0")] + FilterAtom, + #[precedence(level="1")] #[assoc(side="left")] + "and" => Filter::And(Box::new(l), Box::new(r)), + #[precedence(level="2")] #[assoc(side="left")] + "or" => Filter::Or(Box::new(l), Box::new(r)), +}; + +// Atom-level filter: attribute expression, value path, not, or parenthesised group. +// "not" token includes its required trailing SP, so no explicit SP in the rule. +FilterAtom: Filter = { + => Filter::Attr(e), + => Filter::ValuePath(v), + "not" "(" ")" => Filter::Not(Box::new(f)), + "(" ")" => f, +}; + +// --------------------------------------------------------------------------- +// Attribute expression and value path +// --------------------------------------------------------------------------- + +// attrPath "[" valFilter "]" +ValuePath: ValuePath = { + "[" "]" => ValuePath { + attr: a, + filter: Box::new(vf), + }, +}; + +// attrPath "pr" | attrPath compareOp compValue +// ("pr" token includes required leading SP; compareOp tokens include surrounding SP) +AttrExp: AttrExp = { + "pr" => AttrExp::Present(a), + => AttrExp::Comparison(a, op, v), +}; + +AttrPath: AttrPath = { + =>? Ok(parse_attr_path(s)?), + => AttrPath { uri: None, name: s.to_string(), sub_attr: None }, +}; + +// --------------------------------------------------------------------------- +// ValFilter — same as Filter but no nested ValuePath +// (per RFC: "The expression within square brackets MUST be a valid filter +// expression based upon sub-attributes of the parent attribute.") +// --------------------------------------------------------------------------- + +pub ValFilter: ValFilter = { + #[precedence(level="0")] + ValFilterAtom, + #[precedence(level="1")] #[assoc(side="left")] + "and" => ValFilter::And(Box::new(l), Box::new(r)), + #[precedence(level="2")] #[assoc(side="left")] + "or" => ValFilter::Or(Box::new(l), Box::new(r)), +}; + +ValFilterAtom: ValFilter = { + => ValFilter::Attr(e), + "not" "(" ")" => ValFilter::Not(Box::new(f)), + "(" ")" => f, +}; + +// --------------------------------------------------------------------------- +// Operators and values +// --------------------------------------------------------------------------- + +CompareOp: CompareOp = { + "eq" => CompareOp::Eq, + "ne" => CompareOp::Ne, + "co" => CompareOp::Co, + "sw" => CompareOp::Sw, + "ew" => CompareOp::Ew, + "gt" => CompareOp::Gt, + "lt" => CompareOp::Lt, + "ge" => CompareOp::Ge, + "le" => CompareOp::Le, +}; + +CompValue: CompValue = { + "false" => CompValue::False, + "null" => CompValue::Null, + "true" => CompValue::True, + =>? Ok(serde_json::from_str::(n).map(CompValue::Number).map_err(FilterActionError::from)?), + =>? Ok(serde_json::from_str::(s).map(CompValue::Str).map_err(FilterActionError::from)?), +}; + +// --------------------------------------------------------------------------- +// PATCH path (RFC 7644 §3.5.2) +// PATH = attrPath / valuePath [subAttr] +// +// LR(1) disambiguation: +// After AttrPath: '[' → shift into valuePath; else → reduce as plain attrPath +// After AttrPath "[" ValFilter "]": '.' → shift into sub-attr; else → reduce +// --------------------------------------------------------------------------- + +pub Path: PatchPath = { + // Plain attrPath (e.g. "userName", "name.familyName") + => PatchPath::Attr(a), + // valuePath without trailing sub-attribute (e.g. emails[type eq "work"]) + "[" "]" => PatchPath::Value(PatchValuePath { + attr: a, + filter: vf, + sub_attr: None, + }), + // valuePath with trailing sub-attribute (e.g. emails[type eq "work"].value) + "[" "]" "." => PatchPath::Value(PatchValuePath { + attr: a, + filter: vf, + sub_attr: Some(s.to_string()), + }), +}; diff --git a/src/filter_parser.rs b/src/filter_parser.rs new file mode 100644 index 0000000..90b24d7 --- /dev/null +++ b/src/filter_parser.rs @@ -0,0 +1,13729 @@ +// auto-generated: "lalrpop 0.23.1" +// sha3: 06392606ce7ae52c0157f0e98022c2ca81a253110c1a2db5a39b398fccc215b7 +use crate::filter::{ + AttrExp, AttrPath, CompareOp, CompValue, Filter, FilterActionError, + PatchPath, PatchValuePath, ValFilter, ValuePath, parse_attr_path, +}; +#[allow(unused_extern_crates)] +extern crate lalrpop_util as __lalrpop_util; +#[allow(unused_imports)] +use self::__lalrpop_util::state_machine as __state_machine; +#[allow(unused_extern_crates)] +extern crate alloc; + +#[rustfmt::skip] +#[allow(explicit_outlives_requirements, non_snake_case, non_camel_case_types, unused_mut, unused_variables, unused_imports, unused_parens, clippy::needless_lifetimes, clippy::type_complexity, clippy::needless_return, clippy::too_many_arguments, clippy::match_single_binding, clippy::clone_on_copy, clippy::unit_arg)] +mod __parse__Filter { + + use crate::filter::{ + AttrExp, AttrPath, CompareOp, CompValue, Filter, FilterActionError, + PatchPath, PatchValuePath, ValFilter, ValuePath, parse_attr_path, +}; + #[allow(unused_extern_crates)] + extern crate lalrpop_util as __lalrpop_util; + #[allow(unused_imports)] + use self::__lalrpop_util::state_machine as __state_machine; + #[allow(unused_extern_crates)] + extern crate alloc; + use self::__lalrpop_util::lexer::Token; + #[allow(dead_code)] + pub(crate) enum __Symbol<'input> + { + Variant0(&'input str), + Variant1(AttrExp), + Variant2(AttrPath), + Variant3(CompValue), + Variant4(CompareOp), + Variant5(Filter), + Variant6(PatchPath), + Variant7(ValFilter), + Variant8(ValuePath), + } + const __ACTION: &[i8] = &[ + // State 0 + 21, 22, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 1 + 0, 0, 0, 0, 0, 0, 23, 24, 25, 26, 27, 28, 29, 30, 0, 31, 32, 0, 0, 0, 5, 0, 0, 0, 0, + // State 2 + 21, 22, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 3 + 0, 0, 39, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 36, 37, + // State 4 + 21, 22, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, + // State 5 + 21, 22, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 6 + 21, 22, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 7 + 21, 22, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 8 + 0, 0, 0, 0, 0, 0, 23, 24, 25, 26, 27, 28, 29, 30, 0, 31, 32, 0, 0, 0, 0, 0, 0, 0, 0, + // State 9 + 21, 22, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, + // State 10 + 21, 22, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, + // State 11 + 21, 22, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, + // State 12 + 21, 22, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, + // State 13 + 0, 0, 0, 0, 0, -24, 0, 0, 0, 0, 0, 0, 0, 0, -24, 0, 0, 0, -24, 0, 0, 0, 0, 0, 0, + // State 14 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // State 15 + 0, 0, 0, 0, 0, -23, 0, 0, 0, 0, 0, 0, 0, 0, -23, 0, 0, 0, -23, 0, 0, 0, 0, 0, 0, + // State 16 + 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, -20, 0, 0, 0, -20, 0, 0, 0, 0, 0, 0, + // State 17 + 0, 0, 0, 0, 0, -21, 0, 0, 0, 0, 0, 0, 0, 0, -21, 0, 0, 0, -21, 0, 0, 0, 0, 0, 0, + // State 18 + 0, 0, 0, 0, 0, -25, 0, 0, 0, 0, 0, 0, 0, 0, -25, 0, 0, 0, -25, 0, 0, 0, 0, 0, 0, + // State 19 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, + // State 20 + 0, 0, 0, 0, 0, 0, -4, -4, -4, -4, -4, -4, -4, -4, 0, -4, -4, 0, 0, 0, -4, 0, 0, 0, 0, + // State 21 + 0, 0, 0, 0, 0, 0, -3, -3, -3, -3, -3, -3, -3, -3, 0, -3, -3, 0, 0, 0, -3, 0, 0, 0, 0, + // State 22 + 0, 0, -12, 0, -12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -12, -12, -12, + // State 23 + 0, 0, -10, 0, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10, -10, -10, + // State 24 + 0, 0, -14, 0, -14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, -14, -14, + // State 25 + 0, 0, -17, 0, -17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -17, -17, -17, + // State 26 + 0, 0, -15, 0, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, -15, -15, + // State 27 + 0, 0, -18, 0, -18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -18, -18, -18, + // State 28 + 0, 0, -16, 0, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16, -16, -16, + // State 29 + 0, 0, -11, 0, -11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -11, -11, -11, + // State 30 + 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, + // State 31 + 0, 0, -13, 0, -13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -13, -13, -13, + // State 32 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, + // State 33 + 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, -2, 0, 0, -2, 0, 0, 0, + // State 34 + 0, 0, 0, 0, 0, -5, 0, 0, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0, -5, 0, 0, -5, 0, 0, 0, + // State 35 + 0, 0, 0, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, -6, 0, 0, 0, -6, 0, 0, -6, 0, 0, 0, + // State 36 + 0, 0, 0, 0, 0, -7, 0, 0, 0, 0, 0, 0, 0, 0, -7, 0, 0, 0, -7, 0, 0, -7, 0, 0, 0, + // State 37 + 0, 0, 0, 0, 0, -8, 0, 0, 0, 0, 0, 0, 0, 0, -8, 0, 0, 0, -8, 0, 0, -8, 0, 0, 0, + // State 38 + 0, 0, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0, 0, -9, 0, 0, 0, -9, 0, 0, -9, 0, 0, 0, + // State 39 + 0, 0, 0, 0, 0, -36, 0, 0, 0, 0, 0, 0, 0, 0, -36, 0, 0, 0, -36, 0, 0, -36, 0, 0, 0, + // State 40 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, + // State 41 + 0, 0, 0, 0, 0, -35, 0, 0, 0, 0, 0, 0, 0, 0, -35, 0, 0, 0, -35, 0, 0, -35, 0, 0, 0, + // State 42 + 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, -32, 0, 0, 0, -32, 0, 0, -32, 0, 0, 0, + // State 43 + 0, 0, 0, 0, 0, -33, 0, 0, 0, 0, 0, 0, 0, 0, -33, 0, 0, 0, -33, 0, 0, -33, 0, 0, 0, + // State 44 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, + // State 45 + 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, -19, 0, 0, 0, -19, 0, 0, 0, 0, 0, 0, + // State 46 + 0, 0, 0, 0, 0, -22, 0, 0, 0, 0, 0, 0, 0, 0, -22, 0, 0, 0, -22, 0, 0, 0, 0, 0, 0, + // State 47 + 0, 0, 0, 0, 0, -27, 0, 0, 0, 0, 0, 0, 0, 0, -27, 0, 0, 0, -27, 0, 0, 0, 0, 0, 0, + // State 48 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 52, 0, 0, 0, 0, 0, 0, + // State 49 + 0, 0, 0, 0, 0, -39, 0, 0, 0, 0, 0, 0, 0, 0, -39, 0, 0, 0, -39, 0, 0, 0, 0, 0, 0, + // State 50 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, + // State 51 + 0, 0, 0, 0, 0, -26, 0, 0, 0, 0, 0, 0, 0, 0, -26, 0, 0, 0, -26, 0, 0, 0, 0, 0, 0, + // State 52 + 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, -31, 0, 0, 0, -31, 0, 0, -31, 0, 0, 0, + // State 53 + 0, 0, 0, 0, 0, -34, 0, 0, 0, 0, 0, 0, 0, 0, -34, 0, 0, 0, -34, 0, 0, -34, 0, 0, 0, + // State 54 + 0, 0, 0, 0, 0, -38, 0, 0, 0, 0, 0, 0, 0, 0, -38, 0, 0, 0, -38, 0, 0, -38, 0, 0, 0, + // State 55 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 57, 0, 0, 0, 0, 0, 0, + // State 56 + 0, 0, 0, 0, 0, -37, 0, 0, 0, 0, 0, 0, 0, 0, -37, 0, 0, 0, -37, 0, 0, -37, 0, 0, 0, + ]; + fn __action(state: i8, integer: usize) -> i8 { + __ACTION[(state as usize) * 25 + integer] + } + const __EOF_ACTION: &[i8] = &[ + // State 0 + 0, + // State 1 + 0, + // State 2 + 0, + // State 3 + 0, + // State 4 + 0, + // State 5 + 0, + // State 6 + 0, + // State 7 + 0, + // State 8 + 0, + // State 9 + 0, + // State 10 + 0, + // State 11 + 0, + // State 12 + 0, + // State 13 + -24, + // State 14 + -40, + // State 15 + -23, + // State 16 + -20, + // State 17 + -21, + // State 18 + -25, + // State 19 + 0, + // State 20 + 0, + // State 21 + 0, + // State 22 + 0, + // State 23 + 0, + // State 24 + 0, + // State 25 + 0, + // State 26 + 0, + // State 27 + 0, + // State 28 + 0, + // State 29 + 0, + // State 30 + -1, + // State 31 + 0, + // State 32 + 0, + // State 33 + -2, + // State 34 + -5, + // State 35 + -6, + // State 36 + -7, + // State 37 + -8, + // State 38 + -9, + // State 39 + 0, + // State 40 + 0, + // State 41 + 0, + // State 42 + 0, + // State 43 + 0, + // State 44 + 0, + // State 45 + -19, + // State 46 + -22, + // State 47 + -27, + // State 48 + 0, + // State 49 + -39, + // State 50 + 0, + // State 51 + -26, + // State 52 + 0, + // State 53 + 0, + // State 54 + 0, + // State 55 + 0, + // State 56 + 0, + ]; + fn __goto(state: i8, nt: usize) -> i8 { + match nt { + 0 => match state { + 4 | 9..=12 => 39, + _ => 13, + }, + 1 => match state { + 4 | 9..=12 => 8, + _ => 1, + }, + 2 => 33, + 3 => 3, + 4 => match state { + 2 => 32, + 7 => 48, + _ => 14, + }, + 5 => match state { + 6 => 46, + _ => 15, + }, + 6 => match state { + 5 => 45, + _ => 16, + }, + 7 => 17, + 9 => match state { + 9 => 50, + 12 => 55, + _ => 40, + }, + 10 => match state { + 11 => 53, + _ => 41, + }, + 11 => match state { + 10 => 52, + _ => 42, + }, + 12 => 43, + 13 => 18, + _ => 0, + } + } + #[allow(clippy::needless_raw_string_hashes)] + const __TERMINAL: &[&str] = &[ + r###"AttrNameTok"###, + r###"AttrPathTok"###, + r###"StringLit"###, + r###""not""###, + r###"NumberLit"###, + r###""and""###, + r###""co""###, + r###""eq""###, + r###""ew""###, + r###""ge""###, + r###""gt""###, + r###""le""###, + r###""lt""###, + r###""ne""###, + r###""or""###, + r###""pr""###, + r###""sw""###, + r###""(""###, + r###"")""###, + r###"".""###, + r###""[""###, + r###""]""###, + r###""false""###, + r###""null""###, + r###""true""###, + ]; + fn __expected_tokens(__state: i8) -> alloc::vec::Vec { + __TERMINAL.iter().enumerate().filter_map(|(index, terminal)| { + let next_state = __action(__state, index); + if next_state == 0 { + None + } else { + Some(alloc::string::ToString::to_string(terminal)) + } + }).collect() + } + fn __expected_tokens_from_states< + 'input, + >( + __states: &[i8], + _: core::marker::PhantomData<(&'input ())>, + ) -> alloc::vec::Vec + { + __TERMINAL.iter().enumerate().filter_map(|(index, terminal)| { + if __accepts(None, __states, Some(index), core::marker::PhantomData::<(&())>) { + Some(alloc::string::ToString::to_string(terminal)) + } else { + None + } + }).collect() + } + struct __StateMachine<'input> + where + { + input: &'input str, + __phantom: core::marker::PhantomData<(&'input ())>, + } + impl<'input> __state_machine::ParserDefinition for __StateMachine<'input> + where + { + type Location = usize; + type Error = FilterActionError; + type Token = Token<'input>; + type TokenIndex = usize; + type Symbol = __Symbol<'input>; + type Success = Filter; + type StateIndex = i8; + type Action = i8; + type ReduceIndex = i8; + type NonterminalIndex = usize; + + #[inline] + fn start_location(&self) -> Self::Location { + Default::default() + } + + #[inline] + fn start_state(&self) -> Self::StateIndex { + 0 + } + + #[inline] + fn token_to_index(&self, token: &Self::Token) -> Option { + __token_to_integer(token, core::marker::PhantomData::<(&())>) + } + + #[inline] + fn action(&self, state: i8, integer: usize) -> i8 { + __action(state, integer) + } + + #[inline] + fn error_action(&self, state: i8) -> i8 { + __action(state, 25 - 1) + } + + #[inline] + fn eof_action(&self, state: i8) -> i8 { + __EOF_ACTION[state as usize] + } + + #[inline] + fn goto(&self, state: i8, nt: usize) -> i8 { + __goto(state, nt) + } + + fn token_to_symbol(&self, token_index: usize, token: Self::Token) -> Self::Symbol { + __token_to_symbol(token_index, token, core::marker::PhantomData::<(&())>) + } + + fn expected_tokens(&self, state: i8) -> alloc::vec::Vec { + __expected_tokens(state) + } + + fn expected_tokens_from_states(&self, states: &[i8]) -> alloc::vec::Vec { + __expected_tokens_from_states(states, core::marker::PhantomData::<(&())>) + } + + #[inline] + fn uses_error_recovery(&self) -> bool { + false + } + + #[inline] + fn error_recovery_symbol( + &self, + recovery: __state_machine::ErrorRecovery, + ) -> Self::Symbol { + panic!("error recovery not enabled for this grammar") + } + + fn reduce( + &mut self, + action: i8, + start_location: Option<&Self::Location>, + states: &mut alloc::vec::Vec, + symbols: &mut alloc::vec::Vec<__state_machine::SymbolTriple>, + ) -> Option<__state_machine::ParseResult> { + __reduce( + self.input, + action, + start_location, + states, + symbols, + core::marker::PhantomData::<(&())>, + ) + } + + fn simulate_reduce(&self, action: i8) -> __state_machine::SimulatedReduce { + __simulate_reduce(action, core::marker::PhantomData::<(&())>) + } + } + fn __token_to_integer< + 'input, + >( + __token: &Token<'input>, + _: core::marker::PhantomData<(&'input ())>, + ) -> Option + { + #[warn(unused_variables)] + match __token { + Token(0, _) if true => Some(0), + Token(1, _) if true => Some(1), + Token(2, _) if true => Some(2), + Token(3, _) if true => Some(3), + Token(4, _) if true => Some(4), + Token(5, _) if true => Some(5), + Token(6, _) if true => Some(6), + Token(7, _) if true => Some(7), + Token(8, _) if true => Some(8), + Token(9, _) if true => Some(9), + Token(10, _) if true => Some(10), + Token(11, _) if true => Some(11), + Token(12, _) if true => Some(12), + Token(13, _) if true => Some(13), + Token(14, _) if true => Some(14), + Token(15, _) if true => Some(15), + Token(16, _) if true => Some(16), + Token(17, _) if true => Some(17), + Token(18, _) if true => Some(18), + Token(19, _) if true => Some(19), + Token(20, _) if true => Some(20), + Token(21, _) if true => Some(21), + Token(22, _) if true => Some(22), + Token(23, _) if true => Some(23), + Token(24, _) if true => Some(24), + _ => None, + } + } + fn __token_to_symbol< + 'input, + >( + __token_index: usize, + __token: Token<'input>, + _: core::marker::PhantomData<(&'input ())>, + ) -> __Symbol<'input> + { + #[allow(clippy::manual_range_patterns)]match __token_index { + 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 => match __token { + Token(0, __tok0) | Token(1, __tok0) | Token(2, __tok0) | Token(3, __tok0) | Token(4, __tok0) | Token(5, __tok0) | Token(6, __tok0) | Token(7, __tok0) | Token(8, __tok0) | Token(9, __tok0) | Token(10, __tok0) | Token(11, __tok0) | Token(12, __tok0) | Token(13, __tok0) | Token(14, __tok0) | Token(15, __tok0) | Token(16, __tok0) | Token(17, __tok0) | Token(18, __tok0) | Token(19, __tok0) | Token(20, __tok0) | Token(21, __tok0) | Token(22, __tok0) | Token(23, __tok0) | Token(24, __tok0) if true => __Symbol::Variant0(__tok0), + _ => unreachable!(), + }, + _ => unreachable!(), + } + } + fn __simulate_reduce< + 'input, + >( + __reduce_index: i8, + _: core::marker::PhantomData<(&'input ())>, + ) -> __state_machine::SimulatedReduce<__StateMachine<'input>> + { + match __reduce_index { + 0 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 2, + nonterminal_produced: 0, + } + } + 1 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 0, + } + } + 2 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 1, + } + } + 3 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 1, + } + } + 4 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 5 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 6 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 7 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 8 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 9 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 10 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 11 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 12 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 13 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 14 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 15 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 16 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 17 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 18 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 4, + } + } + 19 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 4, + } + } + 20 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 5, + } + } + 21 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 6, + } + } + 22 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 6, + } + } + 23 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 7, + } + } + 24 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 7, + } + } + 25 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 7, + } + } + 26 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 7, + } + } + 27 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 8, + } + } + 28 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 8, + } + } + 29 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 6, + nonterminal_produced: 8, + } + } + 30 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 9, + } + } + 31 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 9, + } + } + 32 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 10, + } + } + 33 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 11, + } + } + 34 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 11, + } + } + 35 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 12, + } + } + 36 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 12, + } + } + 37 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 12, + } + } + 38 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 13, + } + } + 39 => __state_machine::SimulatedReduce::Accept, + 40 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 15, + } + } + 41 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 16, + } + } + 42 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 17, + } + } + 43 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 18, + } + } + 44 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 19, + } + } + 45 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 20, + } + } + _ => panic!("invalid reduction index {__reduce_index}") + } + } + pub struct FilterParser { + builder: __lalrpop_util::lexer::MatcherBuilder, + _priv: (), + } + + impl Default for FilterParser { fn default() -> Self { Self::new() } } + impl FilterParser { + pub fn new() -> FilterParser { + let __builder = super::__intern_token::new_builder(); + FilterParser { + builder: __builder, + _priv: (), + } + } + + #[allow(dead_code)] + pub fn parse< + 'input, + >( + &self, + input: &'input str, + ) -> Result, FilterActionError>> + { + let mut __tokens = self.builder.matcher(input); + __state_machine::Parser::drive( + __StateMachine { + input, + __phantom: core::marker::PhantomData::<(&())>, + }, + __tokens, + ) + } + } + fn __accepts< + 'input, + >( + __error_state: Option, + __states: &[i8], + __opt_integer: Option, + _: core::marker::PhantomData<(&'input ())>, + ) -> bool + { + let mut __states = __states.to_vec(); + __states.extend(__error_state); + loop { + let mut __states_len = __states.len(); + let __top = __states[__states_len - 1]; + let __action = match __opt_integer { + None => __EOF_ACTION[__top as usize], + Some(__integer) => __action(__top, __integer), + }; + if __action == 0 { return false; } + if __action > 0 { return true; } + let (__to_pop, __nt) = match __simulate_reduce(-(__action + 1), core::marker::PhantomData::<(&())>) { + __state_machine::SimulatedReduce::Reduce { + states_to_pop, nonterminal_produced + } => (states_to_pop, nonterminal_produced), + __state_machine::SimulatedReduce::Accept => return true, + }; + __states_len -= __to_pop; + __states.truncate(__states_len); + let __top = __states[__states_len - 1]; + let __next_state = __goto(__top, __nt); + __states.push(__next_state); + } + } + fn __reduce< + 'input, + >( + input: &'input str, + __action: i8, + __lookahead_start: Option<&usize>, + __states: &mut alloc::vec::Vec, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> Option, FilterActionError>>> + { + let (__pop_states, __nonterminal) = match __action { + 0 => { + __reduce0(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 1 => { + __reduce1(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 2 => { + // AttrPath = AttrPathTok => ActionFn(19); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = match super::__action19::<>(input, __sym0) { + Ok(v) => v, + Err(e) => return Some(Err(e)), + }; + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + (1, 1) + } + 3 => { + __reduce3(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 4 => { + __reduce4(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 5 => { + __reduce5(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 6 => { + __reduce6(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 7 => { + // CompValue = NumberLit => ActionFn(41); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = match super::__action41::<>(input, __sym0) { + Ok(v) => v, + Err(e) => return Some(Err(e)), + }; + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + 8 => { + // CompValue = StringLit => ActionFn(42); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = match super::__action42::<>(input, __sym0) { + Ok(v) => v, + Err(e) => return Some(Err(e)), + }; + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + 9 => { + __reduce9(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 10 => { + __reduce10(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 11 => { + __reduce11(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 12 => { + __reduce12(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 13 => { + __reduce13(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 14 => { + __reduce14(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 15 => { + __reduce15(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 16 => { + __reduce16(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 17 => { + __reduce17(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 18 => { + __reduce18(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 19 => { + __reduce19(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 20 => { + __reduce20(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 21 => { + __reduce21(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 22 => { + __reduce22(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 23 => { + __reduce23(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 24 => { + __reduce24(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 25 => { + __reduce25(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 26 => { + __reduce26(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 27 => { + __reduce27(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 28 => { + __reduce28(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 29 => { + __reduce29(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 30 => { + __reduce30(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 31 => { + __reduce31(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 32 => { + __reduce32(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 33 => { + __reduce33(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 34 => { + __reduce34(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 35 => { + __reduce35(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 36 => { + __reduce36(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 37 => { + __reduce37(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 38 => { + __reduce38(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 39 => { + // __Filter = Filter => ActionFn(2); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action2::<>(input, __sym0); + return Some(Ok(__nt)); + } + 40 => { + __reduce40(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 41 => { + __reduce41(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 42 => { + __reduce42(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 43 => { + __reduce43(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 44 => { + __reduce44(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 45 => { + __reduce45(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + _ => panic!("invalid action code {__action}") + }; + let __states_len = __states.len(); + __states.truncate(__states_len - __pop_states); + let __state = *__states.last().unwrap(); + let __next_state = __goto(__state, __nonterminal); + __states.push(__next_state); + None + } + #[inline(never)] + fn __symbol_type_mismatch() -> ! { + panic!("symbol type mismatch") + } + fn __pop_Variant1< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, AttrExp, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant1(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant2< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, AttrPath, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant2(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant3< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, CompValue, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant3(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant4< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, CompareOp, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant4(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant5< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, Filter, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant5(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant6< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, PatchPath, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant6(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant7< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, ValFilter, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant7(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant8< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, ValuePath, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant8(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant0< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, &'input str, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant0(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __reduce0< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // AttrExp = AttrPath, "pr" => ActionFn(17); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym1.2.clone(); + let __nt = super::__action17::<>(input, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (2, 0) + } + fn __reduce1< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // AttrExp = AttrPath, CompareOp, CompValue => ActionFn(18); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant3(__symbols); + let __sym1 = __pop_Variant4(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action18::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (3, 0) + } + fn __reduce3< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // AttrPath = AttrNameTok => ActionFn(20); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action20::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + (1, 1) + } + fn __reduce4< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompValue = "false" => ActionFn(38); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action38::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + fn __reduce5< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompValue = "null" => ActionFn(39); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action39::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + fn __reduce6< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompValue = "true" => ActionFn(40); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action40::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + fn __reduce9< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "eq" => ActionFn(29); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action29::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce10< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "ne" => ActionFn(30); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action30::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce11< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "co" => ActionFn(31); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action31::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce12< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "sw" => ActionFn(32); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action32::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce13< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "ew" => ActionFn(33); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action33::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce14< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "gt" => ActionFn(34); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action34::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce15< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "lt" => ActionFn(35); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action35::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce16< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "ge" => ActionFn(36); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action36::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce17< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "le" => ActionFn(37); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action37::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce18< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter = Filter, "or", Filter1 => ActionFn(10); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action10::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 4) + } + fn __reduce19< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter = Filter1 => ActionFn(11); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action11::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 4) + } + fn __reduce20< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter0 = FilterAtom => ActionFn(7); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action7::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 5) + } + fn __reduce21< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter1 = Filter1, "and", Filter0 => ActionFn(8); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action8::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 6) + } + fn __reduce22< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter1 = Filter0 => ActionFn(9); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action9::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 6) + } + fn __reduce23< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = AttrExp => ActionFn(12); + let __sym0 = __pop_Variant1(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action12::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 7) + } + fn __reduce24< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = ValuePath => ActionFn(13); + let __sym0 = __pop_Variant8(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action13::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 7) + } + fn __reduce25< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = "not", "(", Filter, ")" => ActionFn(14); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action14::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (4, 7) + } + fn __reduce26< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = "(", Filter, ")" => ActionFn(15); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant5(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action15::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 7) + } + fn __reduce27< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Path = AttrPath => ActionFn(43); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action43::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (1, 8) + } + fn __reduce28< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Path = AttrPath, "[", ValFilter, "]" => ActionFn(44); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action44::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (4, 8) + } + fn __reduce29< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Path = AttrPath, "[", ValFilter, "]", ".", AttrNameTok => ActionFn(45); + assert!(__symbols.len() >= 6); + let __sym5 = __pop_Variant0(__symbols); + let __sym4 = __pop_Variant0(__symbols); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym5.2.clone(); + let __nt = super::__action45::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (6, 8) + } + fn __reduce30< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter = ValFilter, "or", ValFilter1 => ActionFn(24); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action24::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (3, 9) + } + fn __reduce31< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter = ValFilter1 => ActionFn(25); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action25::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 9) + } + fn __reduce32< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter0 = ValFilterAtom => ActionFn(21); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action21::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 10) + } + fn __reduce33< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter1 = ValFilter1, "and", ValFilter0 => ActionFn(22); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action22::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (3, 11) + } + fn __reduce34< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter1 = ValFilter0 => ActionFn(23); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action23::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 11) + } + fn __reduce35< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilterAtom = AttrExp => ActionFn(26); + let __sym0 = __pop_Variant1(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action26::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 12) + } + fn __reduce36< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilterAtom = "not", "(", ValFilter, ")" => ActionFn(27); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action27::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (4, 12) + } + fn __reduce37< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilterAtom = "(", ValFilter, ")" => ActionFn(28); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant7(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action28::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (3, 12) + } + fn __reduce38< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValuePath = AttrPath, "[", ValFilter, "]" => ActionFn(16); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action16::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (4, 13) + } + fn __reduce40< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Filter0 = Filter0 => ActionFn(0); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action0::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 15) + } + fn __reduce41< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Filter1 = Filter1 => ActionFn(1); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action1::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 16) + } + fn __reduce42< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Path = Path => ActionFn(6); + let __sym0 = __pop_Variant6(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action6::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (1, 17) + } + fn __reduce43< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __ValFilter = ValFilter => ActionFn(5); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action5::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 18) + } + fn __reduce44< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __ValFilter0 = ValFilter0 => ActionFn(3); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action3::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 19) + } + fn __reduce45< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __ValFilter1 = ValFilter1 => ActionFn(4); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action4::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 20) + } +} +#[allow(unused_imports)] +pub use self::__parse__Filter::FilterParser; + +#[rustfmt::skip] +#[allow(explicit_outlives_requirements, non_snake_case, non_camel_case_types, unused_mut, unused_variables, unused_imports, unused_parens, clippy::needless_lifetimes, clippy::type_complexity, clippy::needless_return, clippy::too_many_arguments, clippy::match_single_binding, clippy::clone_on_copy, clippy::unit_arg)] +mod __parse__Filter0 { + + use crate::filter::{ + AttrExp, AttrPath, CompareOp, CompValue, Filter, FilterActionError, + PatchPath, PatchValuePath, ValFilter, ValuePath, parse_attr_path, +}; + #[allow(unused_extern_crates)] + extern crate lalrpop_util as __lalrpop_util; + #[allow(unused_imports)] + use self::__lalrpop_util::state_machine as __state_machine; + #[allow(unused_extern_crates)] + extern crate alloc; + use self::__lalrpop_util::lexer::Token; + #[allow(dead_code)] + pub(crate) enum __Symbol<'input> + { + Variant0(&'input str), + Variant1(AttrExp), + Variant2(AttrPath), + Variant3(CompValue), + Variant4(CompareOp), + Variant5(Filter), + Variant6(PatchPath), + Variant7(ValFilter), + Variant8(ValuePath), + } + const __ACTION: &[i8] = &[ + // State 0 + 19, 20, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 1 + 0, 0, 0, 0, 0, 0, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 0, 0, 0, 5, 0, 0, 0, 0, + // State 2 + 19, 20, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 3 + 0, 0, 39, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 36, 37, + // State 4 + 19, 20, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, + // State 5 + 19, 20, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 6 + 0, 0, 0, 0, 0, 0, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 0, 0, 0, 0, 0, 0, 0, 0, + // State 7 + 19, 20, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, + // State 8 + 19, 20, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 9 + 19, 20, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 10 + 19, 20, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, + // State 11 + 19, 20, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, + // State 12 + 19, 20, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, + // State 13 + 0, 0, 0, 0, 0, -24, 0, 0, 0, 0, 0, 0, 0, 0, -24, 0, 0, 0, -24, 0, 0, 0, 0, 0, 0, + // State 14 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // State 15 + 0, 0, 0, 0, 0, -21, 0, 0, 0, 0, 0, 0, 0, 0, -21, 0, 0, 0, -21, 0, 0, 0, 0, 0, 0, + // State 16 + 0, 0, 0, 0, 0, -25, 0, 0, 0, 0, 0, 0, 0, 0, -25, 0, 0, 0, -25, 0, 0, 0, 0, 0, 0, + // State 17 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, + // State 18 + 0, 0, 0, 0, 0, 0, -4, -4, -4, -4, -4, -4, -4, -4, 0, -4, -4, 0, 0, 0, -4, 0, 0, 0, 0, + // State 19 + 0, 0, 0, 0, 0, 0, -3, -3, -3, -3, -3, -3, -3, -3, 0, -3, -3, 0, 0, 0, -3, 0, 0, 0, 0, + // State 20 + 0, 0, -12, 0, -12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -12, -12, -12, + // State 21 + 0, 0, -10, 0, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10, -10, -10, + // State 22 + 0, 0, -14, 0, -14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, -14, -14, + // State 23 + 0, 0, -17, 0, -17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -17, -17, -17, + // State 24 + 0, 0, -15, 0, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, -15, -15, + // State 25 + 0, 0, -18, 0, -18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -18, -18, -18, + // State 26 + 0, 0, -16, 0, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16, -16, -16, + // State 27 + 0, 0, -11, 0, -11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -11, -11, -11, + // State 28 + 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, + // State 29 + 0, 0, -13, 0, -13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -13, -13, -13, + // State 30 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, + // State 31 + 0, 0, 0, 0, 0, -23, 0, 0, 0, 0, 0, 0, 0, 0, -23, 0, 0, 0, -23, 0, 0, 0, 0, 0, 0, + // State 32 + 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, -20, 0, 0, 0, -20, 0, 0, 0, 0, 0, 0, + // State 33 + 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, -2, 0, 0, -2, 0, 0, 0, + // State 34 + 0, 0, 0, 0, 0, -5, 0, 0, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0, -5, 0, 0, -5, 0, 0, 0, + // State 35 + 0, 0, 0, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, -6, 0, 0, 0, -6, 0, 0, -6, 0, 0, 0, + // State 36 + 0, 0, 0, 0, 0, -7, 0, 0, 0, 0, 0, 0, 0, 0, -7, 0, 0, 0, -7, 0, 0, -7, 0, 0, 0, + // State 37 + 0, 0, 0, 0, 0, -8, 0, 0, 0, 0, 0, 0, 0, 0, -8, 0, 0, 0, -8, 0, 0, -8, 0, 0, 0, + // State 38 + 0, 0, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0, 0, -9, 0, 0, 0, -9, 0, 0, -9, 0, 0, 0, + // State 39 + 0, 0, 0, 0, 0, -36, 0, 0, 0, 0, 0, 0, 0, 0, -36, 0, 0, 0, -36, 0, 0, -36, 0, 0, 0, + // State 40 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 48, 0, 0, 0, + // State 41 + 0, 0, 0, 0, 0, -35, 0, 0, 0, 0, 0, 0, 0, 0, -35, 0, 0, 0, -35, 0, 0, -35, 0, 0, 0, + // State 42 + 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, -32, 0, 0, 0, -32, 0, 0, -32, 0, 0, 0, + // State 43 + 0, 0, 0, 0, 0, -33, 0, 0, 0, 0, 0, 0, 0, 0, -33, 0, 0, 0, -33, 0, 0, -33, 0, 0, 0, + // State 44 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, + // State 45 + 0, 0, 0, 0, 0, -27, 0, 0, 0, 0, 0, 0, 0, 0, -27, 0, 0, 0, -27, 0, 0, 0, 0, 0, 0, + // State 46 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 52, 0, 0, 0, 0, 0, 0, + // State 47 + 0, 0, 0, 0, 0, -39, 0, 0, 0, 0, 0, 0, 0, 0, -39, 0, 0, 0, -39, 0, 0, 0, 0, 0, 0, + // State 48 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, + // State 49 + 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, -19, 0, 0, 0, -19, 0, 0, 0, 0, 0, 0, + // State 50 + 0, 0, 0, 0, 0, -22, 0, 0, 0, 0, 0, 0, 0, 0, -22, 0, 0, 0, -22, 0, 0, 0, 0, 0, 0, + // State 51 + 0, 0, 0, 0, 0, -26, 0, 0, 0, 0, 0, 0, 0, 0, -26, 0, 0, 0, -26, 0, 0, 0, 0, 0, 0, + // State 52 + 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, -31, 0, 0, 0, -31, 0, 0, -31, 0, 0, 0, + // State 53 + 0, 0, 0, 0, 0, -34, 0, 0, 0, 0, 0, 0, 0, 0, -34, 0, 0, 0, -34, 0, 0, -34, 0, 0, 0, + // State 54 + 0, 0, 0, 0, 0, -38, 0, 0, 0, 0, 0, 0, 0, 0, -38, 0, 0, 0, -38, 0, 0, -38, 0, 0, 0, + // State 55 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 57, 0, 0, 0, 0, 0, 0, + // State 56 + 0, 0, 0, 0, 0, -37, 0, 0, 0, 0, 0, 0, 0, 0, -37, 0, 0, 0, -37, 0, 0, -37, 0, 0, 0, + ]; + fn __action(state: i8, integer: usize) -> i8 { + __ACTION[(state as usize) * 25 + integer] + } + const __EOF_ACTION: &[i8] = &[ + // State 0 + 0, + // State 1 + 0, + // State 2 + 0, + // State 3 + 0, + // State 4 + 0, + // State 5 + 0, + // State 6 + 0, + // State 7 + 0, + // State 8 + 0, + // State 9 + 0, + // State 10 + 0, + // State 11 + 0, + // State 12 + 0, + // State 13 + -24, + // State 14 + -41, + // State 15 + -21, + // State 16 + -25, + // State 17 + 0, + // State 18 + 0, + // State 19 + 0, + // State 20 + 0, + // State 21 + 0, + // State 22 + 0, + // State 23 + 0, + // State 24 + 0, + // State 25 + 0, + // State 26 + 0, + // State 27 + 0, + // State 28 + -1, + // State 29 + 0, + // State 30 + 0, + // State 31 + 0, + // State 32 + 0, + // State 33 + -2, + // State 34 + -5, + // State 35 + -6, + // State 36 + -7, + // State 37 + -8, + // State 38 + -9, + // State 39 + 0, + // State 40 + 0, + // State 41 + 0, + // State 42 + 0, + // State 43 + 0, + // State 44 + 0, + // State 45 + -27, + // State 46 + 0, + // State 47 + -39, + // State 48 + 0, + // State 49 + 0, + // State 50 + 0, + // State 51 + -26, + // State 52 + 0, + // State 53 + 0, + // State 54 + 0, + // State 55 + 0, + // State 56 + 0, + ]; + fn __goto(state: i8, nt: usize) -> i8 { + match nt { + 0 => match state { + 4 | 7 | 10..=12 => 39, + _ => 13, + }, + 1 => match state { + 4 | 7 | 10..=12 => 6, + _ => 1, + }, + 2 => 33, + 3 => 3, + 4 => match state { + 5 => 46, + _ => 30, + }, + 5 => match state { + 0 => 14, + 9 => 50, + _ => 31, + }, + 6 => match state { + 8 => 49, + _ => 32, + }, + 7 => 15, + 9 => match state { + 7 => 48, + 12 => 55, + _ => 40, + }, + 10 => match state { + 11 => 53, + _ => 41, + }, + 11 => match state { + 10 => 52, + _ => 42, + }, + 12 => 43, + 13 => 16, + _ => 0, + } + } + #[allow(clippy::needless_raw_string_hashes)] + const __TERMINAL: &[&str] = &[ + r###"AttrNameTok"###, + r###"AttrPathTok"###, + r###"StringLit"###, + r###""not""###, + r###"NumberLit"###, + r###""and""###, + r###""co""###, + r###""eq""###, + r###""ew""###, + r###""ge""###, + r###""gt""###, + r###""le""###, + r###""lt""###, + r###""ne""###, + r###""or""###, + r###""pr""###, + r###""sw""###, + r###""(""###, + r###"")""###, + r###"".""###, + r###""[""###, + r###""]""###, + r###""false""###, + r###""null""###, + r###""true""###, + ]; + fn __expected_tokens(__state: i8) -> alloc::vec::Vec { + __TERMINAL.iter().enumerate().filter_map(|(index, terminal)| { + let next_state = __action(__state, index); + if next_state == 0 { + None + } else { + Some(alloc::string::ToString::to_string(terminal)) + } + }).collect() + } + fn __expected_tokens_from_states< + 'input, + >( + __states: &[i8], + _: core::marker::PhantomData<(&'input ())>, + ) -> alloc::vec::Vec + { + __TERMINAL.iter().enumerate().filter_map(|(index, terminal)| { + if __accepts(None, __states, Some(index), core::marker::PhantomData::<(&())>) { + Some(alloc::string::ToString::to_string(terminal)) + } else { + None + } + }).collect() + } + struct __StateMachine<'input> + where + { + input: &'input str, + __phantom: core::marker::PhantomData<(&'input ())>, + } + impl<'input> __state_machine::ParserDefinition for __StateMachine<'input> + where + { + type Location = usize; + type Error = FilterActionError; + type Token = Token<'input>; + type TokenIndex = usize; + type Symbol = __Symbol<'input>; + type Success = Filter; + type StateIndex = i8; + type Action = i8; + type ReduceIndex = i8; + type NonterminalIndex = usize; + + #[inline] + fn start_location(&self) -> Self::Location { + Default::default() + } + + #[inline] + fn start_state(&self) -> Self::StateIndex { + 0 + } + + #[inline] + fn token_to_index(&self, token: &Self::Token) -> Option { + __token_to_integer(token, core::marker::PhantomData::<(&())>) + } + + #[inline] + fn action(&self, state: i8, integer: usize) -> i8 { + __action(state, integer) + } + + #[inline] + fn error_action(&self, state: i8) -> i8 { + __action(state, 25 - 1) + } + + #[inline] + fn eof_action(&self, state: i8) -> i8 { + __EOF_ACTION[state as usize] + } + + #[inline] + fn goto(&self, state: i8, nt: usize) -> i8 { + __goto(state, nt) + } + + fn token_to_symbol(&self, token_index: usize, token: Self::Token) -> Self::Symbol { + __token_to_symbol(token_index, token, core::marker::PhantomData::<(&())>) + } + + fn expected_tokens(&self, state: i8) -> alloc::vec::Vec { + __expected_tokens(state) + } + + fn expected_tokens_from_states(&self, states: &[i8]) -> alloc::vec::Vec { + __expected_tokens_from_states(states, core::marker::PhantomData::<(&())>) + } + + #[inline] + fn uses_error_recovery(&self) -> bool { + false + } + + #[inline] + fn error_recovery_symbol( + &self, + recovery: __state_machine::ErrorRecovery, + ) -> Self::Symbol { + panic!("error recovery not enabled for this grammar") + } + + fn reduce( + &mut self, + action: i8, + start_location: Option<&Self::Location>, + states: &mut alloc::vec::Vec, + symbols: &mut alloc::vec::Vec<__state_machine::SymbolTriple>, + ) -> Option<__state_machine::ParseResult> { + __reduce( + self.input, + action, + start_location, + states, + symbols, + core::marker::PhantomData::<(&())>, + ) + } + + fn simulate_reduce(&self, action: i8) -> __state_machine::SimulatedReduce { + __simulate_reduce(action, core::marker::PhantomData::<(&())>) + } + } + fn __token_to_integer< + 'input, + >( + __token: &Token<'input>, + _: core::marker::PhantomData<(&'input ())>, + ) -> Option + { + #[warn(unused_variables)] + match __token { + Token(0, _) if true => Some(0), + Token(1, _) if true => Some(1), + Token(2, _) if true => Some(2), + Token(3, _) if true => Some(3), + Token(4, _) if true => Some(4), + Token(5, _) if true => Some(5), + Token(6, _) if true => Some(6), + Token(7, _) if true => Some(7), + Token(8, _) if true => Some(8), + Token(9, _) if true => Some(9), + Token(10, _) if true => Some(10), + Token(11, _) if true => Some(11), + Token(12, _) if true => Some(12), + Token(13, _) if true => Some(13), + Token(14, _) if true => Some(14), + Token(15, _) if true => Some(15), + Token(16, _) if true => Some(16), + Token(17, _) if true => Some(17), + Token(18, _) if true => Some(18), + Token(19, _) if true => Some(19), + Token(20, _) if true => Some(20), + Token(21, _) if true => Some(21), + Token(22, _) if true => Some(22), + Token(23, _) if true => Some(23), + Token(24, _) if true => Some(24), + _ => None, + } + } + fn __token_to_symbol< + 'input, + >( + __token_index: usize, + __token: Token<'input>, + _: core::marker::PhantomData<(&'input ())>, + ) -> __Symbol<'input> + { + #[allow(clippy::manual_range_patterns)]match __token_index { + 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 => match __token { + Token(0, __tok0) | Token(1, __tok0) | Token(2, __tok0) | Token(3, __tok0) | Token(4, __tok0) | Token(5, __tok0) | Token(6, __tok0) | Token(7, __tok0) | Token(8, __tok0) | Token(9, __tok0) | Token(10, __tok0) | Token(11, __tok0) | Token(12, __tok0) | Token(13, __tok0) | Token(14, __tok0) | Token(15, __tok0) | Token(16, __tok0) | Token(17, __tok0) | Token(18, __tok0) | Token(19, __tok0) | Token(20, __tok0) | Token(21, __tok0) | Token(22, __tok0) | Token(23, __tok0) | Token(24, __tok0) if true => __Symbol::Variant0(__tok0), + _ => unreachable!(), + }, + _ => unreachable!(), + } + } + fn __simulate_reduce< + 'input, + >( + __reduce_index: i8, + _: core::marker::PhantomData<(&'input ())>, + ) -> __state_machine::SimulatedReduce<__StateMachine<'input>> + { + match __reduce_index { + 0 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 2, + nonterminal_produced: 0, + } + } + 1 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 0, + } + } + 2 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 1, + } + } + 3 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 1, + } + } + 4 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 5 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 6 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 7 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 8 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 9 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 10 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 11 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 12 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 13 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 14 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 15 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 16 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 17 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 18 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 4, + } + } + 19 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 4, + } + } + 20 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 5, + } + } + 21 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 6, + } + } + 22 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 6, + } + } + 23 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 7, + } + } + 24 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 7, + } + } + 25 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 7, + } + } + 26 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 7, + } + } + 27 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 8, + } + } + 28 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 8, + } + } + 29 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 6, + nonterminal_produced: 8, + } + } + 30 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 9, + } + } + 31 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 9, + } + } + 32 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 10, + } + } + 33 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 11, + } + } + 34 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 11, + } + } + 35 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 12, + } + } + 36 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 12, + } + } + 37 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 12, + } + } + 38 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 13, + } + } + 39 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 14, + } + } + 40 => __state_machine::SimulatedReduce::Accept, + 41 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 16, + } + } + 42 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 17, + } + } + 43 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 18, + } + } + 44 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 19, + } + } + 45 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 20, + } + } + _ => panic!("invalid reduction index {__reduce_index}") + } + } + pub struct Filter0Parser { + builder: __lalrpop_util::lexer::MatcherBuilder, + _priv: (), + } + + impl Default for Filter0Parser { fn default() -> Self { Self::new() } } + impl Filter0Parser { + pub fn new() -> Filter0Parser { + let __builder = super::__intern_token::new_builder(); + Filter0Parser { + builder: __builder, + _priv: (), + } + } + + #[allow(dead_code)] + pub fn parse< + 'input, + >( + &self, + input: &'input str, + ) -> Result, FilterActionError>> + { + let mut __tokens = self.builder.matcher(input); + __state_machine::Parser::drive( + __StateMachine { + input, + __phantom: core::marker::PhantomData::<(&())>, + }, + __tokens, + ) + } + } + fn __accepts< + 'input, + >( + __error_state: Option, + __states: &[i8], + __opt_integer: Option, + _: core::marker::PhantomData<(&'input ())>, + ) -> bool + { + let mut __states = __states.to_vec(); + __states.extend(__error_state); + loop { + let mut __states_len = __states.len(); + let __top = __states[__states_len - 1]; + let __action = match __opt_integer { + None => __EOF_ACTION[__top as usize], + Some(__integer) => __action(__top, __integer), + }; + if __action == 0 { return false; } + if __action > 0 { return true; } + let (__to_pop, __nt) = match __simulate_reduce(-(__action + 1), core::marker::PhantomData::<(&())>) { + __state_machine::SimulatedReduce::Reduce { + states_to_pop, nonterminal_produced + } => (states_to_pop, nonterminal_produced), + __state_machine::SimulatedReduce::Accept => return true, + }; + __states_len -= __to_pop; + __states.truncate(__states_len); + let __top = __states[__states_len - 1]; + let __next_state = __goto(__top, __nt); + __states.push(__next_state); + } + } + fn __reduce< + 'input, + >( + input: &'input str, + __action: i8, + __lookahead_start: Option<&usize>, + __states: &mut alloc::vec::Vec, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> Option, FilterActionError>>> + { + let (__pop_states, __nonterminal) = match __action { + 0 => { + __reduce0(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 1 => { + __reduce1(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 2 => { + // AttrPath = AttrPathTok => ActionFn(19); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = match super::__action19::<>(input, __sym0) { + Ok(v) => v, + Err(e) => return Some(Err(e)), + }; + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + (1, 1) + } + 3 => { + __reduce3(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 4 => { + __reduce4(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 5 => { + __reduce5(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 6 => { + __reduce6(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 7 => { + // CompValue = NumberLit => ActionFn(41); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = match super::__action41::<>(input, __sym0) { + Ok(v) => v, + Err(e) => return Some(Err(e)), + }; + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + 8 => { + // CompValue = StringLit => ActionFn(42); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = match super::__action42::<>(input, __sym0) { + Ok(v) => v, + Err(e) => return Some(Err(e)), + }; + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + 9 => { + __reduce9(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 10 => { + __reduce10(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 11 => { + __reduce11(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 12 => { + __reduce12(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 13 => { + __reduce13(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 14 => { + __reduce14(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 15 => { + __reduce15(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 16 => { + __reduce16(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 17 => { + __reduce17(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 18 => { + __reduce18(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 19 => { + __reduce19(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 20 => { + __reduce20(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 21 => { + __reduce21(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 22 => { + __reduce22(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 23 => { + __reduce23(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 24 => { + __reduce24(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 25 => { + __reduce25(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 26 => { + __reduce26(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 27 => { + __reduce27(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 28 => { + __reduce28(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 29 => { + __reduce29(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 30 => { + __reduce30(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 31 => { + __reduce31(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 32 => { + __reduce32(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 33 => { + __reduce33(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 34 => { + __reduce34(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 35 => { + __reduce35(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 36 => { + __reduce36(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 37 => { + __reduce37(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 38 => { + __reduce38(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 39 => { + __reduce39(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 40 => { + // __Filter0 = Filter0 => ActionFn(0); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action0::<>(input, __sym0); + return Some(Ok(__nt)); + } + 41 => { + __reduce41(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 42 => { + __reduce42(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 43 => { + __reduce43(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 44 => { + __reduce44(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 45 => { + __reduce45(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + _ => panic!("invalid action code {__action}") + }; + let __states_len = __states.len(); + __states.truncate(__states_len - __pop_states); + let __state = *__states.last().unwrap(); + let __next_state = __goto(__state, __nonterminal); + __states.push(__next_state); + None + } + #[inline(never)] + fn __symbol_type_mismatch() -> ! { + panic!("symbol type mismatch") + } + fn __pop_Variant1< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, AttrExp, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant1(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant2< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, AttrPath, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant2(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant3< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, CompValue, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant3(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant4< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, CompareOp, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant4(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant5< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, Filter, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant5(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant6< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, PatchPath, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant6(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant7< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, ValFilter, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant7(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant8< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, ValuePath, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant8(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant0< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, &'input str, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant0(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __reduce0< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // AttrExp = AttrPath, "pr" => ActionFn(17); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym1.2.clone(); + let __nt = super::__action17::<>(input, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (2, 0) + } + fn __reduce1< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // AttrExp = AttrPath, CompareOp, CompValue => ActionFn(18); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant3(__symbols); + let __sym1 = __pop_Variant4(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action18::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (3, 0) + } + fn __reduce3< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // AttrPath = AttrNameTok => ActionFn(20); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action20::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + (1, 1) + } + fn __reduce4< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompValue = "false" => ActionFn(38); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action38::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + fn __reduce5< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompValue = "null" => ActionFn(39); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action39::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + fn __reduce6< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompValue = "true" => ActionFn(40); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action40::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + fn __reduce9< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "eq" => ActionFn(29); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action29::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce10< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "ne" => ActionFn(30); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action30::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce11< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "co" => ActionFn(31); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action31::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce12< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "sw" => ActionFn(32); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action32::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce13< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "ew" => ActionFn(33); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action33::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce14< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "gt" => ActionFn(34); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action34::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce15< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "lt" => ActionFn(35); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action35::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce16< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "ge" => ActionFn(36); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action36::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce17< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "le" => ActionFn(37); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action37::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce18< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter = Filter, "or", Filter1 => ActionFn(10); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action10::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 4) + } + fn __reduce19< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter = Filter1 => ActionFn(11); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action11::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 4) + } + fn __reduce20< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter0 = FilterAtom => ActionFn(7); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action7::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 5) + } + fn __reduce21< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter1 = Filter1, "and", Filter0 => ActionFn(8); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action8::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 6) + } + fn __reduce22< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter1 = Filter0 => ActionFn(9); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action9::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 6) + } + fn __reduce23< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = AttrExp => ActionFn(12); + let __sym0 = __pop_Variant1(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action12::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 7) + } + fn __reduce24< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = ValuePath => ActionFn(13); + let __sym0 = __pop_Variant8(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action13::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 7) + } + fn __reduce25< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = "not", "(", Filter, ")" => ActionFn(14); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action14::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (4, 7) + } + fn __reduce26< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = "(", Filter, ")" => ActionFn(15); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant5(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action15::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 7) + } + fn __reduce27< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Path = AttrPath => ActionFn(43); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action43::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (1, 8) + } + fn __reduce28< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Path = AttrPath, "[", ValFilter, "]" => ActionFn(44); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action44::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (4, 8) + } + fn __reduce29< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Path = AttrPath, "[", ValFilter, "]", ".", AttrNameTok => ActionFn(45); + assert!(__symbols.len() >= 6); + let __sym5 = __pop_Variant0(__symbols); + let __sym4 = __pop_Variant0(__symbols); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym5.2.clone(); + let __nt = super::__action45::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (6, 8) + } + fn __reduce30< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter = ValFilter, "or", ValFilter1 => ActionFn(24); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action24::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (3, 9) + } + fn __reduce31< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter = ValFilter1 => ActionFn(25); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action25::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 9) + } + fn __reduce32< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter0 = ValFilterAtom => ActionFn(21); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action21::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 10) + } + fn __reduce33< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter1 = ValFilter1, "and", ValFilter0 => ActionFn(22); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action22::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (3, 11) + } + fn __reduce34< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter1 = ValFilter0 => ActionFn(23); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action23::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 11) + } + fn __reduce35< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilterAtom = AttrExp => ActionFn(26); + let __sym0 = __pop_Variant1(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action26::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 12) + } + fn __reduce36< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilterAtom = "not", "(", ValFilter, ")" => ActionFn(27); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action27::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (4, 12) + } + fn __reduce37< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilterAtom = "(", ValFilter, ")" => ActionFn(28); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant7(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action28::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (3, 12) + } + fn __reduce38< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValuePath = AttrPath, "[", ValFilter, "]" => ActionFn(16); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action16::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (4, 13) + } + fn __reduce39< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Filter = Filter => ActionFn(2); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action2::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 14) + } + fn __reduce41< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Filter1 = Filter1 => ActionFn(1); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action1::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 16) + } + fn __reduce42< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Path = Path => ActionFn(6); + let __sym0 = __pop_Variant6(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action6::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (1, 17) + } + fn __reduce43< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __ValFilter = ValFilter => ActionFn(5); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action5::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 18) + } + fn __reduce44< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __ValFilter0 = ValFilter0 => ActionFn(3); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action3::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 19) + } + fn __reduce45< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __ValFilter1 = ValFilter1 => ActionFn(4); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action4::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 20) + } +} +#[allow(unused_imports)] +pub use self::__parse__Filter0::Filter0Parser; + +#[rustfmt::skip] +#[allow(explicit_outlives_requirements, non_snake_case, non_camel_case_types, unused_mut, unused_variables, unused_imports, unused_parens, clippy::needless_lifetimes, clippy::type_complexity, clippy::needless_return, clippy::too_many_arguments, clippy::match_single_binding, clippy::clone_on_copy, clippy::unit_arg)] +mod __parse__Filter1 { + + use crate::filter::{ + AttrExp, AttrPath, CompareOp, CompValue, Filter, FilterActionError, + PatchPath, PatchValuePath, ValFilter, ValuePath, parse_attr_path, +}; + #[allow(unused_extern_crates)] + extern crate lalrpop_util as __lalrpop_util; + #[allow(unused_imports)] + use self::__lalrpop_util::state_machine as __state_machine; + #[allow(unused_extern_crates)] + extern crate alloc; + use self::__lalrpop_util::lexer::Token; + #[allow(dead_code)] + pub(crate) enum __Symbol<'input> + { + Variant0(&'input str), + Variant1(AttrExp), + Variant2(AttrPath), + Variant3(CompValue), + Variant4(CompareOp), + Variant5(Filter), + Variant6(PatchPath), + Variant7(ValFilter), + Variant8(ValuePath), + } + const __ACTION: &[i8] = &[ + // State 0 + 20, 21, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 1 + 0, 0, 0, 0, 0, 0, 22, 23, 24, 25, 26, 27, 28, 29, 0, 30, 31, 0, 0, 0, 5, 0, 0, 0, 0, + // State 2 + 20, 21, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 3 + 0, 0, 39, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 36, 37, + // State 4 + 20, 21, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, + // State 5 + 20, 21, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 6 + 20, 21, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 7 + 0, 0, 0, 0, 0, 0, 22, 23, 24, 25, 26, 27, 28, 29, 0, 30, 31, 0, 0, 0, 0, 0, 0, 0, 0, + // State 8 + 20, 21, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, + // State 9 + 20, 21, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 10 + 20, 21, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, + // State 11 + 20, 21, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, + // State 12 + 20, 21, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, + // State 13 + 0, 0, 0, 0, 0, -24, 0, 0, 0, 0, 0, 0, 0, 0, -24, 0, 0, 0, -24, 0, 0, 0, 0, 0, 0, + // State 14 + 0, 0, 0, 0, 0, -23, 0, 0, 0, 0, 0, 0, 0, 0, -23, 0, 0, 0, -23, 0, 0, 0, 0, 0, 0, + // State 15 + 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // State 16 + 0, 0, 0, 0, 0, -21, 0, 0, 0, 0, 0, 0, 0, 0, -21, 0, 0, 0, -21, 0, 0, 0, 0, 0, 0, + // State 17 + 0, 0, 0, 0, 0, -25, 0, 0, 0, 0, 0, 0, 0, 0, -25, 0, 0, 0, -25, 0, 0, 0, 0, 0, 0, + // State 18 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, + // State 19 + 0, 0, 0, 0, 0, 0, -4, -4, -4, -4, -4, -4, -4, -4, 0, -4, -4, 0, 0, 0, -4, 0, 0, 0, 0, + // State 20 + 0, 0, 0, 0, 0, 0, -3, -3, -3, -3, -3, -3, -3, -3, 0, -3, -3, 0, 0, 0, -3, 0, 0, 0, 0, + // State 21 + 0, 0, -12, 0, -12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -12, -12, -12, + // State 22 + 0, 0, -10, 0, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10, -10, -10, + // State 23 + 0, 0, -14, 0, -14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, -14, -14, + // State 24 + 0, 0, -17, 0, -17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -17, -17, -17, + // State 25 + 0, 0, -15, 0, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, -15, -15, + // State 26 + 0, 0, -18, 0, -18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -18, -18, -18, + // State 27 + 0, 0, -16, 0, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16, -16, -16, + // State 28 + 0, 0, -11, 0, -11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -11, -11, -11, + // State 29 + 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, + // State 30 + 0, 0, -13, 0, -13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -13, -13, -13, + // State 31 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, + // State 32 + 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, -20, 0, 0, 0, -20, 0, 0, 0, 0, 0, 0, + // State 33 + 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, -2, 0, 0, -2, 0, 0, 0, + // State 34 + 0, 0, 0, 0, 0, -5, 0, 0, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0, -5, 0, 0, -5, 0, 0, 0, + // State 35 + 0, 0, 0, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, -6, 0, 0, 0, -6, 0, 0, -6, 0, 0, 0, + // State 36 + 0, 0, 0, 0, 0, -7, 0, 0, 0, 0, 0, 0, 0, 0, -7, 0, 0, 0, -7, 0, 0, -7, 0, 0, 0, + // State 37 + 0, 0, 0, 0, 0, -8, 0, 0, 0, 0, 0, 0, 0, 0, -8, 0, 0, 0, -8, 0, 0, -8, 0, 0, 0, + // State 38 + 0, 0, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0, 0, -9, 0, 0, 0, -9, 0, 0, -9, 0, 0, 0, + // State 39 + 0, 0, 0, 0, 0, -36, 0, 0, 0, 0, 0, 0, 0, 0, -36, 0, 0, 0, -36, 0, 0, -36, 0, 0, 0, + // State 40 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, + // State 41 + 0, 0, 0, 0, 0, -35, 0, 0, 0, 0, 0, 0, 0, 0, -35, 0, 0, 0, -35, 0, 0, -35, 0, 0, 0, + // State 42 + 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, -32, 0, 0, 0, -32, 0, 0, -32, 0, 0, 0, + // State 43 + 0, 0, 0, 0, 0, -33, 0, 0, 0, 0, 0, 0, 0, 0, -33, 0, 0, 0, -33, 0, 0, -33, 0, 0, 0, + // State 44 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, + // State 45 + 0, 0, 0, 0, 0, -22, 0, 0, 0, 0, 0, 0, 0, 0, -22, 0, 0, 0, -22, 0, 0, 0, 0, 0, 0, + // State 46 + 0, 0, 0, 0, 0, -27, 0, 0, 0, 0, 0, 0, 0, 0, -27, 0, 0, 0, -27, 0, 0, 0, 0, 0, 0, + // State 47 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 52, 0, 0, 0, 0, 0, 0, + // State 48 + 0, 0, 0, 0, 0, -39, 0, 0, 0, 0, 0, 0, 0, 0, -39, 0, 0, 0, -39, 0, 0, 0, 0, 0, 0, + // State 49 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, + // State 50 + 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, -19, 0, 0, 0, -19, 0, 0, 0, 0, 0, 0, + // State 51 + 0, 0, 0, 0, 0, -26, 0, 0, 0, 0, 0, 0, 0, 0, -26, 0, 0, 0, -26, 0, 0, 0, 0, 0, 0, + // State 52 + 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, -31, 0, 0, 0, -31, 0, 0, -31, 0, 0, 0, + // State 53 + 0, 0, 0, 0, 0, -34, 0, 0, 0, 0, 0, 0, 0, 0, -34, 0, 0, 0, -34, 0, 0, -34, 0, 0, 0, + // State 54 + 0, 0, 0, 0, 0, -38, 0, 0, 0, 0, 0, 0, 0, 0, -38, 0, 0, 0, -38, 0, 0, -38, 0, 0, 0, + // State 55 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 57, 0, 0, 0, 0, 0, 0, + // State 56 + 0, 0, 0, 0, 0, -37, 0, 0, 0, 0, 0, 0, 0, 0, -37, 0, 0, 0, -37, 0, 0, -37, 0, 0, 0, + ]; + fn __action(state: i8, integer: usize) -> i8 { + __ACTION[(state as usize) * 25 + integer] + } + const __EOF_ACTION: &[i8] = &[ + // State 0 + 0, + // State 1 + 0, + // State 2 + 0, + // State 3 + 0, + // State 4 + 0, + // State 5 + 0, + // State 6 + 0, + // State 7 + 0, + // State 8 + 0, + // State 9 + 0, + // State 10 + 0, + // State 11 + 0, + // State 12 + 0, + // State 13 + -24, + // State 14 + -23, + // State 15 + -42, + // State 16 + -21, + // State 17 + -25, + // State 18 + 0, + // State 19 + 0, + // State 20 + 0, + // State 21 + 0, + // State 22 + 0, + // State 23 + 0, + // State 24 + 0, + // State 25 + 0, + // State 26 + 0, + // State 27 + 0, + // State 28 + 0, + // State 29 + -1, + // State 30 + 0, + // State 31 + 0, + // State 32 + 0, + // State 33 + -2, + // State 34 + -5, + // State 35 + -6, + // State 36 + -7, + // State 37 + -8, + // State 38 + -9, + // State 39 + 0, + // State 40 + 0, + // State 41 + 0, + // State 42 + 0, + // State 43 + 0, + // State 44 + 0, + // State 45 + -22, + // State 46 + -27, + // State 47 + 0, + // State 48 + -39, + // State 49 + 0, + // State 50 + 0, + // State 51 + -26, + // State 52 + 0, + // State 53 + 0, + // State 54 + 0, + // State 55 + 0, + // State 56 + 0, + ]; + fn __goto(state: i8, nt: usize) -> i8 { + match nt { + 0 => match state { + 4 | 8 | 10..=12 => 39, + _ => 13, + }, + 1 => match state { + 4 | 8 | 10..=12 => 7, + _ => 1, + }, + 2 => 33, + 3 => 3, + 4 => match state { + 6 => 47, + _ => 31, + }, + 5 => match state { + 5 => 45, + _ => 14, + }, + 6 => match state { + 0 => 15, + 9 => 50, + _ => 32, + }, + 7 => 16, + 9 => match state { + 8 => 49, + 12 => 55, + _ => 40, + }, + 10 => match state { + 11 => 53, + _ => 41, + }, + 11 => match state { + 10 => 52, + _ => 42, + }, + 12 => 43, + 13 => 17, + _ => 0, + } + } + #[allow(clippy::needless_raw_string_hashes)] + const __TERMINAL: &[&str] = &[ + r###"AttrNameTok"###, + r###"AttrPathTok"###, + r###"StringLit"###, + r###""not""###, + r###"NumberLit"###, + r###""and""###, + r###""co""###, + r###""eq""###, + r###""ew""###, + r###""ge""###, + r###""gt""###, + r###""le""###, + r###""lt""###, + r###""ne""###, + r###""or""###, + r###""pr""###, + r###""sw""###, + r###""(""###, + r###"")""###, + r###"".""###, + r###""[""###, + r###""]""###, + r###""false""###, + r###""null""###, + r###""true""###, + ]; + fn __expected_tokens(__state: i8) -> alloc::vec::Vec { + __TERMINAL.iter().enumerate().filter_map(|(index, terminal)| { + let next_state = __action(__state, index); + if next_state == 0 { + None + } else { + Some(alloc::string::ToString::to_string(terminal)) + } + }).collect() + } + fn __expected_tokens_from_states< + 'input, + >( + __states: &[i8], + _: core::marker::PhantomData<(&'input ())>, + ) -> alloc::vec::Vec + { + __TERMINAL.iter().enumerate().filter_map(|(index, terminal)| { + if __accepts(None, __states, Some(index), core::marker::PhantomData::<(&())>) { + Some(alloc::string::ToString::to_string(terminal)) + } else { + None + } + }).collect() + } + struct __StateMachine<'input> + where + { + input: &'input str, + __phantom: core::marker::PhantomData<(&'input ())>, + } + impl<'input> __state_machine::ParserDefinition for __StateMachine<'input> + where + { + type Location = usize; + type Error = FilterActionError; + type Token = Token<'input>; + type TokenIndex = usize; + type Symbol = __Symbol<'input>; + type Success = Filter; + type StateIndex = i8; + type Action = i8; + type ReduceIndex = i8; + type NonterminalIndex = usize; + + #[inline] + fn start_location(&self) -> Self::Location { + Default::default() + } + + #[inline] + fn start_state(&self) -> Self::StateIndex { + 0 + } + + #[inline] + fn token_to_index(&self, token: &Self::Token) -> Option { + __token_to_integer(token, core::marker::PhantomData::<(&())>) + } + + #[inline] + fn action(&self, state: i8, integer: usize) -> i8 { + __action(state, integer) + } + + #[inline] + fn error_action(&self, state: i8) -> i8 { + __action(state, 25 - 1) + } + + #[inline] + fn eof_action(&self, state: i8) -> i8 { + __EOF_ACTION[state as usize] + } + + #[inline] + fn goto(&self, state: i8, nt: usize) -> i8 { + __goto(state, nt) + } + + fn token_to_symbol(&self, token_index: usize, token: Self::Token) -> Self::Symbol { + __token_to_symbol(token_index, token, core::marker::PhantomData::<(&())>) + } + + fn expected_tokens(&self, state: i8) -> alloc::vec::Vec { + __expected_tokens(state) + } + + fn expected_tokens_from_states(&self, states: &[i8]) -> alloc::vec::Vec { + __expected_tokens_from_states(states, core::marker::PhantomData::<(&())>) + } + + #[inline] + fn uses_error_recovery(&self) -> bool { + false + } + + #[inline] + fn error_recovery_symbol( + &self, + recovery: __state_machine::ErrorRecovery, + ) -> Self::Symbol { + panic!("error recovery not enabled for this grammar") + } + + fn reduce( + &mut self, + action: i8, + start_location: Option<&Self::Location>, + states: &mut alloc::vec::Vec, + symbols: &mut alloc::vec::Vec<__state_machine::SymbolTriple>, + ) -> Option<__state_machine::ParseResult> { + __reduce( + self.input, + action, + start_location, + states, + symbols, + core::marker::PhantomData::<(&())>, + ) + } + + fn simulate_reduce(&self, action: i8) -> __state_machine::SimulatedReduce { + __simulate_reduce(action, core::marker::PhantomData::<(&())>) + } + } + fn __token_to_integer< + 'input, + >( + __token: &Token<'input>, + _: core::marker::PhantomData<(&'input ())>, + ) -> Option + { + #[warn(unused_variables)] + match __token { + Token(0, _) if true => Some(0), + Token(1, _) if true => Some(1), + Token(2, _) if true => Some(2), + Token(3, _) if true => Some(3), + Token(4, _) if true => Some(4), + Token(5, _) if true => Some(5), + Token(6, _) if true => Some(6), + Token(7, _) if true => Some(7), + Token(8, _) if true => Some(8), + Token(9, _) if true => Some(9), + Token(10, _) if true => Some(10), + Token(11, _) if true => Some(11), + Token(12, _) if true => Some(12), + Token(13, _) if true => Some(13), + Token(14, _) if true => Some(14), + Token(15, _) if true => Some(15), + Token(16, _) if true => Some(16), + Token(17, _) if true => Some(17), + Token(18, _) if true => Some(18), + Token(19, _) if true => Some(19), + Token(20, _) if true => Some(20), + Token(21, _) if true => Some(21), + Token(22, _) if true => Some(22), + Token(23, _) if true => Some(23), + Token(24, _) if true => Some(24), + _ => None, + } + } + fn __token_to_symbol< + 'input, + >( + __token_index: usize, + __token: Token<'input>, + _: core::marker::PhantomData<(&'input ())>, + ) -> __Symbol<'input> + { + #[allow(clippy::manual_range_patterns)]match __token_index { + 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 => match __token { + Token(0, __tok0) | Token(1, __tok0) | Token(2, __tok0) | Token(3, __tok0) | Token(4, __tok0) | Token(5, __tok0) | Token(6, __tok0) | Token(7, __tok0) | Token(8, __tok0) | Token(9, __tok0) | Token(10, __tok0) | Token(11, __tok0) | Token(12, __tok0) | Token(13, __tok0) | Token(14, __tok0) | Token(15, __tok0) | Token(16, __tok0) | Token(17, __tok0) | Token(18, __tok0) | Token(19, __tok0) | Token(20, __tok0) | Token(21, __tok0) | Token(22, __tok0) | Token(23, __tok0) | Token(24, __tok0) if true => __Symbol::Variant0(__tok0), + _ => unreachable!(), + }, + _ => unreachable!(), + } + } + fn __simulate_reduce< + 'input, + >( + __reduce_index: i8, + _: core::marker::PhantomData<(&'input ())>, + ) -> __state_machine::SimulatedReduce<__StateMachine<'input>> + { + match __reduce_index { + 0 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 2, + nonterminal_produced: 0, + } + } + 1 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 0, + } + } + 2 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 1, + } + } + 3 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 1, + } + } + 4 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 5 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 6 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 7 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 8 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 9 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 10 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 11 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 12 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 13 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 14 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 15 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 16 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 17 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 18 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 4, + } + } + 19 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 4, + } + } + 20 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 5, + } + } + 21 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 6, + } + } + 22 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 6, + } + } + 23 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 7, + } + } + 24 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 7, + } + } + 25 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 7, + } + } + 26 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 7, + } + } + 27 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 8, + } + } + 28 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 8, + } + } + 29 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 6, + nonterminal_produced: 8, + } + } + 30 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 9, + } + } + 31 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 9, + } + } + 32 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 10, + } + } + 33 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 11, + } + } + 34 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 11, + } + } + 35 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 12, + } + } + 36 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 12, + } + } + 37 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 12, + } + } + 38 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 13, + } + } + 39 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 14, + } + } + 40 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 15, + } + } + 41 => __state_machine::SimulatedReduce::Accept, + 42 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 17, + } + } + 43 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 18, + } + } + 44 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 19, + } + } + 45 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 20, + } + } + _ => panic!("invalid reduction index {__reduce_index}") + } + } + pub struct Filter1Parser { + builder: __lalrpop_util::lexer::MatcherBuilder, + _priv: (), + } + + impl Default for Filter1Parser { fn default() -> Self { Self::new() } } + impl Filter1Parser { + pub fn new() -> Filter1Parser { + let __builder = super::__intern_token::new_builder(); + Filter1Parser { + builder: __builder, + _priv: (), + } + } + + #[allow(dead_code)] + pub fn parse< + 'input, + >( + &self, + input: &'input str, + ) -> Result, FilterActionError>> + { + let mut __tokens = self.builder.matcher(input); + __state_machine::Parser::drive( + __StateMachine { + input, + __phantom: core::marker::PhantomData::<(&())>, + }, + __tokens, + ) + } + } + fn __accepts< + 'input, + >( + __error_state: Option, + __states: &[i8], + __opt_integer: Option, + _: core::marker::PhantomData<(&'input ())>, + ) -> bool + { + let mut __states = __states.to_vec(); + __states.extend(__error_state); + loop { + let mut __states_len = __states.len(); + let __top = __states[__states_len - 1]; + let __action = match __opt_integer { + None => __EOF_ACTION[__top as usize], + Some(__integer) => __action(__top, __integer), + }; + if __action == 0 { return false; } + if __action > 0 { return true; } + let (__to_pop, __nt) = match __simulate_reduce(-(__action + 1), core::marker::PhantomData::<(&())>) { + __state_machine::SimulatedReduce::Reduce { + states_to_pop, nonterminal_produced + } => (states_to_pop, nonterminal_produced), + __state_machine::SimulatedReduce::Accept => return true, + }; + __states_len -= __to_pop; + __states.truncate(__states_len); + let __top = __states[__states_len - 1]; + let __next_state = __goto(__top, __nt); + __states.push(__next_state); + } + } + fn __reduce< + 'input, + >( + input: &'input str, + __action: i8, + __lookahead_start: Option<&usize>, + __states: &mut alloc::vec::Vec, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> Option, FilterActionError>>> + { + let (__pop_states, __nonterminal) = match __action { + 0 => { + __reduce0(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 1 => { + __reduce1(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 2 => { + // AttrPath = AttrPathTok => ActionFn(19); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = match super::__action19::<>(input, __sym0) { + Ok(v) => v, + Err(e) => return Some(Err(e)), + }; + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + (1, 1) + } + 3 => { + __reduce3(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 4 => { + __reduce4(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 5 => { + __reduce5(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 6 => { + __reduce6(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 7 => { + // CompValue = NumberLit => ActionFn(41); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = match super::__action41::<>(input, __sym0) { + Ok(v) => v, + Err(e) => return Some(Err(e)), + }; + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + 8 => { + // CompValue = StringLit => ActionFn(42); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = match super::__action42::<>(input, __sym0) { + Ok(v) => v, + Err(e) => return Some(Err(e)), + }; + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + 9 => { + __reduce9(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 10 => { + __reduce10(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 11 => { + __reduce11(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 12 => { + __reduce12(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 13 => { + __reduce13(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 14 => { + __reduce14(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 15 => { + __reduce15(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 16 => { + __reduce16(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 17 => { + __reduce17(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 18 => { + __reduce18(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 19 => { + __reduce19(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 20 => { + __reduce20(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 21 => { + __reduce21(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 22 => { + __reduce22(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 23 => { + __reduce23(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 24 => { + __reduce24(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 25 => { + __reduce25(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 26 => { + __reduce26(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 27 => { + __reduce27(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 28 => { + __reduce28(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 29 => { + __reduce29(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 30 => { + __reduce30(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 31 => { + __reduce31(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 32 => { + __reduce32(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 33 => { + __reduce33(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 34 => { + __reduce34(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 35 => { + __reduce35(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 36 => { + __reduce36(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 37 => { + __reduce37(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 38 => { + __reduce38(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 39 => { + __reduce39(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 40 => { + __reduce40(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 41 => { + // __Filter1 = Filter1 => ActionFn(1); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action1::<>(input, __sym0); + return Some(Ok(__nt)); + } + 42 => { + __reduce42(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 43 => { + __reduce43(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 44 => { + __reduce44(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 45 => { + __reduce45(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + _ => panic!("invalid action code {__action}") + }; + let __states_len = __states.len(); + __states.truncate(__states_len - __pop_states); + let __state = *__states.last().unwrap(); + let __next_state = __goto(__state, __nonterminal); + __states.push(__next_state); + None + } + #[inline(never)] + fn __symbol_type_mismatch() -> ! { + panic!("symbol type mismatch") + } + fn __pop_Variant1< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, AttrExp, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant1(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant2< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, AttrPath, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant2(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant3< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, CompValue, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant3(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant4< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, CompareOp, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant4(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant5< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, Filter, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant5(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant6< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, PatchPath, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant6(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant7< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, ValFilter, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant7(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant8< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, ValuePath, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant8(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant0< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, &'input str, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant0(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __reduce0< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // AttrExp = AttrPath, "pr" => ActionFn(17); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym1.2.clone(); + let __nt = super::__action17::<>(input, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (2, 0) + } + fn __reduce1< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // AttrExp = AttrPath, CompareOp, CompValue => ActionFn(18); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant3(__symbols); + let __sym1 = __pop_Variant4(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action18::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (3, 0) + } + fn __reduce3< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // AttrPath = AttrNameTok => ActionFn(20); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action20::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + (1, 1) + } + fn __reduce4< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompValue = "false" => ActionFn(38); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action38::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + fn __reduce5< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompValue = "null" => ActionFn(39); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action39::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + fn __reduce6< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompValue = "true" => ActionFn(40); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action40::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + fn __reduce9< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "eq" => ActionFn(29); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action29::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce10< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "ne" => ActionFn(30); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action30::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce11< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "co" => ActionFn(31); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action31::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce12< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "sw" => ActionFn(32); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action32::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce13< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "ew" => ActionFn(33); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action33::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce14< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "gt" => ActionFn(34); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action34::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce15< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "lt" => ActionFn(35); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action35::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce16< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "ge" => ActionFn(36); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action36::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce17< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "le" => ActionFn(37); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action37::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce18< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter = Filter, "or", Filter1 => ActionFn(10); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action10::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 4) + } + fn __reduce19< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter = Filter1 => ActionFn(11); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action11::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 4) + } + fn __reduce20< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter0 = FilterAtom => ActionFn(7); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action7::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 5) + } + fn __reduce21< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter1 = Filter1, "and", Filter0 => ActionFn(8); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action8::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 6) + } + fn __reduce22< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter1 = Filter0 => ActionFn(9); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action9::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 6) + } + fn __reduce23< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = AttrExp => ActionFn(12); + let __sym0 = __pop_Variant1(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action12::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 7) + } + fn __reduce24< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = ValuePath => ActionFn(13); + let __sym0 = __pop_Variant8(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action13::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 7) + } + fn __reduce25< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = "not", "(", Filter, ")" => ActionFn(14); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action14::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (4, 7) + } + fn __reduce26< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = "(", Filter, ")" => ActionFn(15); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant5(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action15::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 7) + } + fn __reduce27< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Path = AttrPath => ActionFn(43); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action43::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (1, 8) + } + fn __reduce28< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Path = AttrPath, "[", ValFilter, "]" => ActionFn(44); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action44::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (4, 8) + } + fn __reduce29< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Path = AttrPath, "[", ValFilter, "]", ".", AttrNameTok => ActionFn(45); + assert!(__symbols.len() >= 6); + let __sym5 = __pop_Variant0(__symbols); + let __sym4 = __pop_Variant0(__symbols); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym5.2.clone(); + let __nt = super::__action45::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (6, 8) + } + fn __reduce30< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter = ValFilter, "or", ValFilter1 => ActionFn(24); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action24::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (3, 9) + } + fn __reduce31< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter = ValFilter1 => ActionFn(25); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action25::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 9) + } + fn __reduce32< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter0 = ValFilterAtom => ActionFn(21); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action21::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 10) + } + fn __reduce33< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter1 = ValFilter1, "and", ValFilter0 => ActionFn(22); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action22::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (3, 11) + } + fn __reduce34< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter1 = ValFilter0 => ActionFn(23); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action23::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 11) + } + fn __reduce35< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilterAtom = AttrExp => ActionFn(26); + let __sym0 = __pop_Variant1(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action26::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 12) + } + fn __reduce36< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilterAtom = "not", "(", ValFilter, ")" => ActionFn(27); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action27::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (4, 12) + } + fn __reduce37< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilterAtom = "(", ValFilter, ")" => ActionFn(28); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant7(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action28::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (3, 12) + } + fn __reduce38< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValuePath = AttrPath, "[", ValFilter, "]" => ActionFn(16); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action16::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (4, 13) + } + fn __reduce39< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Filter = Filter => ActionFn(2); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action2::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 14) + } + fn __reduce40< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Filter0 = Filter0 => ActionFn(0); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action0::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 15) + } + fn __reduce42< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Path = Path => ActionFn(6); + let __sym0 = __pop_Variant6(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action6::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (1, 17) + } + fn __reduce43< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __ValFilter = ValFilter => ActionFn(5); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action5::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 18) + } + fn __reduce44< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __ValFilter0 = ValFilter0 => ActionFn(3); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action3::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 19) + } + fn __reduce45< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __ValFilter1 = ValFilter1 => ActionFn(4); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action4::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 20) + } +} +#[allow(unused_imports)] +pub use self::__parse__Filter1::Filter1Parser; + +#[rustfmt::skip] +#[allow(explicit_outlives_requirements, non_snake_case, non_camel_case_types, unused_mut, unused_variables, unused_imports, unused_parens, clippy::needless_lifetimes, clippy::type_complexity, clippy::needless_return, clippy::too_many_arguments, clippy::match_single_binding, clippy::clone_on_copy, clippy::unit_arg)] +mod __parse__Path { + + use crate::filter::{ + AttrExp, AttrPath, CompareOp, CompValue, Filter, FilterActionError, + PatchPath, PatchValuePath, ValFilter, ValuePath, parse_attr_path, +}; + #[allow(unused_extern_crates)] + extern crate lalrpop_util as __lalrpop_util; + #[allow(unused_imports)] + use self::__lalrpop_util::state_machine as __state_machine; + #[allow(unused_extern_crates)] + extern crate alloc; + use self::__lalrpop_util::lexer::Token; + #[allow(dead_code)] + pub(crate) enum __Symbol<'input> + { + Variant0(&'input str), + Variant1(AttrExp), + Variant2(AttrPath), + Variant3(CompValue), + Variant4(CompareOp), + Variant5(Filter), + Variant6(PatchPath), + Variant7(ValFilter), + Variant8(ValuePath), + } + const __ACTION: &[i8] = &[ + // State 0 + 11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // State 1 + 11, 12, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, + // State 2 + 0, 0, 0, 0, 0, 0, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, + // State 3 + 11, 12, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, + // State 4 + 0, 0, 36, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 33, 34, + // State 5 + 11, 12, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, + // State 6 + 11, 12, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, + // State 7 + 11, 12, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, + // State 8 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, + // State 9 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // State 10 + 0, 0, 0, 0, 0, 0, -4, -4, -4, -4, -4, -4, -4, -4, 0, -4, -4, 0, 0, 0, -4, 0, 0, 0, 0, + // State 11 + 0, 0, 0, 0, 0, 0, -3, -3, -3, -3, -3, -3, -3, -3, 0, -3, -3, 0, 0, 0, -3, 0, 0, 0, 0, + // State 12 + 0, 0, 0, 0, 0, -36, 0, 0, 0, 0, 0, 0, 0, 0, -36, 0, 0, 0, -36, 0, 0, -36, 0, 0, 0, + // State 13 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, + // State 14 + 0, 0, 0, 0, 0, -35, 0, 0, 0, 0, 0, 0, 0, 0, -35, 0, 0, 0, -35, 0, 0, -35, 0, 0, 0, + // State 15 + 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, -32, 0, 0, 0, -32, 0, 0, -32, 0, 0, 0, + // State 16 + 0, 0, 0, 0, 0, -33, 0, 0, 0, 0, 0, 0, 0, 0, -33, 0, 0, 0, -33, 0, 0, -33, 0, 0, 0, + // State 17 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, + // State 18 + 0, 0, -12, 0, -12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -12, -12, -12, + // State 19 + 0, 0, -10, 0, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10, -10, -10, + // State 20 + 0, 0, -14, 0, -14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, -14, -14, + // State 21 + 0, 0, -17, 0, -17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -17, -17, -17, + // State 22 + 0, 0, -15, 0, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, -15, -15, + // State 23 + 0, 0, -18, 0, -18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -18, -18, -18, + // State 24 + 0, 0, -16, 0, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16, -16, -16, + // State 25 + 0, 0, -11, 0, -11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -11, -11, -11, + // State 26 + 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, + // State 27 + 0, 0, -13, 0, -13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -13, -13, -13, + // State 28 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, + // State 29 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, + // State 30 + 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, -2, 0, 0, -2, 0, 0, 0, + // State 31 + 0, 0, 0, 0, 0, -5, 0, 0, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0, -5, 0, 0, -5, 0, 0, 0, + // State 32 + 0, 0, 0, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, -6, 0, 0, 0, -6, 0, 0, -6, 0, 0, 0, + // State 33 + 0, 0, 0, 0, 0, -7, 0, 0, 0, 0, 0, 0, 0, 0, -7, 0, 0, 0, -7, 0, 0, -7, 0, 0, 0, + // State 34 + 0, 0, 0, 0, 0, -8, 0, 0, 0, 0, 0, 0, 0, 0, -8, 0, 0, 0, -8, 0, 0, -8, 0, 0, 0, + // State 35 + 0, 0, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0, 0, -9, 0, 0, 0, -9, 0, 0, -9, 0, 0, 0, + // State 36 + 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // State 37 + 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, -31, 0, 0, 0, -31, 0, 0, -31, 0, 0, 0, + // State 38 + 0, 0, 0, 0, 0, -34, 0, 0, 0, 0, 0, 0, 0, 0, -34, 0, 0, 0, -34, 0, 0, -34, 0, 0, 0, + // State 39 + 0, 0, 0, 0, 0, -38, 0, 0, 0, 0, 0, 0, 0, 0, -38, 0, 0, 0, -38, 0, 0, -38, 0, 0, 0, + // State 40 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, + // State 41 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // State 42 + 0, 0, 0, 0, 0, -37, 0, 0, 0, 0, 0, 0, 0, 0, -37, 0, 0, 0, -37, 0, 0, -37, 0, 0, 0, + ]; + fn __action(state: i8, integer: usize) -> i8 { + __ACTION[(state as usize) * 25 + integer] + } + const __EOF_ACTION: &[i8] = &[ + // State 0 + 0, + // State 1 + 0, + // State 2 + 0, + // State 3 + 0, + // State 4 + 0, + // State 5 + 0, + // State 6 + 0, + // State 7 + 0, + // State 8 + -28, + // State 9 + -43, + // State 10 + -4, + // State 11 + -3, + // State 12 + 0, + // State 13 + 0, + // State 14 + 0, + // State 15 + 0, + // State 16 + 0, + // State 17 + 0, + // State 18 + 0, + // State 19 + 0, + // State 20 + 0, + // State 21 + 0, + // State 22 + 0, + // State 23 + 0, + // State 24 + 0, + // State 25 + 0, + // State 26 + 0, + // State 27 + 0, + // State 28 + -29, + // State 29 + 0, + // State 30 + 0, + // State 31 + 0, + // State 32 + 0, + // State 33 + 0, + // State 34 + 0, + // State 35 + 0, + // State 36 + 0, + // State 37 + 0, + // State 38 + 0, + // State 39 + 0, + // State 40 + 0, + // State 41 + -30, + // State 42 + 0, + ]; + fn __goto(state: i8, nt: usize) -> i8 { + match nt { + 0 => 12, + 1 => match state { + 0 => 8, + _ => 2, + }, + 2 => 30, + 3 => 4, + 8 => 9, + 9 => match state { + 3 => 29, + 7 => 40, + _ => 13, + }, + 10 => match state { + 6 => 38, + _ => 14, + }, + 11 => match state { + 5 => 37, + _ => 15, + }, + 12 => 16, + _ => 0, + } + } + #[allow(clippy::needless_raw_string_hashes)] + const __TERMINAL: &[&str] = &[ + r###"AttrNameTok"###, + r###"AttrPathTok"###, + r###"StringLit"###, + r###""not""###, + r###"NumberLit"###, + r###""and""###, + r###""co""###, + r###""eq""###, + r###""ew""###, + r###""ge""###, + r###""gt""###, + r###""le""###, + r###""lt""###, + r###""ne""###, + r###""or""###, + r###""pr""###, + r###""sw""###, + r###""(""###, + r###"")""###, + r###"".""###, + r###""[""###, + r###""]""###, + r###""false""###, + r###""null""###, + r###""true""###, + ]; + fn __expected_tokens(__state: i8) -> alloc::vec::Vec { + __TERMINAL.iter().enumerate().filter_map(|(index, terminal)| { + let next_state = __action(__state, index); + if next_state == 0 { + None + } else { + Some(alloc::string::ToString::to_string(terminal)) + } + }).collect() + } + fn __expected_tokens_from_states< + 'input, + >( + __states: &[i8], + _: core::marker::PhantomData<(&'input ())>, + ) -> alloc::vec::Vec + { + __TERMINAL.iter().enumerate().filter_map(|(index, terminal)| { + if __accepts(None, __states, Some(index), core::marker::PhantomData::<(&())>) { + Some(alloc::string::ToString::to_string(terminal)) + } else { + None + } + }).collect() + } + struct __StateMachine<'input> + where + { + input: &'input str, + __phantom: core::marker::PhantomData<(&'input ())>, + } + impl<'input> __state_machine::ParserDefinition for __StateMachine<'input> + where + { + type Location = usize; + type Error = FilterActionError; + type Token = Token<'input>; + type TokenIndex = usize; + type Symbol = __Symbol<'input>; + type Success = PatchPath; + type StateIndex = i8; + type Action = i8; + type ReduceIndex = i8; + type NonterminalIndex = usize; + + #[inline] + fn start_location(&self) -> Self::Location { + Default::default() + } + + #[inline] + fn start_state(&self) -> Self::StateIndex { + 0 + } + + #[inline] + fn token_to_index(&self, token: &Self::Token) -> Option { + __token_to_integer(token, core::marker::PhantomData::<(&())>) + } + + #[inline] + fn action(&self, state: i8, integer: usize) -> i8 { + __action(state, integer) + } + + #[inline] + fn error_action(&self, state: i8) -> i8 { + __action(state, 25 - 1) + } + + #[inline] + fn eof_action(&self, state: i8) -> i8 { + __EOF_ACTION[state as usize] + } + + #[inline] + fn goto(&self, state: i8, nt: usize) -> i8 { + __goto(state, nt) + } + + fn token_to_symbol(&self, token_index: usize, token: Self::Token) -> Self::Symbol { + __token_to_symbol(token_index, token, core::marker::PhantomData::<(&())>) + } + + fn expected_tokens(&self, state: i8) -> alloc::vec::Vec { + __expected_tokens(state) + } + + fn expected_tokens_from_states(&self, states: &[i8]) -> alloc::vec::Vec { + __expected_tokens_from_states(states, core::marker::PhantomData::<(&())>) + } + + #[inline] + fn uses_error_recovery(&self) -> bool { + false + } + + #[inline] + fn error_recovery_symbol( + &self, + recovery: __state_machine::ErrorRecovery, + ) -> Self::Symbol { + panic!("error recovery not enabled for this grammar") + } + + fn reduce( + &mut self, + action: i8, + start_location: Option<&Self::Location>, + states: &mut alloc::vec::Vec, + symbols: &mut alloc::vec::Vec<__state_machine::SymbolTriple>, + ) -> Option<__state_machine::ParseResult> { + __reduce( + self.input, + action, + start_location, + states, + symbols, + core::marker::PhantomData::<(&())>, + ) + } + + fn simulate_reduce(&self, action: i8) -> __state_machine::SimulatedReduce { + __simulate_reduce(action, core::marker::PhantomData::<(&())>) + } + } + fn __token_to_integer< + 'input, + >( + __token: &Token<'input>, + _: core::marker::PhantomData<(&'input ())>, + ) -> Option + { + #[warn(unused_variables)] + match __token { + Token(0, _) if true => Some(0), + Token(1, _) if true => Some(1), + Token(2, _) if true => Some(2), + Token(3, _) if true => Some(3), + Token(4, _) if true => Some(4), + Token(5, _) if true => Some(5), + Token(6, _) if true => Some(6), + Token(7, _) if true => Some(7), + Token(8, _) if true => Some(8), + Token(9, _) if true => Some(9), + Token(10, _) if true => Some(10), + Token(11, _) if true => Some(11), + Token(12, _) if true => Some(12), + Token(13, _) if true => Some(13), + Token(14, _) if true => Some(14), + Token(15, _) if true => Some(15), + Token(16, _) if true => Some(16), + Token(17, _) if true => Some(17), + Token(18, _) if true => Some(18), + Token(19, _) if true => Some(19), + Token(20, _) if true => Some(20), + Token(21, _) if true => Some(21), + Token(22, _) if true => Some(22), + Token(23, _) if true => Some(23), + Token(24, _) if true => Some(24), + _ => None, + } + } + fn __token_to_symbol< + 'input, + >( + __token_index: usize, + __token: Token<'input>, + _: core::marker::PhantomData<(&'input ())>, + ) -> __Symbol<'input> + { + #[allow(clippy::manual_range_patterns)]match __token_index { + 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 => match __token { + Token(0, __tok0) | Token(1, __tok0) | Token(2, __tok0) | Token(3, __tok0) | Token(4, __tok0) | Token(5, __tok0) | Token(6, __tok0) | Token(7, __tok0) | Token(8, __tok0) | Token(9, __tok0) | Token(10, __tok0) | Token(11, __tok0) | Token(12, __tok0) | Token(13, __tok0) | Token(14, __tok0) | Token(15, __tok0) | Token(16, __tok0) | Token(17, __tok0) | Token(18, __tok0) | Token(19, __tok0) | Token(20, __tok0) | Token(21, __tok0) | Token(22, __tok0) | Token(23, __tok0) | Token(24, __tok0) if true => __Symbol::Variant0(__tok0), + _ => unreachable!(), + }, + _ => unreachable!(), + } + } + fn __simulate_reduce< + 'input, + >( + __reduce_index: i8, + _: core::marker::PhantomData<(&'input ())>, + ) -> __state_machine::SimulatedReduce<__StateMachine<'input>> + { + match __reduce_index { + 0 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 2, + nonterminal_produced: 0, + } + } + 1 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 0, + } + } + 2 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 1, + } + } + 3 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 1, + } + } + 4 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 5 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 6 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 7 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 8 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 9 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 10 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 11 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 12 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 13 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 14 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 15 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 16 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 17 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 18 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 4, + } + } + 19 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 4, + } + } + 20 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 5, + } + } + 21 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 6, + } + } + 22 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 6, + } + } + 23 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 7, + } + } + 24 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 7, + } + } + 25 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 7, + } + } + 26 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 7, + } + } + 27 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 8, + } + } + 28 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 8, + } + } + 29 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 6, + nonterminal_produced: 8, + } + } + 30 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 9, + } + } + 31 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 9, + } + } + 32 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 10, + } + } + 33 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 11, + } + } + 34 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 11, + } + } + 35 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 12, + } + } + 36 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 12, + } + } + 37 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 12, + } + } + 38 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 13, + } + } + 39 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 14, + } + } + 40 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 15, + } + } + 41 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 16, + } + } + 42 => __state_machine::SimulatedReduce::Accept, + 43 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 18, + } + } + 44 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 19, + } + } + 45 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 20, + } + } + _ => panic!("invalid reduction index {__reduce_index}") + } + } + pub struct PathParser { + builder: __lalrpop_util::lexer::MatcherBuilder, + _priv: (), + } + + impl Default for PathParser { fn default() -> Self { Self::new() } } + impl PathParser { + pub fn new() -> PathParser { + let __builder = super::__intern_token::new_builder(); + PathParser { + builder: __builder, + _priv: (), + } + } + + #[allow(dead_code)] + pub fn parse< + 'input, + >( + &self, + input: &'input str, + ) -> Result, FilterActionError>> + { + let mut __tokens = self.builder.matcher(input); + __state_machine::Parser::drive( + __StateMachine { + input, + __phantom: core::marker::PhantomData::<(&())>, + }, + __tokens, + ) + } + } + fn __accepts< + 'input, + >( + __error_state: Option, + __states: &[i8], + __opt_integer: Option, + _: core::marker::PhantomData<(&'input ())>, + ) -> bool + { + let mut __states = __states.to_vec(); + __states.extend(__error_state); + loop { + let mut __states_len = __states.len(); + let __top = __states[__states_len - 1]; + let __action = match __opt_integer { + None => __EOF_ACTION[__top as usize], + Some(__integer) => __action(__top, __integer), + }; + if __action == 0 { return false; } + if __action > 0 { return true; } + let (__to_pop, __nt) = match __simulate_reduce(-(__action + 1), core::marker::PhantomData::<(&())>) { + __state_machine::SimulatedReduce::Reduce { + states_to_pop, nonterminal_produced + } => (states_to_pop, nonterminal_produced), + __state_machine::SimulatedReduce::Accept => return true, + }; + __states_len -= __to_pop; + __states.truncate(__states_len); + let __top = __states[__states_len - 1]; + let __next_state = __goto(__top, __nt); + __states.push(__next_state); + } + } + fn __reduce< + 'input, + >( + input: &'input str, + __action: i8, + __lookahead_start: Option<&usize>, + __states: &mut alloc::vec::Vec, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> Option, FilterActionError>>> + { + let (__pop_states, __nonterminal) = match __action { + 0 => { + __reduce0(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 1 => { + __reduce1(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 2 => { + // AttrPath = AttrPathTok => ActionFn(19); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = match super::__action19::<>(input, __sym0) { + Ok(v) => v, + Err(e) => return Some(Err(e)), + }; + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + (1, 1) + } + 3 => { + __reduce3(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 4 => { + __reduce4(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 5 => { + __reduce5(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 6 => { + __reduce6(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 7 => { + // CompValue = NumberLit => ActionFn(41); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = match super::__action41::<>(input, __sym0) { + Ok(v) => v, + Err(e) => return Some(Err(e)), + }; + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + 8 => { + // CompValue = StringLit => ActionFn(42); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = match super::__action42::<>(input, __sym0) { + Ok(v) => v, + Err(e) => return Some(Err(e)), + }; + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + 9 => { + __reduce9(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 10 => { + __reduce10(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 11 => { + __reduce11(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 12 => { + __reduce12(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 13 => { + __reduce13(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 14 => { + __reduce14(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 15 => { + __reduce15(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 16 => { + __reduce16(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 17 => { + __reduce17(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 18 => { + __reduce18(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 19 => { + __reduce19(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 20 => { + __reduce20(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 21 => { + __reduce21(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 22 => { + __reduce22(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 23 => { + __reduce23(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 24 => { + __reduce24(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 25 => { + __reduce25(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 26 => { + __reduce26(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 27 => { + __reduce27(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 28 => { + __reduce28(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 29 => { + __reduce29(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 30 => { + __reduce30(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 31 => { + __reduce31(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 32 => { + __reduce32(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 33 => { + __reduce33(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 34 => { + __reduce34(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 35 => { + __reduce35(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 36 => { + __reduce36(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 37 => { + __reduce37(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 38 => { + __reduce38(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 39 => { + __reduce39(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 40 => { + __reduce40(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 41 => { + __reduce41(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 42 => { + // __Path = Path => ActionFn(6); + let __sym0 = __pop_Variant6(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action6::<>(input, __sym0); + return Some(Ok(__nt)); + } + 43 => { + __reduce43(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 44 => { + __reduce44(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 45 => { + __reduce45(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + _ => panic!("invalid action code {__action}") + }; + let __states_len = __states.len(); + __states.truncate(__states_len - __pop_states); + let __state = *__states.last().unwrap(); + let __next_state = __goto(__state, __nonterminal); + __states.push(__next_state); + None + } + #[inline(never)] + fn __symbol_type_mismatch() -> ! { + panic!("symbol type mismatch") + } + fn __pop_Variant1< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, AttrExp, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant1(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant2< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, AttrPath, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant2(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant3< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, CompValue, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant3(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant4< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, CompareOp, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant4(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant5< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, Filter, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant5(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant6< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, PatchPath, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant6(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant7< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, ValFilter, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant7(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant8< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, ValuePath, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant8(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant0< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, &'input str, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant0(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __reduce0< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // AttrExp = AttrPath, "pr" => ActionFn(17); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym1.2.clone(); + let __nt = super::__action17::<>(input, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (2, 0) + } + fn __reduce1< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // AttrExp = AttrPath, CompareOp, CompValue => ActionFn(18); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant3(__symbols); + let __sym1 = __pop_Variant4(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action18::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (3, 0) + } + fn __reduce3< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // AttrPath = AttrNameTok => ActionFn(20); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action20::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + (1, 1) + } + fn __reduce4< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompValue = "false" => ActionFn(38); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action38::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + fn __reduce5< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompValue = "null" => ActionFn(39); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action39::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + fn __reduce6< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompValue = "true" => ActionFn(40); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action40::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + fn __reduce9< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "eq" => ActionFn(29); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action29::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce10< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "ne" => ActionFn(30); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action30::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce11< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "co" => ActionFn(31); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action31::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce12< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "sw" => ActionFn(32); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action32::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce13< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "ew" => ActionFn(33); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action33::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce14< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "gt" => ActionFn(34); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action34::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce15< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "lt" => ActionFn(35); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action35::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce16< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "ge" => ActionFn(36); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action36::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce17< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "le" => ActionFn(37); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action37::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce18< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter = Filter, "or", Filter1 => ActionFn(10); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action10::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 4) + } + fn __reduce19< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter = Filter1 => ActionFn(11); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action11::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 4) + } + fn __reduce20< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter0 = FilterAtom => ActionFn(7); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action7::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 5) + } + fn __reduce21< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter1 = Filter1, "and", Filter0 => ActionFn(8); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action8::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 6) + } + fn __reduce22< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter1 = Filter0 => ActionFn(9); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action9::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 6) + } + fn __reduce23< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = AttrExp => ActionFn(12); + let __sym0 = __pop_Variant1(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action12::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 7) + } + fn __reduce24< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = ValuePath => ActionFn(13); + let __sym0 = __pop_Variant8(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action13::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 7) + } + fn __reduce25< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = "not", "(", Filter, ")" => ActionFn(14); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action14::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (4, 7) + } + fn __reduce26< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = "(", Filter, ")" => ActionFn(15); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant5(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action15::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 7) + } + fn __reduce27< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Path = AttrPath => ActionFn(43); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action43::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (1, 8) + } + fn __reduce28< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Path = AttrPath, "[", ValFilter, "]" => ActionFn(44); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action44::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (4, 8) + } + fn __reduce29< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Path = AttrPath, "[", ValFilter, "]", ".", AttrNameTok => ActionFn(45); + assert!(__symbols.len() >= 6); + let __sym5 = __pop_Variant0(__symbols); + let __sym4 = __pop_Variant0(__symbols); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym5.2.clone(); + let __nt = super::__action45::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (6, 8) + } + fn __reduce30< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter = ValFilter, "or", ValFilter1 => ActionFn(24); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action24::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (3, 9) + } + fn __reduce31< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter = ValFilter1 => ActionFn(25); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action25::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 9) + } + fn __reduce32< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter0 = ValFilterAtom => ActionFn(21); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action21::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 10) + } + fn __reduce33< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter1 = ValFilter1, "and", ValFilter0 => ActionFn(22); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action22::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (3, 11) + } + fn __reduce34< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter1 = ValFilter0 => ActionFn(23); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action23::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 11) + } + fn __reduce35< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilterAtom = AttrExp => ActionFn(26); + let __sym0 = __pop_Variant1(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action26::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 12) + } + fn __reduce36< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilterAtom = "not", "(", ValFilter, ")" => ActionFn(27); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action27::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (4, 12) + } + fn __reduce37< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilterAtom = "(", ValFilter, ")" => ActionFn(28); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant7(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action28::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (3, 12) + } + fn __reduce38< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValuePath = AttrPath, "[", ValFilter, "]" => ActionFn(16); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action16::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (4, 13) + } + fn __reduce39< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Filter = Filter => ActionFn(2); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action2::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 14) + } + fn __reduce40< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Filter0 = Filter0 => ActionFn(0); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action0::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 15) + } + fn __reduce41< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Filter1 = Filter1 => ActionFn(1); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action1::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 16) + } + fn __reduce43< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __ValFilter = ValFilter => ActionFn(5); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action5::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 18) + } + fn __reduce44< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __ValFilter0 = ValFilter0 => ActionFn(3); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action3::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 19) + } + fn __reduce45< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __ValFilter1 = ValFilter1 => ActionFn(4); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action4::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 20) + } +} +#[allow(unused_imports)] +pub use self::__parse__Path::PathParser; + +#[rustfmt::skip] +#[allow(explicit_outlives_requirements, non_snake_case, non_camel_case_types, unused_mut, unused_variables, unused_imports, unused_parens, clippy::needless_lifetimes, clippy::type_complexity, clippy::needless_return, clippy::too_many_arguments, clippy::match_single_binding, clippy::clone_on_copy, clippy::unit_arg)] +mod __parse__ValFilter { + + use crate::filter::{ + AttrExp, AttrPath, CompareOp, CompValue, Filter, FilterActionError, + PatchPath, PatchValuePath, ValFilter, ValuePath, parse_attr_path, +}; + #[allow(unused_extern_crates)] + extern crate lalrpop_util as __lalrpop_util; + #[allow(unused_imports)] + use self::__lalrpop_util::state_machine as __state_machine; + #[allow(unused_extern_crates)] + extern crate alloc; + use self::__lalrpop_util::lexer::Token; + #[allow(dead_code)] + pub(crate) enum __Symbol<'input> + { + Variant0(&'input str), + Variant1(AttrExp), + Variant2(AttrPath), + Variant3(CompValue), + Variant4(CompareOp), + Variant5(Filter), + Variant6(PatchPath), + Variant7(ValFilter), + Variant8(ValuePath), + } + const __ACTION: &[i8] = &[ + // State 0 + 14, 15, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 1 + 0, 0, 0, 0, 0, 0, 16, 17, 18, 19, 20, 21, 22, 23, 0, 24, 25, 0, 0, 0, 0, 0, 0, 0, 0, + // State 2 + 14, 15, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 3 + 0, 0, 32, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 29, 30, + // State 4 + 14, 15, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 5 + 14, 15, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 6 + 14, 15, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 7 + 0, 0, 0, 0, 0, -36, 0, 0, 0, 0, 0, 0, 0, 0, -36, 0, 0, 0, -36, 0, 0, 0, 0, 0, 0, + // State 8 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // State 9 + 0, 0, 0, 0, 0, -35, 0, 0, 0, 0, 0, 0, 0, 0, -35, 0, 0, 0, -35, 0, 0, 0, 0, 0, 0, + // State 10 + 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, -32, 0, 0, 0, -32, 0, 0, 0, 0, 0, 0, + // State 11 + 0, 0, 0, 0, 0, -33, 0, 0, 0, 0, 0, 0, 0, 0, -33, 0, 0, 0, -33, 0, 0, 0, 0, 0, 0, + // State 12 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, + // State 13 + 0, 0, 0, 0, 0, 0, -4, -4, -4, -4, -4, -4, -4, -4, 0, -4, -4, 0, 0, 0, 0, 0, 0, 0, 0, + // State 14 + 0, 0, 0, 0, 0, 0, -3, -3, -3, -3, -3, -3, -3, -3, 0, -3, -3, 0, 0, 0, 0, 0, 0, 0, 0, + // State 15 + 0, 0, -12, 0, -12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -12, -12, -12, + // State 16 + 0, 0, -10, 0, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10, -10, -10, + // State 17 + 0, 0, -14, 0, -14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, -14, -14, + // State 18 + 0, 0, -17, 0, -17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -17, -17, -17, + // State 19 + 0, 0, -15, 0, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, -15, -15, + // State 20 + 0, 0, -18, 0, -18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -18, -18, -18, + // State 21 + 0, 0, -16, 0, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16, -16, -16, + // State 22 + 0, 0, -11, 0, -11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -11, -11, -11, + // State 23 + 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, + // State 24 + 0, 0, -13, 0, -13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -13, -13, -13, + // State 25 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, + // State 26 + 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, + // State 27 + 0, 0, 0, 0, 0, -5, 0, 0, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0, -5, 0, 0, 0, 0, 0, 0, + // State 28 + 0, 0, 0, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, -6, 0, 0, 0, -6, 0, 0, 0, 0, 0, 0, + // State 29 + 0, 0, 0, 0, 0, -7, 0, 0, 0, 0, 0, 0, 0, 0, -7, 0, 0, 0, -7, 0, 0, 0, 0, 0, 0, + // State 30 + 0, 0, 0, 0, 0, -8, 0, 0, 0, 0, 0, 0, 0, 0, -8, 0, 0, 0, -8, 0, 0, 0, 0, 0, 0, + // State 31 + 0, 0, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0, 0, -9, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, + // State 32 + 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, -31, 0, 0, 0, -31, 0, 0, 0, 0, 0, 0, + // State 33 + 0, 0, 0, 0, 0, -34, 0, 0, 0, 0, 0, 0, 0, 0, -34, 0, 0, 0, -34, 0, 0, 0, 0, 0, 0, + // State 34 + 0, 0, 0, 0, 0, -38, 0, 0, 0, 0, 0, 0, 0, 0, -38, 0, 0, 0, -38, 0, 0, 0, 0, 0, 0, + // State 35 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, + // State 36 + 0, 0, 0, 0, 0, -37, 0, 0, 0, 0, 0, 0, 0, 0, -37, 0, 0, 0, -37, 0, 0, 0, 0, 0, 0, + ]; + fn __action(state: i8, integer: usize) -> i8 { + __ACTION[(state as usize) * 25 + integer] + } + const __EOF_ACTION: &[i8] = &[ + // State 0 + 0, + // State 1 + 0, + // State 2 + 0, + // State 3 + 0, + // State 4 + 0, + // State 5 + 0, + // State 6 + 0, + // State 7 + -36, + // State 8 + -44, + // State 9 + -35, + // State 10 + -32, + // State 11 + -33, + // State 12 + 0, + // State 13 + 0, + // State 14 + 0, + // State 15 + 0, + // State 16 + 0, + // State 17 + 0, + // State 18 + 0, + // State 19 + 0, + // State 20 + 0, + // State 21 + 0, + // State 22 + 0, + // State 23 + -1, + // State 24 + 0, + // State 25 + 0, + // State 26 + -2, + // State 27 + -5, + // State 28 + -6, + // State 29 + -7, + // State 30 + -8, + // State 31 + -9, + // State 32 + -31, + // State 33 + -34, + // State 34 + -38, + // State 35 + 0, + // State 36 + -37, + ]; + fn __goto(state: i8, nt: usize) -> i8 { + match nt { + 0 => 7, + 1 => 1, + 2 => 26, + 3 => 3, + 9 => match state { + 2 => 25, + 6 => 35, + _ => 8, + }, + 10 => match state { + 5 => 33, + _ => 9, + }, + 11 => match state { + 4 => 32, + _ => 10, + }, + 12 => 11, + _ => 0, + } + } + #[allow(clippy::needless_raw_string_hashes)] + const __TERMINAL: &[&str] = &[ + r###"AttrNameTok"###, + r###"AttrPathTok"###, + r###"StringLit"###, + r###""not""###, + r###"NumberLit"###, + r###""and""###, + r###""co""###, + r###""eq""###, + r###""ew""###, + r###""ge""###, + r###""gt""###, + r###""le""###, + r###""lt""###, + r###""ne""###, + r###""or""###, + r###""pr""###, + r###""sw""###, + r###""(""###, + r###"")""###, + r###"".""###, + r###""[""###, + r###""]""###, + r###""false""###, + r###""null""###, + r###""true""###, + ]; + fn __expected_tokens(__state: i8) -> alloc::vec::Vec { + __TERMINAL.iter().enumerate().filter_map(|(index, terminal)| { + let next_state = __action(__state, index); + if next_state == 0 { + None + } else { + Some(alloc::string::ToString::to_string(terminal)) + } + }).collect() + } + fn __expected_tokens_from_states< + 'input, + >( + __states: &[i8], + _: core::marker::PhantomData<(&'input ())>, + ) -> alloc::vec::Vec + { + __TERMINAL.iter().enumerate().filter_map(|(index, terminal)| { + if __accepts(None, __states, Some(index), core::marker::PhantomData::<(&())>) { + Some(alloc::string::ToString::to_string(terminal)) + } else { + None + } + }).collect() + } + struct __StateMachine<'input> + where + { + input: &'input str, + __phantom: core::marker::PhantomData<(&'input ())>, + } + impl<'input> __state_machine::ParserDefinition for __StateMachine<'input> + where + { + type Location = usize; + type Error = FilterActionError; + type Token = Token<'input>; + type TokenIndex = usize; + type Symbol = __Symbol<'input>; + type Success = ValFilter; + type StateIndex = i8; + type Action = i8; + type ReduceIndex = i8; + type NonterminalIndex = usize; + + #[inline] + fn start_location(&self) -> Self::Location { + Default::default() + } + + #[inline] + fn start_state(&self) -> Self::StateIndex { + 0 + } + + #[inline] + fn token_to_index(&self, token: &Self::Token) -> Option { + __token_to_integer(token, core::marker::PhantomData::<(&())>) + } + + #[inline] + fn action(&self, state: i8, integer: usize) -> i8 { + __action(state, integer) + } + + #[inline] + fn error_action(&self, state: i8) -> i8 { + __action(state, 25 - 1) + } + + #[inline] + fn eof_action(&self, state: i8) -> i8 { + __EOF_ACTION[state as usize] + } + + #[inline] + fn goto(&self, state: i8, nt: usize) -> i8 { + __goto(state, nt) + } + + fn token_to_symbol(&self, token_index: usize, token: Self::Token) -> Self::Symbol { + __token_to_symbol(token_index, token, core::marker::PhantomData::<(&())>) + } + + fn expected_tokens(&self, state: i8) -> alloc::vec::Vec { + __expected_tokens(state) + } + + fn expected_tokens_from_states(&self, states: &[i8]) -> alloc::vec::Vec { + __expected_tokens_from_states(states, core::marker::PhantomData::<(&())>) + } + + #[inline] + fn uses_error_recovery(&self) -> bool { + false + } + + #[inline] + fn error_recovery_symbol( + &self, + recovery: __state_machine::ErrorRecovery, + ) -> Self::Symbol { + panic!("error recovery not enabled for this grammar") + } + + fn reduce( + &mut self, + action: i8, + start_location: Option<&Self::Location>, + states: &mut alloc::vec::Vec, + symbols: &mut alloc::vec::Vec<__state_machine::SymbolTriple>, + ) -> Option<__state_machine::ParseResult> { + __reduce( + self.input, + action, + start_location, + states, + symbols, + core::marker::PhantomData::<(&())>, + ) + } + + fn simulate_reduce(&self, action: i8) -> __state_machine::SimulatedReduce { + __simulate_reduce(action, core::marker::PhantomData::<(&())>) + } + } + fn __token_to_integer< + 'input, + >( + __token: &Token<'input>, + _: core::marker::PhantomData<(&'input ())>, + ) -> Option + { + #[warn(unused_variables)] + match __token { + Token(0, _) if true => Some(0), + Token(1, _) if true => Some(1), + Token(2, _) if true => Some(2), + Token(3, _) if true => Some(3), + Token(4, _) if true => Some(4), + Token(5, _) if true => Some(5), + Token(6, _) if true => Some(6), + Token(7, _) if true => Some(7), + Token(8, _) if true => Some(8), + Token(9, _) if true => Some(9), + Token(10, _) if true => Some(10), + Token(11, _) if true => Some(11), + Token(12, _) if true => Some(12), + Token(13, _) if true => Some(13), + Token(14, _) if true => Some(14), + Token(15, _) if true => Some(15), + Token(16, _) if true => Some(16), + Token(17, _) if true => Some(17), + Token(18, _) if true => Some(18), + Token(19, _) if true => Some(19), + Token(20, _) if true => Some(20), + Token(21, _) if true => Some(21), + Token(22, _) if true => Some(22), + Token(23, _) if true => Some(23), + Token(24, _) if true => Some(24), + _ => None, + } + } + fn __token_to_symbol< + 'input, + >( + __token_index: usize, + __token: Token<'input>, + _: core::marker::PhantomData<(&'input ())>, + ) -> __Symbol<'input> + { + #[allow(clippy::manual_range_patterns)]match __token_index { + 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 => match __token { + Token(0, __tok0) | Token(1, __tok0) | Token(2, __tok0) | Token(3, __tok0) | Token(4, __tok0) | Token(5, __tok0) | Token(6, __tok0) | Token(7, __tok0) | Token(8, __tok0) | Token(9, __tok0) | Token(10, __tok0) | Token(11, __tok0) | Token(12, __tok0) | Token(13, __tok0) | Token(14, __tok0) | Token(15, __tok0) | Token(16, __tok0) | Token(17, __tok0) | Token(18, __tok0) | Token(19, __tok0) | Token(20, __tok0) | Token(21, __tok0) | Token(22, __tok0) | Token(23, __tok0) | Token(24, __tok0) if true => __Symbol::Variant0(__tok0), + _ => unreachable!(), + }, + _ => unreachable!(), + } + } + fn __simulate_reduce< + 'input, + >( + __reduce_index: i8, + _: core::marker::PhantomData<(&'input ())>, + ) -> __state_machine::SimulatedReduce<__StateMachine<'input>> + { + match __reduce_index { + 0 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 2, + nonterminal_produced: 0, + } + } + 1 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 0, + } + } + 2 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 1, + } + } + 3 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 1, + } + } + 4 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 5 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 6 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 7 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 8 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 9 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 10 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 11 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 12 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 13 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 14 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 15 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 16 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 17 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 18 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 4, + } + } + 19 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 4, + } + } + 20 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 5, + } + } + 21 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 6, + } + } + 22 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 6, + } + } + 23 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 7, + } + } + 24 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 7, + } + } + 25 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 7, + } + } + 26 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 7, + } + } + 27 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 8, + } + } + 28 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 8, + } + } + 29 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 6, + nonterminal_produced: 8, + } + } + 30 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 9, + } + } + 31 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 9, + } + } + 32 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 10, + } + } + 33 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 11, + } + } + 34 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 11, + } + } + 35 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 12, + } + } + 36 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 12, + } + } + 37 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 12, + } + } + 38 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 13, + } + } + 39 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 14, + } + } + 40 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 15, + } + } + 41 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 16, + } + } + 42 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 17, + } + } + 43 => __state_machine::SimulatedReduce::Accept, + 44 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 19, + } + } + 45 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 20, + } + } + _ => panic!("invalid reduction index {__reduce_index}") + } + } + pub struct ValFilterParser { + builder: __lalrpop_util::lexer::MatcherBuilder, + _priv: (), + } + + impl Default for ValFilterParser { fn default() -> Self { Self::new() } } + impl ValFilterParser { + pub fn new() -> ValFilterParser { + let __builder = super::__intern_token::new_builder(); + ValFilterParser { + builder: __builder, + _priv: (), + } + } + + #[allow(dead_code)] + pub fn parse< + 'input, + >( + &self, + input: &'input str, + ) -> Result, FilterActionError>> + { + let mut __tokens = self.builder.matcher(input); + __state_machine::Parser::drive( + __StateMachine { + input, + __phantom: core::marker::PhantomData::<(&())>, + }, + __tokens, + ) + } + } + fn __accepts< + 'input, + >( + __error_state: Option, + __states: &[i8], + __opt_integer: Option, + _: core::marker::PhantomData<(&'input ())>, + ) -> bool + { + let mut __states = __states.to_vec(); + __states.extend(__error_state); + loop { + let mut __states_len = __states.len(); + let __top = __states[__states_len - 1]; + let __action = match __opt_integer { + None => __EOF_ACTION[__top as usize], + Some(__integer) => __action(__top, __integer), + }; + if __action == 0 { return false; } + if __action > 0 { return true; } + let (__to_pop, __nt) = match __simulate_reduce(-(__action + 1), core::marker::PhantomData::<(&())>) { + __state_machine::SimulatedReduce::Reduce { + states_to_pop, nonterminal_produced + } => (states_to_pop, nonterminal_produced), + __state_machine::SimulatedReduce::Accept => return true, + }; + __states_len -= __to_pop; + __states.truncate(__states_len); + let __top = __states[__states_len - 1]; + let __next_state = __goto(__top, __nt); + __states.push(__next_state); + } + } + fn __reduce< + 'input, + >( + input: &'input str, + __action: i8, + __lookahead_start: Option<&usize>, + __states: &mut alloc::vec::Vec, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> Option, FilterActionError>>> + { + let (__pop_states, __nonterminal) = match __action { + 0 => { + __reduce0(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 1 => { + __reduce1(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 2 => { + // AttrPath = AttrPathTok => ActionFn(19); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = match super::__action19::<>(input, __sym0) { + Ok(v) => v, + Err(e) => return Some(Err(e)), + }; + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + (1, 1) + } + 3 => { + __reduce3(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 4 => { + __reduce4(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 5 => { + __reduce5(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 6 => { + __reduce6(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 7 => { + // CompValue = NumberLit => ActionFn(41); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = match super::__action41::<>(input, __sym0) { + Ok(v) => v, + Err(e) => return Some(Err(e)), + }; + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + 8 => { + // CompValue = StringLit => ActionFn(42); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = match super::__action42::<>(input, __sym0) { + Ok(v) => v, + Err(e) => return Some(Err(e)), + }; + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + 9 => { + __reduce9(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 10 => { + __reduce10(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 11 => { + __reduce11(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 12 => { + __reduce12(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 13 => { + __reduce13(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 14 => { + __reduce14(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 15 => { + __reduce15(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 16 => { + __reduce16(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 17 => { + __reduce17(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 18 => { + __reduce18(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 19 => { + __reduce19(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 20 => { + __reduce20(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 21 => { + __reduce21(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 22 => { + __reduce22(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 23 => { + __reduce23(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 24 => { + __reduce24(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 25 => { + __reduce25(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 26 => { + __reduce26(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 27 => { + __reduce27(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 28 => { + __reduce28(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 29 => { + __reduce29(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 30 => { + __reduce30(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 31 => { + __reduce31(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 32 => { + __reduce32(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 33 => { + __reduce33(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 34 => { + __reduce34(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 35 => { + __reduce35(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 36 => { + __reduce36(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 37 => { + __reduce37(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 38 => { + __reduce38(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 39 => { + __reduce39(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 40 => { + __reduce40(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 41 => { + __reduce41(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 42 => { + __reduce42(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 43 => { + // __ValFilter = ValFilter => ActionFn(5); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action5::<>(input, __sym0); + return Some(Ok(__nt)); + } + 44 => { + __reduce44(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 45 => { + __reduce45(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + _ => panic!("invalid action code {__action}") + }; + let __states_len = __states.len(); + __states.truncate(__states_len - __pop_states); + let __state = *__states.last().unwrap(); + let __next_state = __goto(__state, __nonterminal); + __states.push(__next_state); + None + } + #[inline(never)] + fn __symbol_type_mismatch() -> ! { + panic!("symbol type mismatch") + } + fn __pop_Variant1< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, AttrExp, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant1(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant2< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, AttrPath, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant2(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant3< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, CompValue, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant3(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant4< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, CompareOp, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant4(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant5< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, Filter, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant5(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant6< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, PatchPath, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant6(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant7< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, ValFilter, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant7(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant8< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, ValuePath, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant8(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant0< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, &'input str, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant0(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __reduce0< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // AttrExp = AttrPath, "pr" => ActionFn(17); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym1.2.clone(); + let __nt = super::__action17::<>(input, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (2, 0) + } + fn __reduce1< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // AttrExp = AttrPath, CompareOp, CompValue => ActionFn(18); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant3(__symbols); + let __sym1 = __pop_Variant4(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action18::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (3, 0) + } + fn __reduce3< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // AttrPath = AttrNameTok => ActionFn(20); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action20::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + (1, 1) + } + fn __reduce4< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompValue = "false" => ActionFn(38); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action38::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + fn __reduce5< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompValue = "null" => ActionFn(39); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action39::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + fn __reduce6< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompValue = "true" => ActionFn(40); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action40::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + fn __reduce9< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "eq" => ActionFn(29); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action29::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce10< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "ne" => ActionFn(30); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action30::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce11< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "co" => ActionFn(31); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action31::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce12< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "sw" => ActionFn(32); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action32::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce13< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "ew" => ActionFn(33); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action33::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce14< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "gt" => ActionFn(34); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action34::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce15< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "lt" => ActionFn(35); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action35::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce16< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "ge" => ActionFn(36); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action36::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce17< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "le" => ActionFn(37); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action37::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce18< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter = Filter, "or", Filter1 => ActionFn(10); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action10::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 4) + } + fn __reduce19< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter = Filter1 => ActionFn(11); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action11::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 4) + } + fn __reduce20< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter0 = FilterAtom => ActionFn(7); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action7::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 5) + } + fn __reduce21< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter1 = Filter1, "and", Filter0 => ActionFn(8); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action8::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 6) + } + fn __reduce22< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter1 = Filter0 => ActionFn(9); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action9::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 6) + } + fn __reduce23< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = AttrExp => ActionFn(12); + let __sym0 = __pop_Variant1(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action12::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 7) + } + fn __reduce24< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = ValuePath => ActionFn(13); + let __sym0 = __pop_Variant8(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action13::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 7) + } + fn __reduce25< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = "not", "(", Filter, ")" => ActionFn(14); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action14::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (4, 7) + } + fn __reduce26< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = "(", Filter, ")" => ActionFn(15); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant5(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action15::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 7) + } + fn __reduce27< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Path = AttrPath => ActionFn(43); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action43::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (1, 8) + } + fn __reduce28< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Path = AttrPath, "[", ValFilter, "]" => ActionFn(44); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action44::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (4, 8) + } + fn __reduce29< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Path = AttrPath, "[", ValFilter, "]", ".", AttrNameTok => ActionFn(45); + assert!(__symbols.len() >= 6); + let __sym5 = __pop_Variant0(__symbols); + let __sym4 = __pop_Variant0(__symbols); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym5.2.clone(); + let __nt = super::__action45::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (6, 8) + } + fn __reduce30< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter = ValFilter, "or", ValFilter1 => ActionFn(24); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action24::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (3, 9) + } + fn __reduce31< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter = ValFilter1 => ActionFn(25); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action25::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 9) + } + fn __reduce32< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter0 = ValFilterAtom => ActionFn(21); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action21::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 10) + } + fn __reduce33< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter1 = ValFilter1, "and", ValFilter0 => ActionFn(22); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action22::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (3, 11) + } + fn __reduce34< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter1 = ValFilter0 => ActionFn(23); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action23::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 11) + } + fn __reduce35< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilterAtom = AttrExp => ActionFn(26); + let __sym0 = __pop_Variant1(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action26::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 12) + } + fn __reduce36< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilterAtom = "not", "(", ValFilter, ")" => ActionFn(27); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action27::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (4, 12) + } + fn __reduce37< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilterAtom = "(", ValFilter, ")" => ActionFn(28); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant7(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action28::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (3, 12) + } + fn __reduce38< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValuePath = AttrPath, "[", ValFilter, "]" => ActionFn(16); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action16::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (4, 13) + } + fn __reduce39< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Filter = Filter => ActionFn(2); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action2::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 14) + } + fn __reduce40< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Filter0 = Filter0 => ActionFn(0); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action0::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 15) + } + fn __reduce41< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Filter1 = Filter1 => ActionFn(1); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action1::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 16) + } + fn __reduce42< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Path = Path => ActionFn(6); + let __sym0 = __pop_Variant6(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action6::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (1, 17) + } + fn __reduce44< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __ValFilter0 = ValFilter0 => ActionFn(3); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action3::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 19) + } + fn __reduce45< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __ValFilter1 = ValFilter1 => ActionFn(4); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action4::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 20) + } +} +#[allow(unused_imports)] +pub use self::__parse__ValFilter::ValFilterParser; + +#[rustfmt::skip] +#[allow(explicit_outlives_requirements, non_snake_case, non_camel_case_types, unused_mut, unused_variables, unused_imports, unused_parens, clippy::needless_lifetimes, clippy::type_complexity, clippy::needless_return, clippy::too_many_arguments, clippy::match_single_binding, clippy::clone_on_copy, clippy::unit_arg)] +mod __parse__ValFilter0 { + + use crate::filter::{ + AttrExp, AttrPath, CompareOp, CompValue, Filter, FilterActionError, + PatchPath, PatchValuePath, ValFilter, ValuePath, parse_attr_path, +}; + #[allow(unused_extern_crates)] + extern crate lalrpop_util as __lalrpop_util; + #[allow(unused_imports)] + use self::__lalrpop_util::state_machine as __state_machine; + #[allow(unused_extern_crates)] + extern crate alloc; + use self::__lalrpop_util::lexer::Token; + #[allow(dead_code)] + pub(crate) enum __Symbol<'input> + { + Variant0(&'input str), + Variant1(AttrExp), + Variant2(AttrPath), + Variant3(CompValue), + Variant4(CompareOp), + Variant5(Filter), + Variant6(PatchPath), + Variant7(ValFilter), + Variant8(ValuePath), + } + const __ACTION: &[i8] = &[ + // State 0 + 12, 13, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 1 + 0, 0, 0, 0, 0, 0, 14, 15, 16, 17, 18, 19, 20, 21, 0, 22, 23, 0, 0, 0, 0, 0, 0, 0, 0, + // State 2 + 12, 13, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 3 + 0, 0, 32, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 29, 30, + // State 4 + 12, 13, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 5 + 12, 13, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 6 + 12, 13, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 7 + 0, 0, 0, 0, 0, -36, 0, 0, 0, 0, 0, 0, 0, 0, -36, 0, 0, 0, -36, 0, 0, 0, 0, 0, 0, + // State 8 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // State 9 + 0, 0, 0, 0, 0, -33, 0, 0, 0, 0, 0, 0, 0, 0, -33, 0, 0, 0, -33, 0, 0, 0, 0, 0, 0, + // State 10 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, + // State 11 + 0, 0, 0, 0, 0, 0, -4, -4, -4, -4, -4, -4, -4, -4, 0, -4, -4, 0, 0, 0, 0, 0, 0, 0, 0, + // State 12 + 0, 0, 0, 0, 0, 0, -3, -3, -3, -3, -3, -3, -3, -3, 0, -3, -3, 0, 0, 0, 0, 0, 0, 0, 0, + // State 13 + 0, 0, -12, 0, -12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -12, -12, -12, + // State 14 + 0, 0, -10, 0, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10, -10, -10, + // State 15 + 0, 0, -14, 0, -14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, -14, -14, + // State 16 + 0, 0, -17, 0, -17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -17, -17, -17, + // State 17 + 0, 0, -15, 0, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, -15, -15, + // State 18 + 0, 0, -18, 0, -18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -18, -18, -18, + // State 19 + 0, 0, -16, 0, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16, -16, -16, + // State 20 + 0, 0, -11, 0, -11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -11, -11, -11, + // State 21 + 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, + // State 22 + 0, 0, -13, 0, -13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -13, -13, -13, + // State 23 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, + // State 24 + 0, 0, 0, 0, 0, -35, 0, 0, 0, 0, 0, 0, 0, 0, -35, 0, 0, 0, -35, 0, 0, 0, 0, 0, 0, + // State 25 + 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, -32, 0, 0, 0, -32, 0, 0, 0, 0, 0, 0, + // State 26 + 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, + // State 27 + 0, 0, 0, 0, 0, -5, 0, 0, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0, -5, 0, 0, 0, 0, 0, 0, + // State 28 + 0, 0, 0, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, -6, 0, 0, 0, -6, 0, 0, 0, 0, 0, 0, + // State 29 + 0, 0, 0, 0, 0, -7, 0, 0, 0, 0, 0, 0, 0, 0, -7, 0, 0, 0, -7, 0, 0, 0, 0, 0, 0, + // State 30 + 0, 0, 0, 0, 0, -8, 0, 0, 0, 0, 0, 0, 0, 0, -8, 0, 0, 0, -8, 0, 0, 0, 0, 0, 0, + // State 31 + 0, 0, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0, 0, -9, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, + // State 32 + 0, 0, 0, 0, 0, -38, 0, 0, 0, 0, 0, 0, 0, 0, -38, 0, 0, 0, -38, 0, 0, 0, 0, 0, 0, + // State 33 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, + // State 34 + 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, -31, 0, 0, 0, -31, 0, 0, 0, 0, 0, 0, + // State 35 + 0, 0, 0, 0, 0, -34, 0, 0, 0, 0, 0, 0, 0, 0, -34, 0, 0, 0, -34, 0, 0, 0, 0, 0, 0, + // State 36 + 0, 0, 0, 0, 0, -37, 0, 0, 0, 0, 0, 0, 0, 0, -37, 0, 0, 0, -37, 0, 0, 0, 0, 0, 0, + ]; + fn __action(state: i8, integer: usize) -> i8 { + __ACTION[(state as usize) * 25 + integer] + } + const __EOF_ACTION: &[i8] = &[ + // State 0 + 0, + // State 1 + 0, + // State 2 + 0, + // State 3 + 0, + // State 4 + 0, + // State 5 + 0, + // State 6 + 0, + // State 7 + -36, + // State 8 + -45, + // State 9 + -33, + // State 10 + 0, + // State 11 + 0, + // State 12 + 0, + // State 13 + 0, + // State 14 + 0, + // State 15 + 0, + // State 16 + 0, + // State 17 + 0, + // State 18 + 0, + // State 19 + 0, + // State 20 + 0, + // State 21 + -1, + // State 22 + 0, + // State 23 + 0, + // State 24 + 0, + // State 25 + 0, + // State 26 + -2, + // State 27 + -5, + // State 28 + -6, + // State 29 + -7, + // State 30 + -8, + // State 31 + -9, + // State 32 + -38, + // State 33 + 0, + // State 34 + 0, + // State 35 + 0, + // State 36 + -37, + ]; + fn __goto(state: i8, nt: usize) -> i8 { + match nt { + 0 => 7, + 1 => 1, + 2 => 26, + 3 => 3, + 9 => match state { + 4 => 33, + _ => 23, + }, + 10 => match state { + 0 => 8, + 6 => 35, + _ => 24, + }, + 11 => match state { + 5 => 34, + _ => 25, + }, + 12 => 9, + _ => 0, + } + } + #[allow(clippy::needless_raw_string_hashes)] + const __TERMINAL: &[&str] = &[ + r###"AttrNameTok"###, + r###"AttrPathTok"###, + r###"StringLit"###, + r###""not""###, + r###"NumberLit"###, + r###""and""###, + r###""co""###, + r###""eq""###, + r###""ew""###, + r###""ge""###, + r###""gt""###, + r###""le""###, + r###""lt""###, + r###""ne""###, + r###""or""###, + r###""pr""###, + r###""sw""###, + r###""(""###, + r###"")""###, + r###"".""###, + r###""[""###, + r###""]""###, + r###""false""###, + r###""null""###, + r###""true""###, + ]; + fn __expected_tokens(__state: i8) -> alloc::vec::Vec { + __TERMINAL.iter().enumerate().filter_map(|(index, terminal)| { + let next_state = __action(__state, index); + if next_state == 0 { + None + } else { + Some(alloc::string::ToString::to_string(terminal)) + } + }).collect() + } + fn __expected_tokens_from_states< + 'input, + >( + __states: &[i8], + _: core::marker::PhantomData<(&'input ())>, + ) -> alloc::vec::Vec + { + __TERMINAL.iter().enumerate().filter_map(|(index, terminal)| { + if __accepts(None, __states, Some(index), core::marker::PhantomData::<(&())>) { + Some(alloc::string::ToString::to_string(terminal)) + } else { + None + } + }).collect() + } + struct __StateMachine<'input> + where + { + input: &'input str, + __phantom: core::marker::PhantomData<(&'input ())>, + } + impl<'input> __state_machine::ParserDefinition for __StateMachine<'input> + where + { + type Location = usize; + type Error = FilterActionError; + type Token = Token<'input>; + type TokenIndex = usize; + type Symbol = __Symbol<'input>; + type Success = ValFilter; + type StateIndex = i8; + type Action = i8; + type ReduceIndex = i8; + type NonterminalIndex = usize; + + #[inline] + fn start_location(&self) -> Self::Location { + Default::default() + } + + #[inline] + fn start_state(&self) -> Self::StateIndex { + 0 + } + + #[inline] + fn token_to_index(&self, token: &Self::Token) -> Option { + __token_to_integer(token, core::marker::PhantomData::<(&())>) + } + + #[inline] + fn action(&self, state: i8, integer: usize) -> i8 { + __action(state, integer) + } + + #[inline] + fn error_action(&self, state: i8) -> i8 { + __action(state, 25 - 1) + } + + #[inline] + fn eof_action(&self, state: i8) -> i8 { + __EOF_ACTION[state as usize] + } + + #[inline] + fn goto(&self, state: i8, nt: usize) -> i8 { + __goto(state, nt) + } + + fn token_to_symbol(&self, token_index: usize, token: Self::Token) -> Self::Symbol { + __token_to_symbol(token_index, token, core::marker::PhantomData::<(&())>) + } + + fn expected_tokens(&self, state: i8) -> alloc::vec::Vec { + __expected_tokens(state) + } + + fn expected_tokens_from_states(&self, states: &[i8]) -> alloc::vec::Vec { + __expected_tokens_from_states(states, core::marker::PhantomData::<(&())>) + } + + #[inline] + fn uses_error_recovery(&self) -> bool { + false + } + + #[inline] + fn error_recovery_symbol( + &self, + recovery: __state_machine::ErrorRecovery, + ) -> Self::Symbol { + panic!("error recovery not enabled for this grammar") + } + + fn reduce( + &mut self, + action: i8, + start_location: Option<&Self::Location>, + states: &mut alloc::vec::Vec, + symbols: &mut alloc::vec::Vec<__state_machine::SymbolTriple>, + ) -> Option<__state_machine::ParseResult> { + __reduce( + self.input, + action, + start_location, + states, + symbols, + core::marker::PhantomData::<(&())>, + ) + } + + fn simulate_reduce(&self, action: i8) -> __state_machine::SimulatedReduce { + __simulate_reduce(action, core::marker::PhantomData::<(&())>) + } + } + fn __token_to_integer< + 'input, + >( + __token: &Token<'input>, + _: core::marker::PhantomData<(&'input ())>, + ) -> Option + { + #[warn(unused_variables)] + match __token { + Token(0, _) if true => Some(0), + Token(1, _) if true => Some(1), + Token(2, _) if true => Some(2), + Token(3, _) if true => Some(3), + Token(4, _) if true => Some(4), + Token(5, _) if true => Some(5), + Token(6, _) if true => Some(6), + Token(7, _) if true => Some(7), + Token(8, _) if true => Some(8), + Token(9, _) if true => Some(9), + Token(10, _) if true => Some(10), + Token(11, _) if true => Some(11), + Token(12, _) if true => Some(12), + Token(13, _) if true => Some(13), + Token(14, _) if true => Some(14), + Token(15, _) if true => Some(15), + Token(16, _) if true => Some(16), + Token(17, _) if true => Some(17), + Token(18, _) if true => Some(18), + Token(19, _) if true => Some(19), + Token(20, _) if true => Some(20), + Token(21, _) if true => Some(21), + Token(22, _) if true => Some(22), + Token(23, _) if true => Some(23), + Token(24, _) if true => Some(24), + _ => None, + } + } + fn __token_to_symbol< + 'input, + >( + __token_index: usize, + __token: Token<'input>, + _: core::marker::PhantomData<(&'input ())>, + ) -> __Symbol<'input> + { + #[allow(clippy::manual_range_patterns)]match __token_index { + 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 => match __token { + Token(0, __tok0) | Token(1, __tok0) | Token(2, __tok0) | Token(3, __tok0) | Token(4, __tok0) | Token(5, __tok0) | Token(6, __tok0) | Token(7, __tok0) | Token(8, __tok0) | Token(9, __tok0) | Token(10, __tok0) | Token(11, __tok0) | Token(12, __tok0) | Token(13, __tok0) | Token(14, __tok0) | Token(15, __tok0) | Token(16, __tok0) | Token(17, __tok0) | Token(18, __tok0) | Token(19, __tok0) | Token(20, __tok0) | Token(21, __tok0) | Token(22, __tok0) | Token(23, __tok0) | Token(24, __tok0) if true => __Symbol::Variant0(__tok0), + _ => unreachable!(), + }, + _ => unreachable!(), + } + } + fn __simulate_reduce< + 'input, + >( + __reduce_index: i8, + _: core::marker::PhantomData<(&'input ())>, + ) -> __state_machine::SimulatedReduce<__StateMachine<'input>> + { + match __reduce_index { + 0 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 2, + nonterminal_produced: 0, + } + } + 1 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 0, + } + } + 2 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 1, + } + } + 3 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 1, + } + } + 4 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 5 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 6 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 7 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 8 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 9 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 10 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 11 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 12 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 13 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 14 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 15 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 16 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 17 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 18 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 4, + } + } + 19 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 4, + } + } + 20 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 5, + } + } + 21 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 6, + } + } + 22 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 6, + } + } + 23 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 7, + } + } + 24 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 7, + } + } + 25 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 7, + } + } + 26 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 7, + } + } + 27 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 8, + } + } + 28 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 8, + } + } + 29 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 6, + nonterminal_produced: 8, + } + } + 30 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 9, + } + } + 31 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 9, + } + } + 32 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 10, + } + } + 33 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 11, + } + } + 34 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 11, + } + } + 35 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 12, + } + } + 36 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 12, + } + } + 37 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 12, + } + } + 38 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 13, + } + } + 39 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 14, + } + } + 40 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 15, + } + } + 41 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 16, + } + } + 42 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 17, + } + } + 43 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 18, + } + } + 44 => __state_machine::SimulatedReduce::Accept, + 45 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 20, + } + } + _ => panic!("invalid reduction index {__reduce_index}") + } + } + pub struct ValFilter0Parser { + builder: __lalrpop_util::lexer::MatcherBuilder, + _priv: (), + } + + impl Default for ValFilter0Parser { fn default() -> Self { Self::new() } } + impl ValFilter0Parser { + pub fn new() -> ValFilter0Parser { + let __builder = super::__intern_token::new_builder(); + ValFilter0Parser { + builder: __builder, + _priv: (), + } + } + + #[allow(dead_code)] + pub fn parse< + 'input, + >( + &self, + input: &'input str, + ) -> Result, FilterActionError>> + { + let mut __tokens = self.builder.matcher(input); + __state_machine::Parser::drive( + __StateMachine { + input, + __phantom: core::marker::PhantomData::<(&())>, + }, + __tokens, + ) + } + } + fn __accepts< + 'input, + >( + __error_state: Option, + __states: &[i8], + __opt_integer: Option, + _: core::marker::PhantomData<(&'input ())>, + ) -> bool + { + let mut __states = __states.to_vec(); + __states.extend(__error_state); + loop { + let mut __states_len = __states.len(); + let __top = __states[__states_len - 1]; + let __action = match __opt_integer { + None => __EOF_ACTION[__top as usize], + Some(__integer) => __action(__top, __integer), + }; + if __action == 0 { return false; } + if __action > 0 { return true; } + let (__to_pop, __nt) = match __simulate_reduce(-(__action + 1), core::marker::PhantomData::<(&())>) { + __state_machine::SimulatedReduce::Reduce { + states_to_pop, nonterminal_produced + } => (states_to_pop, nonterminal_produced), + __state_machine::SimulatedReduce::Accept => return true, + }; + __states_len -= __to_pop; + __states.truncate(__states_len); + let __top = __states[__states_len - 1]; + let __next_state = __goto(__top, __nt); + __states.push(__next_state); + } + } + fn __reduce< + 'input, + >( + input: &'input str, + __action: i8, + __lookahead_start: Option<&usize>, + __states: &mut alloc::vec::Vec, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> Option, FilterActionError>>> + { + let (__pop_states, __nonterminal) = match __action { + 0 => { + __reduce0(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 1 => { + __reduce1(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 2 => { + // AttrPath = AttrPathTok => ActionFn(19); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = match super::__action19::<>(input, __sym0) { + Ok(v) => v, + Err(e) => return Some(Err(e)), + }; + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + (1, 1) + } + 3 => { + __reduce3(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 4 => { + __reduce4(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 5 => { + __reduce5(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 6 => { + __reduce6(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 7 => { + // CompValue = NumberLit => ActionFn(41); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = match super::__action41::<>(input, __sym0) { + Ok(v) => v, + Err(e) => return Some(Err(e)), + }; + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + 8 => { + // CompValue = StringLit => ActionFn(42); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = match super::__action42::<>(input, __sym0) { + Ok(v) => v, + Err(e) => return Some(Err(e)), + }; + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + 9 => { + __reduce9(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 10 => { + __reduce10(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 11 => { + __reduce11(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 12 => { + __reduce12(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 13 => { + __reduce13(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 14 => { + __reduce14(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 15 => { + __reduce15(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 16 => { + __reduce16(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 17 => { + __reduce17(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 18 => { + __reduce18(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 19 => { + __reduce19(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 20 => { + __reduce20(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 21 => { + __reduce21(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 22 => { + __reduce22(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 23 => { + __reduce23(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 24 => { + __reduce24(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 25 => { + __reduce25(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 26 => { + __reduce26(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 27 => { + __reduce27(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 28 => { + __reduce28(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 29 => { + __reduce29(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 30 => { + __reduce30(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 31 => { + __reduce31(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 32 => { + __reduce32(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 33 => { + __reduce33(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 34 => { + __reduce34(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 35 => { + __reduce35(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 36 => { + __reduce36(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 37 => { + __reduce37(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 38 => { + __reduce38(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 39 => { + __reduce39(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 40 => { + __reduce40(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 41 => { + __reduce41(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 42 => { + __reduce42(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 43 => { + __reduce43(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 44 => { + // __ValFilter0 = ValFilter0 => ActionFn(3); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action3::<>(input, __sym0); + return Some(Ok(__nt)); + } + 45 => { + __reduce45(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + _ => panic!("invalid action code {__action}") + }; + let __states_len = __states.len(); + __states.truncate(__states_len - __pop_states); + let __state = *__states.last().unwrap(); + let __next_state = __goto(__state, __nonterminal); + __states.push(__next_state); + None + } + #[inline(never)] + fn __symbol_type_mismatch() -> ! { + panic!("symbol type mismatch") + } + fn __pop_Variant1< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, AttrExp, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant1(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant2< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, AttrPath, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant2(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant3< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, CompValue, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant3(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant4< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, CompareOp, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant4(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant5< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, Filter, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant5(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant6< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, PatchPath, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant6(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant7< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, ValFilter, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant7(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant8< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, ValuePath, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant8(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant0< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, &'input str, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant0(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __reduce0< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // AttrExp = AttrPath, "pr" => ActionFn(17); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym1.2.clone(); + let __nt = super::__action17::<>(input, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (2, 0) + } + fn __reduce1< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // AttrExp = AttrPath, CompareOp, CompValue => ActionFn(18); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant3(__symbols); + let __sym1 = __pop_Variant4(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action18::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (3, 0) + } + fn __reduce3< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // AttrPath = AttrNameTok => ActionFn(20); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action20::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + (1, 1) + } + fn __reduce4< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompValue = "false" => ActionFn(38); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action38::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + fn __reduce5< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompValue = "null" => ActionFn(39); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action39::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + fn __reduce6< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompValue = "true" => ActionFn(40); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action40::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + fn __reduce9< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "eq" => ActionFn(29); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action29::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce10< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "ne" => ActionFn(30); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action30::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce11< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "co" => ActionFn(31); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action31::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce12< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "sw" => ActionFn(32); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action32::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce13< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "ew" => ActionFn(33); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action33::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce14< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "gt" => ActionFn(34); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action34::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce15< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "lt" => ActionFn(35); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action35::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce16< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "ge" => ActionFn(36); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action36::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce17< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "le" => ActionFn(37); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action37::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce18< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter = Filter, "or", Filter1 => ActionFn(10); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action10::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 4) + } + fn __reduce19< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter = Filter1 => ActionFn(11); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action11::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 4) + } + fn __reduce20< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter0 = FilterAtom => ActionFn(7); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action7::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 5) + } + fn __reduce21< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter1 = Filter1, "and", Filter0 => ActionFn(8); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action8::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 6) + } + fn __reduce22< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter1 = Filter0 => ActionFn(9); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action9::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 6) + } + fn __reduce23< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = AttrExp => ActionFn(12); + let __sym0 = __pop_Variant1(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action12::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 7) + } + fn __reduce24< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = ValuePath => ActionFn(13); + let __sym0 = __pop_Variant8(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action13::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 7) + } + fn __reduce25< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = "not", "(", Filter, ")" => ActionFn(14); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action14::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (4, 7) + } + fn __reduce26< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = "(", Filter, ")" => ActionFn(15); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant5(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action15::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 7) + } + fn __reduce27< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Path = AttrPath => ActionFn(43); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action43::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (1, 8) + } + fn __reduce28< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Path = AttrPath, "[", ValFilter, "]" => ActionFn(44); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action44::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (4, 8) + } + fn __reduce29< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Path = AttrPath, "[", ValFilter, "]", ".", AttrNameTok => ActionFn(45); + assert!(__symbols.len() >= 6); + let __sym5 = __pop_Variant0(__symbols); + let __sym4 = __pop_Variant0(__symbols); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym5.2.clone(); + let __nt = super::__action45::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (6, 8) + } + fn __reduce30< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter = ValFilter, "or", ValFilter1 => ActionFn(24); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action24::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (3, 9) + } + fn __reduce31< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter = ValFilter1 => ActionFn(25); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action25::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 9) + } + fn __reduce32< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter0 = ValFilterAtom => ActionFn(21); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action21::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 10) + } + fn __reduce33< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter1 = ValFilter1, "and", ValFilter0 => ActionFn(22); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action22::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (3, 11) + } + fn __reduce34< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter1 = ValFilter0 => ActionFn(23); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action23::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 11) + } + fn __reduce35< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilterAtom = AttrExp => ActionFn(26); + let __sym0 = __pop_Variant1(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action26::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 12) + } + fn __reduce36< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilterAtom = "not", "(", ValFilter, ")" => ActionFn(27); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action27::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (4, 12) + } + fn __reduce37< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilterAtom = "(", ValFilter, ")" => ActionFn(28); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant7(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action28::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (3, 12) + } + fn __reduce38< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValuePath = AttrPath, "[", ValFilter, "]" => ActionFn(16); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action16::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (4, 13) + } + fn __reduce39< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Filter = Filter => ActionFn(2); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action2::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 14) + } + fn __reduce40< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Filter0 = Filter0 => ActionFn(0); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action0::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 15) + } + fn __reduce41< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Filter1 = Filter1 => ActionFn(1); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action1::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 16) + } + fn __reduce42< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Path = Path => ActionFn(6); + let __sym0 = __pop_Variant6(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action6::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (1, 17) + } + fn __reduce43< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __ValFilter = ValFilter => ActionFn(5); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action5::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 18) + } + fn __reduce45< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __ValFilter1 = ValFilter1 => ActionFn(4); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action4::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 20) + } +} +#[allow(unused_imports)] +pub use self::__parse__ValFilter0::ValFilter0Parser; + +#[rustfmt::skip] +#[allow(explicit_outlives_requirements, non_snake_case, non_camel_case_types, unused_mut, unused_variables, unused_imports, unused_parens, clippy::needless_lifetimes, clippy::type_complexity, clippy::needless_return, clippy::too_many_arguments, clippy::match_single_binding, clippy::clone_on_copy, clippy::unit_arg)] +mod __parse__ValFilter1 { + + use crate::filter::{ + AttrExp, AttrPath, CompareOp, CompValue, Filter, FilterActionError, + PatchPath, PatchValuePath, ValFilter, ValuePath, parse_attr_path, +}; + #[allow(unused_extern_crates)] + extern crate lalrpop_util as __lalrpop_util; + #[allow(unused_imports)] + use self::__lalrpop_util::state_machine as __state_machine; + #[allow(unused_extern_crates)] + extern crate alloc; + use self::__lalrpop_util::lexer::Token; + #[allow(dead_code)] + pub(crate) enum __Symbol<'input> + { + Variant0(&'input str), + Variant1(AttrExp), + Variant2(AttrPath), + Variant3(CompValue), + Variant4(CompareOp), + Variant5(Filter), + Variant6(PatchPath), + Variant7(ValFilter), + Variant8(ValuePath), + } + const __ACTION: &[i8] = &[ + // State 0 + 13, 14, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 1 + 0, 0, 0, 0, 0, 0, 15, 16, 17, 18, 19, 20, 21, 22, 0, 23, 24, 0, 0, 0, 0, 0, 0, 0, 0, + // State 2 + 13, 14, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 3 + 0, 0, 32, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 29, 30, + // State 4 + 13, 14, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 5 + 13, 14, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 6 + 13, 14, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + // State 7 + 0, 0, 0, 0, 0, -36, 0, 0, 0, 0, 0, 0, 0, 0, -36, 0, 0, 0, -36, 0, 0, 0, 0, 0, 0, + // State 8 + 0, 0, 0, 0, 0, -35, 0, 0, 0, 0, 0, 0, 0, 0, -35, 0, 0, 0, -35, 0, 0, 0, 0, 0, 0, + // State 9 + 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // State 10 + 0, 0, 0, 0, 0, -33, 0, 0, 0, 0, 0, 0, 0, 0, -33, 0, 0, 0, -33, 0, 0, 0, 0, 0, 0, + // State 11 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, + // State 12 + 0, 0, 0, 0, 0, 0, -4, -4, -4, -4, -4, -4, -4, -4, 0, -4, -4, 0, 0, 0, 0, 0, 0, 0, 0, + // State 13 + 0, 0, 0, 0, 0, 0, -3, -3, -3, -3, -3, -3, -3, -3, 0, -3, -3, 0, 0, 0, 0, 0, 0, 0, 0, + // State 14 + 0, 0, -12, 0, -12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -12, -12, -12, + // State 15 + 0, 0, -10, 0, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10, -10, -10, + // State 16 + 0, 0, -14, 0, -14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, -14, -14, + // State 17 + 0, 0, -17, 0, -17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -17, -17, -17, + // State 18 + 0, 0, -15, 0, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, -15, -15, + // State 19 + 0, 0, -18, 0, -18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -18, -18, -18, + // State 20 + 0, 0, -16, 0, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16, -16, -16, + // State 21 + 0, 0, -11, 0, -11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -11, -11, -11, + // State 22 + 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, + // State 23 + 0, 0, -13, 0, -13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -13, -13, -13, + // State 24 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, + // State 25 + 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, -32, 0, 0, 0, -32, 0, 0, 0, 0, 0, 0, + // State 26 + 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, + // State 27 + 0, 0, 0, 0, 0, -5, 0, 0, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0, -5, 0, 0, 0, 0, 0, 0, + // State 28 + 0, 0, 0, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, -6, 0, 0, 0, -6, 0, 0, 0, 0, 0, 0, + // State 29 + 0, 0, 0, 0, 0, -7, 0, 0, 0, 0, 0, 0, 0, 0, -7, 0, 0, 0, -7, 0, 0, 0, 0, 0, 0, + // State 30 + 0, 0, 0, 0, 0, -8, 0, 0, 0, 0, 0, 0, 0, 0, -8, 0, 0, 0, -8, 0, 0, 0, 0, 0, 0, + // State 31 + 0, 0, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0, 0, -9, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, + // State 32 + 0, 0, 0, 0, 0, -34, 0, 0, 0, 0, 0, 0, 0, 0, -34, 0, 0, 0, -34, 0, 0, 0, 0, 0, 0, + // State 33 + 0, 0, 0, 0, 0, -38, 0, 0, 0, 0, 0, 0, 0, 0, -38, 0, 0, 0, -38, 0, 0, 0, 0, 0, 0, + // State 34 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, + // State 35 + 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, -31, 0, 0, 0, -31, 0, 0, 0, 0, 0, 0, + // State 36 + 0, 0, 0, 0, 0, -37, 0, 0, 0, 0, 0, 0, 0, 0, -37, 0, 0, 0, -37, 0, 0, 0, 0, 0, 0, + ]; + fn __action(state: i8, integer: usize) -> i8 { + __ACTION[(state as usize) * 25 + integer] + } + const __EOF_ACTION: &[i8] = &[ + // State 0 + 0, + // State 1 + 0, + // State 2 + 0, + // State 3 + 0, + // State 4 + 0, + // State 5 + 0, + // State 6 + 0, + // State 7 + -36, + // State 8 + -35, + // State 9 + -46, + // State 10 + -33, + // State 11 + 0, + // State 12 + 0, + // State 13 + 0, + // State 14 + 0, + // State 15 + 0, + // State 16 + 0, + // State 17 + 0, + // State 18 + 0, + // State 19 + 0, + // State 20 + 0, + // State 21 + 0, + // State 22 + -1, + // State 23 + 0, + // State 24 + 0, + // State 25 + 0, + // State 26 + -2, + // State 27 + -5, + // State 28 + -6, + // State 29 + -7, + // State 30 + -8, + // State 31 + -9, + // State 32 + -34, + // State 33 + -38, + // State 34 + 0, + // State 35 + 0, + // State 36 + -37, + ]; + fn __goto(state: i8, nt: usize) -> i8 { + match nt { + 0 => 7, + 1 => 1, + 2 => 26, + 3 => 3, + 9 => match state { + 5 => 34, + _ => 24, + }, + 10 => match state { + 4 => 32, + _ => 8, + }, + 11 => match state { + 0 => 9, + 6 => 35, + _ => 25, + }, + 12 => 10, + _ => 0, + } + } + #[allow(clippy::needless_raw_string_hashes)] + const __TERMINAL: &[&str] = &[ + r###"AttrNameTok"###, + r###"AttrPathTok"###, + r###"StringLit"###, + r###""not""###, + r###"NumberLit"###, + r###""and""###, + r###""co""###, + r###""eq""###, + r###""ew""###, + r###""ge""###, + r###""gt""###, + r###""le""###, + r###""lt""###, + r###""ne""###, + r###""or""###, + r###""pr""###, + r###""sw""###, + r###""(""###, + r###"")""###, + r###"".""###, + r###""[""###, + r###""]""###, + r###""false""###, + r###""null""###, + r###""true""###, + ]; + fn __expected_tokens(__state: i8) -> alloc::vec::Vec { + __TERMINAL.iter().enumerate().filter_map(|(index, terminal)| { + let next_state = __action(__state, index); + if next_state == 0 { + None + } else { + Some(alloc::string::ToString::to_string(terminal)) + } + }).collect() + } + fn __expected_tokens_from_states< + 'input, + >( + __states: &[i8], + _: core::marker::PhantomData<(&'input ())>, + ) -> alloc::vec::Vec + { + __TERMINAL.iter().enumerate().filter_map(|(index, terminal)| { + if __accepts(None, __states, Some(index), core::marker::PhantomData::<(&())>) { + Some(alloc::string::ToString::to_string(terminal)) + } else { + None + } + }).collect() + } + struct __StateMachine<'input> + where + { + input: &'input str, + __phantom: core::marker::PhantomData<(&'input ())>, + } + impl<'input> __state_machine::ParserDefinition for __StateMachine<'input> + where + { + type Location = usize; + type Error = FilterActionError; + type Token = Token<'input>; + type TokenIndex = usize; + type Symbol = __Symbol<'input>; + type Success = ValFilter; + type StateIndex = i8; + type Action = i8; + type ReduceIndex = i8; + type NonterminalIndex = usize; + + #[inline] + fn start_location(&self) -> Self::Location { + Default::default() + } + + #[inline] + fn start_state(&self) -> Self::StateIndex { + 0 + } + + #[inline] + fn token_to_index(&self, token: &Self::Token) -> Option { + __token_to_integer(token, core::marker::PhantomData::<(&())>) + } + + #[inline] + fn action(&self, state: i8, integer: usize) -> i8 { + __action(state, integer) + } + + #[inline] + fn error_action(&self, state: i8) -> i8 { + __action(state, 25 - 1) + } + + #[inline] + fn eof_action(&self, state: i8) -> i8 { + __EOF_ACTION[state as usize] + } + + #[inline] + fn goto(&self, state: i8, nt: usize) -> i8 { + __goto(state, nt) + } + + fn token_to_symbol(&self, token_index: usize, token: Self::Token) -> Self::Symbol { + __token_to_symbol(token_index, token, core::marker::PhantomData::<(&())>) + } + + fn expected_tokens(&self, state: i8) -> alloc::vec::Vec { + __expected_tokens(state) + } + + fn expected_tokens_from_states(&self, states: &[i8]) -> alloc::vec::Vec { + __expected_tokens_from_states(states, core::marker::PhantomData::<(&())>) + } + + #[inline] + fn uses_error_recovery(&self) -> bool { + false + } + + #[inline] + fn error_recovery_symbol( + &self, + recovery: __state_machine::ErrorRecovery, + ) -> Self::Symbol { + panic!("error recovery not enabled for this grammar") + } + + fn reduce( + &mut self, + action: i8, + start_location: Option<&Self::Location>, + states: &mut alloc::vec::Vec, + symbols: &mut alloc::vec::Vec<__state_machine::SymbolTriple>, + ) -> Option<__state_machine::ParseResult> { + __reduce( + self.input, + action, + start_location, + states, + symbols, + core::marker::PhantomData::<(&())>, + ) + } + + fn simulate_reduce(&self, action: i8) -> __state_machine::SimulatedReduce { + __simulate_reduce(action, core::marker::PhantomData::<(&())>) + } + } + fn __token_to_integer< + 'input, + >( + __token: &Token<'input>, + _: core::marker::PhantomData<(&'input ())>, + ) -> Option + { + #[warn(unused_variables)] + match __token { + Token(0, _) if true => Some(0), + Token(1, _) if true => Some(1), + Token(2, _) if true => Some(2), + Token(3, _) if true => Some(3), + Token(4, _) if true => Some(4), + Token(5, _) if true => Some(5), + Token(6, _) if true => Some(6), + Token(7, _) if true => Some(7), + Token(8, _) if true => Some(8), + Token(9, _) if true => Some(9), + Token(10, _) if true => Some(10), + Token(11, _) if true => Some(11), + Token(12, _) if true => Some(12), + Token(13, _) if true => Some(13), + Token(14, _) if true => Some(14), + Token(15, _) if true => Some(15), + Token(16, _) if true => Some(16), + Token(17, _) if true => Some(17), + Token(18, _) if true => Some(18), + Token(19, _) if true => Some(19), + Token(20, _) if true => Some(20), + Token(21, _) if true => Some(21), + Token(22, _) if true => Some(22), + Token(23, _) if true => Some(23), + Token(24, _) if true => Some(24), + _ => None, + } + } + fn __token_to_symbol< + 'input, + >( + __token_index: usize, + __token: Token<'input>, + _: core::marker::PhantomData<(&'input ())>, + ) -> __Symbol<'input> + { + #[allow(clippy::manual_range_patterns)]match __token_index { + 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 => match __token { + Token(0, __tok0) | Token(1, __tok0) | Token(2, __tok0) | Token(3, __tok0) | Token(4, __tok0) | Token(5, __tok0) | Token(6, __tok0) | Token(7, __tok0) | Token(8, __tok0) | Token(9, __tok0) | Token(10, __tok0) | Token(11, __tok0) | Token(12, __tok0) | Token(13, __tok0) | Token(14, __tok0) | Token(15, __tok0) | Token(16, __tok0) | Token(17, __tok0) | Token(18, __tok0) | Token(19, __tok0) | Token(20, __tok0) | Token(21, __tok0) | Token(22, __tok0) | Token(23, __tok0) | Token(24, __tok0) if true => __Symbol::Variant0(__tok0), + _ => unreachable!(), + }, + _ => unreachable!(), + } + } + fn __simulate_reduce< + 'input, + >( + __reduce_index: i8, + _: core::marker::PhantomData<(&'input ())>, + ) -> __state_machine::SimulatedReduce<__StateMachine<'input>> + { + match __reduce_index { + 0 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 2, + nonterminal_produced: 0, + } + } + 1 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 0, + } + } + 2 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 1, + } + } + 3 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 1, + } + } + 4 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 5 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 6 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 7 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 8 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 2, + } + } + 9 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 10 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 11 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 12 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 13 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 14 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 15 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 16 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 17 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 3, + } + } + 18 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 4, + } + } + 19 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 4, + } + } + 20 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 5, + } + } + 21 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 6, + } + } + 22 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 6, + } + } + 23 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 7, + } + } + 24 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 7, + } + } + 25 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 7, + } + } + 26 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 7, + } + } + 27 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 8, + } + } + 28 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 8, + } + } + 29 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 6, + nonterminal_produced: 8, + } + } + 30 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 9, + } + } + 31 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 9, + } + } + 32 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 10, + } + } + 33 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 11, + } + } + 34 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 11, + } + } + 35 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 12, + } + } + 36 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 12, + } + } + 37 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 12, + } + } + 38 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 4, + nonterminal_produced: 13, + } + } + 39 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 14, + } + } + 40 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 15, + } + } + 41 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 16, + } + } + 42 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 17, + } + } + 43 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 18, + } + } + 44 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 19, + } + } + 45 => __state_machine::SimulatedReduce::Accept, + _ => panic!("invalid reduction index {__reduce_index}") + } + } + pub struct ValFilter1Parser { + builder: __lalrpop_util::lexer::MatcherBuilder, + _priv: (), + } + + impl Default for ValFilter1Parser { fn default() -> Self { Self::new() } } + impl ValFilter1Parser { + pub fn new() -> ValFilter1Parser { + let __builder = super::__intern_token::new_builder(); + ValFilter1Parser { + builder: __builder, + _priv: (), + } + } + + #[allow(dead_code)] + pub fn parse< + 'input, + >( + &self, + input: &'input str, + ) -> Result, FilterActionError>> + { + let mut __tokens = self.builder.matcher(input); + __state_machine::Parser::drive( + __StateMachine { + input, + __phantom: core::marker::PhantomData::<(&())>, + }, + __tokens, + ) + } + } + fn __accepts< + 'input, + >( + __error_state: Option, + __states: &[i8], + __opt_integer: Option, + _: core::marker::PhantomData<(&'input ())>, + ) -> bool + { + let mut __states = __states.to_vec(); + __states.extend(__error_state); + loop { + let mut __states_len = __states.len(); + let __top = __states[__states_len - 1]; + let __action = match __opt_integer { + None => __EOF_ACTION[__top as usize], + Some(__integer) => __action(__top, __integer), + }; + if __action == 0 { return false; } + if __action > 0 { return true; } + let (__to_pop, __nt) = match __simulate_reduce(-(__action + 1), core::marker::PhantomData::<(&())>) { + __state_machine::SimulatedReduce::Reduce { + states_to_pop, nonterminal_produced + } => (states_to_pop, nonterminal_produced), + __state_machine::SimulatedReduce::Accept => return true, + }; + __states_len -= __to_pop; + __states.truncate(__states_len); + let __top = __states[__states_len - 1]; + let __next_state = __goto(__top, __nt); + __states.push(__next_state); + } + } + fn __reduce< + 'input, + >( + input: &'input str, + __action: i8, + __lookahead_start: Option<&usize>, + __states: &mut alloc::vec::Vec, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> Option, FilterActionError>>> + { + let (__pop_states, __nonterminal) = match __action { + 0 => { + __reduce0(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 1 => { + __reduce1(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 2 => { + // AttrPath = AttrPathTok => ActionFn(19); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = match super::__action19::<>(input, __sym0) { + Ok(v) => v, + Err(e) => return Some(Err(e)), + }; + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + (1, 1) + } + 3 => { + __reduce3(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 4 => { + __reduce4(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 5 => { + __reduce5(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 6 => { + __reduce6(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 7 => { + // CompValue = NumberLit => ActionFn(41); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = match super::__action41::<>(input, __sym0) { + Ok(v) => v, + Err(e) => return Some(Err(e)), + }; + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + 8 => { + // CompValue = StringLit => ActionFn(42); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = match super::__action42::<>(input, __sym0) { + Ok(v) => v, + Err(e) => return Some(Err(e)), + }; + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + 9 => { + __reduce9(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 10 => { + __reduce10(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 11 => { + __reduce11(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 12 => { + __reduce12(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 13 => { + __reduce13(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 14 => { + __reduce14(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 15 => { + __reduce15(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 16 => { + __reduce16(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 17 => { + __reduce17(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 18 => { + __reduce18(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 19 => { + __reduce19(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 20 => { + __reduce20(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 21 => { + __reduce21(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 22 => { + __reduce22(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 23 => { + __reduce23(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 24 => { + __reduce24(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 25 => { + __reduce25(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 26 => { + __reduce26(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 27 => { + __reduce27(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 28 => { + __reduce28(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 29 => { + __reduce29(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 30 => { + __reduce30(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 31 => { + __reduce31(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 32 => { + __reduce32(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 33 => { + __reduce33(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 34 => { + __reduce34(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 35 => { + __reduce35(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 36 => { + __reduce36(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 37 => { + __reduce37(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 38 => { + __reduce38(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 39 => { + __reduce39(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 40 => { + __reduce40(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 41 => { + __reduce41(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 42 => { + __reduce42(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 43 => { + __reduce43(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 44 => { + __reduce44(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 45 => { + // __ValFilter1 = ValFilter1 => ActionFn(4); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action4::<>(input, __sym0); + return Some(Ok(__nt)); + } + _ => panic!("invalid action code {__action}") + }; + let __states_len = __states.len(); + __states.truncate(__states_len - __pop_states); + let __state = *__states.last().unwrap(); + let __next_state = __goto(__state, __nonterminal); + __states.push(__next_state); + None + } + #[inline(never)] + fn __symbol_type_mismatch() -> ! { + panic!("symbol type mismatch") + } + fn __pop_Variant1< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, AttrExp, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant1(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant2< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, AttrPath, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant2(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant3< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, CompValue, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant3(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant4< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, CompareOp, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant4(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant5< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, Filter, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant5(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant6< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, PatchPath, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant6(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant7< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, ValFilter, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant7(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant8< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, ValuePath, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant8(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant0< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, &'input str, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant0(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __reduce0< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // AttrExp = AttrPath, "pr" => ActionFn(17); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym1.2.clone(); + let __nt = super::__action17::<>(input, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (2, 0) + } + fn __reduce1< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // AttrExp = AttrPath, CompareOp, CompValue => ActionFn(18); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant3(__symbols); + let __sym1 = __pop_Variant4(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action18::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (3, 0) + } + fn __reduce3< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // AttrPath = AttrNameTok => ActionFn(20); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action20::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + (1, 1) + } + fn __reduce4< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompValue = "false" => ActionFn(38); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action38::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + fn __reduce5< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompValue = "null" => ActionFn(39); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action39::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + fn __reduce6< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompValue = "true" => ActionFn(40); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action40::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 2) + } + fn __reduce9< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "eq" => ActionFn(29); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action29::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce10< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "ne" => ActionFn(30); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action30::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce11< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "co" => ActionFn(31); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action31::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce12< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "sw" => ActionFn(32); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action32::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce13< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "ew" => ActionFn(33); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action33::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce14< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "gt" => ActionFn(34); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action34::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce15< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "lt" => ActionFn(35); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action35::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce16< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "ge" => ActionFn(36); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action36::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce17< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // CompareOp = "le" => ActionFn(37); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action37::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) + } + fn __reduce18< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter = Filter, "or", Filter1 => ActionFn(10); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action10::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 4) + } + fn __reduce19< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter = Filter1 => ActionFn(11); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action11::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 4) + } + fn __reduce20< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter0 = FilterAtom => ActionFn(7); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action7::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 5) + } + fn __reduce21< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter1 = Filter1, "and", Filter0 => ActionFn(8); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action8::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 6) + } + fn __reduce22< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Filter1 = Filter0 => ActionFn(9); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action9::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 6) + } + fn __reduce23< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = AttrExp => ActionFn(12); + let __sym0 = __pop_Variant1(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action12::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 7) + } + fn __reduce24< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = ValuePath => ActionFn(13); + let __sym0 = __pop_Variant8(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action13::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 7) + } + fn __reduce25< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = "not", "(", Filter, ")" => ActionFn(14); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action14::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (4, 7) + } + fn __reduce26< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // FilterAtom = "(", Filter, ")" => ActionFn(15); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant5(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action15::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 7) + } + fn __reduce27< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Path = AttrPath => ActionFn(43); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action43::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (1, 8) + } + fn __reduce28< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Path = AttrPath, "[", ValFilter, "]" => ActionFn(44); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action44::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (4, 8) + } + fn __reduce29< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Path = AttrPath, "[", ValFilter, "]", ".", AttrNameTok => ActionFn(45); + assert!(__symbols.len() >= 6); + let __sym5 = __pop_Variant0(__symbols); + let __sym4 = __pop_Variant0(__symbols); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym5.2.clone(); + let __nt = super::__action45::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (6, 8) + } + fn __reduce30< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter = ValFilter, "or", ValFilter1 => ActionFn(24); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action24::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (3, 9) + } + fn __reduce31< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter = ValFilter1 => ActionFn(25); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action25::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 9) + } + fn __reduce32< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter0 = ValFilterAtom => ActionFn(21); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action21::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 10) + } + fn __reduce33< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter1 = ValFilter1, "and", ValFilter0 => ActionFn(22); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action22::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (3, 11) + } + fn __reduce34< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilter1 = ValFilter0 => ActionFn(23); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action23::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 11) + } + fn __reduce35< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilterAtom = AttrExp => ActionFn(26); + let __sym0 = __pop_Variant1(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action26::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 12) + } + fn __reduce36< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilterAtom = "not", "(", ValFilter, ")" => ActionFn(27); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action27::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (4, 12) + } + fn __reduce37< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValFilterAtom = "(", ValFilter, ")" => ActionFn(28); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant7(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action28::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (3, 12) + } + fn __reduce38< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ValuePath = AttrPath, "[", ValFilter, "]" => ActionFn(16); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant7(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym3.2.clone(); + let __nt = super::__action16::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (4, 13) + } + fn __reduce39< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Filter = Filter => ActionFn(2); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action2::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 14) + } + fn __reduce40< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Filter0 = Filter0 => ActionFn(0); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action0::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 15) + } + fn __reduce41< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Filter1 = Filter1 => ActionFn(1); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action1::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 16) + } + fn __reduce42< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __Path = Path => ActionFn(6); + let __sym0 = __pop_Variant6(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action6::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (1, 17) + } + fn __reduce43< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __ValFilter = ValFilter => ActionFn(5); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action5::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 18) + } + fn __reduce44< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // __ValFilter0 = ValFilter0 => ActionFn(3); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action3::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 19) + } +} +#[allow(unused_imports)] +pub use self::__parse__ValFilter1::ValFilter1Parser; +#[rustfmt::skip] +mod __intern_token { + #![allow(unused_imports)] + use crate::filter::{ + AttrExp, AttrPath, CompareOp, CompValue, Filter, FilterActionError, + PatchPath, PatchValuePath, ValFilter, ValuePath, parse_attr_path, +}; + #[allow(unused_extern_crates)] + extern crate lalrpop_util as __lalrpop_util; + #[allow(unused_imports)] + use self::__lalrpop_util::state_machine as __state_machine; + #[allow(unused_extern_crates)] + extern crate alloc; + pub fn new_builder() -> __lalrpop_util::lexer::MatcherBuilder { + let __strs: &[(&str, bool)] = &[ + ("(?:[A-Za-z][\\-0-9A-Z_a-z]*)", false), + ("(?:[A-Za-z][\\-0-9A-Z_a-z]*[\\.:][\\-\\.0-:A-Z_a-z]*)", false), + ("(?:\"((?:[\0-!\\#-\\[\\]-\u{10ffff}]|(?:\\\\[\0-\t\u{b}-\u{10ffff}])))*\")", false), + ("(?:[Nn][Oo][Tt][\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+)", false), + ("(?:\\-?(?:0|(?:[1-9][0-9]*))(?:\\.[0-9]+)?(?:[Ee][\\+\\-]?[0-9]+)?)", false), + ("(?:[\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+[Aa][Nn][Dd][\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+)", false), + ("(?:[\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+[Cc][Oo][\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+)", false), + ("(?:[\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+[Ee][Qq][\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+)", false), + ("(?:[\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+[Ee][Ww][\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+)", false), + ("(?:[\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+[Gg][Ee][\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+)", false), + ("(?:[\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+[Gg][Tt][\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+)", false), + ("(?:[\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+[Ll][Ee][\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+)", false), + ("(?:[\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+[Ll][Tt][\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+)", false), + ("(?:[\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+[Nn][Ee][\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+)", false), + ("(?:[\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+[Oo][Rr][\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+)", false), + ("(?:[\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+[Pp][Rr])", false), + ("(?:[\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+[Ssſ][Ww][\t-\r \u{85}\u{a0}\u{1680}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}]+)", false), + ("\\(", false), + ("\\)", false), + ("\\.", false), + ("\\[", false), + ("\\]", false), + ("(?:false)", false), + ("(?:null)", false), + ("(?:true)", false), + (r"\s+", true), + ]; + __lalrpop_util::lexer::MatcherBuilder::new(__strs.iter().copied()).unwrap() + } +} +pub(crate) use self::__lalrpop_util::lexer::Token; + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action0< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, Filter, usize), +) -> Filter +{ + __0 +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action1< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, Filter, usize), +) -> Filter +{ + __0 +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action2< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, Filter, usize), +) -> Filter +{ + __0 +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action3< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, ValFilter, usize), +) -> ValFilter +{ + __0 +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action4< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, ValFilter, usize), +) -> ValFilter +{ + __0 +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action5< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, ValFilter, usize), +) -> ValFilter +{ + __0 +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action6< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, PatchPath, usize), +) -> PatchPath +{ + __0 +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action7< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, Filter, usize), +) -> Filter +{ + __0 +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action8< + 'input, +>( + input: &'input str, + (_, l, _): (usize, Filter, usize), + (_, _, _): (usize, &'input str, usize), + (_, r, _): (usize, Filter, usize), +) -> Filter +{ + Filter::And(Box::new(l), Box::new(r)) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action9< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, Filter, usize), +) -> Filter +{ + __0 +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action10< + 'input, +>( + input: &'input str, + (_, l, _): (usize, Filter, usize), + (_, _, _): (usize, &'input str, usize), + (_, r, _): (usize, Filter, usize), +) -> Filter +{ + Filter::Or(Box::new(l), Box::new(r)) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action11< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, Filter, usize), +) -> Filter +{ + __0 +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action12< + 'input, +>( + input: &'input str, + (_, e, _): (usize, AttrExp, usize), +) -> Filter +{ + Filter::Attr(e) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action13< + 'input, +>( + input: &'input str, + (_, v, _): (usize, ValuePath, usize), +) -> Filter +{ + Filter::ValuePath(v) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action14< + 'input, +>( + input: &'input str, + (_, _, _): (usize, &'input str, usize), + (_, _, _): (usize, &'input str, usize), + (_, f, _): (usize, Filter, usize), + (_, _, _): (usize, &'input str, usize), +) -> Filter +{ + Filter::Not(Box::new(f)) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action15< + 'input, +>( + input: &'input str, + (_, _, _): (usize, &'input str, usize), + (_, f, _): (usize, Filter, usize), + (_, _, _): (usize, &'input str, usize), +) -> Filter +{ + f +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action16< + 'input, +>( + input: &'input str, + (_, a, _): (usize, AttrPath, usize), + (_, _, _): (usize, &'input str, usize), + (_, vf, _): (usize, ValFilter, usize), + (_, _, _): (usize, &'input str, usize), +) -> ValuePath +{ + ValuePath { + attr: a, + filter: Box::new(vf), + } +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action17< + 'input, +>( + input: &'input str, + (_, a, _): (usize, AttrPath, usize), + (_, _, _): (usize, &'input str, usize), +) -> AttrExp +{ + AttrExp::Present(a) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action18< + 'input, +>( + input: &'input str, + (_, a, _): (usize, AttrPath, usize), + (_, op, _): (usize, CompareOp, usize), + (_, v, _): (usize, CompValue, usize), +) -> AttrExp +{ + AttrExp::Comparison(a, op, v) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action19< + 'input, +>( + input: &'input str, + (_, s, _): (usize, &'input str, usize), +) -> Result,FilterActionError>> +{ + Ok(parse_attr_path(s)?) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action20< + 'input, +>( + input: &'input str, + (_, s, _): (usize, &'input str, usize), +) -> AttrPath +{ + AttrPath { uri: None, name: s.to_string(), sub_attr: None } +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action21< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, ValFilter, usize), +) -> ValFilter +{ + __0 +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action22< + 'input, +>( + input: &'input str, + (_, l, _): (usize, ValFilter, usize), + (_, _, _): (usize, &'input str, usize), + (_, r, _): (usize, ValFilter, usize), +) -> ValFilter +{ + ValFilter::And(Box::new(l), Box::new(r)) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action23< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, ValFilter, usize), +) -> ValFilter +{ + __0 +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action24< + 'input, +>( + input: &'input str, + (_, l, _): (usize, ValFilter, usize), + (_, _, _): (usize, &'input str, usize), + (_, r, _): (usize, ValFilter, usize), +) -> ValFilter +{ + ValFilter::Or(Box::new(l), Box::new(r)) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action25< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, ValFilter, usize), +) -> ValFilter +{ + __0 +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action26< + 'input, +>( + input: &'input str, + (_, e, _): (usize, AttrExp, usize), +) -> ValFilter +{ + ValFilter::Attr(e) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action27< + 'input, +>( + input: &'input str, + (_, _, _): (usize, &'input str, usize), + (_, _, _): (usize, &'input str, usize), + (_, f, _): (usize, ValFilter, usize), + (_, _, _): (usize, &'input str, usize), +) -> ValFilter +{ + ValFilter::Not(Box::new(f)) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action28< + 'input, +>( + input: &'input str, + (_, _, _): (usize, &'input str, usize), + (_, f, _): (usize, ValFilter, usize), + (_, _, _): (usize, &'input str, usize), +) -> ValFilter +{ + f +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action29< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> CompareOp +{ + CompareOp::Eq +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action30< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> CompareOp +{ + CompareOp::Ne +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action31< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> CompareOp +{ + CompareOp::Co +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action32< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> CompareOp +{ + CompareOp::Sw +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action33< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> CompareOp +{ + CompareOp::Ew +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action34< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> CompareOp +{ + CompareOp::Gt +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action35< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> CompareOp +{ + CompareOp::Lt +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action36< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> CompareOp +{ + CompareOp::Ge +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action37< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> CompareOp +{ + CompareOp::Le +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action38< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> CompValue +{ + CompValue::False +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action39< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> CompValue +{ + CompValue::Null +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action40< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> CompValue +{ + CompValue::True +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action41< + 'input, +>( + input: &'input str, + (_, n, _): (usize, &'input str, usize), +) -> Result,FilterActionError>> +{ + Ok(serde_json::from_str::(n).map(CompValue::Number).map_err(FilterActionError::from)?) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action42< + 'input, +>( + input: &'input str, + (_, s, _): (usize, &'input str, usize), +) -> Result,FilterActionError>> +{ + Ok(serde_json::from_str::(s).map(CompValue::Str).map_err(FilterActionError::from)?) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action43< + 'input, +>( + input: &'input str, + (_, a, _): (usize, AttrPath, usize), +) -> PatchPath +{ + PatchPath::Attr(a) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action44< + 'input, +>( + input: &'input str, + (_, a, _): (usize, AttrPath, usize), + (_, _, _): (usize, &'input str, usize), + (_, vf, _): (usize, ValFilter, usize), + (_, _, _): (usize, &'input str, usize), +) -> PatchPath +{ + PatchPath::Value(PatchValuePath { + attr: a, + filter: vf, + sub_attr: None, + }) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action45< + 'input, +>( + input: &'input str, + (_, a, _): (usize, AttrPath, usize), + (_, _, _): (usize, &'input str, usize), + (_, vf, _): (usize, ValFilter, usize), + (_, _, _): (usize, &'input str, usize), + (_, _, _): (usize, &'input str, usize), + (_, s, _): (usize, &'input str, usize), +) -> PatchPath +{ + PatchPath::Value(PatchValuePath { + attr: a, + filter: vf, + sub_attr: Some(s.to_string()), + }) +} + +#[allow(clippy::type_complexity, dead_code)] +pub trait __ToTriple<'input, > +{ + fn to_triple(self) -> Result<(usize,Token<'input>,usize), __lalrpop_util::ParseError, FilterActionError>>; +} + +impl<'input, > __ToTriple<'input, > for (usize, Token<'input>, usize) +{ + fn to_triple(self) -> Result<(usize,Token<'input>,usize), __lalrpop_util::ParseError, FilterActionError>> { + Ok(self) + } +} +impl<'input, > __ToTriple<'input, > for Result<(usize, Token<'input>, usize), FilterActionError> +{ + fn to_triple(self) -> Result<(usize,Token<'input>,usize), __lalrpop_util::ParseError, FilterActionError>> { + self.map_err(|error| __lalrpop_util::ParseError::User { error }) + } +} diff --git a/src/lib.rs b/src/lib.rs index 008513a..3bc494f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,6 +21,7 @@ //! //! let user = User { //! user_name: "jdoe@example.com".to_string(), +//! id: Some("123".to_string()), //! // other fields... //! ..Default::default() //! }; @@ -41,6 +42,7 @@ //! let user = User { //! schemas: vec!["urn:ietf:params:scim:schemas:core:2.0:User".to_string()], //! user_name: "jdoe@example.com".to_string(), +//! id: Some("123".to_string()), //! // Initialize other fields as necessary... //! ..Default::default() //! }; @@ -57,9 +59,10 @@ //! //! ```rust //! use scim_v2::models::user::User; +//! use serde_json::from_str; //! //! let user_json = r#"{"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"], "userName": "jdoe@example.com"}"#; -//! match User::try_from(user_json) { +//! match serde_json::from_str::>(user_json) { //! Ok(user) => println!("Successfully converted JSON to User: {:?}", user), //! Err(e) => println!("Error converting from JSON to User: {}", e), //! } @@ -70,7 +73,7 @@ //! use scim_v2::models::user::User; //! //! let user_json = r#"{"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"], "userName": "jdoe@example.com"}"#; -//! match User::deserialize(user_json) { +//! match User::::deserialize(user_json) { //! Ok(user) => println!("Deserialized User: {:?}", user), //! Err(e) => println!("Deserialization error: {}", e), //! } @@ -94,7 +97,13 @@ pub mod models { pub mod user; } +#[rustfmt::skip] +#[allow(clippy::all)] +pub(crate) mod filter_parser; +pub mod filter; + /// Declaring the utils module which contains the error submodule pub mod utils { pub mod error; + pub(crate) mod serde; } diff --git a/src/models/group.rs b/src/models/group.rs index de74431..82e9387 100644 --- a/src/models/group.rs +++ b/src/models/group.rs @@ -1,79 +1,44 @@ //Schema for group -use serde::{Deserialize, Serialize}; - -use crate::models::scim_schema::Meta; -use crate::utils::error::SCIMError; +use crate::{models::scim_schema::Meta, utils::error::SCIMError}; +use serde::{Deserialize, Serialize, de::DeserializeOwned}; #[derive(Serialize, Deserialize, Debug)] #[serde(rename_all = "camelCase")] -pub struct Group { +pub struct Group { pub schemas: Vec, #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, + pub id: Option, #[serde(skip_serializing_if = "Option::is_none")] pub external_id: Option, pub display_name: String, #[serde(skip_serializing_if = "Option::is_none")] - pub members: Option>, + pub members: Option>>, #[serde(skip_serializing_if = "Option::is_none")] pub meta: Option, } -impl Default for Group { - fn default() -> Self { - Group { - schemas: vec!["urn:ietf:params:scim:schemas:core:2.0:Group".to_string()], - id: None, - external_id: None, - display_name: "default_display_name".to_string(), - members: None, - meta: None, - } - } +#[derive(Serialize, Deserialize, Debug)] +#[serde(rename_all = "camelCase")] +pub enum MemberType { + #[serde(rename = "User", alias = "USER", alias = "user")] + User, + #[serde(rename = "Group", alias = "GROUP", alias = "group")] + Group, } #[derive(Serialize, Deserialize, Debug, Default)] -pub struct Member { +pub struct Member { #[serde(skip_serializing_if = "Option::is_none")] - pub value: Option, + pub value: Option, #[serde(rename = "$ref", skip_serializing_if = "Option::is_none")] pub r#ref: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub r#type: Option, + pub r#type: Option, #[serde(skip_serializing_if = "Option::is_none")] pub display: Option, } -/// Converts a JSON string into a `Group` struct. -/// -/// This method attempts to parse a JSON string to construct a `Group` object. It's useful for scenarios where -/// you receive a JSON representation of a user from an external source (e.g., a web request) and you need to -/// work with this data in a strongly-typed manner within your application. -/// -/// # Errors -/// -/// Returns `SCIMError::DeserializationError` if the provided JSON string cannot be parsed into a `Group` object. -/// -/// # Examples -/// -/// ```rust -/// use scim_v2::models::group::Group; -/// -/// let group_json = r#"{"schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"], "id": "e9e30dba-f08f-4109-8486-d5c6a331660a", "displayName": "Tour Guides"}"#; -/// match Group::try_from(group_json) { -/// Ok(group) => println!("Successfully converted JSON to Group: {:?}", group), -/// Err(e) => println!("Error converting from JSON to Group: {}", e), -/// } -/// ``` -impl TryFrom<&str> for Group { - type Error = SCIMError; - - fn try_from(value: &str) -> Result { - serde_json::from_str(value).map_err(SCIMError::DeserializationError) - } -} - -impl Group { +impl Group { /// Validates a group. /// /// This function checks if the group has `schemas`, `id`, and `display_name`. If any of these fields are missing, it returns an error. @@ -95,9 +60,10 @@ impl Group { /// let group = Group { /// schemas: vec!["urn:ietf:params:scim:schemas:core:2.0:Group".to_string()], /// id: Some("e9e30dba-f08f-4109-8486-d5c6a331660a".to_string()), + /// external_id: None, /// display_name: "Tour Guides".to_string(), - /// // other fields... - /// ..Default::default() + /// meta: None, + /// members: None /// }; /// /// match group.validate() { @@ -114,7 +80,12 @@ impl Group { } Ok(()) } +} +impl Group +where + T: Serialize, +{ /// Serializes the `Group` instance to a JSON string, using the custom SCIMError for error handling. /// /// # Returns @@ -131,9 +102,10 @@ impl Group { /// let group = Group { /// schemas: vec!["urn:ietf:params:scim:schemas:core:2.0:Group".to_string()], /// id: Some("e9e30dba-f08f-4109-8486-d5c6a331660a".to_string()), + /// external_id: None, /// display_name: "Tour Guides".to_string(), - /// // other fields... - /// ..Default::default() + /// meta: None, + /// members: None /// }; /// /// match group.serialize() { @@ -144,7 +116,12 @@ impl Group { pub fn serialize(&self) -> Result { serde_json::to_string(&self).map_err(SCIMError::SerializationError) } +} +impl Group +where + T: DeserializeOwned, +{ /// Deserializes a JSON string into a `Group` instance, using the custom SCIMError for error handling. /// /// # Parameters @@ -162,7 +139,7 @@ impl Group { /// use scim_v2::models::group::Group; /// /// let group_json = r#"{"schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"], "id": "e9e30dba-f08f-4109-8486-d5c6a331660a", "displayName": "Tour Guides"}"#; - /// match Group::deserialize(group_json) { + /// match Group::::deserialize(group_json) { /// Ok(group) => println!("Deserialized Group: {:?}", group), /// Err(e) => println!("Deserialization error: {}", e), /// } diff --git a/src/models/others.rs b/src/models/others.rs index be9795c..3145bf4 100644 --- a/src/models/others.rs +++ b/src/models/others.rs @@ -1,8 +1,8 @@ -use std::collections::HashMap; - +use serde::de::Deserializer; use serde::{Deserialize, Serialize}; use serde_json::Value; +use crate::filter::{Filter, PatchPath}; use crate::models::group::Group; use crate::models::resource_types::ResourceType; use crate::models::scim_schema::Schema; @@ -16,7 +16,8 @@ pub struct SearchRequest { pub attributes: Option>, #[serde(skip_serializing_if = "Option::is_none")] excluded_attributes: Option>, - pub filter: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub filter: Option, pub start_index: i64, pub count: i64, } @@ -27,7 +28,7 @@ impl Default for SearchRequest { schemas: vec!["urn:ietf:params:scim:api:messages:2.0:SearchRequest".to_string()], attributes: None, excluded_attributes: None, - filter: "".to_string(), + filter: None, start_index: 1, count: 100, } @@ -38,7 +39,7 @@ impl Default for SearchRequest { #[serde(rename_all = "camelCase")] pub struct ListQuery { #[serde(skip_serializing_if = "Option::is_none")] - pub filter: Option, + pub filter: Option, #[serde(skip_serializing_if = "Option::is_none")] pub start_index: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -52,7 +53,7 @@ pub struct ListQuery { impl Default for ListQuery { fn default() -> Self { ListQuery { - filter: Some("".to_string()), + filter: None, start_index: Some(1), count: Some(100), attributes: Some("".to_string()), @@ -63,63 +64,528 @@ impl Default for ListQuery { #[derive(Serialize, Deserialize, Debug)] #[serde(untagged)] -pub enum Resource { - User(Box), +pub enum Resource { + User(Box>), Schema(Box), - Group(Box), + Group(Box>), ResourceType(Box), } #[derive(Serialize, Deserialize, Debug)] #[serde(rename_all = "camelCase")] -pub struct ListResponse { +pub struct ListResponse { pub items_per_page: i64, pub total_results: i64, pub start_index: i64, pub schemas: Vec, #[serde(rename = "Resources")] - pub resources: Vec, -} - -impl Default for ListResponse { - fn default() -> Self { - ListResponse { - items_per_page: 0, - total_results: 0, - start_index: 1, - schemas: vec!["urn:ietf:params:scim:api:messages:2.0:ListResponse".to_string()], - resources: vec![], - } - } + pub resources: Vec>, } #[derive(Serialize, Deserialize, Debug)] pub struct PatchOp { pub schemas: Vec, #[serde(rename = "Operations")] - pub operations: Vec, + pub operations: Vec, } -impl Default for PatchOp { - fn default() -> Self { - PatchOp { - schemas: vec!["urn:ietf:params:scim:api:messages:2.0:PatchOp".to_string()], - operations: vec![PatchOperations::default()], +#[derive(Serialize, Debug)] +#[serde(untagged)] +#[expect(clippy::large_enum_variant)] +pub enum OperationTarget { + WithPath { + path: PatchPath, + value: Value, + }, + WithoutPath { + value: serde_json::Map, + }, +} + +impl<'de> Deserialize<'de> for OperationTarget { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let mut map = serde_json::Map::deserialize(deserializer)?; + + if let Some(path_value) = map.remove("path") { + let path_str = path_value + .as_str() + .ok_or_else(|| serde::de::Error::custom("\"path\" must be a string"))?; + let path: PatchPath = path_str + .parse() + .map_err(|e| serde::de::Error::custom(format!("invalid SCIM path: {e}")))?; + let value = map.remove("value").unwrap_or(Value::Null); + Ok(OperationTarget::WithPath { path, value }) + } else { + let value = match map.remove("value") { + Some(Value::Object(m)) => m, + Some(_) => { + return Err(serde::de::Error::custom( + "\"value\" must be a JSON object when \"path\" is absent", + )); + } + None => return Err(serde::de::Error::missing_field("value")), + }; + Ok(OperationTarget::WithoutPath { value }) } } } #[derive(Serialize, Deserialize, Debug)] -pub struct PatchOperations { - pub op: String, - pub value: HashMap, +#[serde(tag = "op")] +pub enum PatchOperation { + #[serde(rename = "add", alias = "Add", alias = "ADD")] + Add(OperationTarget), + #[serde(rename = "remove", alias = "Remove", alias = "REMOVE")] + Remove { + path: PatchPath, + #[serde(skip_serializing_if = "Option::is_none")] + value: Option, + }, + #[serde(rename = "replace", alias = "Replace", alias = "REPLACE")] + Replace(OperationTarget), } -impl Default for PatchOperations { - fn default() -> Self { - PatchOperations { - op: "".to_string(), - value: HashMap::new(), +#[cfg(test)] +mod tests { + use super::*; + use crate::filter::{ + AttrExp, AttrPath, CompValue, CompareOp, PatchPath, PatchValuePath, ValFilter, + }; + use pretty_assertions::assert_eq; + + const PATCH_OP_SCHEMA: &str = "urn:ietf:params:scim:api:messages:2.0:PatchOp"; + + #[test] + fn test_patch_op_01_add_with_path() { + let ops: PatchOp = serde_json::from_str(include_str!("../test_data/operations_01.json")) + .expect("Failed to deserialize patch operations"); + assert_eq!(ops.schemas, vec![PATCH_OP_SCHEMA]); + assert_eq!(ops.operations.len(), 1); + assert!(matches!( + &ops.operations[0], + PatchOperation::Add(OperationTarget::WithPath { + path: PatchPath::Attr(AttrPath { uri: None, name, sub_attr: None }), + .. + }) if name == "members" + )); + } + + #[test] + fn test_patch_op_02_add_without_path() { + let ops: PatchOp = serde_json::from_str(include_str!("../test_data/operations_02.json")) + .expect("Failed to deserialize patch operations"); + assert_eq!(ops.schemas, vec![PATCH_OP_SCHEMA]); + assert_eq!(ops.operations.len(), 1); + assert!(matches!( + &ops.operations[0], + PatchOperation::Add(OperationTarget::WithoutPath { .. }) + )); + } + + #[test] + fn test_patch_op_03_remove_member_by_filter() { + let ops: PatchOp = serde_json::from_str(include_str!("../test_data/operations_03.json")) + .expect("Failed to deserialize patch operations"); + assert_eq!(ops.schemas, vec![PATCH_OP_SCHEMA]); + assert_eq!(ops.operations.len(), 1); + match &ops.operations[0] { + PatchOperation::Remove { + path: + PatchPath::Value(PatchValuePath { + attr: + AttrPath { + uri: None, + name: attr_name, + sub_attr: None, + }, + filter: + ValFilter::Attr(AttrExp::Comparison( + AttrPath { + uri: None, + name: inner_name, + sub_attr: None, + }, + CompareOp::Eq, + CompValue::Str(v), + )), + sub_attr: None, + }), + value: None, + } if attr_name == "members" + && inner_name == "value" + && v == "2819c223-7f76-...413861904646" => {} + other => panic!("unexpected operation: {other:?}"), + } + } + + #[test] + fn test_patch_op_04_remove_all_members() { + let ops: PatchOp = serde_json::from_str(include_str!("../test_data/operations_04.json")) + .expect("Failed to deserialize patch operations"); + assert_eq!(ops.schemas, vec![PATCH_OP_SCHEMA]); + assert_eq!(ops.operations.len(), 1); + assert!(matches!( + &ops.operations[0], + PatchOperation::Remove { + path: PatchPath::Attr(AttrPath { uri: None, name, sub_attr: None }), + value: None, + } if name == "members" + )); + } + + #[test] + fn test_patch_op_05_remove_emails_compound_filter() { + let ops: PatchOp = serde_json::from_str(include_str!("../test_data/operations_05.json")) + .expect("Failed to deserialize patch operations"); + assert_eq!(ops.schemas, vec![PATCH_OP_SCHEMA]); + assert_eq!(ops.operations.len(), 1); + match &ops.operations[0] { + PatchOperation::Remove { + path: + PatchPath::Value(PatchValuePath { + attr: + AttrPath { + uri: None, + name: attr_name, + sub_attr: None, + }, + filter: ValFilter::And(left, right), + sub_attr: None, + }), + value: None, + } if attr_name == "emails" => { + match left.as_ref() { + ValFilter::Attr(AttrExp::Comparison( + AttrPath { + uri: None, + name: n, + sub_attr: None, + }, + CompareOp::Eq, + CompValue::Str(v), + )) if n == "type" && v == "work" => {} + other => panic!("unexpected left filter: {other:?}"), + } + match right.as_ref() { + ValFilter::Attr(AttrExp::Comparison( + AttrPath { + uri: None, + name: n, + sub_attr: None, + }, + CompareOp::Ew, + CompValue::Str(v), + )) if n == "value" && v == "example.com" => {} + other => panic!("unexpected right filter: {other:?}"), + } + } + other => panic!("unexpected operation: {other:?}"), + } + } + + #[test] + fn test_patch_op_06_remove_then_add_members() { + let ops: PatchOp = serde_json::from_str(include_str!("../test_data/operations_06.json")) + .expect("Failed to deserialize patch operations"); + assert_eq!(ops.schemas, vec![PATCH_OP_SCHEMA]); + assert_eq!(ops.operations.len(), 2); + assert!(matches!( + &ops.operations[0], + PatchOperation::Remove { + path: PatchPath::Attr(AttrPath { uri: None, name, sub_attr: None }), + value: None, + } if name == "members" + )); + assert!(matches!( + &ops.operations[1], + PatchOperation::Add(OperationTarget::WithPath { + path: PatchPath::Attr(AttrPath { uri: None, name, sub_attr: None }), + .. + }) if name == "members" + )); + } + + #[test] + fn test_patch_op_07_replace_members_list() { + let ops: PatchOp = serde_json::from_str(include_str!("../test_data/operations_07.json")) + .expect("Failed to deserialize patch operations"); + assert_eq!(ops.schemas, vec![PATCH_OP_SCHEMA]); + assert_eq!(ops.operations.len(), 1); + assert!(matches!( + &ops.operations[0], + PatchOperation::Replace(OperationTarget::WithPath { + path: PatchPath::Attr(AttrPath { uri: None, name, sub_attr: None }), + .. + }) if name == "members" + )); + } + + #[test] + fn test_patch_op_08_replace_work_address() { + let ops: PatchOp = serde_json::from_str(include_str!("../test_data/operations_08.json")) + .expect("Failed to deserialize patch operations"); + assert_eq!(ops.schemas, vec![PATCH_OP_SCHEMA]); + assert_eq!(ops.operations.len(), 1); + match &ops.operations[0] { + PatchOperation::Replace(OperationTarget::WithPath { + path: + PatchPath::Value(PatchValuePath { + attr: + AttrPath { + uri: None, + name: attr_name, + sub_attr: None, + }, + filter: + ValFilter::Attr(AttrExp::Comparison( + AttrPath { + uri: None, + name: n, + sub_attr: None, + }, + CompareOp::Eq, + CompValue::Str(v), + )), + sub_attr: None, + }), + .. + }) if attr_name == "addresses" && n == "type" && v == "work" => {} + other => panic!("unexpected operation: {other:?}"), } } + + #[test] + fn test_patch_op_09_replace_street_address_via_filter() { + let ops: PatchOp = serde_json::from_str(include_str!("../test_data/operations_09.json")) + .expect("Failed to deserialize patch operations"); + assert_eq!(ops.schemas, vec![PATCH_OP_SCHEMA]); + assert_eq!(ops.operations.len(), 1); + match &ops.operations[0] { + PatchOperation::Replace(OperationTarget::WithPath { + path: + PatchPath::Value(PatchValuePath { + attr: + AttrPath { + uri: None, + name: attr_name, + sub_attr: None, + }, + filter: + ValFilter::Attr(AttrExp::Comparison( + AttrPath { + uri: None, + name: n, + sub_attr: None, + }, + CompareOp::Eq, + CompValue::Str(v), + )), + sub_attr: Some(sub_attr), + }), + value, + }) if attr_name == "addresses" + && sub_attr == "streetAddress" + && n == "type" + && v == "work" => + { + assert_eq!(value.as_str(), Some("1010 Broadway Ave")); + } + _ => panic!("Expected Replace WithPath for addresses[type eq \"work\"].streetAddress"), + } + } + + #[test] + fn test_patch_op_10_replace_without_path() { + let ops: PatchOp = serde_json::from_str(include_str!("../test_data/operations_10.json")) + .expect("Failed to deserialize patch operations"); + assert_eq!(ops.schemas, vec![PATCH_OP_SCHEMA]); + assert_eq!(ops.operations.len(), 1); + assert!(matches!( + &ops.operations[0], + PatchOperation::Replace(OperationTarget::WithoutPath { .. }) + )); + } + + // ---- Okta provider tests ---- + + #[test] + fn test_okta_replace_deactivate() { + let ops: PatchOp = + serde_json::from_str(include_str!("../test_data/okta_replace_deactivate.json")) + .expect("Failed to deserialize Okta deactivation"); + assert_eq!(ops.operations.len(), 1); + match &ops.operations[0] { + PatchOperation::Replace(OperationTarget::WithoutPath { value }) => { + assert_eq!(value.get("active").and_then(|v| v.as_bool()), Some(false)); + } + other => panic!("expected Replace WithoutPath, got {other:?}"), + } + } + + #[test] + fn test_okta_add_members_array_value() { + let ops: PatchOp = serde_json::from_str(include_str!("../test_data/okta_add_members.json")) + .expect("Failed to deserialize Okta add members"); + assert_eq!(ops.operations.len(), 1); + match &ops.operations[0] { + PatchOperation::Add(OperationTarget::WithPath { path, value }) => { + assert_eq!( + path, + &PatchPath::Attr(AttrPath { + uri: None, + name: "members".into(), + sub_attr: None, + }) + ); + let arr = value.as_array().expect("value should be an array"); + assert_eq!(arr.len(), 1); + assert_eq!(arr[0]["display"], "user@example.com"); + // Okta does NOT send "type" in member objects + assert!(arr[0].get("type").is_none()); + } + other => panic!("expected Add WithPath, got {other:?}"), + } + } + + #[test] + fn test_okta_replace_members_array_value() { + let ops: PatchOp = + serde_json::from_str(include_str!("../test_data/okta_replace_members.json")) + .expect("Failed to deserialize Okta replace members"); + assert_eq!(ops.operations.len(), 1); + match &ops.operations[0] { + PatchOperation::Replace(OperationTarget::WithPath { path, value }) => { + assert_eq!( + path, + &PatchPath::Attr(AttrPath { + uri: None, + name: "members".into(), + sub_attr: None, + }) + ); + let arr = value.as_array().expect("value should be an array"); + assert_eq!(arr.len(), 2); + } + other => panic!("expected Replace WithPath, got {other:?}"), + } + } + + // ---- JumpCloud provider tests ---- + + #[test] + fn test_jumpcloud_replace_user_fields() { + let ops: PatchOp = serde_json::from_str(include_str!( + "../test_data/jumpcloud_replace_user_fields.json" + )) + .expect("Failed to deserialize JumpCloud user field replace"); + assert_eq!(ops.operations.len(), 3); + // JumpCloud sends one op per attribute with path + match &ops.operations[0] { + PatchOperation::Replace(OperationTarget::WithPath { path, value }) => { + assert_eq!( + path, + &PatchPath::Attr(AttrPath { + uri: None, + name: "name".into(), + sub_attr: Some("givenName".into()), + }) + ); + assert_eq!(value.as_str(), Some("John")); + } + other => panic!("expected Replace WithPath for givenName, got {other:?}"), + } + // Third op: active = false (scalar bool value) + match &ops.operations[2] { + PatchOperation::Replace(OperationTarget::WithPath { path, value }) => { + assert_eq!( + path, + &PatchPath::Attr(AttrPath { + uri: None, + name: "active".into(), + sub_attr: None, + }) + ); + assert_eq!(value.as_bool(), Some(false)); + } + other => panic!("expected Replace WithPath for active, got {other:?}"), + } + } + + #[test] + fn test_jumpcloud_add_member_minimal() { + let ops: PatchOp = + serde_json::from_str(include_str!("../test_data/jumpcloud_add_member.json")) + .expect("Failed to deserialize JumpCloud add member"); + assert_eq!(ops.operations.len(), 1); + match &ops.operations[0] { + PatchOperation::Add(OperationTarget::WithPath { value, .. }) => { + let arr = value.as_array().expect("value should be an array"); + assert_eq!(arr.len(), 1); + // JumpCloud sends minimal member objects: just "value", no display/type + assert_eq!(arr[0]["value"], "jc-user-uuid-001"); + assert!(arr[0].get("display").is_none()); + assert!(arr[0].get("type").is_none()); + } + other => panic!("expected Add WithPath, got {other:?}"), + } + } + + #[test] + fn test_jumpcloud_remove_member_with_value() { + let ops: PatchOp = serde_json::from_str(include_str!( + "../test_data/jumpcloud_remove_member_with_value.json" + )) + .expect("Failed to deserialize JumpCloud remove member with value"); + assert_eq!(ops.operations.len(), 1); + match &ops.operations[0] { + PatchOperation::Remove { + path, + value: Some(v), + } => { + assert_eq!( + path, + &PatchPath::Attr(AttrPath { + uri: None, + name: "members".into(), + sub_attr: None, + }) + ); + let arr = v.as_array().expect("value should be an array"); + assert_eq!(arr[0]["value"], "jc-user-uuid-001"); + } + other => panic!("expected Remove with value, got {other:?}"), + } + } + + // ---- Negative tests: malformed path must NOT silently fallthrough ---- + + #[test] + fn test_malformed_path_returns_error() { + let json = r#"{ + "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"], + "Operations": [{ + "op": "replace", + "path": "emails[broken!!!filter", + "value": {"displayName": "pwned"} + }] + }"#; + let result: Result = serde_json::from_str(json); + assert!( + result.is_err(), + "malformed path must produce an error, not silently fallthrough" + ); + } + + #[test] + fn test_invalid_op_returns_error() { + let json = r#"{ + "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"], + "Operations": [{"op": "delete", "path": "members"}] + }"#; + let result: Result = serde_json::from_str(json); + assert!(result.is_err(), "invalid op 'delete' must produce an error"); + } } diff --git a/src/models/user.rs b/src/models/user.rs index 5d2ad7f..77e5b1b 100644 --- a/src/models/user.rs +++ b/src/models/user.rs @@ -1,18 +1,16 @@ -use std::convert::TryFrom; - -use serde::{Deserialize, Serialize}; - use crate::models::enterprise_user::EnterpriseUser; use crate::models::scim_schema::Meta; -use crate::utils::error::SCIMError; +use crate::utils::{error::SCIMError, serde::deserialize_optional_lenient_bool}; +use serde::de::DeserializeOwned; +use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug)] #[serde(rename_all = "camelCase")] -pub struct User { +pub struct User { // urn:ietf:params:scim:schemas:core:2.0:User pub schemas: Vec, #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, + pub id: Option, #[serde(skip_serializing_if = "Option::is_none")] pub external_id: Option, pub user_name: String, @@ -65,7 +63,7 @@ pub struct User { pub enterprise_user: Option, } -impl Default for User { +impl Default for User { fn default() -> Self { User { schemas: vec!["urn:ietf:params:scim:schemas:core:2.0:User".to_string()], @@ -213,7 +211,10 @@ pub struct Role { pub display: Option, #[serde(skip_serializing_if = "Option::is_none")] pub r#type: Option, - #[serde(skip_serializing_if = "Option::is_none")] + #[serde( + skip_serializing_if = "Option::is_none", + deserialize_with = "deserialize_optional_lenient_bool" + )] pub primary: Option, } @@ -229,36 +230,7 @@ pub struct X509Certificate { pub primary: Option, } -/// Converts a JSON string into a `User` struct. -/// -/// This method attempts to parse a JSON string to construct a `User` object. It's useful for scenarios where -/// you receive a JSON representation of a user from an external source (e.g., a web request) and you need to -/// work with this data in a strongly-typed manner within your application. -/// -/// # Errors -/// -/// Returns `SCIMError::DeserializationError` if the provided JSON string cannot be parsed into a `User` object. -/// -/// # Examples -/// -/// ```rust -/// use scim_v2::models::user::User; -/// -/// let user_json = r#"{"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"], "userName": "jdoe@example.com"}"#; -/// match User::try_from(user_json) { -/// Ok(user) => println!("Successfully converted JSON to User: {:?}", user), -/// Err(e) => println!("Error converting from JSON to User: {}", e), -/// } -/// ``` -impl TryFrom<&str> for User { - type Error = SCIMError; - - fn try_from(value: &str) -> Result { - serde_json::from_str(value).map_err(SCIMError::DeserializationError) - } -} - -impl User { +impl User { /// Validates a user. /// /// This function checks if the user has a `name` and `user_name`. If either is missing, it returns an error. @@ -279,7 +251,7 @@ impl User { /// ```rust /// use scim_v2::models::user::User; /// - /// let user = User { + /// let user: User = User { /// user_name: "jdoe@example.com".to_string(), /// // other fields... /// ..Default::default() @@ -304,7 +276,12 @@ impl User { } Ok(()) } +} +impl User +where + T: Serialize, +{ /// Serializes the `User` instance to a JSON string, using the custom SCIMError for error handling. /// /// # Returns @@ -321,6 +298,7 @@ impl User { /// let user = User { /// schemas: vec!["urn:ietf:params:scim:schemas:core:2.0:User".to_string()], /// user_name: "jdoe@example.com".to_string(), + /// id: Some("123".to_string()), /// // Initialize other fields as necessary... /// ..Default::default() /// }; @@ -333,7 +311,12 @@ impl User { pub fn serialize(&self) -> Result { serde_json::to_string(&self).map_err(SCIMError::SerializationError) } +} +impl User +where + T: DeserializeOwned, +{ /// Deserializes a JSON string into a `User` instance, using the custom SCIMError for error handling. /// /// # Parameters @@ -351,7 +334,7 @@ impl User { /// use scim_v2::models::user::User; /// /// let user_json = r#"{"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"], "userName": "jdoe@example.com"}"#; - /// match User::deserialize(user_json) { + /// match User::::deserialize(user_json) { /// Ok(user) => println!("Deserialized User: {:?}", user), /// Err(e) => println!("Deserialization error: {}", e), /// } @@ -782,4 +765,12 @@ mod tests { let user = user.unwrap(); assert!(user.enterprise_user.is_none()); } + + // Test data is from https://scimvalidator.microsoft.com/ + #[test] + fn deserialize_entra_user() { + let user: Result = + serde_json::from_str(include_str!("../test_data/entra_user_creation_test.json")); + user.expect("user should deserialize"); + } } diff --git a/src/test_data/entra_user_creation_test.json b/src/test_data/entra_user_creation_test.json new file mode 100644 index 0000000..aee1a5c --- /dev/null +++ b/src/test_data/entra_user_creation_test.json @@ -0,0 +1,76 @@ +{ + "active": true, + "addresses": [ + { + "type": "work", + "formatted": "ANUMAAOJUYMA", + "streetAddress": "046 Wisoky Route", + "locality": "AQCGFHJMVSXU", + "region": "CXLKAWAESJPV", + "postalCode": "dk0 2uz", + "primary": true, + "country": "Gibraltar" + } + ], + "displayName": "QTZODTJXGFLR", + "emails": [ + { + "type": "work", + "value": "bettie@parisian.com", + "primary": true + } + ], + "locale": "HNULHBRGUHWA", + "name": { + "givenName": "Aida", + "familyName": "Chandler", + "formatted": "Hyman", + "middleName": "Haylie", + "honorificPrefix": "Athena", + "honorificSuffix": "Brooks" + }, + "nickName": "CRILRBTBOQOW", + "phoneNumbers": [ + { + "type": "work", + "value": "0-351-9540", + "primary": true + }, + { + "type": "mobile", + "value": "0-351-9540" + }, + { + "type": "fax", + "value": "0-351-9540" + } + ], + "preferredLanguage": "lu", + "profileUrl": "ROQHEOEENWTS", + "roles": [ + { + "primary": "True", + "display": "DJAPQUWELUHM", + "value": "DRIHDNWREZZV", + "type": "EHUDZVCXYJOO" + } + ], + "schemas": [ + "urn:ietf:params:scim:schemas:core:2.0:User", + "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User" + ], + "timezone": "America/Goose_Bay", + "title": "OWOJJVOCUHKD", + "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": { + "employeeNumber": "LLQMUPKSPYGA", + "department": "BYQJSWLGXQTB", + "costCenter": "UNPCDCIBUXTN", + "organization": "CHZYDKXGJHHJ", + "division": "OSLUHIBPTUGX", + "manager": { + "value": "BGKAWQXOZREF" + } + }, + "userName": "isaias@bode.ca", + "userType": "QWQJIEJYZILC" +} diff --git a/src/test_data/jumpcloud_add_member.json b/src/test_data/jumpcloud_add_member.json new file mode 100644 index 0000000..1298642 --- /dev/null +++ b/src/test_data/jumpcloud_add_member.json @@ -0,0 +1,16 @@ +{ + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:PatchOp" + ], + "Operations": [ + { + "op": "add", + "path": "members", + "value": [ + { + "value": "jc-user-uuid-001" + } + ] + } + ] +} diff --git a/src/test_data/jumpcloud_remove_member_with_value.json b/src/test_data/jumpcloud_remove_member_with_value.json new file mode 100644 index 0000000..a716b6e --- /dev/null +++ b/src/test_data/jumpcloud_remove_member_with_value.json @@ -0,0 +1,16 @@ +{ + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:PatchOp" + ], + "Operations": [ + { + "op": "remove", + "path": "members", + "value": [ + { + "value": "jc-user-uuid-001" + } + ] + } + ] +} diff --git a/src/test_data/jumpcloud_replace_user_fields.json b/src/test_data/jumpcloud_replace_user_fields.json new file mode 100644 index 0000000..ef68297 --- /dev/null +++ b/src/test_data/jumpcloud_replace_user_fields.json @@ -0,0 +1,22 @@ +{ + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:PatchOp" + ], + "Operations": [ + { + "op": "replace", + "path": "name.givenName", + "value": "John" + }, + { + "op": "replace", + "path": "name.familyName", + "value": "Doe" + }, + { + "op": "replace", + "path": "active", + "value": false + } + ] +} diff --git a/src/test_data/okta_add_members.json b/src/test_data/okta_add_members.json new file mode 100644 index 0000000..1beee3d --- /dev/null +++ b/src/test_data/okta_add_members.json @@ -0,0 +1,17 @@ +{ + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:PatchOp" + ], + "Operations": [ + { + "op": "add", + "path": "members", + "value": [ + { + "value": "abc123-def456", + "display": "user@example.com" + } + ] + } + ] +} diff --git a/src/test_data/okta_replace_deactivate.json b/src/test_data/okta_replace_deactivate.json new file mode 100644 index 0000000..3636da2 --- /dev/null +++ b/src/test_data/okta_replace_deactivate.json @@ -0,0 +1,13 @@ +{ + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:PatchOp" + ], + "Operations": [ + { + "op": "replace", + "value": { + "active": false + } + } + ] +} diff --git a/src/test_data/okta_replace_members.json b/src/test_data/okta_replace_members.json new file mode 100644 index 0000000..d8bcf2e --- /dev/null +++ b/src/test_data/okta_replace_members.json @@ -0,0 +1,21 @@ +{ + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:PatchOp" + ], + "Operations": [ + { + "op": "replace", + "path": "members", + "value": [ + { + "value": "id-001", + "display": "user1@example.com" + }, + { + "value": "id-002", + "display": "user2@example.com" + } + ] + } + ] +} diff --git a/src/test_data/operations_01.json b/src/test_data/operations_01.json new file mode 100644 index 0000000..a755340 --- /dev/null +++ b/src/test_data/operations_01.json @@ -0,0 +1,18 @@ +{ + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:PatchOp" + ], + "Operations": [ + { + "op": "add", + "path": "members", + "value": [ + { + "display": "Babs Jensen", + "$ref": "https://example.com/v2/Users/2819c223...413861904646", + "value": "2819c223-7f76-453a-919d-413861904646" + } + ] + } + ] +} diff --git a/src/test_data/operations_02.json b/src/test_data/operations_02.json new file mode 100644 index 0000000..24e126d --- /dev/null +++ b/src/test_data/operations_02.json @@ -0,0 +1,19 @@ +{ + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:PatchOp" + ], + "Operations": [ + { + "op": "add", + "value": { + "emails": [ + { + "value": "babs@jensen.org", + "type": "home" + } + ], + "nickname": "Babs" + } + } + ] +} diff --git a/src/test_data/operations_03.json b/src/test_data/operations_03.json new file mode 100644 index 0000000..8c51884 --- /dev/null +++ b/src/test_data/operations_03.json @@ -0,0 +1,11 @@ +{ + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:PatchOp" + ], + "Operations": [ + { + "op": "remove", + "path": "members[value eq \"2819c223-7f76-...413861904646\"]" + } + ] +} diff --git a/src/test_data/operations_04.json b/src/test_data/operations_04.json new file mode 100644 index 0000000..7c9244c --- /dev/null +++ b/src/test_data/operations_04.json @@ -0,0 +1,11 @@ +{ + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:PatchOp" + ], + "Operations": [ + { + "op": "remove", + "path": "members" + } + ] +} diff --git a/src/test_data/operations_05.json b/src/test_data/operations_05.json new file mode 100644 index 0000000..62c9933 --- /dev/null +++ b/src/test_data/operations_05.json @@ -0,0 +1,8 @@ +{ + "schemas": + ["urn:ietf:params:scim:api:messages:2.0:PatchOp"], + "Operations": [{ + "op":"remove", + "path":"emails[type eq \"work\" and value ew \"example.com\"]" + }] +} diff --git a/src/test_data/operations_06.json b/src/test_data/operations_06.json new file mode 100644 index 0000000..d045b41 --- /dev/null +++ b/src/test_data/operations_06.json @@ -0,0 +1,26 @@ +{ + "schemas": + ["urn:ietf:params:scim:api:messages:2.0:PatchOp"], + "Operations": [ + { + "op":"remove","path":"members" + }, + { + "op":"add", + "path":"members", + "value":[ + { + "display": "Babs Jensen", + "$ref": + "https://example.com/v2/Users/2819c223...413861904646", + "value": "2819c223-7f76-453a-919d-413861904646" + }, + { + "display": "James Smith", + "$ref": + "https://example.com/v2/Users/08e1d05d...473d93df9210", + "value": "08e1d05d-121c-4561-8b96-473d93df9210" + }] + } + ] +} diff --git a/src/test_data/operations_07.json b/src/test_data/operations_07.json new file mode 100644 index 0000000..454047a --- /dev/null +++ b/src/test_data/operations_07.json @@ -0,0 +1,22 @@ +{ + "schemas": + ["urn:ietf:params:scim:api:messages:2.0:PatchOp"], + "Operations": [{ + "op":"replace", + "path":"members", + "value":[ + { + "display": "Babs Jensen", + "$ref": + "https://example.com/v2/Users/2819c223...413861904646", + "value": "2819c223...413861904646" + }, + { + "display": "James Smith", + "$ref": + "https://example.com/v2/Users/08e1d05d...473d93df9210", + "value": "08e1d05d...473d93df9210" + } + ] + }] +} diff --git a/src/test_data/operations_08.json b/src/test_data/operations_08.json new file mode 100644 index 0000000..6fab285 --- /dev/null +++ b/src/test_data/operations_08.json @@ -0,0 +1,20 @@ +{ + "schemas": + ["urn:ietf:params:scim:api:messages:2.0:PatchOp"], + "Operations": [{ + "op":"replace", + "path":"addresses[type eq \"work\"]", + "value": + { + "type": "work", + "streetAddress": "911 Universal City Plaza", + "locality": "Hollywood", + "region": "CA", + "postalCode": "91608", + "country": "US", + "formatted": + "911 Universal City Plaza\nHollywood, CA 91608 US", + "primary": true + } + }] +} diff --git a/src/test_data/operations_09.json b/src/test_data/operations_09.json new file mode 100644 index 0000000..9cd595c --- /dev/null +++ b/src/test_data/operations_09.json @@ -0,0 +1,9 @@ +{ + "schemas": + ["urn:ietf:params:scim:api:messages:2.0:PatchOp"], + "Operations": [{ + "op":"replace", + "path":"addresses[type eq \"work\"].streetAddress", + "value":"1010 Broadway Ave" + }] +} diff --git a/src/test_data/operations_10.json b/src/test_data/operations_10.json new file mode 100644 index 0000000..74d232c --- /dev/null +++ b/src/test_data/operations_10.json @@ -0,0 +1,24 @@ +{ + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:PatchOp" + ], + "Operations": [ + { + "op": "replace", + "value": { + "emails": [ + { + "value": "bjensen@example.com", + "type": "work", + "primary": true + }, + { + "value": "babs@jensen.org", + "type": "home" + } + ], + "nickname": "Babs" + } + } + ] +} diff --git a/src/utils/serde.rs b/src/utils/serde.rs new file mode 100644 index 0000000..a671f06 --- /dev/null +++ b/src/utils/serde.rs @@ -0,0 +1,44 @@ +use serde::Deserializer; + +pub(crate) fn deserialize_optional_lenient_bool<'de, D>( + deserializer: D, +) -> Result, D::Error> +where + D: Deserializer<'de>, +{ + use serde::de; + + struct OptionalLenientBoolVisitor; + + impl<'de> de::Visitor<'de> for OptionalLenientBoolVisitor { + type Value = Option; + + fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { + formatter.write_str("a boolean, a string representing a boolean, or null") + } + + fn visit_bool(self, v: bool) -> Result, E> { + Ok(Some(v)) + } + + fn visit_str(self, v: &str) -> Result, E> { + if v.eq_ignore_ascii_case("true") { + Ok(Some(true)) + } else if v.eq_ignore_ascii_case("false") { + Ok(Some(false)) + } else { + Err(E::invalid_value(de::Unexpected::Str(v), &self)) + } + } + + fn visit_none(self) -> Result, E> { + Ok(None) + } + + fn visit_unit(self) -> Result, E> { + Ok(None) + } + } + + deserializer.deserialize_any(OptionalLenientBoolVisitor) +}