From b7d15c2afde6d612f77d39512f6cf5fdb3be2432 Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Wed, 29 May 2019 21:19:46 -0700 Subject: [PATCH] Better errors and more fleshed out semantics --- Cargo.lock | 34 + Cargo.toml | 1 + Makefile.toml | 18 +- src/cli.rs | 42 +- src/env/host.rs | 19 + src/errors.rs | 124 +- src/evaluate/evaluator.rs | 2 +- src/object/base.rs | 3 +- src/parser.rs | 10 +- src/parser/ast.rs | 49 +- src/parser/lexer.rs | 361 +++-- src/parser/parser.lalrpop | 90 +- src/parser/parser.rs | 2804 ++++++++++++++++--------------------- src/parser/span.rs | 80 ++ 14 files changed, 1844 insertions(+), 1793 deletions(-) create mode 100644 src/parser/span.rs diff --git a/Cargo.lock b/Cargo.lock index 6c454a71c6..810ae352bf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -842,6 +842,14 @@ dependencies = [ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "itertools" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "itertools" version = "0.8.0" @@ -869,6 +877,18 @@ name = "lalrpop-util" version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "language-reporting" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "derive-new 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "render-tree 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "lazy_static" version = "1.3.0" @@ -1049,6 +1069,7 @@ dependencies = [ "indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "lalrpop-util 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "language-reporting 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "logos 0.10.0-rc2 (registry+https://github.com/rust-lang/crates.io-index)", "logos-derive 0.10.0-rc2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1504,6 +1525,16 @@ dependencies = [ "ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "render-tree" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "itertools 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rustc-demangle" version = "0.1.14" @@ -2104,10 +2135,12 @@ dependencies = [ "checksum ident_case 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" "checksum indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7e81a7c05f79578dbc15793d8b619db9ba32b4577003ef3af1a91c416798c58d" "checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" +"checksum itertools 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0d47946d458e94a1b7bcabbf6521ea7c037062c81f534615abcad76e84d4970d" "checksum itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5b8467d9c1cebe26feb08c640139247fac215782d35371ade9a2136ed6085358" "checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum lalrpop-util 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9768f55211206d3c17181108d8facb80bdffc1f1e674a67b1dddb2743529ca19" +"checksum language-reporting 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "61e5d4e5c7a76724d544bb5652a8a3ded29475a1b260a263b5d6743f5871ac83" "checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14" "checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" "checksum lexical-core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e82e023e062f1d25f807ad182008fba1b46538e999f908a08cc0c29e084462e" @@ -2174,6 +2207,7 @@ dependencies = [ "checksum redox_users 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe5204c3a17e97dde73f285d49be585df59ed84b50a872baf416e73b62c3828" "checksum regex 1.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "8f0a0bcab2fd7d1d7c54fa9eae6f43eddeb9ce2e7352f8518a814a4f65d60c58" "checksum regex-syntax 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "dcfd8681eebe297b81d98498869d4aae052137651ad7b96822f09ceb690d0a96" +"checksum render-tree 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "68ed587df09cfb7ce1bc6fe8f77e24db219f222c049326ccbfb948ec67e31664" "checksum rustc-demangle 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "ccc78bfd5acd7bf3e89cffcf899e5cb1a52d6fafa8dec2739ad70c9577a57288" "checksum rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" diff --git a/Cargo.toml b/Cargo.toml index 119ef2a97c..45afc34b34 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,6 +43,7 @@ serde_derive = "1.0.91" getset = "0.0.7" logos = "0.10.0-rc2" logos-derive = "0.10.0-rc2" +language-reporting = "0.3.0" [dependencies.pancurses] version = "0.16" diff --git a/Makefile.toml b/Makefile.toml index 448a295f29..9d98c7fde6 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -3,6 +3,9 @@ install_crate = { crate_name = "lalrpop", binary = "lalrpop", test_arg = "--help command = "lalrpop" args = ["src/parser/parser.lalrpop"] +[tasks.baseline] +dependencies = ["lalrpop"] + [tasks.build] command = "cargo" args = ["build"] @@ -10,5 +13,16 @@ dependencies = ["lalrpop"] [tasks.run] command = "cargo" -args = ["run"] -dependencies = ["build"] \ No newline at end of file +args = ["run", "--release"] +dependencies = ["baseline"] + +[tasks.test] +command = "cargo" +args = ["test"] +dependencies = ["baseline"] + +[tasks.check] +command = "cargo" +args = ["check"] +dependencies = ["baseline"] + diff --git a/src/cli.rs b/src/cli.rs index 18f25885df..e506515980 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -87,9 +87,23 @@ pub async fn cli() -> Result<(), Box> { rl.add_history_entry(line.clone()); } - LineResult::Error(err) => { - context.host.lock().unwrap().stdout(&err); - } + LineResult::Error(err) => match err { + ShellError::Diagnostic(diag, source) => { + let host = context.host.lock().unwrap(); + let writer = host.err_termcolor(); + let files = crate::parser::span::Files::new(source); + + language_reporting::emit( + &mut writer.lock(), + &files, + &diag.diagnostic, + &language_reporting::DefaultConfig, + ) + .unwrap(); + } + + ShellError::String(s) => context.host.lock().unwrap().stdout(&format!("{:?}", s)), + }, LineResult::Break => { break; @@ -111,7 +125,7 @@ pub async fn cli() -> Result<(), Box> { enum LineResult { Success(String), - Error(String), + Error(ShellError), Break, #[allow(unused)] @@ -125,13 +139,13 @@ impl std::ops::Try for LineResult { fn into_result(self) -> Result, ShellError> { match self { LineResult::Success(s) => Ok(Some(s)), - LineResult::Error(s) => Err(ShellError::string(s)), + LineResult::Error(s) => Err(s), LineResult::Break => Ok(None), LineResult::FatalError(err) => Err(err), } } fn from_error(v: ShellError) -> Self { - LineResult::Error(v.to_string()) + LineResult::Error(v) } fn from_ok(v: Option) -> Self { @@ -151,7 +165,7 @@ async fn process_line(readline: Result, ctx: &mut Context Ok(line) => { let result = match crate::parser::parse(&line, &ctx.registry()) { Err(err) => { - return LineResult::Error(format!("{:?}", err)); + return LineResult::Error(err); } Ok(val) => val, @@ -178,13 +192,13 @@ async fn process_line(readline: Result, ctx: &mut Context Some(ClassifiedCommand::Internal(_)), ) => match left.run(ctx, input).await { Ok(val) => ClassifiedInputStream::from_input_stream(val), - Err(err) => return LineResult::Error(format!("{}", err.description())), + Err(err) => return LineResult::Error(err), }, (Some(ClassifiedCommand::Internal(left)), None) => { match left.run(ctx, input).await { Ok(val) => ClassifiedInputStream::from_input_stream(val), - Err(err) => return LineResult::Error(format!("{}", err.description())), + Err(err) => return LineResult::Error(err), } } @@ -193,18 +207,18 @@ async fn process_line(readline: Result, ctx: &mut Context Some(ClassifiedCommand::External(_)), ) => match left.run(ctx, input, StreamNext::External).await { Ok(val) => val, - Err(err) => return LineResult::Error(format!("{}", err.description())), + Err(err) => return LineResult::Error(err), }, ( Some(ClassifiedCommand::Internal(ref i)), Some(ClassifiedCommand::External(ref e)), ) => { - return LineResult::Error(format!( + return LineResult::Error(ShellError::string(&format!( "Unimplemented Internal({}) -> External({})", i.name(), e.name() - )) + ))) } ( @@ -212,13 +226,13 @@ async fn process_line(readline: Result, ctx: &mut Context Some(ClassifiedCommand::Internal(_)), ) => match left.run(ctx, input, StreamNext::Internal).await { Ok(val) => val, - Err(err) => return LineResult::Error(format!("{}", err.description())), + Err(err) => return LineResult::Error(err), }, (Some(ClassifiedCommand::External(left)), None) => { match left.run(ctx, input, StreamNext::Last).await { Ok(val) => val, - Err(err) => return LineResult::Error(format!("{}", err.description())), + Err(err) => return LineResult::Error(err), } } } diff --git a/src/env/host.rs b/src/env/host.rs index b452af154f..edf9e54302 100644 --- a/src/env/host.rs +++ b/src/env/host.rs @@ -1,9 +1,13 @@ use crate::prelude::*; +use language_reporting::termcolor; pub trait Host { fn out_terminal(&self) -> Box; fn err_terminal(&self) -> Box; + fn out_termcolor(&self) -> termcolor::StandardStream; + fn err_termcolor(&self) -> termcolor::StandardStream; + fn stdout(&mut self, out: &str); fn stderr(&mut self, out: &str); } @@ -24,6 +28,14 @@ impl Host for Box { fn stderr(&mut self, out: &str) { (**self).stderr(out) } + + fn out_termcolor(&self) -> termcolor::StandardStream { + (**self).out_termcolor() + } + + fn err_termcolor(&self) -> termcolor::StandardStream { + (**self).err_termcolor() + } } crate struct BasicHost; @@ -50,6 +62,13 @@ impl Host for BasicHost { other => eprintln!("{}", other), } } + + fn out_termcolor(&self) -> termcolor::StandardStream { + termcolor::StandardStream::stdout(termcolor::ColorChoice::Auto) + } + fn err_termcolor(&self) -> termcolor::StandardStream { + termcolor::StandardStream::stderr(termcolor::ColorChoice::Auto) + } } crate fn handle_unexpected( diff --git a/src/errors.rs b/src/errors.rs index 1cbcf044b2..5fbd99ebb9 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,34 +1,102 @@ +use crate::parser::lexer::{Span, SpannedToken}; #[allow(unused)] use crate::prelude::*; -use serde_derive::Serialize; use derive_new::new; +use language_reporting::Diagnostic; +use serde::{Serialize, Serializer}; +use serde_derive::Serialize; + +#[derive(Debug, Eq, PartialEq, Clone, Ord, PartialOrd, Serialize)] +pub enum ShellError { + String(StringError), + Diagnostic(ShellDiagnostic, String), +} + +impl ShellError { + crate fn parse_error( + error: lalrpop_util::ParseError, + source: String, + ) -> ShellError { + use lalrpop_util::ParseError; + use language_reporting::*; + + match error { + ParseError::UnrecognizedToken { + token: (start, SpannedToken { token, .. }, end), + expected, + } => { + let diagnostic = Diagnostic::new( + Severity::Error, + format!("Unexpected {:?}, expected {:?}", token, expected), + ) + .with_label(Label::new_primary(Span::from((start, end)))); + + ShellError::diagnostic(diagnostic, source) + } + + other => ShellError::string(format!("{:?}", other)), + } + } + + crate fn diagnostic(diagnostic: Diagnostic, source: String) -> ShellError { + ShellError::Diagnostic(ShellDiagnostic { diagnostic }, source) + } + + crate fn string(title: impl Into) -> ShellError { + ShellError::String(StringError::new(title.into(), Value::nothing())) + } + + crate fn copy_error(&self) -> ShellError { + self.clone() + } +} + +#[derive(Debug, Clone)] +pub struct ShellDiagnostic { + crate diagnostic: Diagnostic, +} + +impl PartialEq for ShellDiagnostic { + fn eq(&self, _other: &ShellDiagnostic) -> bool { + false + } +} + +impl Eq for ShellDiagnostic {} + +impl std::cmp::PartialOrd for ShellDiagnostic { + fn partial_cmp(&self, _other: &Self) -> Option { + Some(std::cmp::Ordering::Less) + } +} + +impl std::cmp::Ord for ShellDiagnostic { + fn cmp(&self, _other: &Self) -> std::cmp::Ordering { + std::cmp::Ordering::Less + } +} + +impl Serialize for ShellDiagnostic { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + "".serialize(serializer) + } +} #[derive(Debug, Ord, PartialOrd, Eq, PartialEq, new, Clone, Serialize)] -pub struct ShellError { +pub struct StringError { title: String, error: Value, } -impl ShellError { - crate fn string(title: impl Into) -> ShellError { - ShellError::new(title.into(), Value::nothing()) - } - - crate fn copy_error(&self) -> ShellError { - ShellError { - title: self.title.clone(), - error: self.error.copy(), - } - } - - crate fn description(&self) -> String { - self.title.clone() - } -} - impl std::fmt::Display for ShellError { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - write!(f, "{}", &self.title) + match self { + ShellError::String(s) => write!(f, "{}", &s.title), + ShellError::Diagnostic(_, _) => write!(f, ""), + } } } @@ -36,36 +104,36 @@ impl std::error::Error for ShellError {} impl std::convert::From for ShellError { fn from(input: std::io::Error) -> ShellError { - ShellError { + ShellError::String(StringError { title: format!("{}", input), error: Value::nothing(), - } + }) } } impl std::convert::From for ShellError { fn from(_input: futures_sink::VecSinkError) -> ShellError { - ShellError { + ShellError::String(StringError { title: format!("Unexpected Vec Sink Error"), error: Value::nothing(), - } + }) } } impl std::convert::From for ShellError { fn from(input: subprocess::PopenError) -> ShellError { - ShellError { + ShellError::String(StringError { title: format!("{}", input), error: Value::nothing(), - } + }) } } impl std::convert::From> for ShellError { fn from(input: nom::Err<(&str, nom::error::ErrorKind)>) -> ShellError { - ShellError { + ShellError::String(StringError { title: format!("{:?}", input), error: Value::nothing(), - } + }) } } diff --git a/src/evaluate/evaluator.rs b/src/evaluate/evaluator.rs index 02a4cbe86a..b780445e5c 100644 --- a/src/evaluate/evaluator.rs +++ b/src/evaluate/evaluator.rs @@ -32,7 +32,7 @@ fn evaluate_leaf(leaf: &ast::Leaf) -> Value { match leaf { Leaf::String(s) => Value::string(s), - Leaf::Bare(s) => Value::string(s), + Leaf::Bare(path) => Value::string(path.to_string()), Leaf::Boolean(b) => Value::boolean(*b), Leaf::Int(i) => Value::int(*i), } diff --git a/src/object/base.rs b/src/object/base.rs index d7086495c7..e938c54609 100644 --- a/src/object/base.rs +++ b/src/object/base.rs @@ -183,7 +183,6 @@ impl Value { crate fn compare(&self, operator: ast::Operator, other: &Value) -> Option { match operator { - ast::Operator::Equal | ast::Operator::NotEqual => unimplemented!(), _ => { let coerced = coerce_compare(self, other)?; let ordering = coerced.compare(); @@ -192,6 +191,8 @@ impl Value { let result = match (operator, ordering) { (Operator::Equal, Ordering::Equal) => true, + (Operator::NotEqual, Ordering::Less) + | (Operator::NotEqual, Ordering::Greater) => true, (Operator::LessThan, Ordering::Less) => true, (Operator::GreaterThan, Ordering::Greater) => true, (Operator::GreaterThanOrEqual, Ordering::Greater) diff --git a/src/parser.rs b/src/parser.rs index 0db1752686..7fdb19be66 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -3,17 +3,21 @@ crate mod completer; crate mod lexer; crate mod parser; crate mod registry; +crate mod span; crate use ast::{ParsedCommand, Pipeline}; crate use registry::{CommandConfig, CommandRegistry}; use crate::errors::ShellError; +use lexer::Lexer; use parser::PipelineParser; pub fn parse(input: &str, _registry: &dyn CommandRegistry) -> Result { let parser = PipelineParser::new(); + let tokens = Lexer::new(input); - parser - .parse(input) - .map_err(|e| ShellError::string(format!("{:?}", e))) + match parser.parse(tokens) { + Ok(val) => Ok(val), + Err(err) => Err(ShellError::parse_error(err, input.to_string())), + } } diff --git a/src/parser/ast.rs b/src/parser/ast.rs index 4fbc23a6cb..8ccfdf7bf8 100644 --- a/src/parser/ast.rs +++ b/src/parser/ast.rs @@ -1,7 +1,8 @@ +use crate::parser::lexer::SpannedToken; use derive_new::new; use getset::Getters; -use std::str::FromStr; use serde_derive::{Deserialize, Serialize}; +use std::str::FromStr; #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize)] pub enum Operator { @@ -65,9 +66,8 @@ impl Expression { crate fn as_string(&self) -> Option { match self { - Expression::Leaf(Leaf::String(s)) | Expression::Leaf(Leaf::Bare(s)) => { - Some(s.to_string()) - } + Expression::Leaf(Leaf::String(s)) => Some(s.to_string()), + Expression::Leaf(Leaf::Bare(path)) => Some(path.to_string()), _ => None, } } @@ -135,21 +135,58 @@ impl Variable { } } +impl FromStr for Variable { + type Err = (); + fn from_str(input: &str) -> Result::Err> { + Ok(match input { + "it" => Variable::It, + "true" => Variable::True, + "false" => Variable::False, + other => Variable::Other(other.to_string()), + }) + } +} + +#[derive(Debug, Clone, Ord, PartialOrd, Eq, PartialEq)] +pub struct BarePath { + head: String, + tail: Vec, +} + +impl BarePath { + crate fn from_tokens(head: SpannedToken, tail: Vec) -> BarePath { + BarePath { + head: head.to_string(), + tail: tail.iter().map(|i| i.to_string()).collect(), + } + } + + crate fn to_string(&self) -> String { + bare_string(&self.head, &self.tail) + } +} + #[derive(Debug, Clone, Ord, PartialOrd, Eq, PartialEq)] pub enum Leaf { String(String), - Bare(String), + Bare(BarePath), #[allow(unused)] Boolean(bool), Int(i64), } +crate fn bare_string(head: &String, tail: &Vec) -> String { + let mut out = vec![head.clone()]; + out.extend(tail.clone()); + itertools::join(out, ".") +} + impl Leaf { fn print(&self) -> String { match self { Leaf::String(s) => format!("{:?}", s), - Leaf::Bare(s) => format!("{}", s), + Leaf::Bare(path) => format!("{}", path.to_string()), Leaf::Boolean(b) => format!("{}", b), Leaf::Int(i) => format!("{}", i), } diff --git a/src/parser/lexer.rs b/src/parser/lexer.rs index 6c1b688ff5..7c056a84a7 100644 --- a/src/parser/lexer.rs +++ b/src/parser/lexer.rs @@ -1,5 +1,6 @@ use crate::errors::ShellError; use derive_new::new; +use log::debug; use logos_derive::Logos; use std::ops::Range; @@ -68,17 +69,57 @@ crate enum TopToken { #[token = "!="] OpNeq, + #[token = "--"] + DashDash, + + #[token = "-"] + Dash, + #[regex = r"\s+"] Whitespace, } +impl TopToken { + fn to_token(&self) -> Option { + use TopToken::*; + + let result = match self { + END => return None, + Num => Token::Num, + SQString => Token::SQString, + DQString => Token::DQString, + Size => Token::Size, + Dollar => Token::Dollar, + Bare => Token::Bare, + Pipe => Token::Pipe, + Dot => Token::Dot, + OpenBrace => Token::OpenBrace, + CloseBrace => Token::CloseBrace, + OpenParen => Token::OpenParen, + CloseParen => Token::CloseParen, + OpGt => Token::OpGt, + OpLt => Token::OpLt, + OpGte => Token::OpGte, + OpLte => Token::OpLte, + OpEq => Token::OpEq, + OpNeq => Token::OpNeq, + DashDash => Token::DashDash, + Dash => Token::Dash, + Whitespace => Token::Whitespace, + Error => unreachable!("Don't call to_token with the error variant"), + }; + + Some(result) + } +} + fn start_variable(lex: &mut logos::Lexer) { - println!("start_variable EXTRAS={:?}", lex.extras); + debug!("start_variable EXTRAS={:?}", lex.extras); lex.extras.current = LexerStateName::Var; } fn end_bare_variable(lex: &mut logos::Lexer) { - println!("end_variable EXTRAS={:?}", lex.extras); + debug!("end_variable EXTRAS={:?}", lex.extras); lex.extras.current = LexerStateName::AfterVariableToken; } @@ -96,8 +137,22 @@ crate enum VariableToken { Variable, } +impl VariableToken { + fn to_token(&self) -> Option { + use VariableToken::*; + + let result = match self { + END => return None, + Variable => Token::Variable, + Error => unreachable!("Don't call to_token with the error variant"), + }; + + Some(result) + } +} + fn end_variable(lex: &mut logos::Lexer) { - println!("end_variable EXTRAS={:?}", lex.extras); + debug!("end_variable EXTRAS={:?}", lex.extras); lex.extras.current = LexerStateName::AfterVariableToken; } @@ -119,13 +174,28 @@ crate enum AfterVariableToken { Whitespace, } +impl AfterVariableToken { + fn to_token(&self) -> Option { + use AfterVariableToken::*; + + let result = match self { + END => return None, + Dot => Token::Dot, + Whitespace => Token::Whitespace, + Error => unreachable!("Don't call to_token with the error variant"), + }; + + Some(result) + } +} + fn start_member(lex: &mut logos::Lexer) { - println!("start_variable EXTRAS={:?}", lex.extras); + debug!("start_variable EXTRAS={:?}", lex.extras); lex.extras.current = LexerStateName::AfterMemberDot; } fn terminate_variable(lex: &mut logos::Lexer) { - println!("terminate_variable EXTRAS={:?}", lex.extras); + debug!("terminate_variable EXTRAS={:?}", lex.extras); lex.extras.current = LexerStateName::Top; } @@ -146,8 +216,23 @@ crate enum AfterMemberDot { Whitespace, } +impl AfterMemberDot { + fn to_token(&self) -> Option { + use AfterMemberDot::*; + + let result = match self { + END => return None, + Member => Token::Member, + Whitespace => Token::Whitespace, + Error => unreachable!("Don't call to_token with the error variant"), + }; + + Some(result) + } +} + fn finish_member(lex: &mut logos::Lexer) { - println!("finish_member EXTRAS={:?}", lex.extras); + debug!("finish_member EXTRAS={:?}", lex.extras); lex.extras.current = LexerStateName::AfterVariableToken; } @@ -175,43 +260,117 @@ impl logos::Extras for LexerState { fn on_whitespace(&mut self, _byte: u8) {} } +#[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd)] +pub struct Span { + start: usize, + end: usize, + // source: &'source str, +} + +impl From<(usize, usize)> for Span { + fn from(input: (usize, usize)) -> Span { + Span { + start: input.0, + end: input.1, + } + } +} + +impl From<&std::ops::Range> for Span { + fn from(input: &std::ops::Range) -> Span { + Span { + start: input.start, + end: input.end, + } + } +} + +impl Span { + fn new(range: &Range) -> Span { + Span { + start: range.start, + end: range.end, + // source, + } + } +} + +impl language_reporting::ReportingSpan for Span { + fn with_start(&self, start: usize) -> Self { + Span { + start, + end: self.end, + } + } + + fn with_end(&self, end: usize) -> Self { + Span { + start: self.start, + end, + } + } + + fn start(&self) -> usize { + self.start + } + + fn end(&self) -> usize { + self.end + } +} + #[derive(new, Debug, Clone, Eq, PartialEq)] -crate struct SpannedToken<'source, T> { - span: std::ops::Range, - slice: &'source str, - token: T, +pub struct SpannedToken<'source> { + crate span: Span, + crate slice: &'source str, + crate token: Token, +} + +impl SpannedToken<'source> { + crate fn to_string(&self) -> String { + self.slice.to_string() + } + + crate fn as_slice(&self) -> &str { + self.slice + } } #[derive(Debug, Clone, Eq, PartialEq)] -crate enum Token<'source> { - Top(SpannedToken<'source, TopToken>), - Var(SpannedToken<'source, VariableToken>), - Dot(SpannedToken<'source, &'source str>), - Member(SpannedToken<'source, &'source str>), - Whitespace(SpannedToken<'source, &'source str>), +pub enum Token { + Variable, + Dot, + Member, + Num, + SQString, + DQString, + Size, + Dollar, + Bare, + Pipe, + OpenBrace, + CloseBrace, + OpenParen, + CloseParen, + OpGt, + OpLt, + OpGte, + OpLte, + OpEq, + OpNeq, + Dash, + DashDash, + Whitespace, } -impl Token<'source> { - crate fn range(&self) -> &Range { - match self { - Token::Top(spanned) => &spanned.span, - Token::Var(spanned) => &spanned.span, - Token::Dot(spanned) => &spanned.span, - Token::Member(spanned) => &spanned.span, - Token::Whitespace(spanned) => &spanned.span, - } - } - - crate fn slice(&self) -> &str { - match self { - Token::Top(spanned) => spanned.slice, - Token::Var(spanned) => spanned.slice, - Token::Dot(spanned) => spanned.slice, - Token::Member(spanned) => spanned.slice, - Token::Whitespace(spanned) => spanned.slice, - } - } -} +// #[derive(Debug, Clone, Eq, PartialEq)] +// crate enum Token<'source> { +// Top(SpannedToken<'source, TopToken>), +// Var(SpannedToken<'source, VariableToken>), +// Dot(SpannedToken<'source, &'source str>), +// Member(SpannedToken<'source, &'source str>), +// Whitespace(SpannedToken<'source, &'source str>), +// } crate struct Lexer<'source> { lexer: logos::Lexer, @@ -230,30 +389,24 @@ impl Lexer<'source> { } impl Iterator for Lexer<'source> { - type Item = Result, ShellError>; + type Item = Result<(usize, SpannedToken<'source>, usize), ShellError>; + // type Item = Result, ShellError>; fn next(&mut self) -> Option { if self.first { self.first = false; match self.lexer.token { - TopToken::END => None, - TopToken::Whitespace => Some(Ok(Token::Whitespace(SpannedToken::new( - self.lexer.range(), - self.lexer.slice(), - self.lexer.slice(), - )))), - _ => { - let token = Token::Top(SpannedToken::new( - self.lexer.range(), - self.lexer.slice(), - self.lexer.token, - )); - Some(Ok(token)) + TopToken::Error => { + return Some(Err(lex_error(&self.lexer.range(), self.lexer.source))) + } + TopToken::Whitespace => return self.next(), + other => { + return spanned(other.to_token()?, self.lexer.slice(), &self.lexer.range()) } } } else { - println!("STATE={:?}", self.lexer.extras); + debug!("STATE={:?}", self.lexer.extras); match self.lexer.extras.current { LexerStateName::Top => { @@ -261,14 +414,9 @@ impl Iterator for Lexer<'source> { self.lexer = lexer; match token { - TopToken::END => None, - TopToken::Whitespace => Some(Ok(Token::Whitespace(SpannedToken::new( - range, slice, slice, - )))), - other => { - let token = Token::Top(SpannedToken::new(range, slice, other)); - Some(Ok(token)) - } + TopToken::Error => return Some(Err(lex_error(&range, self.lexer.source))), + TopToken::Whitespace => return self.next(), + other => return spanned(other.to_token()?, slice, &range), } } @@ -278,16 +426,11 @@ impl Iterator for Lexer<'source> { self.lexer = lexer; match token { - AfterMemberDot::END => None, AfterMemberDot::Error => { - Some(Err(ShellError::string(&format!("Lex error at {}", slice)))) - } - AfterMemberDot::Whitespace => Some(Ok(Token::Whitespace( - SpannedToken::new(range, slice, slice), - ))), - AfterMemberDot::Member => { - Some(Ok(Token::Member(SpannedToken::new(range, slice, slice)))) + return Some(Err(lex_error(&range, self.lexer.source))) } + AfterMemberDot::Whitespace => self.next(), + other => return spanned(other.to_token()?, slice, &range), } } @@ -297,16 +440,12 @@ impl Iterator for Lexer<'source> { self.lexer = lexer; match token { - AfterVariableToken::END => None, AfterVariableToken::Error => { - Some(Err(ShellError::string(&format!("Lex error at {}", slice)))) - } - AfterVariableToken::Whitespace => Some(Ok(Token::Whitespace( - SpannedToken::new(range, slice, slice), - ))), - AfterVariableToken::Dot => { - Some(Ok(Token::Dot(SpannedToken::new(range, slice, slice)))) + return Some(Err(lex_error(&range, self.lexer.source))) } + AfterVariableToken::Whitespace => self.next(), + + other => return spanned(other.to_token()?, slice, &range), } } @@ -315,11 +454,10 @@ impl Iterator for Lexer<'source> { self.lexer = lexer; match token { - VariableToken::END => None, - other => { - let token = Token::Var(SpannedToken::new(range, slice, other)); - Some(Ok(token)) + VariableToken::Error => { + return Some(Err(lex_error(&range, self.lexer.source))) } + other => return spanned(other.to_token()?, slice, &range), } } } @@ -327,6 +465,25 @@ impl Iterator for Lexer<'source> { } } +fn lex_error(range: &Range, source: &str) -> ShellError { + use language_reporting::*; + + ShellError::diagnostic( + Diagnostic::new(Severity::Error, "Lex error") + .with_label(Label::new_primary(Span::new(range))), + source.to_string(), + ) +} + +fn spanned<'source>( + token: Token, + slice: &'source str, + range: &Range, +) -> Option, usize), ShellError>> { + let token = SpannedToken::new(Span::new(range), slice, token); + Some(Ok((range.start, token, range.end))) +} + fn advance( lexer: logos::Lexer, ) -> ( @@ -348,34 +505,37 @@ where #[cfg(test)] mod tests { use super::*; - use logos::Logos; use pretty_assertions::assert_eq; fn assert_lex(source: &str, tokens: &[TestToken<'_>]) { let lex = Lexer::new(source); let mut current = 0; - let expected_tokens: Vec = tokens + let expected_tokens: Vec = tokens .iter() - .map(|token_desc| { - println!("{:?}", token_desc); + .filter_map(|token_desc| { + debug!("{:?}", token_desc); let len = token_desc.source.len(); let range = current..(current + len); - let token = token_desc.to_token(range); + let token = token_desc.to_token(&range); current = current + len; - token + if let SpannedToken { + token: Token::Whitespace, + .. + } = token + { + None + } else { + Some(token) + } }) .collect(); - let actual_tokens: Result, _> = lex - .map(|i| { - println!("{:?}", i); - i - }) - .collect(); + let actual_tokens: Result, _> = + lex.map(|result| result.map(|(_, i, _)| i)).collect(); let actual_tokens = actual_tokens.unwrap(); @@ -397,18 +557,23 @@ mod tests { } impl TestToken<'source> { - fn to_token(&self, span: std::ops::Range) -> Token { + fn to_token(&self, range: &std::ops::Range) -> SpannedToken<'source> { match self.desc { TokenDesc::Top(TopToken::Dot) => { - Token::Dot(SpannedToken::new(span, self.source, ".")) + SpannedToken::new(Span::new(range), self.source, Token::Dot) + } + TokenDesc::Top(tok) => { + SpannedToken::new(Span::new(range), self.source, tok.to_token().unwrap()) + } + TokenDesc::Var(tok) => { + SpannedToken::new(Span::new(range), self.source, tok.to_token().unwrap()) } - TokenDesc::Top(tok) => Token::Top(SpannedToken::new(span, self.source, tok)), - TokenDesc::Var(tok) => Token::Var(SpannedToken::new(span, self.source, tok)), TokenDesc::Member => { - Token::Member(SpannedToken::new(span, self.source, self.source)) + SpannedToken::new(Span::new(range), self.source, Token::Member) } + TokenDesc::Ws => { - Token::Whitespace(SpannedToken::new(span, self.source, self.source)) + SpannedToken::new(Span::new(range), self.source, Token::Whitespace) } } } diff --git a/src/parser/parser.lalrpop b/src/parser/parser.lalrpop index ec1f1ed4c3..0556e963cb 100644 --- a/src/parser/parser.lalrpop +++ b/src/parser/parser.lalrpop @@ -1,8 +1,11 @@ -use std::str::FromStr; -use byte_unit::Byte; -use crate::parser::ast::*; +#![allow(unused)] -grammar; +use std::str::FromStr; +use crate::parser::ast::*; +use crate::prelude::*; +use crate::parser::lexer::{SpannedToken, Token}; + +grammar<'input>; pub Pipeline: Pipeline = { => Pipeline::new(vec![first]), @@ -10,19 +13,20 @@ pub Pipeline: Pipeline = { } Command: ParsedCommand = { - => ParsedCommand::new(command, expr), - => ParsedCommand::new(command, vec![expr]), + => ParsedCommand::new(command.to_string(), vec![]), + => ParsedCommand::new(command.to_string(), expr), + => ParsedCommand::new(command.to_string(), vec![expr]), } Leaf: Expression = { => Expression::Leaf(Leaf::String(<>)), - => Expression::Leaf(Leaf::Int(<>)), - => Expression::Leaf(Leaf::Int(<>)), + => Expression::Leaf(Leaf::Int(<>)), + // => Expression::Leaf(Leaf::Int(<>)), => Expression::VariableReference(<>), } BinaryExpression: Expression = { - => Expression::Binary(Box::new(Binary::new(left, op, right))), + => Expression::Binary(Box::new(Binary::new(left, op, right))), } Parenthesized: Expression = { @@ -45,25 +49,26 @@ WholeExpression: Expression = { , } +PathHead: Expression = { + , + => Expression::Leaf(Leaf::Bare(<>)), +} + PathExpression: Expression = { )+> => Expression::Path(Box::new(Path::new(head, tail))) } Expr: Expression = { - => Expression::Leaf(Leaf::Bare(<>)), - => <>, - + , + } Variable: Variable = { - "$true" => Variable::True, - "$false" => Variable::False, - "$it" => Variable::It, - => Variable::Other(<>[1..].to_string()), + "$" <"variable"> => Variable::from_str(<>.as_slice()).unwrap(), } Member: String = { - , + <"member"> => <>.to_string(), } @@ -77,22 +82,49 @@ Operator: Operator = { } Flag: Flag = { - "-" => Flag::Shorthand(<>.to_string()), - "--" => Flag::Longhand(<>.to_string()), + "-" => Flag::Shorthand(<>.to_string()), + "--" => Flag::Longhand(<>.to_string()), } String: String = { - SQString, - DQString, + <"sqstring"> => <>.as_slice()[1..(<>.as_slice().len() - 1)].to_string(), + <"dqstring"> => <>.as_slice()[1..(<>.as_slice().len() - 1)].to_string() } -BareWord = { - , +BarePath: BarePath = { + )*> => BarePath::from_tokens(head, tail) } -VariableBody: &'input str = => <>; -RawBareWord: String = => <>.to_string(); -DQString: String = => s[1..s.len() - 1].to_string(); -SQString: String = => s[1..s.len() - 1].to_string(); -Num: i64 = => i64::from_str(s).unwrap(); -Size: i64 = => Byte::from_string(s).unwrap().get_bytes() as i64; +Int: i64 = { + <"num"> => i64::from_str(<>.as_slice()).unwrap() +} + +extern { + type Location = usize; + type Error = ShellError; + + enum SpannedToken<'input> { + "." => SpannedToken { token: Token::Dot, .. }, + "|" => SpannedToken { token: Token::Pipe, .. }, + "(" => SpannedToken { token: Token::OpenParen, .. }, + ")" => SpannedToken { token: Token::CloseParen, .. }, + "{" => SpannedToken { token: Token::OpenBrace, .. }, + "}" => SpannedToken { token: Token::CloseBrace, .. }, + "==" => SpannedToken { token: Token::OpEq, .. }, + "!=" => SpannedToken { token: Token::OpNeq, .. }, + "<" => SpannedToken { token: Token::OpLt, .. }, + "<=" => SpannedToken { token: Token::OpLte, .. }, + ">" => SpannedToken { token: Token::OpGt, .. }, + ">=" => SpannedToken { token: Token::OpGte, .. }, + "-" => SpannedToken { token: Token::Dash, .. }, + "--" => SpannedToken { token: Token::DashDash, .. }, + "$" => SpannedToken { token: Token::Dollar, .. }, + "num" => SpannedToken { token: Token::Num, .. }, + "member" => SpannedToken { token: Token::Member, .. }, + "variable" => SpannedToken { token: Token::Variable, .. }, + "bare" => SpannedToken { token: Token::Bare, .. }, + "dqstring" => SpannedToken { token: Token::DQString, .. }, + "sqstring" => SpannedToken { token: Token::SQString, .. }, + "size" => SpannedToken { token: Token::Size, .. }, + } +} \ No newline at end of file diff --git a/src/parser/parser.rs b/src/parser/parser.rs index 9233ad6909..1c857af8f4 100644 --- a/src/parser/parser.rs +++ b/src/parser/parser.rs @@ -1,8 +1,10 @@ // auto-generated: "lalrpop 0.17.0" -// sha256: b14d4daa8f97f546c3e6e2cb4a931d9bb69a859a6548dc32fc3a984d93cbc +// sha256: b82840a51b10edc8c46329da103254cdd83b8f03b21f19f5392bd21f8f459ea +#![allow(unused)] use std::str::FromStr; -use byte_unit::Byte; use crate::parser::ast::*; +use crate::prelude::*; +use crate::parser::lexer::{SpannedToken, Token}; #[allow(unused_extern_crates)] extern crate lalrpop_util as __lalrpop_util; #[allow(unused_imports)] @@ -13,419 +15,408 @@ mod __parse__Pipeline { #![allow(non_snake_case, non_camel_case_types, unused_mut, unused_variables, unused_imports, unused_parens)] use std::str::FromStr; - use byte_unit::Byte; use crate::parser::ast::*; + use crate::prelude::*; + use crate::parser::lexer::{SpannedToken, Token}; #[allow(unused_extern_crates)] extern crate lalrpop_util as __lalrpop_util; #[allow(unused_imports)] use self::__lalrpop_util::state_machine as __state_machine; - use super::__intern_token::Token; + use super::__ToTriple; #[allow(dead_code)] pub enum __Symbol<'input> { - Variant0(&'input str), - Variant1(String), - Variant2(::std::vec::Vec), - Variant3(ParsedCommand), - Variant4(::std::vec::Vec), - Variant5(Expression), - Variant6(::std::vec::Vec), - Variant7(Flag), - Variant8(i64), - Variant9(Operator), - Variant10(Pipeline), - Variant11(Variable), + Variant0(SpannedToken<'input>), + Variant1(::std::vec::Vec>), + Variant2(String), + Variant3(::std::vec::Vec), + Variant4(ParsedCommand), + Variant5(::std::vec::Vec), + Variant6(Expression), + Variant7(BarePath), + Variant8(::std::vec::Vec), + Variant9(Flag), + Variant10(i64), + Variant11(Operator), + Variant12(Pipeline), + Variant13(Variable), } const __ACTION: &'static [i8] = &[ // State 0 - 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 1 - 0, 24, 25, 26, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, -13, 0, 29, 30, 31, 32, 6, 33, + 0, 20, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 22, 0, 23, 0, 24, 0, 25, -19, 0, // State 2 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 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, 0, 0, 27, 0, // State 3 - 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 4 - -9, -9, -9, -9, -9, 0, 0, 0, -9, -9, -9, -9, -9, -9, -9, -9, 0, -9, -9, -9, -9, -9, -9, + -14, -14, -14, -14, 0, 0, 29, -14, -14, -14, -14, -14, -14, -14, 0, -14, 0, -14, 0, -14, -14, -14, // State 5 - -44, -44, -44, -44, -44, 0, 0, 0, -44, -44, -44, -44, -44, -44, -44, -44, 0, -44, -44, -44, -44, -44, -44, + -50, -50, -50, -50, 0, 0, -50, -50, -50, -50, -50, -50, -50, -50, 0, -50, 0, -50, 0, -50, -50, -50, // State 6 - -54, -54, -54, -54, -54, 0, 0, 0, -54, -54, -54, -54, -54, -54, -54, -54, 0, -54, -54, -54, -54, -54, -54, + -44, -44, -44, -44, 0, 0, 0, -44, -44, -44, -44, -44, -44, -44, 0, -44, 0, -44, 0, -44, -44, -44, // State 7 - -17, -17, -17, -17, -17, 0, 0, 0, 0, -17, -17, -17, -17, -17, -17, -17, 0, -17, -17, -17, -17, -17, -17, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -21, 0, // State 8 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, 0, 0, 0, 0, 0, 0, 0, + -51, -51, -51, -51, 0, 0, -51, -51, -51, -51, -51, -51, -51, -51, 0, -51, 0, -51, 0, -51, -51, -51, // State 9 - -55, -55, -55, -55, -55, 0, 0, 0, -55, -55, -55, -55, -55, -55, -55, -55, 0, -55, -55, -55, -55, -55, -55, + 31, -24, -24, 0, 0, 0, 0, 32, 33, 34, 35, 36, -24, -24, 0, -24, 0, -24, 0, -24, -24, 0, // State 10 - -48, -48, -48, -48, -48, -48, 0, 0, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + 0, 20, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 22, 0, 23, 0, 24, 0, 25, -20, 0, // State 11 - 37, -22, -22, -22, -22, 0, 0, 0, 0, 38, 39, 40, 41, 42, -22, -22, 0, -22, -22, -22, -22, -22, -22, + -30, -30, -30, -30, 0, 0, -30, -30, -30, -30, -30, -30, -30, -30, 0, -30, 0, -30, 0, -30, -30, -30, // State 12 - 0, 24, 25, 26, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, -14, 0, 29, 30, 31, 32, 6, 33, + -13, -13, -13, -13, 0, 0, -13, -13, -13, -13, -13, -13, -13, -13, 0, -13, 0, -13, 0, -13, -13, -13, // State 13 - -8, -8, -8, -8, -8, 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, + -12, -12, -12, -12, 0, 0, -12, -12, -12, -12, -12, -12, -12, -12, 0, -12, 0, -12, 0, -12, -12, -12, // State 14 - -27, -27, -27, -27, -27, -27, 0, 0, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -22, -22, -22, -22, 0, 0, 0, -22, -22, -22, -22, -22, -22, -22, 0, -22, 0, -22, 0, -22, -22, -22, // State 15 - -7, -7, -7, -7, -7, 0, 0, 0, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, + -23, -23, -23, -23, 0, 0, 0, -23, -23, -23, -23, -23, -23, -23, 0, -23, 0, -23, 0, -23, -23, -23, // State 16 - -19, -19, -19, -19, -19, 0, 0, 0, 0, -19, -19, -19, -19, -19, -19, -19, 0, -19, -19, -19, -19, -19, -19, + -29, -29, -29, -29, 0, 0, -29, -29, -29, -29, -29, -29, -29, -29, 0, -29, 0, -29, 0, -29, -29, -29, // State 17 - -47, -47, -47, -47, -47, -47, 0, 0, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, + -31, -31, -31, -31, 0, 0, -31, -31, -31, -31, -31, -31, -31, -31, 0, -31, 0, -31, 0, -31, -31, -31, // State 18 - -28, -28, -28, -28, -28, -28, 0, 0, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -43, -43, -43, -43, 0, 0, 39, -43, -43, -43, -43, -43, -43, -43, 0, -43, 0, -43, 0, -43, -43, -43, // State 19 - -26, -26, -26, -26, -26, -26, 0, 0, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, // State 20 - -29, -29, -29, -29, -29, -29, 0, 0, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + 0, 20, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 22, 0, 23, 0, 24, 0, 25, 0, 0, // State 21 - -52, -52, -52, -52, -52, -52, 0, 0, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, + -48, -48, -48, -48, 0, 0, -48, -48, -48, -48, -48, -48, -48, -48, 0, -48, 0, -48, 0, -48, -48, -48, // State 22 - -18, -18, -18, -18, -18, 0, 0, 0, 45, -18, -18, -18, -18, -18, -18, -18, 0, -18, -18, -18, -18, -18, -18, + -28, -28, -28, -28, 0, 0, -28, -28, -28, -28, -28, -28, -28, -28, 0, -28, 0, -28, 0, -28, -28, -28, // State 23 - -50, -50, -50, -50, -50, -50, 0, 0, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -47, -47, -47, -47, 0, 0, -47, -47, -47, -47, -47, -47, -47, -47, 0, -47, 0, -47, 0, -47, -47, -47, // State 24 - -51, -51, -51, -51, -51, -51, 0, 0, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + 0, 20, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 22, 0, 23, 0, 24, 0, 25, 0, 0, // State 25 - -49, -49, -49, -49, -49, -49, 0, 0, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, // State 26 - 0, 24, 25, 26, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 29, 30, 31, 32, 6, 33, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 27 - 0, 24, 25, 26, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 29, 30, 31, 32, 6, 33, + -15, -15, -15, -15, 0, 0, 48, -15, -15, -15, -15, -15, -15, -15, 0, -15, 0, -15, 0, -15, -15, -15, // State 28 - -16, -16, -16, -16, -16, -16, 0, 0, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 0, // State 29 - -45, -45, -45, -45, -45, -45, 0, 0, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + 0, 20, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 22, 0, 23, 0, 24, 0, 25, 0, 0, // State 30 - -32, -32, -32, -32, -32, -32, 0, 0, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + 0, -35, -35, 0, 0, 0, 0, 0, 0, 0, 0, 0, -35, -35, 0, -35, 0, -35, 0, -35, 0, 0, // State 31 - -46, -46, -46, -46, -46, -46, 0, 0, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, + 0, -36, -36, 0, 0, 0, 0, 0, 0, 0, 0, 0, -36, -36, 0, -36, 0, -36, 0, -36, 0, 0, // State 32 - -53, -53, -53, -53, -53, -53, 0, 0, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + 0, -38, -38, 0, 0, 0, 0, 0, 0, 0, 0, 0, -38, -38, 0, -38, 0, -38, 0, -38, 0, 0, // State 33 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, + 0, -34, -34, 0, 0, 0, 0, 0, 0, 0, 0, 0, -34, -34, 0, -34, 0, -34, 0, -34, 0, 0, // State 34 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, + 0, -37, -37, 0, 0, 0, 0, 0, 0, 0, 0, 0, -37, -37, 0, -37, 0, -37, 0, -37, 0, 0, // State 35 - 0, 24, 25, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 30, 31, 32, 0, 33, + 0, -39, -39, 0, 0, 0, 0, 0, 0, 0, 0, 0, -39, -39, 0, -39, 0, -39, 0, -39, 0, 0, // State 36 - 0, -34, -34, -34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -34, -34, -34, -34, 0, -34, + 0, -25, -25, 0, 0, 0, 0, 0, 0, 0, 0, 0, -25, -25, 0, -25, 0, -25, 0, -25, -25, 0, // State 37 - 0, -35, -35, -35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -35, -35, -35, -35, 0, -35, + -42, -42, -42, -42, 0, 0, 51, -42, -42, -42, -42, -42, -42, -42, 0, -42, 0, -42, 0, -42, -42, -42, // State 38 - 0, -37, -37, -37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -37, -37, -37, -37, 0, -37, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 54, 0, 0, 24, 0, 0, 0, 0, // State 39 - 0, -33, -33, -33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -33, -33, -33, -33, 0, -33, + -49, -49, -49, -49, 0, 0, -49, -49, -49, -49, -49, -49, -49, -49, 0, -49, 0, -49, 0, -49, -49, -49, // State 40 - 0, -36, -36, -36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -36, -36, -36, -36, 0, -36, + 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 41 - 0, -38, -38, -38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -38, -38, -38, -38, 0, -38, + 31, 0, 0, 0, 0, 0, 0, 32, 33, 34, 35, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 42 - 0, -23, -23, -23, -23, 0, 0, 0, 0, 0, 0, 0, 0, 0, -23, -23, 0, -23, -23, -23, -23, -23, -23, + -13, 0, 0, 56, 0, 0, -13, -13, -13, -13, -13, -13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 43 - -41, -41, -41, -41, -41, 0, 0, 0, 54, -41, -41, -41, -41, -41, -41, -41, 0, -41, -41, -41, -41, -41, -41, + -50, 0, 0, 0, 0, 0, -50, -50, -50, -50, -50, -50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, // State 44 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 30, 0, 0, 6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, // State 45 - 0, 0, 0, 0, 0, 58, 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, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 46 - 37, 0, 0, 0, 0, 0, 0, 0, 0, 38, 39, 40, 41, 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, 0, 0, 0, 0, 0, -10, 0, // State 47 - -8, 0, 0, 0, 0, 59, 0, 0, -8, -8, -8, -8, -8, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, // State 48 - -54, 0, 0, 0, 0, 0, 0, 0, -54, -54, -54, -54, -54, -54, 0, 0, 60, 0, 0, 0, 0, 0, 0, + -4, -4, -4, -4, 0, 0, -4, -4, -4, -4, -4, -4, -4, -4, 0, -4, 0, -4, 0, -4, -4, -4, // State 49 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, + 0, 0, 0, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16, -16, // State 50 - 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 22, 54, 0, 0, 24, 0, 0, 0, 0, // State 51 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0, 0, 0, 0, 0, + -7, -7, -7, -7, 0, 0, -7, -7, -7, -7, -7, -7, -7, -7, 0, -7, 0, -7, 0, -7, -7, -7, // State 52 - 0, 0, 0, 0, 0, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10, -10, 0, 0, 0, 0, 0, 0, + -33, -33, -33, -33, 0, 0, -33, -33, -33, -33, -33, -33, -33, -33, 0, -33, 0, -33, 0, -33, -33, -33, // State 53 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 30, 0, 0, 6, 0, + -32, -32, -32, -32, 0, 0, -32, -32, -32, -32, -32, -32, -32, -32, 0, -32, 0, -32, 0, -32, -32, -32, // State 54 - -30, -30, -30, -30, -30, 0, 0, 0, -30, -30, -30, -30, -30, -30, -30, -30, 0, -30, -30, -30, -30, -30, -30, + -41, -41, -41, -41, 0, 0, -41, -41, -41, -41, -41, -41, -41, -41, 0, -41, 0, -41, 0, -41, -41, -41, // State 55 - -2, -2, -2, -2, -2, 0, 0, 0, -2, -2, -2, -2, -2, -2, -2, -2, 0, -2, -2, -2, -2, -2, -2, + -40, -40, -40, -40, 0, 0, -40, -40, -40, -40, -40, -40, -40, -40, 0, -40, 0, -40, 0, -40, -40, -40, // State 56 - -31, -31, -31, -31, -31, 0, 0, 0, -31, -31, -31, -31, -31, -31, -31, -31, 0, -31, -31, -31, -31, -31, -31, + -17, -17, -17, -17, 0, 0, -17, -17, -17, -17, -17, -17, -17, -17, 0, -17, 0, -17, 0, -17, -17, -17, // State 57 - -40, -40, -40, -40, -40, 0, 0, 0, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, + -18, -18, -18, -18, 0, 0, -18, -18, -18, -18, -18, -18, -18, -18, 0, -18, 0, -18, 0, -18, -18, -18, // State 58 - -39, -39, -39, -39, -39, 0, 0, 0, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -11, 0, // State 59 - -11, -11, -11, -11, -11, 0, 0, 0, -11, -11, -11, -11, -11, -11, -11, -11, 0, -11, -11, -11, -11, -11, -11, + -5, -5, -5, -5, 0, 0, -5, -5, -5, -5, -5, -5, -5, -5, 0, -5, 0, -5, 0, -5, -5, -5, // State 60 - -12, -12, -12, -12, -12, 0, 0, 0, -12, -12, -12, -12, -12, -12, -12, -12, 0, -12, -12, -12, -12, -12, -12, - // State 61 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, - // State 62 - -3, -3, -3, -3, -3, 0, 0, 0, -3, -3, -3, -3, -3, -3, -3, -3, 0, -3, -3, -3, -3, -3, -3, + -8, -8, -8, -8, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, 0, -8, 0, -8, 0, -8, -8, -8, ]; const __EOF_ACTION: &'static [i8] = &[ // State 0 0, // State 1 - -13, - // State 2 - -42, - // State 3 - -56, - // State 4 - -9, - // State 5 - -44, - // State 6 - -54, - // State 7 - -17, - // State 8 - -15, - // State 9 - -55, - // State 10 - -48, - // State 11 - -22, - // State 12 - -14, - // State 13 - -8, - // State 14 - -27, - // State 15 - -7, - // State 16 -19, - // State 17 - -47, - // State 18 - -28, - // State 19 - -26, - // State 20 - -29, - // State 21 + // State 2 + -45, + // State 3 -52, - // State 22 - -18, - // State 23 + // State 4 + -14, + // State 5 -50, - // State 24 + // State 6 + -44, + // State 7 + -21, + // State 8 -51, + // State 9 + -24, + // State 10 + -20, + // State 11 + -30, + // State 12 + -13, + // State 13 + -12, + // State 14 + -22, + // State 15 + -23, + // State 16 + -29, + // State 17 + -31, + // State 18 + -43, + // State 19 + 0, + // State 20 + 0, + // State 21 + -48, + // State 22 + -28, + // State 23 + -47, + // State 24 + 0, // State 25 - -49, + -46, // State 26 0, // State 27 - 0, + -15, // State 28 - -16, + 0, // State 29 - -45, + 0, // State 30 - -32, + 0, // State 31 - -46, + 0, // State 32 - -53, + 0, // State 33 - -43, + 0, // State 34 0, // State 35 0, // State 36 - 0, + -25, // State 37 - 0, + -42, // State 38 0, // State 39 - 0, + -49, // State 40 0, // State 41 0, // State 42 - -23, + 0, // State 43 - -41, + 0, // State 44 0, // State 45 0, // State 46 - 0, + -10, // State 47 0, // State 48 - 0, + -4, // State 49 - 0, + -16, // State 50 0, // State 51 - -5, + -7, // State 52 - -10, + -33, // State 53 - 0, + -32, // State 54 - -30, + -41, // State 55 - -2, - // State 56 - -31, - // State 57 -40, + // State 56 + -17, + // State 57 + -18, // State 58 - -39, - // State 59 -11, + // State 59 + -5, // State 60 - -12, - // State 61 - -6, - // State 62 - -3, + -8, ]; const __GOTO: &'static [i8] = &[ // State 0 - 0, 0, 0, 0, 0, 2, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, // State 1 - 0, 0, 0, 0, 7, 8, 9, 10, 0, 11, 12, 0, 13, 0, 14, 0, 15, 0, 16, 17, 0, 5, 18, 19, 20, 21, 22, 23, 0, + 0, 0, 0, 0, 0, 0, 0, 6, 7, 8, 9, 0, 10, 11, 0, 12, 13, 0, 0, 14, 15, 16, 0, 17, 18, 19, 0, // State 2 - 0, 0, 0, 34, 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, + 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 3 - 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, 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, 0, 0, 0, 0, 0, 0, // State 4 - 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, 0, 0, 0, 0, + 0, 0, 28, 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 5 - 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, 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, 0, 0, 0, 0, 0, 0, // State 6 - 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, 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, 0, 0, 0, 0, 0, 0, // State 7 - 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, 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, 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, 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, 0, 0, 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, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 6, 7, 0, 9, 0, 37, 0, 0, 12, 13, 0, 0, 14, 15, 16, 0, 17, 18, 19, 0, // State 11 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 12 - 0, 0, 0, 0, 7, 8, 0, 10, 0, 11, 43, 0, 0, 0, 14, 0, 15, 0, 16, 17, 0, 5, 18, 19, 20, 21, 22, 23, 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, 0, 0, 0, // State 13 - 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, // State 15 - 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, 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, 0, 0, 0, 0, 0, 0, // State 16 - 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 20 - 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, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 6, 7, 41, 9, 0, 42, 0, 0, 12, 43, 0, 0, 14, 15, 16, 0, 17, 18, 19, 0, // State 21 - 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, 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, 0, 0, 0, 0, 0, 0, // State 22 - 0, 44, 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, 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, 0, 0, 0, 0, // State 23 - 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, 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, 0, 0, 0, 0, 0, 0, // State 24 - 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, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 44, 7, 45, 9, 0, 42, 0, 0, 12, 13, 0, 0, 14, 15, 16, 0, 17, 18, 19, 0, // State 25 - 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, 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, 0, 0, 0, 0, 0, 0, // State 26 - 0, 0, 0, 0, 7, 8, 46, 10, 0, 11, 47, 0, 0, 0, 48, 0, 15, 0, 16, 17, 0, 5, 18, 19, 20, 21, 22, 23, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 27 - 0, 0, 0, 0, 49, 8, 50, 10, 0, 11, 47, 0, 0, 0, 14, 0, 15, 0, 16, 17, 0, 5, 18, 19, 20, 21, 22, 23, 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, 0, 0, 0, // State 28 - 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, 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, 0, 0, 0, 0, 0, 0, // State 29 - 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, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 6, 7, 0, 9, 0, 50, 0, 0, 12, 13, 0, 0, 14, 15, 16, 0, 17, 18, 19, 0, // State 30 - 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, 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, 0, 0, 0, 0, 0, 0, // State 31 - 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, 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, 0, 0, 0, 0, 0, 0, // State 32 - 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, 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, 0, 0, 0, 0, 0, 0, // State 33 - 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, 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, 0, 0, 0, 0, 0, 0, // State 34 - 0, 0, 0, 0, 0, 2, 0, 0, 52, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 35 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 53, 0, 15, 0, 0, 0, 0, 0, 18, 19, 20, 21, 22, 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, 0, 0, 0, 0, // State 36 - 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, 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, 0, 0, 0, 0, 0, 0, // State 37 - 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, 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, 0, 0, 0, 0, 0, 0, // State 38 - 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, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, 0, 0, 53, 0, 0, 0, // State 39 - 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, 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, 0, 0, 0, 0, 0, 0, // State 40 - 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, 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, 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, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, // State 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, 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, 0, 0, 0, 0, 0, 0, 0, // State 43 - 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, 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, 0, 0, 0, 0, 0, 0, // State 44 - 0, 0, 0, 0, 0, 55, 0, 0, 0, 11, 0, 0, 0, 0, 0, 56, 0, 0, 0, 0, 0, 5, 18, 0, 57, 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, 0, 0, 0, 0, 0, 0, // State 45 - 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, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 46 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 47 - 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, 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, 0, 0, 0, 0, 0, 0, // State 48 - 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, 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, 0, 0, 0, 0, 0, 0, // State 49 - 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, 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, 0, 0, 0, 0, 0, 0, // State 50 - 0, 0, 0, 0, 0, 2, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, 53, 0, 0, 0, // State 51 - 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, 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, 0, 0, 0, 0, 0, 0, // State 52 - 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, 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, 0, 0, 0, 0, 0, 0, // State 53 - 0, 0, 0, 0, 0, 55, 0, 0, 0, 11, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 5, 18, 0, 57, 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, 0, 0, 0, 0, 0, 0, // State 54 - 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, 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, 0, 0, 0, 0, 0, 0, // State 55 - 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, 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, 0, 0, 0, 0, 0, 0, // State 56 - 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, 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, 0, 0, 0, 0, 0, 0, // State 57 - 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, 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, 0, 0, 0, 0, 0, 0, // State 58 - 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, 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, 0, 0, 0, 0, 0, 0, // State 59 - 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, 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, 0, 0, 0, 0, 0, 0, // State 60 - 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, 0, 0, 0, 0, - // State 61 - 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, 0, 0, 0, 0, - // State 62 - 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, 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, 0, 0, 0, 0, 0, 0, ]; fn __expected_tokens(__state: usize) -> Vec<::std::string::String> { const __TERMINAL: &'static [&'static str] = &[ r###""!=""###, - r###""$false""###, - r###""$it""###, - r###""$true""###, + r###""$""###, r###""(""###, r###"")""###, r###""-""###, @@ -436,17 +427,18 @@ mod __parse__Pipeline { r###""==""###, r###"">""###, r###"">=""###, + r###""bare""###, + r###""dqstring""###, + r###""member""###, + r###""num""###, + r###""size""###, + r###""sqstring""###, + r###""variable""###, r###""{""###, r###""|""###, r###""}""###, - r###"r#"\"([^\"]|\\\\\")*\""#"###, - r###"r#"\'([^\']|\\\\\')*\'"#"###, - r###"r#"-?[0-9]+"#"###, - r###"r#"-?[0-9]+[A-Za-z]+"#"###, - r###"r#"[^0-9\"\'$\\-\\.][^\\s\"\']*"#"###, - r###"r#"\\$\\p{XID_Start}(\\p{XID_Continue}|[\\-?!])*"#"###, ]; - __ACTION[(__state * 23)..].iter().zip(__TERMINAL).filter_map(|(&state, terminal)| { + __ACTION[(__state * 22)..].iter().zip(__TERMINAL).filter_map(|(&state, terminal)| { if state == 0 { None } else { @@ -457,15 +449,14 @@ mod __parse__Pipeline { pub struct __StateMachine<'input> where { - input: &'input str, __phantom: ::std::marker::PhantomData<(&'input ())>, } impl<'input> __state_machine::ParserDefinition for __StateMachine<'input> where { type Location = usize; - type Error = &'static str; - type Token = Token<'input>; + type Error = ShellError; + type Token = SpannedToken<'input>; type TokenIndex = usize; type Symbol = __Symbol<'input>; type Success = Pipeline; @@ -491,12 +482,12 @@ mod __parse__Pipeline { #[inline] fn action(&self, state: i8, integer: usize) -> i8 { - __ACTION[(state as usize) * 23 + integer] + __ACTION[(state as usize) * 22 + integer] } #[inline] fn error_action(&self, state: i8) -> i8 { - __ACTION[(state as usize) * 23 + (23 - 1)] + __ACTION[(state as usize) * 22 + (22 - 1)] } #[inline] @@ -506,7 +497,7 @@ mod __parse__Pipeline { #[inline] fn goto(&self, state: i8, nt: usize) -> i8 { - __GOTO[(state as usize) * 29 + nt] - 1 + __GOTO[(state as usize) * 27 + nt] - 1 } fn token_to_symbol(&self, token_index: usize, token: Self::Token) -> Self::Symbol { @@ -538,7 +529,6 @@ mod __parse__Pipeline { symbols: &mut Vec<__state_machine::SymbolTriple>, ) -> Option<__state_machine::ParseResult> { __reduce( - self.input, action, start_location, states, @@ -554,34 +544,33 @@ mod __parse__Pipeline { fn __token_to_integer< 'input, >( - __token: &Token<'input>, + __token: &SpannedToken<'input>, _: ::std::marker::PhantomData<(&'input ())>, ) -> Option { match *__token { - Token(6, _) if true => Some(0), - Token(7, _) if true => Some(1), - Token(8, _) if true => Some(2), - Token(9, _) if true => Some(3), - Token(10, _) if true => Some(4), - Token(11, _) if true => Some(5), - Token(12, _) if true => Some(6), - Token(13, _) if true => Some(7), - Token(14, _) if true => Some(8), - Token(15, _) if true => Some(9), - Token(16, _) if true => Some(10), - Token(17, _) if true => Some(11), - Token(18, _) if true => Some(12), - Token(19, _) if true => Some(13), - Token(20, _) if true => Some(14), - Token(21, _) if true => Some(15), - Token(22, _) if true => Some(16), - Token(0, _) if true => Some(17), - Token(1, _) if true => Some(18), - Token(2, _) if true => Some(19), - Token(3, _) if true => Some(20), - Token(4, _) if true => Some(21), - Token(5, _) if true => Some(22), + SpannedToken { token: Token::OpNeq, .. } if true => Some(0), + SpannedToken { token: Token::Dollar, .. } if true => Some(1), + SpannedToken { token: Token::OpenParen, .. } if true => Some(2), + SpannedToken { token: Token::CloseParen, .. } if true => Some(3), + SpannedToken { token: Token::Dash, .. } if true => Some(4), + SpannedToken { token: Token::DashDash, .. } if true => Some(5), + SpannedToken { token: Token::Dot, .. } if true => Some(6), + SpannedToken { token: Token::OpLt, .. } if true => Some(7), + SpannedToken { token: Token::OpLte, .. } if true => Some(8), + SpannedToken { token: Token::OpEq, .. } if true => Some(9), + SpannedToken { token: Token::OpGt, .. } if true => Some(10), + SpannedToken { token: Token::OpGte, .. } if true => Some(11), + SpannedToken { token: Token::Bare, .. } if true => Some(12), + SpannedToken { token: Token::DQString, .. } if true => Some(13), + SpannedToken { token: Token::Member, .. } if true => Some(14), + SpannedToken { token: Token::Num, .. } if true => Some(15), + SpannedToken { token: Token::Size, .. } if true => Some(16), + SpannedToken { token: Token::SQString, .. } if true => Some(17), + SpannedToken { token: Token::Variable, .. } if true => Some(18), + SpannedToken { token: Token::OpenBrace, .. } if true => Some(19), + SpannedToken { token: Token::Pipe, .. } if true => Some(20), + SpannedToken { token: Token::CloseBrace, .. } if true => Some(21), _ => None, } } @@ -589,101 +578,97 @@ mod __parse__Pipeline { 'input, >( __token_index: usize, - __token: Token<'input>, + __token: SpannedToken<'input>, _: ::std::marker::PhantomData<(&'input ())>, ) -> __Symbol<'input> { match __token_index { 0 => match __token { - Token(6, __tok0) => __Symbol::Variant0((__tok0)), + __tok @ SpannedToken { token: Token::OpNeq, .. } => __Symbol::Variant0((__tok)), _ => unreachable!(), }, 1 => match __token { - Token(7, __tok0) => __Symbol::Variant0((__tok0)), + __tok @ SpannedToken { token: Token::Dollar, .. } => __Symbol::Variant0((__tok)), _ => unreachable!(), }, 2 => match __token { - Token(8, __tok0) => __Symbol::Variant0((__tok0)), + __tok @ SpannedToken { token: Token::OpenParen, .. } => __Symbol::Variant0((__tok)), _ => unreachable!(), }, 3 => match __token { - Token(9, __tok0) => __Symbol::Variant0((__tok0)), + __tok @ SpannedToken { token: Token::CloseParen, .. } => __Symbol::Variant0((__tok)), _ => unreachable!(), }, 4 => match __token { - Token(10, __tok0) => __Symbol::Variant0((__tok0)), + __tok @ SpannedToken { token: Token::Dash, .. } => __Symbol::Variant0((__tok)), _ => unreachable!(), }, 5 => match __token { - Token(11, __tok0) => __Symbol::Variant0((__tok0)), + __tok @ SpannedToken { token: Token::DashDash, .. } => __Symbol::Variant0((__tok)), _ => unreachable!(), }, 6 => match __token { - Token(12, __tok0) => __Symbol::Variant0((__tok0)), + __tok @ SpannedToken { token: Token::Dot, .. } => __Symbol::Variant0((__tok)), _ => unreachable!(), }, 7 => match __token { - Token(13, __tok0) => __Symbol::Variant0((__tok0)), + __tok @ SpannedToken { token: Token::OpLt, .. } => __Symbol::Variant0((__tok)), _ => unreachable!(), }, 8 => match __token { - Token(14, __tok0) => __Symbol::Variant0((__tok0)), + __tok @ SpannedToken { token: Token::OpLte, .. } => __Symbol::Variant0((__tok)), _ => unreachable!(), }, 9 => match __token { - Token(15, __tok0) => __Symbol::Variant0((__tok0)), + __tok @ SpannedToken { token: Token::OpEq, .. } => __Symbol::Variant0((__tok)), _ => unreachable!(), }, 10 => match __token { - Token(16, __tok0) => __Symbol::Variant0((__tok0)), + __tok @ SpannedToken { token: Token::OpGt, .. } => __Symbol::Variant0((__tok)), _ => unreachable!(), }, 11 => match __token { - Token(17, __tok0) => __Symbol::Variant0((__tok0)), + __tok @ SpannedToken { token: Token::OpGte, .. } => __Symbol::Variant0((__tok)), _ => unreachable!(), }, 12 => match __token { - Token(18, __tok0) => __Symbol::Variant0((__tok0)), + __tok @ SpannedToken { token: Token::Bare, .. } => __Symbol::Variant0((__tok)), _ => unreachable!(), }, 13 => match __token { - Token(19, __tok0) => __Symbol::Variant0((__tok0)), + __tok @ SpannedToken { token: Token::DQString, .. } => __Symbol::Variant0((__tok)), _ => unreachable!(), }, 14 => match __token { - Token(20, __tok0) => __Symbol::Variant0((__tok0)), + __tok @ SpannedToken { token: Token::Member, .. } => __Symbol::Variant0((__tok)), _ => unreachable!(), }, 15 => match __token { - Token(21, __tok0) => __Symbol::Variant0((__tok0)), + __tok @ SpannedToken { token: Token::Num, .. } => __Symbol::Variant0((__tok)), _ => unreachable!(), }, 16 => match __token { - Token(22, __tok0) => __Symbol::Variant0((__tok0)), + __tok @ SpannedToken { token: Token::Size, .. } => __Symbol::Variant0((__tok)), _ => unreachable!(), }, 17 => match __token { - Token(0, __tok0) => __Symbol::Variant0((__tok0)), + __tok @ SpannedToken { token: Token::SQString, .. } => __Symbol::Variant0((__tok)), _ => unreachable!(), }, 18 => match __token { - Token(1, __tok0) => __Symbol::Variant0((__tok0)), + __tok @ SpannedToken { token: Token::Variable, .. } => __Symbol::Variant0((__tok)), _ => unreachable!(), }, 19 => match __token { - Token(2, __tok0) => __Symbol::Variant0((__tok0)), + __tok @ SpannedToken { token: Token::OpenBrace, .. } => __Symbol::Variant0((__tok)), _ => unreachable!(), }, 20 => match __token { - Token(3, __tok0) => __Symbol::Variant0((__tok0)), + __tok @ SpannedToken { token: Token::Pipe, .. } => __Symbol::Variant0((__tok)), _ => unreachable!(), }, 21 => match __token { - Token(4, __tok0) => __Symbol::Variant0((__tok0)), - _ => unreachable!(), - }, - 22 => match __token { - Token(5, __tok0) => __Symbol::Variant0((__tok0)), + __tok @ SpannedToken { token: Token::CloseBrace, .. } => __Symbol::Variant0((__tok)), _ => unreachable!(), }, _ => unreachable!(), @@ -705,13 +690,13 @@ mod __parse__Pipeline { } 1 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, + states_to_pop: 0, nonterminal_produced: 1, } } 2 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, + states_to_pop: 1, nonterminal_produced: 1, } } @@ -723,61 +708,61 @@ mod __parse__Pipeline { } 4 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 3, + states_to_pop: 3, + nonterminal_produced: 2, } } 5 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, + states_to_pop: 2, nonterminal_produced: 3, } } 6 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 2, nonterminal_produced: 4, } } 7 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 3, nonterminal_produced: 4, } } 8 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 2, nonterminal_produced: 5, } } 9 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, + states_to_pop: 2, nonterminal_produced: 6, } } 10 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 3, - nonterminal_produced: 7, + nonterminal_produced: 6, } } 11 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, + states_to_pop: 1, nonterminal_produced: 7, } } 12 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 8, + nonterminal_produced: 7, } } 13 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, + states_to_pop: 1, nonterminal_produced: 8, } } @@ -789,37 +774,37 @@ mod __parse__Pipeline { } 15 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 3, nonterminal_produced: 9, } } 16 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 3, nonterminal_produced: 10, } } 17 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 3, nonterminal_produced: 10, } } 18 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 10, + nonterminal_produced: 11, } } 19 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, + states_to_pop: 2, nonterminal_produced: 11, } } 20 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 2, nonterminal_produced: 11, } } @@ -831,13 +816,13 @@ mod __parse__Pipeline { } 22 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, + states_to_pop: 1, nonterminal_produced: 12, } } 23 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, + states_to_pop: 1, nonterminal_produced: 13, } } @@ -849,44 +834,44 @@ mod __parse__Pipeline { } 25 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 2, nonterminal_produced: 14, } } 26 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 2, nonterminal_produced: 14, } } 27 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 14, + nonterminal_produced: 15, } } 28 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 14, + nonterminal_produced: 16, } } 29 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 15, + nonterminal_produced: 16, } } 30 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 15, + nonterminal_produced: 16, } } 31 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 16, + nonterminal_produced: 17, } } 32 => { @@ -898,61 +883,61 @@ mod __parse__Pipeline { 33 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 17, + nonterminal_produced: 18, } } 34 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 17, + nonterminal_produced: 18, } } 35 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 17, + nonterminal_produced: 18, } } 36 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 17, + nonterminal_produced: 18, } } 37 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 17, + nonterminal_produced: 18, } } 38 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, + states_to_pop: 1, nonterminal_produced: 18, } } 39 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 3, - nonterminal_produced: 18, + nonterminal_produced: 19, } } 40 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, + states_to_pop: 3, nonterminal_produced: 19, } } 41 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 2, nonterminal_produced: 20, } } 42 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 20, + states_to_pop: 1, + nonterminal_produced: 21, } } 43 => { @@ -969,26 +954,26 @@ mod __parse__Pipeline { } 45 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 23, + states_to_pop: 2, + nonterminal_produced: 22, } } 46 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 24, + nonterminal_produced: 23, } } 47 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 24, + nonterminal_produced: 23, } } 48 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 25, + states_to_pop: 2, + nonterminal_produced: 24, } } 49 => { @@ -1003,44 +988,17 @@ mod __parse__Pipeline { nonterminal_produced: 25, } } - 51 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 25, - } - } - 52 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 26, - } - } - 53 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 27, - } - } - 54 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 27, - } - } - 55 => __state_machine::SimulatedReduce::Accept, + 51 => __state_machine::SimulatedReduce::Accept, _ => panic!("invalid reduction index {}", __reduce_index) } } pub struct PipelineParser { - builder: super::__intern_token::__MatcherBuilder, _priv: (), } impl PipelineParser { pub fn new() -> PipelineParser { - let __builder = super::__intern_token::__MatcherBuilder::new(); PipelineParser { - builder: __builder, _priv: (), } } @@ -1048,15 +1006,17 @@ mod __parse__Pipeline { #[allow(dead_code)] pub fn parse< 'input, + __TOKEN: __ToTriple<'input, >, + __TOKENS: IntoIterator, >( &self, - input: &'input str, - ) -> Result, &'static str>> + __tokens0: __TOKENS, + ) -> Result, ShellError>> { - let mut __tokens = self.builder.matcher(input); + let __tokens = __tokens0.into_iter(); + let mut __tokens = __tokens.map(|t| __ToTriple::to_triple(t)); let __r = __state_machine::Parser::drive( __StateMachine { - input, __phantom: ::std::marker::PhantomData::<(&())>, }, __tokens, @@ -1067,186 +1027,173 @@ mod __parse__Pipeline { pub(crate) fn __reduce< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, _: ::std::marker::PhantomData<(&'input ())>, - ) -> Option, &'static str>>> + ) -> Option, ShellError>>> { let (__pop_states, __nonterminal) = match __action { 0 => { - __reduce0(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce0(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 1 => { - __reduce1(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce1(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 2 => { - __reduce2(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce2(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 3 => { - __reduce3(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce3(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 4 => { - __reduce4(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce4(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 5 => { - __reduce5(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce5(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 6 => { - __reduce6(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce6(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 7 => { - __reduce7(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce7(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 8 => { - __reduce8(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce8(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 9 => { - __reduce9(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce9(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 10 => { - __reduce10(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce10(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 11 => { - __reduce11(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce11(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 12 => { - __reduce12(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce12(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 13 => { - __reduce13(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce13(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 14 => { - __reduce14(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce14(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 15 => { - __reduce15(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce15(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 16 => { - __reduce16(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce16(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 17 => { - __reduce17(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce17(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 18 => { - __reduce18(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce18(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 19 => { - __reduce19(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce19(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 20 => { - __reduce20(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce20(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 21 => { - __reduce21(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce21(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 22 => { - __reduce22(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce22(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 23 => { - __reduce23(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce23(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 24 => { - __reduce24(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce24(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 25 => { - __reduce25(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce25(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 26 => { - __reduce26(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce26(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 27 => { - __reduce27(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce27(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 28 => { - __reduce28(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce28(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 29 => { - __reduce29(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce29(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 30 => { - __reduce30(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce30(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 31 => { - __reduce31(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce31(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 32 => { - __reduce32(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce32(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 33 => { - __reduce33(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce33(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 34 => { - __reduce34(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce34(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 35 => { - __reduce35(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce35(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 36 => { - __reduce36(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce36(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 37 => { - __reduce37(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce37(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 38 => { - __reduce38(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce38(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 39 => { - __reduce39(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce39(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 40 => { - __reduce40(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce40(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 41 => { - __reduce41(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce41(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 42 => { - __reduce42(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce42(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 43 => { - __reduce43(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce43(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 44 => { - __reduce44(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce44(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 45 => { - __reduce45(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce45(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 46 => { - __reduce46(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce46(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 47 => { - __reduce47(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce47(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 48 => { - __reduce48(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce48(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 49 => { - __reduce49(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce49(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 50 => { - __reduce50(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) + __reduce50(__action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) } 51 => { - __reduce51(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) - } - 52 => { - __reduce52(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) - } - 53 => { - __reduce53(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) - } - 54 => { - __reduce54(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<(&())>) - } - 55 => { // __Pipeline = Pipeline => ActionFn(0); - let __sym0 = __pop_Variant10(__symbols); + let __sym0 = __pop_Variant12(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action0::<>(input, __sym0); + let __nt = super::__action0::<>(__sym0); return Some(Ok(__nt)); } _ => panic!("invalid action code {}", __action) @@ -1254,128 +1201,73 @@ mod __parse__Pipeline { let __states_len = __states.len(); __states.truncate(__states_len - __pop_states); let __state = *__states.last().unwrap() as usize; - let __next_state = __GOTO[__state * 29 + __nonterminal] - 1; + let __next_state = __GOTO[__state * 27 + __nonterminal] - 1; __states.push(__next_state); None } - fn __pop_Variant5< - 'input, - >( - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, Expression, usize) - { - match __symbols.pop().unwrap() { - (__l, __Symbol::Variant5(__v), __r) => (__l, __v, __r), - _ => panic!("symbol type mismatch") - } - } fn __pop_Variant7< 'input, >( __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, Flag, usize) + ) -> (usize, BarePath, usize) { match __symbols.pop().unwrap() { (__l, __Symbol::Variant7(__v), __r) => (__l, __v, __r), _ => panic!("symbol type mismatch") } } - fn __pop_Variant9< - 'input, - >( - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, Operator, usize) - { - match __symbols.pop().unwrap() { - (__l, __Symbol::Variant9(__v), __r) => (__l, __v, __r), - _ => panic!("symbol type mismatch") - } - } - fn __pop_Variant3< - 'input, - >( - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, ParsedCommand, usize) - { - match __symbols.pop().unwrap() { - (__l, __Symbol::Variant3(__v), __r) => (__l, __v, __r), - _ => panic!("symbol type mismatch") - } - } - fn __pop_Variant10< - 'input, - >( - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, Pipeline, usize) - { - match __symbols.pop().unwrap() { - (__l, __Symbol::Variant10(__v), __r) => (__l, __v, __r), - _ => panic!("symbol type mismatch") - } - } - fn __pop_Variant1< - 'input, - >( - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, String, usize) - { - match __symbols.pop().unwrap() { - (__l, __Symbol::Variant1(__v), __r) => (__l, __v, __r), - _ => panic!("symbol type mismatch") - } - } - fn __pop_Variant11< - 'input, - >( - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, Variable, usize) - { - match __symbols.pop().unwrap() { - (__l, __Symbol::Variant11(__v), __r) => (__l, __v, __r), - _ => panic!("symbol type mismatch") - } - } - fn __pop_Variant8< - 'input, - >( - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, i64, usize) - { - match __symbols.pop().unwrap() { - (__l, __Symbol::Variant8(__v), __r) => (__l, __v, __r), - _ => panic!("symbol type mismatch") - } - } fn __pop_Variant6< 'input, >( __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, ::std::vec::Vec, usize) + ) -> (usize, Expression, usize) { match __symbols.pop().unwrap() { (__l, __Symbol::Variant6(__v), __r) => (__l, __v, __r), _ => panic!("symbol type mismatch") } } + fn __pop_Variant9< + 'input, + >( + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, Flag, usize) + { + match __symbols.pop().unwrap() { + (__l, __Symbol::Variant9(__v), __r) => (__l, __v, __r), + _ => panic!("symbol type mismatch") + } + } + fn __pop_Variant11< + 'input, + >( + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, Operator, usize) + { + match __symbols.pop().unwrap() { + (__l, __Symbol::Variant11(__v), __r) => (__l, __v, __r), + _ => panic!("symbol type mismatch") + } + } fn __pop_Variant4< 'input, >( __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, ::std::vec::Vec, usize) + ) -> (usize, ParsedCommand, usize) { match __symbols.pop().unwrap() { (__l, __Symbol::Variant4(__v), __r) => (__l, __v, __r), _ => panic!("symbol type mismatch") } } - fn __pop_Variant2< + fn __pop_Variant12< 'input, >( __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, ::std::vec::Vec, usize) + ) -> (usize, Pipeline, usize) { match __symbols.pop().unwrap() { - (__l, __Symbol::Variant2(__v), __r) => (__l, __v, __r), + (__l, __Symbol::Variant12(__v), __r) => (__l, __v, __r), _ => panic!("symbol type mismatch") } } @@ -1383,17 +1275,93 @@ mod __parse__Pipeline { 'input, >( __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, &'input str, usize) + ) -> (usize, SpannedToken<'input>, usize) { match __symbols.pop().unwrap() { (__l, __Symbol::Variant0(__v), __r) => (__l, __v, __r), _ => panic!("symbol type mismatch") } } + fn __pop_Variant2< + 'input, + >( + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, String, usize) + { + match __symbols.pop().unwrap() { + (__l, __Symbol::Variant2(__v), __r) => (__l, __v, __r), + _ => panic!("symbol type mismatch") + } + } + fn __pop_Variant13< + 'input, + >( + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, Variable, usize) + { + match __symbols.pop().unwrap() { + (__l, __Symbol::Variant13(__v), __r) => (__l, __v, __r), + _ => panic!("symbol type mismatch") + } + } + fn __pop_Variant10< + 'input, + >( + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, i64, usize) + { + match __symbols.pop().unwrap() { + (__l, __Symbol::Variant10(__v), __r) => (__l, __v, __r), + _ => panic!("symbol type mismatch") + } + } + fn __pop_Variant8< + 'input, + >( + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, ::std::vec::Vec, usize) + { + match __symbols.pop().unwrap() { + (__l, __Symbol::Variant8(__v), __r) => (__l, __v, __r), + _ => panic!("symbol type mismatch") + } + } + fn __pop_Variant5< + 'input, + >( + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, ::std::vec::Vec, usize) + { + match __symbols.pop().unwrap() { + (__l, __Symbol::Variant5(__v), __r) => (__l, __v, __r), + _ => panic!("symbol type mismatch") + } + } + fn __pop_Variant1< + 'input, + >( + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, ::std::vec::Vec>, usize) + { + match __symbols.pop().unwrap() { + (__l, __Symbol::Variant1(__v), __r) => (__l, __v, __r), + _ => panic!("symbol type mismatch") + } + } + fn __pop_Variant3< + 'input, + >( + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, ::std::vec::Vec, usize) + { + match __symbols.pop().unwrap() { + (__l, __Symbol::Variant3(__v), __r) => (__l, __v, __r), + _ => panic!("symbol type mismatch") + } + } pub(crate) fn __reduce0< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -1401,19 +1369,111 @@ mod __parse__Pipeline { _: ::std::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ("." ) = ".", Member => ActionFn(47); - let __sym1 = __pop_Variant1(__symbols); + // ("." <"member">) = ".", "member" => ActionFn(40); + let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); let __end = __sym1.2.clone(); - let __nt = super::__action47::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + let __nt = super::__action40::<>(__sym0, __sym1); + __symbols.push((__start, __Symbol::Variant0(__nt), __end)); (2, 0) } pub(crate) fn __reduce1< 'input, >( - input: &'input str, + __action: i8, + __lookahead_start: Option<&usize>, + __states: &mut ::std::vec::Vec, + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: ::std::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ("." <"member">)* = => ActionFn(38); + let __start = __symbols.last().map(|s| s.2.clone()).unwrap_or_default(); + let __end = __lookahead_start.cloned().unwrap_or_else(|| __start.clone()); + let __nt = super::__action38::<>(&__start, &__end); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (0, 1) + } + pub(crate) fn __reduce2< + 'input, + >( + __action: i8, + __lookahead_start: Option<&usize>, + __states: &mut ::std::vec::Vec, + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: ::std::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ("." <"member">)* = ("." <"member">)+ => ActionFn(39); + let __sym0 = __pop_Variant1(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action39::<>(__sym0); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (1, 1) + } + pub(crate) fn __reduce3< + 'input, + >( + __action: i8, + __lookahead_start: Option<&usize>, + __states: &mut ::std::vec::Vec, + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: ::std::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ("." <"member">)+ = ".", "member" => ActionFn(51); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym1.2.clone(); + let __nt = super::__action51::<>(__sym0, __sym1); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (2, 2) + } + pub(crate) fn __reduce4< + 'input, + >( + __action: i8, + __lookahead_start: Option<&usize>, + __states: &mut ::std::vec::Vec, + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: ::std::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ("." <"member">)+ = ("." <"member">)+, ".", "member" => ActionFn(52); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant1(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym2.2.clone(); + let __nt = super::__action52::<>(__sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (3, 2) + } + pub(crate) fn __reduce5< + 'input, + >( + __action: i8, + __lookahead_start: Option<&usize>, + __states: &mut ::std::vec::Vec, + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: ::std::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ("." ) = ".", Member => ActionFn(43); + let __sym1 = __pop_Variant2(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym1.2.clone(); + let __nt = super::__action43::<>(__sym0, __sym1); + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + (2, 3) + } + pub(crate) fn __reduce6< + 'input, + >( __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -1422,18 +1482,17 @@ mod __parse__Pipeline { ) -> (usize, usize) { // ("." )+ = ".", Member => ActionFn(55); - let __sym1 = __pop_Variant1(__symbols); + let __sym1 = __pop_Variant2(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); let __end = __sym1.2.clone(); - let __nt = super::__action55::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant2(__nt), __end)); - (2, 1) + let __nt = super::__action55::<>(__sym0, __sym1); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (2, 4) } - pub(crate) fn __reduce2< + pub(crate) fn __reduce7< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -1442,19 +1501,18 @@ mod __parse__Pipeline { ) -> (usize, usize) { // ("." )+ = ("." )+, ".", Member => ActionFn(56); - let __sym2 = __pop_Variant1(__symbols); + let __sym2 = __pop_Variant2(__symbols); let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant2(__symbols); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0.clone(); let __end = __sym2.2.clone(); - let __nt = super::__action56::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant2(__nt), __end)); - (3, 1) + let __nt = super::__action56::<>(__sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (3, 4) } - pub(crate) fn __reduce3< + pub(crate) fn __reduce8< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -1462,19 +1520,18 @@ mod __parse__Pipeline { _: ::std::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ("|" ) = "|", Command => ActionFn(52); - let __sym1 = __pop_Variant3(__symbols); + // ("|" ) = "|", Command => ActionFn(48); + let __sym1 = __pop_Variant4(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); let __end = __sym1.2.clone(); - let __nt = super::__action52::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (2, 2) + let __nt = super::__action48::<>(__sym0, __sym1); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (2, 5) } - pub(crate) fn __reduce4< + pub(crate) fn __reduce9< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -1483,18 +1540,17 @@ mod __parse__Pipeline { ) -> (usize, usize) { // ("|" )+ = "|", Command => ActionFn(57); - let __sym1 = __pop_Variant3(__symbols); + let __sym1 = __pop_Variant4(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); let __end = __sym1.2.clone(); - let __nt = super::__action57::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant4(__nt), __end)); - (2, 3) + let __nt = super::__action57::<>(__sym0, __sym1); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (2, 6) } - pub(crate) fn __reduce5< + pub(crate) fn __reduce10< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -1503,19 +1559,18 @@ mod __parse__Pipeline { ) -> (usize, usize) { // ("|" )+ = ("|" )+, "|", Command => ActionFn(58); - let __sym2 = __pop_Variant3(__symbols); + let __sym2 = __pop_Variant4(__symbols); let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant4(__symbols); + let __sym0 = __pop_Variant5(__symbols); let __start = __sym0.0.clone(); let __end = __sym2.2.clone(); - let __nt = super::__action58::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant4(__nt), __end)); - (3, 3) + let __nt = super::__action58::<>(__sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 6) } - pub(crate) fn __reduce6< + pub(crate) fn __reduce11< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -1524,17 +1579,16 @@ mod __parse__Pipeline { ) -> (usize, usize) { // AtomicExpression = Parenthesized => ActionFn(12); - let __sym0 = __pop_Variant5(__symbols); + let __sym0 = __pop_Variant6(__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, 4) + let __nt = super::__action12::<>(__sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (1, 7) } - pub(crate) fn __reduce7< + pub(crate) fn __reduce12< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -1543,17 +1597,16 @@ mod __parse__Pipeline { ) -> (usize, usize) { // AtomicExpression = Leaf => ActionFn(13); - let __sym0 = __pop_Variant5(__symbols); + let __sym0 = __pop_Variant6(__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, 4) + let __nt = super::__action13::<>(__sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (1, 7) } - pub(crate) fn __reduce8< + pub(crate) fn __reduce13< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -1561,18 +1614,17 @@ mod __parse__Pipeline { _: ::std::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BareWord = RawBareWord => ActionFn(38); - let __sym0 = __pop_Variant1(__symbols); + // BarePath = "bare" => ActionFn(53); + 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::Variant1(__nt), __end)); - (1, 5) + let __nt = super::__action53::<>(__sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 8) } - pub(crate) fn __reduce9< + pub(crate) fn __reduce14< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -1580,20 +1632,38 @@ mod __parse__Pipeline { _: ::std::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryExpression = Expr, Operator, Leaf => ActionFn(9); - let __sym2 = __pop_Variant5(__symbols); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant5(__symbols); + // BarePath = "bare", ("." <"member">)+ => ActionFn(54); + let __sym1 = __pop_Variant1(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym1.2.clone(); + let __nt = super::__action54::<>(__sym0, __sym1); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (2, 8) + } + pub(crate) fn __reduce15< + 'input, + >( + __action: i8, + __lookahead_start: Option<&usize>, + __states: &mut ::std::vec::Vec, + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: ::std::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // BinaryExpression = Expr, Operator, Expr => ActionFn(9); + let __sym2 = __pop_Variant6(__symbols); + let __sym1 = __pop_Variant11(__symbols); + let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0.clone(); let __end = __sym2.2.clone(); - let __nt = super::__action9::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (3, 6) + let __nt = super::__action9::<>(__sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (3, 9) } - pub(crate) fn __reduce10< + pub(crate) fn __reduce16< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -1603,18 +1673,17 @@ mod __parse__Pipeline { { // Block = "{", AtomicExpression, "}" => ActionFn(14); let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant6(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); let __end = __sym2.2.clone(); - let __nt = super::__action14::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (3, 7) + let __nt = super::__action14::<>(__sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (3, 10) } - pub(crate) fn __reduce11< + pub(crate) fn __reduce17< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -1624,134 +1693,73 @@ mod __parse__Pipeline { { // Block = "{", BinaryExpression, "}" => ActionFn(15); let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant6(__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) - } - pub(crate) fn __reduce12< - 'input, - >( - input: &'input str, - __action: i8, - __lookahead_start: Option<&usize>, - __states: &mut ::std::vec::Vec, - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: ::std::marker::PhantomData<(&'input ())>, - ) -> (usize, usize) - { - // Command = BareWord => ActionFn(59); - let __sym0 = __pop_Variant1(__symbols); - let __start = __sym0.0.clone(); - let __end = __sym0.2.clone(); - let __nt = super::__action59::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (1, 8) - } - pub(crate) fn __reduce13< - 'input, - >( - input: &'input str, - __action: i8, - __lookahead_start: Option<&usize>, - __states: &mut ::std::vec::Vec, - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: ::std::marker::PhantomData<(&'input ())>, - ) -> (usize, usize) - { - // Command = BareWord, Expr+ => ActionFn(60); - let __sym1 = __pop_Variant6(__symbols); - let __sym0 = __pop_Variant1(__symbols); - let __start = __sym0.0.clone(); - let __end = __sym1.2.clone(); - let __nt = super::__action60::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (2, 8) - } - pub(crate) fn __reduce14< - 'input, - >( - input: &'input str, - __action: i8, - __lookahead_start: Option<&usize>, - __states: &mut ::std::vec::Vec, - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: ::std::marker::PhantomData<(&'input ())>, - ) -> (usize, usize) - { - // Command = BareWord, BinaryExpression => ActionFn(4); - let __sym1 = __pop_Variant5(__symbols); - let __sym0 = __pop_Variant1(__symbols); - let __start = __sym0.0.clone(); - let __end = __sym1.2.clone(); - let __nt = super::__action4::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (2, 8) - } - pub(crate) fn __reduce15< - 'input, - >( - input: &'input str, - __action: i8, - __lookahead_start: Option<&usize>, - __states: &mut ::std::vec::Vec, - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: ::std::marker::PhantomData<(&'input ())>, - ) -> (usize, usize) - { - // DQString = r#"\"([^\"]|\\\\\")*\""# => ActionFn(41); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0.clone(); - let __end = __sym0.2.clone(); - let __nt = super::__action41::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (1, 9) - } - pub(crate) fn __reduce16< - 'input, - >( - input: &'input str, - __action: i8, - __lookahead_start: Option<&usize>, - __states: &mut ::std::vec::Vec, - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: ::std::marker::PhantomData<(&'input ())>, - ) -> (usize, usize) - { - // Expr = BareWord => ActionFn(19); - let __sym0 = __pop_Variant1(__symbols); - let __start = __sym0.0.clone(); - let __end = __sym0.2.clone(); - let __nt = super::__action19::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 10) - } - pub(crate) fn __reduce17< - 'input, - >( - input: &'input str, - __action: i8, - __lookahead_start: Option<&usize>, - __states: &mut ::std::vec::Vec, - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: ::std::marker::PhantomData<(&'input ())>, - ) -> (usize, usize) - { - // Expr = WholeExpression => ActionFn(20); - let __sym0 = __pop_Variant5(__symbols); - let __start = __sym0.0.clone(); - let __end = __sym0.2.clone(); - let __nt = super::__action20::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 10) + let __nt = super::__action15::<>(__sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (3, 10) } pub(crate) fn __reduce18< 'input, >( - input: &'input str, + __action: i8, + __lookahead_start: Option<&usize>, + __states: &mut ::std::vec::Vec, + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: ::std::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Command = BarePath => ActionFn(3); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action3::<>(__sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 11) + } + pub(crate) fn __reduce19< + 'input, + >( + __action: i8, + __lookahead_start: Option<&usize>, + __states: &mut ::std::vec::Vec, + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: ::std::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Command = BarePath, Expr+ => ActionFn(4); + let __sym1 = __pop_Variant8(__symbols); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym1.2.clone(); + let __nt = super::__action4::<>(__sym0, __sym1); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (2, 11) + } + pub(crate) fn __reduce20< + 'input, + >( + __action: i8, + __lookahead_start: Option<&usize>, + __states: &mut ::std::vec::Vec, + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: ::std::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Command = BarePath, BinaryExpression => ActionFn(5); + let __sym1 = __pop_Variant6(__symbols); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym1.2.clone(); + let __nt = super::__action5::<>(__sym0, __sym1); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (2, 11) + } + pub(crate) fn __reduce21< + 'input, + >( __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -1760,73 +1768,16 @@ mod __parse__Pipeline { ) -> (usize, usize) { // Expr = PathExpression => ActionFn(21); - let __sym0 = __pop_Variant5(__symbols); - let __start = __sym0.0.clone(); - let __end = __sym0.2.clone(); - let __nt = super::__action21::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 10) - } - pub(crate) fn __reduce19< - 'input, - >( - input: &'input str, - __action: i8, - __lookahead_start: Option<&usize>, - __states: &mut ::std::vec::Vec, - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: ::std::marker::PhantomData<(&'input ())>, - ) -> (usize, usize) - { - // Expr* = => ActionFn(48); - let __start = __symbols.last().map(|s| s.2.clone()).unwrap_or_default(); - let __end = __lookahead_start.cloned().unwrap_or_else(|| __start.clone()); - let __nt = super::__action48::<>(input, &__start, &__end); - __symbols.push((__start, __Symbol::Variant6(__nt), __end)); - (0, 11) - } - pub(crate) fn __reduce20< - 'input, - >( - input: &'input str, - __action: i8, - __lookahead_start: Option<&usize>, - __states: &mut ::std::vec::Vec, - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: ::std::marker::PhantomData<(&'input ())>, - ) -> (usize, usize) - { - // Expr* = Expr+ => ActionFn(49); let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action49::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant6(__nt), __end)); - (1, 11) - } - pub(crate) fn __reduce21< - 'input, - >( - input: &'input str, - __action: i8, - __lookahead_start: Option<&usize>, - __states: &mut ::std::vec::Vec, - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: ::std::marker::PhantomData<(&'input ())>, - ) -> (usize, usize) - { - // Expr+ = Expr => ActionFn(53); - let __sym0 = __pop_Variant5(__symbols); - let __start = __sym0.0.clone(); - let __end = __sym0.2.clone(); - let __nt = super::__action53::<>(input, __sym0); + let __nt = super::__action21::<>(__sym0); __symbols.push((__start, __Symbol::Variant6(__nt), __end)); (1, 12) } pub(crate) fn __reduce22< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -1834,19 +1785,17 @@ mod __parse__Pipeline { _: ::std::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Expr+ = Expr+, Expr => ActionFn(54); - let __sym1 = __pop_Variant5(__symbols); + // Expr = PathHead => ActionFn(22); let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0.clone(); - let __end = __sym1.2.clone(); - let __nt = super::__action54::<>(input, __sym0, __sym1); + let __end = __sym0.2.clone(); + let __nt = super::__action22::<>(__sym0); __symbols.push((__start, __Symbol::Variant6(__nt), __end)); - (2, 12) + (1, 12) } pub(crate) fn __reduce23< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -1854,19 +1803,17 @@ mod __parse__Pipeline { _: ::std::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Flag = "-", BareWord => ActionFn(34); - let __sym1 = __pop_Variant1(__symbols); - let __sym0 = __pop_Variant0(__symbols); + // Expr+ = Expr => ActionFn(44); + let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0.clone(); - let __end = __sym1.2.clone(); - let __nt = super::__action34::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant7(__nt), __end)); - (2, 13) + let __end = __sym0.2.clone(); + let __nt = super::__action44::<>(__sym0); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (1, 13) } pub(crate) fn __reduce24< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -1874,19 +1821,18 @@ mod __parse__Pipeline { _: ::std::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Flag = "--", BareWord => ActionFn(35); - let __sym1 = __pop_Variant1(__symbols); - let __sym0 = __pop_Variant0(__symbols); + // Expr+ = Expr+, Expr => ActionFn(45); + let __sym1 = __pop_Variant6(__symbols); + let __sym0 = __pop_Variant8(__symbols); let __start = __sym0.0.clone(); let __end = __sym1.2.clone(); - let __nt = super::__action35::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + let __nt = super::__action45::<>(__sym0, __sym1); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); (2, 13) } pub(crate) fn __reduce25< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -1894,18 +1840,18 @@ mod __parse__Pipeline { _: ::std::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Leaf = String => ActionFn(5); - let __sym0 = __pop_Variant1(__symbols); + // Flag = "-", BarePath => ActionFn(32); + let __sym1 = __pop_Variant7(__symbols); + let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); - let __end = __sym0.2.clone(); - let __nt = super::__action5::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 14) + let __end = __sym1.2.clone(); + let __nt = super::__action32::<>(__sym0, __sym1); + __symbols.push((__start, __Symbol::Variant9(__nt), __end)); + (2, 14) } pub(crate) fn __reduce26< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -1913,18 +1859,18 @@ mod __parse__Pipeline { _: ::std::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Leaf = Num => ActionFn(6); - let __sym0 = __pop_Variant8(__symbols); + // Flag = "--", BarePath => ActionFn(33); + let __sym1 = __pop_Variant7(__symbols); + let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); - let __end = __sym0.2.clone(); - let __nt = super::__action6::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 14) + let __end = __sym1.2.clone(); + let __nt = super::__action33::<>(__sym0, __sym1); + __symbols.push((__start, __Symbol::Variant9(__nt), __end)); + (2, 14) } pub(crate) fn __reduce27< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -1932,18 +1878,53 @@ mod __parse__Pipeline { _: ::std::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Leaf = Size => ActionFn(7); - let __sym0 = __pop_Variant8(__symbols); + // Int = "num" => ActionFn(37); + let __sym0 = __pop_Variant0(__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, 14) + let __nt = super::__action37::<>(__sym0); + __symbols.push((__start, __Symbol::Variant10(__nt), __end)); + (1, 15) } pub(crate) fn __reduce28< 'input, >( - input: &'input str, + __action: i8, + __lookahead_start: Option<&usize>, + __states: &mut ::std::vec::Vec, + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: ::std::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Leaf = String => ActionFn(6); + let __sym0 = __pop_Variant2(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action6::<>(__sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (1, 16) + } + pub(crate) fn __reduce29< + 'input, + >( + __action: i8, + __lookahead_start: Option<&usize>, + __states: &mut ::std::vec::Vec, + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: ::std::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Leaf = Int => ActionFn(7); + let __sym0 = __pop_Variant10(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action7::<>(__sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (1, 16) + } + pub(crate) fn __reduce30< + 'input, + >( __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -1952,55 +1933,16 @@ mod __parse__Pipeline { ) -> (usize, usize) { // Leaf = Variable => ActionFn(8); - let __sym0 = __pop_Variant11(__symbols); + let __sym0 = __pop_Variant13(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action8::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 14) - } - pub(crate) fn __reduce29< - 'input, - >( - input: &'input str, - __action: i8, - __lookahead_start: Option<&usize>, - __states: &mut ::std::vec::Vec, - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: ::std::marker::PhantomData<(&'input ())>, - ) -> (usize, usize) - { - // Member = BareWord => 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::Variant1(__nt), __end)); - (1, 15) - } - pub(crate) fn __reduce30< - 'input, - >( - input: &'input str, - __action: i8, - __lookahead_start: Option<&usize>, - __states: &mut ::std::vec::Vec, - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: ::std::marker::PhantomData<(&'input ())>, - ) -> (usize, usize) - { - // Member = String => ActionFn(27); - let __sym0 = __pop_Variant1(__symbols); - let __start = __sym0.0.clone(); - let __end = __sym0.2.clone(); - let __nt = super::__action27::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (1, 15) + let __nt = super::__action8::<>(__sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (1, 16) } pub(crate) fn __reduce31< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -2008,18 +1950,17 @@ mod __parse__Pipeline { _: ::std::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Num = r#"-?[0-9]+"# => ActionFn(43); + // Member = "member" => ActionFn(24); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action43::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (1, 16) + let __nt = super::__action24::<>(__sym0); + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + (1, 17) } pub(crate) fn __reduce32< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -2027,18 +1968,17 @@ mod __parse__Pipeline { _: ::std::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Operator = "==" => ActionFn(28); - let __sym0 = __pop_Variant0(__symbols); + // Member = String => ActionFn(25); + let __sym0 = __pop_Variant2(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action28::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant9(__nt), __end)); + let __nt = super::__action25::<>(__sym0); + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); (1, 17) } pub(crate) fn __reduce33< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -2046,18 +1986,17 @@ mod __parse__Pipeline { _: ::std::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Operator = "!=" => ActionFn(29); + // Operator = "==" => ActionFn(26); 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::Variant9(__nt), __end)); - (1, 17) + let __nt = super::__action26::<>(__sym0); + __symbols.push((__start, __Symbol::Variant11(__nt), __end)); + (1, 18) } pub(crate) fn __reduce34< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -2065,18 +2004,17 @@ mod __parse__Pipeline { _: ::std::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Operator = "<" => ActionFn(30); + // Operator = "!=" => ActionFn(27); 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::Variant9(__nt), __end)); - (1, 17) + let __nt = super::__action27::<>(__sym0); + __symbols.push((__start, __Symbol::Variant11(__nt), __end)); + (1, 18) } pub(crate) fn __reduce35< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -2084,18 +2022,17 @@ mod __parse__Pipeline { _: ::std::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Operator = ">" => ActionFn(31); + // Operator = "<" => ActionFn(28); 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::Variant9(__nt), __end)); - (1, 17) + let __nt = super::__action28::<>(__sym0); + __symbols.push((__start, __Symbol::Variant11(__nt), __end)); + (1, 18) } pub(crate) fn __reduce36< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -2103,18 +2040,17 @@ mod __parse__Pipeline { _: ::std::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Operator = "<=" => ActionFn(32); + // Operator = ">" => ActionFn(29); 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::Variant9(__nt), __end)); - (1, 17) + let __nt = super::__action29::<>(__sym0); + __symbols.push((__start, __Symbol::Variant11(__nt), __end)); + (1, 18) } pub(crate) fn __reduce37< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -2122,18 +2058,35 @@ mod __parse__Pipeline { _: ::std::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Operator = ">=" => ActionFn(33); + // Operator = "<=" => ActionFn(30); 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::Variant9(__nt), __end)); - (1, 17) + let __nt = super::__action30::<>(__sym0); + __symbols.push((__start, __Symbol::Variant11(__nt), __end)); + (1, 18) } pub(crate) fn __reduce38< 'input, >( - input: &'input str, + __action: i8, + __lookahead_start: Option<&usize>, + __states: &mut ::std::vec::Vec, + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: ::std::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Operator = ">=" => ActionFn(31); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action31::<>(__sym0); + __symbols.push((__start, __Symbol::Variant11(__nt), __end)); + (1, 18) + } + pub(crate) fn __reduce39< + 'input, + >( __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -2143,18 +2096,17 @@ mod __parse__Pipeline { { // Parenthesized = "(", Leaf, ")" => ActionFn(10); let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant6(__symbols); let __sym0 = __pop_Variant0(__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, 18) + let __nt = super::__action10::<>(__sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (3, 19) } - pub(crate) fn __reduce39< + pub(crate) fn __reduce40< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -2164,18 +2116,17 @@ mod __parse__Pipeline { { // Parenthesized = "(", BinaryExpression, ")" => ActionFn(11); let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant6(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); let __end = __sym2.2.clone(); - let __nt = super::__action11::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (3, 18) + let __nt = super::__action11::<>(__sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (3, 19) } - pub(crate) fn __reduce40< + pub(crate) fn __reduce41< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -2183,19 +2134,54 @@ mod __parse__Pipeline { _: ::std::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // PathExpression = WholeExpression, ("." )+ => ActionFn(18); - let __sym1 = __pop_Variant2(__symbols); - let __sym0 = __pop_Variant5(__symbols); + // PathExpression = WholeExpression, ("." )+ => ActionFn(20); + let __sym1 = __pop_Variant3(__symbols); + let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0.clone(); let __end = __sym1.2.clone(); - let __nt = super::__action18::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (2, 19) + let __nt = super::__action20::<>(__sym0, __sym1); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (2, 20) } - pub(crate) fn __reduce41< + pub(crate) fn __reduce42< + 'input, + >( + __action: i8, + __lookahead_start: Option<&usize>, + __states: &mut ::std::vec::Vec, + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: ::std::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // PathHead = WholeExpression => ActionFn(18); + let __sym0 = __pop_Variant6(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action18::<>(__sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (1, 21) + } + pub(crate) fn __reduce43< + 'input, + >( + __action: i8, + __lookahead_start: Option<&usize>, + __states: &mut ::std::vec::Vec, + __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: ::std::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // PathHead = BarePath => ActionFn(19); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action19::<>(__sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (1, 21) + } + pub(crate) fn __reduce44< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -2204,17 +2190,16 @@ mod __parse__Pipeline { ) -> (usize, usize) { // Pipeline = Command => ActionFn(1); - let __sym0 = __pop_Variant3(__symbols); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action1::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant10(__nt), __end)); - (1, 20) + let __nt = super::__action1::<>(__sym0); + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + (1, 22) } - pub(crate) fn __reduce42< + pub(crate) fn __reduce45< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -2223,75 +2208,17 @@ mod __parse__Pipeline { ) -> (usize, usize) { // Pipeline = Command, ("|" )+ => ActionFn(2); - let __sym1 = __pop_Variant4(__symbols); - let __sym0 = __pop_Variant3(__symbols); + let __sym1 = __pop_Variant5(__symbols); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0.clone(); let __end = __sym1.2.clone(); - let __nt = super::__action2::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant10(__nt), __end)); - (2, 20) - } - pub(crate) fn __reduce43< - 'input, - >( - input: &'input str, - __action: i8, - __lookahead_start: Option<&usize>, - __states: &mut ::std::vec::Vec, - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: ::std::marker::PhantomData<(&'input ())>, - ) -> (usize, usize) - { - // RawBareWord = r#"[^0-9\"\'$\\-\\.][^\\s\"\']*"# => 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::Variant1(__nt), __end)); - (1, 21) - } - pub(crate) fn __reduce44< - 'input, - >( - input: &'input str, - __action: i8, - __lookahead_start: Option<&usize>, - __states: &mut ::std::vec::Vec, - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: ::std::marker::PhantomData<(&'input ())>, - ) -> (usize, usize) - { - // SQString = r#"\'([^\']|\\\\\')*\'"# => ActionFn(42); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0.clone(); - let __end = __sym0.2.clone(); - let __nt = super::__action42::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (1, 22) - } - pub(crate) fn __reduce45< - 'input, - >( - input: &'input str, - __action: i8, - __lookahead_start: Option<&usize>, - __states: &mut ::std::vec::Vec, - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: ::std::marker::PhantomData<(&'input ())>, - ) -> (usize, usize) - { - // Size = r#"-?[0-9]+[A-Za-z]+"# => ActionFn(44); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0.clone(); - let __end = __sym0.2.clone(); - let __nt = super::__action44::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (1, 23) + let __nt = super::__action2::<>(__sym0, __sym1); + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + (2, 22) } pub(crate) fn __reduce46< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -2299,18 +2226,17 @@ mod __parse__Pipeline { _: ::std::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // String = SQString => ActionFn(36); - let __sym0 = __pop_Variant1(__symbols); + // String = "sqstring" => ActionFn(34); + 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::Variant1(__nt), __end)); - (1, 24) + let __nt = super::__action34::<>(__sym0); + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + (1, 23) } pub(crate) fn __reduce47< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -2318,18 +2244,17 @@ mod __parse__Pipeline { _: ::std::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // String = DQString => ActionFn(37); - let __sym0 = __pop_Variant1(__symbols); + // String = "dqstring" => ActionFn(35); + 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::Variant1(__nt), __end)); - (1, 24) + let __nt = super::__action35::<>(__sym0); + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + (1, 23) } pub(crate) fn __reduce48< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -2337,94 +2262,18 @@ mod __parse__Pipeline { _: ::std::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Variable = "$true" => ActionFn(22); + // Variable = "$", "variable" => ActionFn(23); + let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); - let __end = __sym0.2.clone(); - let __nt = super::__action22::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (1, 25) + let __end = __sym1.2.clone(); + let __nt = super::__action23::<>(__sym0, __sym1); + __symbols.push((__start, __Symbol::Variant13(__nt), __end)); + (2, 24) } pub(crate) fn __reduce49< 'input, >( - input: &'input str, - __action: i8, - __lookahead_start: Option<&usize>, - __states: &mut ::std::vec::Vec, - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: ::std::marker::PhantomData<(&'input ())>, - ) -> (usize, usize) - { - // Variable = "$false" => ActionFn(23); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0.clone(); - let __end = __sym0.2.clone(); - let __nt = super::__action23::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (1, 25) - } - pub(crate) fn __reduce50< - 'input, - >( - input: &'input str, - __action: i8, - __lookahead_start: Option<&usize>, - __states: &mut ::std::vec::Vec, - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: ::std::marker::PhantomData<(&'input ())>, - ) -> (usize, usize) - { - // Variable = "$it" => ActionFn(24); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0.clone(); - let __end = __sym0.2.clone(); - let __nt = super::__action24::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (1, 25) - } - pub(crate) fn __reduce51< - 'input, - >( - input: &'input str, - __action: i8, - __lookahead_start: Option<&usize>, - __states: &mut ::std::vec::Vec, - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: ::std::marker::PhantomData<(&'input ())>, - ) -> (usize, usize) - { - // Variable = VariableBody => ActionFn(25); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0.clone(); - let __end = __sym0.2.clone(); - let __nt = super::__action25::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (1, 25) - } - pub(crate) fn __reduce52< - 'input, - >( - input: &'input str, - __action: i8, - __lookahead_start: Option<&usize>, - __states: &mut ::std::vec::Vec, - __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: ::std::marker::PhantomData<(&'input ())>, - ) -> (usize, usize) - { - // VariableBody = r#"\\$\\p{XID_Start}(\\p{XID_Continue}|[\\-?!])*"# => 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::Variant0(__nt), __end)); - (1, 26) - } - pub(crate) fn __reduce53< - 'input, - >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -2433,17 +2282,16 @@ mod __parse__Pipeline { ) -> (usize, usize) { // WholeExpression = AtomicExpression => ActionFn(16); - let __sym0 = __pop_Variant5(__symbols); + let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action16::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 27) + let __nt = super::__action16::<>(__sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (1, 25) } - pub(crate) fn __reduce54< + pub(crate) fn __reduce50< 'input, >( - input: &'input str, __action: i8, __lookahead_start: Option<&usize>, __states: &mut ::std::vec::Vec, @@ -2452,183 +2300,37 @@ mod __parse__Pipeline { ) -> (usize, usize) { // WholeExpression = Block => ActionFn(17); - let __sym0 = __pop_Variant5(__symbols); + let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action17::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 27) + let __nt = super::__action17::<>(__sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (1, 25) } } pub use self::__parse__Pipeline::PipelineParser; -#[cfg_attr(rustfmt, rustfmt_skip)] -mod __intern_token { - #![allow(unused_imports)] - use std::str::FromStr; - use byte_unit::Byte; - use crate::parser::ast::*; - #[allow(unused_extern_crates)] - extern crate lalrpop_util as __lalrpop_util; - #[allow(unused_imports)] - use self::__lalrpop_util::state_machine as __state_machine; - extern crate regex as __regex; - use std::fmt as __fmt; - #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] - pub struct Token<'input>(pub usize, pub &'input str); - impl<'a> __fmt::Display for Token<'a> { - fn fmt<'f>(&self, formatter: &mut __fmt::Formatter<'f>) -> Result<(), __fmt::Error> { - __fmt::Display::fmt(self.1, formatter) - } - } - - pub struct __MatcherBuilder { - regex_set: __regex::RegexSet, - regex_vec: Vec<__regex::Regex>, - } - - impl __MatcherBuilder { - pub fn new() -> __MatcherBuilder { - let __strs: &[&str] = &[ - "^(\"([\u{0}-!\\#-\u{10ffff}]|\\\\\")*\")", - "^(\'([\u{0}-\\&\\(-\u{10ffff}]|\\\\\')*\')", - "^(\\-?[0-9]+)", - "^(\\-?[0-9]+[A-Za-z]+)", - "^([\u{0}-!\\#%-\\&\\(-,/:-\u{10ffff}][\u{0}-\u{8}\u{e}-\u{1f}!\\#-\\&\\(-\u{84}\u{86}-\u{9f}¡-ᙿᚁ-\u{1fff}\u{200b}-‧\u{202a}-\u{202e}‰-⁞\u{2060}-\u{2fff}、-\u{10ffff}]*)", - "^(\\$[A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶ-ͷͻ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮ-ٯٱ-ۓەۥ-ۦۮ-ۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴ-ߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএ-ঐও-নপ-রলশ-হঽৎড়-ঢ়য়-ৡৰ-ৱৼਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽૐૠ-ૡૹଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽଡ଼-ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠ-ౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠ-ೡೱ-ೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาเ-ๆກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥ-ၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮ-ᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳱᳵ-ᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿯ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪ-ꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞹꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽ-ꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﱝﱤ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷹﹱﹳﹷﹹﹻﹽﹿ-ﻼA-Za-zヲ-ンᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ𐀀-𐀋𐀍-𐀦𐀨-𐀺𐀼-𐀽𐀿-𐁍𐁐-𐁝𐂀-𐃺𐅀-𐅴𐊀-𐊜𐊠-𐋐𐌀-𐌟𐌭-𐍊𐍐-𐍵𐎀-𐎝𐎠-𐏃𐏈-𐏏𐏑-𐏕𐐀-𐒝𐒰-𐓓𐓘-𐓻𐔀-𐔧𐔰-𐕣𐘀-𐜶𐝀-𐝕𐝠-𐝧𐠀-𐠅𐠈𐠊-𐠵𐠷-𐠸𐠼𐠿-𐡕𐡠-𐡶𐢀-𐢞𐣠-𐣲𐣴-𐣵𐤀-𐤕𐤠-𐤹𐦀-𐦷𐦾-𐦿𐨀𐨐-𐨓𐨕-𐨗𐨙-𐨵𐩠-𐩼𐪀-𐪜𐫀-𐫇𐫉-𐫤𐬀-𐬵𐭀-𐭕𐭠-𐭲𐮀-𐮑𐰀-𐱈𐲀-𐲲𐳀-𐳲𐴀-𐴣𐼀-𐼜𐼧𐼰-𐽅𑀃-𑀷𑂃-𑂯𑃐-𑃨𑄃-𑄦𑅄𑅐-𑅲𑅶𑆃-𑆲𑇁-𑇄𑇚𑇜𑈀-𑈑𑈓-𑈫𑊀-𑊆𑊈𑊊-𑊍𑊏-𑊝𑊟-𑊨𑊰-𑋞𑌅-𑌌𑌏-𑌐𑌓-𑌨𑌪-𑌰𑌲-𑌳𑌵-𑌹𑌽𑍐𑍝-𑍡𑐀-𑐴𑑇-𑑊𑒀-𑒯𑓄-𑓅𑓇𑖀-𑖮𑗘-𑗛𑘀-𑘯𑙄𑚀-𑚪𑜀-𑜚𑠀-𑠫𑢠-𑣟𑣿𑨀𑨋-𑨲𑨺𑩐𑩜-𑪃𑪆-𑪉𑪝𑫀-𑫸𑰀-𑰈𑰊-𑰮𑱀𑱲-𑲏𑴀-𑴆𑴈-𑴉𑴋-𑴰𑵆𑵠-𑵥𑵧-𑵨𑵪-𑶉𑶘𑻠-𑻲𒀀-𒎙𒐀-𒑮𒒀-𒕃𓀀-𓐮𔐀-𔙆𖠀-𖨸𖩀-𖩞𖫐-𖫭𖬀-𖬯𖭀-𖭃𖭣-𖭷𖭽-𖮏𖹀-𖹿𖼀-𖽄𖽐𖾓-𖾟𖿠-𖿡𗀀-𘟱𘠀-𘫲𛀀-𛄞𛅰-𛋻𛰀-𛱪𛱰-𛱼𛲀-𛲈𛲐-𛲙𝐀-𝑔𝑖-𝒜𝒞-𝒟𝒢𝒥-𝒦𝒩-𝒬𝒮-𝒹𝒻𝒽-𝓃𝓅-𝔅𝔇-𝔊𝔍-𝔔𝔖-𝔜𝔞-𝔹𝔻-𝔾𝕀-𝕄𝕆𝕊-𝕐𝕒-𝚥𝚨-𝛀𝛂-𝛚𝛜-𝛺𝛼-𝜔𝜖-𝜴𝜶-𝝎𝝐-𝝮𝝰-𝞈𝞊-𝞨𝞪-𝟂𝟄-𝟋𞠀-𞣄𞤀-𞥃𞸀-𞸃𞸅-𞸟𞸡-𞸢𞸤𞸧𞸩-𞸲𞸴-𞸷𞸹𞸻𞹂𞹇𞹉𞹋𞹍-𞹏𞹑-𞹒𞹔𞹗𞹙𞹛𞹝𞹟𞹡-𞹢𞹤𞹧-𞹪𞹬-𞹲𞹴-𞹷𞹹-𞹼𞹾𞺀-𞺉𞺋-𞺛𞺡-𞺣𞺥-𞺩𞺫-𞺻𠀀-𪛖𪜀-𫜴𫝀-𫠝𫠠-𬺡𬺰-𮯠丽-𪘀]([0-9A-Z_a-zªµ·ºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ\u{300}-ʹͶ-ͷͻ-ͽͿΆ-ΊΌΎ-ΡΣ-ϵϷ-ҁ\u{483}-\u{487}Ҋ-ԯԱ-Ֆՙՠ-ֈ\u{591}-\u{5bd}\u{5bf}\u{5c1}-\u{5c2}\u{5c4}-\u{5c5}\u{5c7}א-תׯ-ײ\u{610}-\u{61a}ؠ-٩ٮ-ۓە-\u{6dc}\u{6df}-\u{6e8}\u{6ea}-ۼۿܐ-\u{74a}ݍ-ޱ߀-ߵߺ\u{7fd}ࠀ-\u{82d}ࡀ-\u{85b}ࡠ-ࡪࢠ-ࢴࢶ-ࢽ\u{8d3}-\u{8e1}\u{8e3}-\u{963}०-९ॱ-ঃঅ-ঌএ-ঐও-নপ-রলশ-হ\u{9bc}-\u{9c4}ে-ৈো-ৎ\u{9d7}ড়-ঢ়য়-\u{9e3}০-ৱৼ\u{9fe}\u{a01}-ਃਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹ\u{a3c}ਾ-\u{a42}\u{a47}-\u{a48}\u{a4b}-\u{a4d}\u{a51}ਖ਼-ੜਫ਼੦-\u{a75}\u{a81}-ઃઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હ\u{abc}-\u{ac5}\u{ac7}-ૉો-\u{acd}ૐૠ-\u{ae3}૦-૯ૹ-\u{aff}\u{b01}-ଃଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ\u{b3c}-\u{b44}େ-ୈୋ-\u{b4d}\u{b56}-\u{b57}ଡ଼-ଢ଼ୟ-\u{b63}୦-୯ୱ\u{b82}-ஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹ\u{bbe}-ூெ-ைொ-\u{bcd}ௐ\u{bd7}௦-௯\u{c00}-ఌఎ-ఐఒ-నప-హఽ-ౄ\u{c46}-\u{c48}\u{c4a}-\u{c4d}\u{c55}-\u{c56}ౘ-ౚౠ-\u{c63}౦-౯ಀ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ\u{cbc}-ೄ\u{cc6}-ೈೊ-\u{ccd}\u{cd5}-\u{cd6}ೞೠ-\u{ce3}೦-೯ೱ-ೲ\u{d00}-ഃഅ-ഌഎ-ഐഒ-\u{d44}െ-ൈൊ-ൎൔ-\u{d57}ൟ-\u{d63}൦-൯ൺ-ൿං-ඃඅ-ඖක-නඳ-රලව-ෆ\u{dca}\u{dcf}-\u{dd4}\u{dd6}ෘ-\u{ddf}෦-෯ෲ-ෳก-\u{e3a}เ-\u{e4e}๐-๙ກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-\u{eb9}\u{ebb}-ຽເ-ໄໆ\u{ec8}-\u{ecd}໐-໙ໜ-ໟༀ\u{f18}-\u{f19}༠-༩\u{f35}\u{f37}\u{f39}༾-ཇཉ-ཬ\u{f71}-\u{f84}\u{f86}-\u{f97}\u{f99}-\u{fbc}\u{fc6}က-၉ၐ-\u{109d}Ⴀ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ\u{135d}-\u{135f}፩-፱ᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-\u{1714}ᜠ-\u{1734}ᝀ-\u{1753}ᝠ-ᝬᝮ-ᝰ\u{1772}-\u{1773}ក-\u{17d3}ៗៜ-\u{17dd}០-៩\u{180b}-\u{180d}᠐-᠙ᠠ-ᡸᢀ-ᢪᢰ-ᣵᤀ-ᤞ\u{1920}-ᤫᤰ-\u{193b}᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧚ᨀ-\u{1a1b}ᨠ-\u{1a5e}\u{1a60}-\u{1a7c}\u{1a7f}-᪉᪐-᪙ᪧ\u{1ab0}-\u{1abd}\u{1b00}-ᭋ᭐-᭙\u{1b6b}-\u{1b73}\u{1b80}-᯳ᰀ-\u{1c37}᱀-᱉ᱍ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿ\u{1cd0}-\u{1cd2}\u{1cd4}-\u{1cf9}ᴀ-\u{1df9}\u{1dfb}-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿-⁀⁔ⁱⁿₐ-ₜ\u{20d0}-\u{20dc}\u{20e1}\u{20e5}-\u{20f0}ℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ\u{2d7f}-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ\u{2de0}-\u{2dff}々-〇〡-\u{302f}〱-〵〸-〼ぁ-ゖ\u{3099}-\u{309a}ゝ-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿯ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-\u{a66f}\u{a674}-\u{a67d}ꙿ-\u{a6f1}ꜗ-ꜟꜢ-ꞈꞋ-ꞹꟷ-ꠧꡀ-ꡳꢀ-\u{a8c5}꣐-꣙\u{a8e0}-ꣷꣻꣽ-\u{a92d}ꤰ-꥓ꥠ-ꥼ\u{a980}-꧀ꧏ-꧙ꧠ-ꧾꨀ-\u{aa36}ꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺ-ꫂꫛ-ꫝꫠ-ꫯꫲ-\u{aaf6}ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯪ꯬-\u{abed}꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﱝﱤ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷹ\u{fe00}-\u{fe0f}\u{fe20}-\u{fe2f}︳-︴﹍-﹏ﹱﹳﹷﹹﹻﹽﹿ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ𐀀-𐀋𐀍-𐀦𐀨-𐀺𐀼-𐀽𐀿-𐁍𐁐-𐁝𐂀-𐃺𐅀-𐅴\u{101fd}𐊀-𐊜𐊠-𐋐\u{102e0}𐌀-𐌟𐌭-𐍊𐍐-\u{1037a}𐎀-𐎝𐎠-𐏃𐏈-𐏏𐏑-𐏕𐐀-𐒝𐒠-𐒩𐒰-𐓓𐓘-𐓻𐔀-𐔧𐔰-𐕣𐘀-𐜶𐝀-𐝕𐝠-𐝧𐠀-𐠅𐠈𐠊-𐠵𐠷-𐠸𐠼𐠿-𐡕𐡠-𐡶𐢀-𐢞𐣠-𐣲𐣴-𐣵𐤀-𐤕𐤠-𐤹𐦀-𐦷𐦾-𐦿𐨀-\u{10a03}\u{10a05}-\u{10a06}\u{10a0c}-𐨓𐨕-𐨗𐨙-𐨵\u{10a38}-\u{10a3a}\u{10a3f}𐩠-𐩼𐪀-𐪜𐫀-𐫇𐫉-\u{10ae6}𐬀-𐬵𐭀-𐭕𐭠-𐭲𐮀-𐮑𐰀-𐱈𐲀-𐲲𐳀-𐳲𐴀-\u{10d27}𐴰-𐴹𐼀-𐼜𐼧𐼰-\u{10f50}𑀀-\u{11046}𑁦-𑁯\u{1107f}-\u{110ba}𑃐-𑃨𑃰-𑃹\u{11100}-\u{11134}𑄶-𑄿𑅄-𑅆𑅐-\u{11173}𑅶\u{11180}-𑇄\u{111c9}-\u{111cc}𑇐-𑇚𑇜𑈀-𑈑𑈓-\u{11237}\u{1123e}𑊀-𑊆𑊈𑊊-𑊍𑊏-𑊝𑊟-𑊨𑊰-\u{112ea}𑋰-𑋹\u{11300}-𑌃𑌅-𑌌𑌏-𑌐𑌓-𑌨𑌪-𑌰𑌲-𑌳𑌵-𑌹\u{1133b}-𑍄𑍇-𑍈𑍋-𑍍𑍐\u{11357}𑍝-𑍣\u{11366}-\u{1136c}\u{11370}-\u{11374}𑐀-𑑊𑑐-𑑙\u{1145e}𑒀-𑓅𑓇𑓐-𑓙𑖀-\u{115b5}𑖸-\u{115c0}𑗘-\u{115dd}𑘀-\u{11640}𑙄𑙐-𑙙𑚀-\u{116b7}𑛀-𑛉𑜀-𑜚\u{1171d}-\u{1172b}𑜰-𑜹𑠀-\u{1183a}𑢠-𑣩𑣿𑨀-\u{11a3e}\u{11a47}𑩐-𑪃𑪆-\u{11a99}𑪝𑫀-𑫸𑰀-𑰈𑰊-\u{11c36}\u{11c38}-𑱀𑱐-𑱙𑱲-𑲏\u{11c92}-\u{11ca7}𑲩-\u{11cb6}𑴀-𑴆𑴈-𑴉𑴋-\u{11d36}\u{11d3a}\u{11d3c}-\u{11d3d}\u{11d3f}-\u{11d47}𑵐-𑵙𑵠-𑵥𑵧-𑵨𑵪-𑶎\u{11d90}-\u{11d91}𑶓-𑶘𑶠-𑶩𑻠-𑻶𒀀-𒎙𒐀-𒑮𒒀-𒕃𓀀-𓐮𔐀-𔙆𖠀-𖨸𖩀-𖩞𖩠-𖩩𖫐-𖫭\u{16af0}-\u{16af4}𖬀-\u{16b36}𖭀-𖭃𖭐-𖭙𖭣-𖭷𖭽-𖮏𖹀-𖹿𖼀-𖽄𖽐-𖽾\u{16f8f}-𖾟𖿠-𖿡𗀀-𘟱𘠀-𘫲𛀀-𛄞𛅰-𛋻𛰀-𛱪𛱰-𛱼𛲀-𛲈𛲐-𛲙\u{1bc9d}-\u{1bc9e}\u{1d165}-\u{1d169}𝅭-\u{1d172}\u{1d17b}-\u{1d182}\u{1d185}-\u{1d18b}\u{1d1aa}-\u{1d1ad}\u{1d242}-\u{1d244}𝐀-𝑔𝑖-𝒜𝒞-𝒟𝒢𝒥-𝒦𝒩-𝒬𝒮-𝒹𝒻𝒽-𝓃𝓅-𝔅𝔇-𝔊𝔍-𝔔𝔖-𝔜𝔞-𝔹𝔻-𝔾𝕀-𝕄𝕆𝕊-𝕐𝕒-𝚥𝚨-𝛀𝛂-𝛚𝛜-𝛺𝛼-𝜔𝜖-𝜴𝜶-𝝎𝝐-𝝮𝝰-𝞈𝞊-𝞨𝞪-𝟂𝟄-𝟋𝟎-𝟿\u{1da00}-\u{1da36}\u{1da3b}-\u{1da6c}\u{1da75}\u{1da84}\u{1da9b}-\u{1da9f}\u{1daa1}-\u{1daaf}\u{1e000}-\u{1e006}\u{1e008}-\u{1e018}\u{1e01b}-\u{1e021}\u{1e023}-\u{1e024}\u{1e026}-\u{1e02a}𞠀-𞣄\u{1e8d0}-\u{1e8d6}𞤀-\u{1e94a}𞥐-𞥙𞸀-𞸃𞸅-𞸟𞸡-𞸢𞸤𞸧𞸩-𞸲𞸴-𞸷𞸹𞸻𞹂𞹇𞹉𞹋𞹍-𞹏𞹑-𞹒𞹔𞹗𞹙𞹛𞹝𞹟𞹡-𞹢𞹤𞹧-𞹪𞹬-𞹲𞹴-𞹷𞹹-𞹼𞹾𞺀-𞺉𞺋-𞺛𞺡-𞺣𞺥-𞺩𞺫-𞺻𠀀-𪛖𪜀-𫜴𫝀-𫠝𫠠-𬺡𬺰-𮯠丽-𪘀\u{e0100}-\u{e01ef}]|[!\\-\\?])*)", - "^(!=)", - "^(\\$false)", - "^(\\$it)", - "^(\\$true)", - "^(\\()", - "^(\\))", - "^(\\-)", - "^(\\-\\-)", - "^(\\.)", - "^(<)", - "^(<=)", - "^(==)", - "^(>)", - "^(>=)", - "^(\\{)", - "^(\\|)", - "^(\\})", - ]; - let __regex_set = __regex::RegexSet::new(__strs).unwrap(); - let __regex_vec = vec![ - __regex::Regex::new("^(\"([\u{0}-!\\#-\u{10ffff}]|\\\\\")*\")").unwrap(), - __regex::Regex::new("^(\'([\u{0}-\\&\\(-\u{10ffff}]|\\\\\')*\')").unwrap(), - __regex::Regex::new("^(\\-?[0-9]+)").unwrap(), - __regex::Regex::new("^(\\-?[0-9]+[A-Za-z]+)").unwrap(), - __regex::Regex::new("^([\u{0}-!\\#%-\\&\\(-,/:-\u{10ffff}][\u{0}-\u{8}\u{e}-\u{1f}!\\#-\\&\\(-\u{84}\u{86}-\u{9f}¡-ᙿᚁ-\u{1fff}\u{200b}-‧\u{202a}-\u{202e}‰-⁞\u{2060}-\u{2fff}、-\u{10ffff}]*)").unwrap(), - __regex::Regex::new("^(\\$[A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶ-ͷͻ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮ-ٯٱ-ۓەۥ-ۦۮ-ۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴ-ߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএ-ঐও-নপ-রলশ-হঽৎড়-ঢ়য়-ৡৰ-ৱৼਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽૐૠ-ૡૹଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽଡ଼-ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠ-ౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠ-ೡೱ-ೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาเ-ๆກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥ-ၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮ-ᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳱᳵ-ᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿯ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪ-ꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞹꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽ-ꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﱝﱤ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷹﹱﹳﹷﹹﹻﹽﹿ-ﻼA-Za-zヲ-ンᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ𐀀-𐀋𐀍-𐀦𐀨-𐀺𐀼-𐀽𐀿-𐁍𐁐-𐁝𐂀-𐃺𐅀-𐅴𐊀-𐊜𐊠-𐋐𐌀-𐌟𐌭-𐍊𐍐-𐍵𐎀-𐎝𐎠-𐏃𐏈-𐏏𐏑-𐏕𐐀-𐒝𐒰-𐓓𐓘-𐓻𐔀-𐔧𐔰-𐕣𐘀-𐜶𐝀-𐝕𐝠-𐝧𐠀-𐠅𐠈𐠊-𐠵𐠷-𐠸𐠼𐠿-𐡕𐡠-𐡶𐢀-𐢞𐣠-𐣲𐣴-𐣵𐤀-𐤕𐤠-𐤹𐦀-𐦷𐦾-𐦿𐨀𐨐-𐨓𐨕-𐨗𐨙-𐨵𐩠-𐩼𐪀-𐪜𐫀-𐫇𐫉-𐫤𐬀-𐬵𐭀-𐭕𐭠-𐭲𐮀-𐮑𐰀-𐱈𐲀-𐲲𐳀-𐳲𐴀-𐴣𐼀-𐼜𐼧𐼰-𐽅𑀃-𑀷𑂃-𑂯𑃐-𑃨𑄃-𑄦𑅄𑅐-𑅲𑅶𑆃-𑆲𑇁-𑇄𑇚𑇜𑈀-𑈑𑈓-𑈫𑊀-𑊆𑊈𑊊-𑊍𑊏-𑊝𑊟-𑊨𑊰-𑋞𑌅-𑌌𑌏-𑌐𑌓-𑌨𑌪-𑌰𑌲-𑌳𑌵-𑌹𑌽𑍐𑍝-𑍡𑐀-𑐴𑑇-𑑊𑒀-𑒯𑓄-𑓅𑓇𑖀-𑖮𑗘-𑗛𑘀-𑘯𑙄𑚀-𑚪𑜀-𑜚𑠀-𑠫𑢠-𑣟𑣿𑨀𑨋-𑨲𑨺𑩐𑩜-𑪃𑪆-𑪉𑪝𑫀-𑫸𑰀-𑰈𑰊-𑰮𑱀𑱲-𑲏𑴀-𑴆𑴈-𑴉𑴋-𑴰𑵆𑵠-𑵥𑵧-𑵨𑵪-𑶉𑶘𑻠-𑻲𒀀-𒎙𒐀-𒑮𒒀-𒕃𓀀-𓐮𔐀-𔙆𖠀-𖨸𖩀-𖩞𖫐-𖫭𖬀-𖬯𖭀-𖭃𖭣-𖭷𖭽-𖮏𖹀-𖹿𖼀-𖽄𖽐𖾓-𖾟𖿠-𖿡𗀀-𘟱𘠀-𘫲𛀀-𛄞𛅰-𛋻𛰀-𛱪𛱰-𛱼𛲀-𛲈𛲐-𛲙𝐀-𝑔𝑖-𝒜𝒞-𝒟𝒢𝒥-𝒦𝒩-𝒬𝒮-𝒹𝒻𝒽-𝓃𝓅-𝔅𝔇-𝔊𝔍-𝔔𝔖-𝔜𝔞-𝔹𝔻-𝔾𝕀-𝕄𝕆𝕊-𝕐𝕒-𝚥𝚨-𝛀𝛂-𝛚𝛜-𝛺𝛼-𝜔𝜖-𝜴𝜶-𝝎𝝐-𝝮𝝰-𝞈𝞊-𝞨𝞪-𝟂𝟄-𝟋𞠀-𞣄𞤀-𞥃𞸀-𞸃𞸅-𞸟𞸡-𞸢𞸤𞸧𞸩-𞸲𞸴-𞸷𞸹𞸻𞹂𞹇𞹉𞹋𞹍-𞹏𞹑-𞹒𞹔𞹗𞹙𞹛𞹝𞹟𞹡-𞹢𞹤𞹧-𞹪𞹬-𞹲𞹴-𞹷𞹹-𞹼𞹾𞺀-𞺉𞺋-𞺛𞺡-𞺣𞺥-𞺩𞺫-𞺻𠀀-𪛖𪜀-𫜴𫝀-𫠝𫠠-𬺡𬺰-𮯠丽-𪘀]([0-9A-Z_a-zªµ·ºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ\u{300}-ʹͶ-ͷͻ-ͽͿΆ-ΊΌΎ-ΡΣ-ϵϷ-ҁ\u{483}-\u{487}Ҋ-ԯԱ-Ֆՙՠ-ֈ\u{591}-\u{5bd}\u{5bf}\u{5c1}-\u{5c2}\u{5c4}-\u{5c5}\u{5c7}א-תׯ-ײ\u{610}-\u{61a}ؠ-٩ٮ-ۓە-\u{6dc}\u{6df}-\u{6e8}\u{6ea}-ۼۿܐ-\u{74a}ݍ-ޱ߀-ߵߺ\u{7fd}ࠀ-\u{82d}ࡀ-\u{85b}ࡠ-ࡪࢠ-ࢴࢶ-ࢽ\u{8d3}-\u{8e1}\u{8e3}-\u{963}०-९ॱ-ঃঅ-ঌএ-ঐও-নপ-রলশ-হ\u{9bc}-\u{9c4}ে-ৈো-ৎ\u{9d7}ড়-ঢ়য়-\u{9e3}০-ৱৼ\u{9fe}\u{a01}-ਃਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹ\u{a3c}ਾ-\u{a42}\u{a47}-\u{a48}\u{a4b}-\u{a4d}\u{a51}ਖ਼-ੜਫ਼੦-\u{a75}\u{a81}-ઃઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હ\u{abc}-\u{ac5}\u{ac7}-ૉો-\u{acd}ૐૠ-\u{ae3}૦-૯ૹ-\u{aff}\u{b01}-ଃଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହ\u{b3c}-\u{b44}େ-ୈୋ-\u{b4d}\u{b56}-\u{b57}ଡ଼-ଢ଼ୟ-\u{b63}୦-୯ୱ\u{b82}-ஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹ\u{bbe}-ூெ-ைொ-\u{bcd}ௐ\u{bd7}௦-௯\u{c00}-ఌఎ-ఐఒ-నప-హఽ-ౄ\u{c46}-\u{c48}\u{c4a}-\u{c4d}\u{c55}-\u{c56}ౘ-ౚౠ-\u{c63}౦-౯ಀ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ\u{cbc}-ೄ\u{cc6}-ೈೊ-\u{ccd}\u{cd5}-\u{cd6}ೞೠ-\u{ce3}೦-೯ೱ-ೲ\u{d00}-ഃഅ-ഌഎ-ഐഒ-\u{d44}െ-ൈൊ-ൎൔ-\u{d57}ൟ-\u{d63}൦-൯ൺ-ൿං-ඃඅ-ඖක-නඳ-රලව-ෆ\u{dca}\u{dcf}-\u{dd4}\u{dd6}ෘ-\u{ddf}෦-෯ෲ-ෳก-\u{e3a}เ-\u{e4e}๐-๙ກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-\u{eb9}\u{ebb}-ຽເ-ໄໆ\u{ec8}-\u{ecd}໐-໙ໜ-ໟༀ\u{f18}-\u{f19}༠-༩\u{f35}\u{f37}\u{f39}༾-ཇཉ-ཬ\u{f71}-\u{f84}\u{f86}-\u{f97}\u{f99}-\u{fbc}\u{fc6}က-၉ၐ-\u{109d}Ⴀ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ\u{135d}-\u{135f}፩-፱ᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-\u{1714}ᜠ-\u{1734}ᝀ-\u{1753}ᝠ-ᝬᝮ-ᝰ\u{1772}-\u{1773}ក-\u{17d3}ៗៜ-\u{17dd}០-៩\u{180b}-\u{180d}᠐-᠙ᠠ-ᡸᢀ-ᢪᢰ-ᣵᤀ-ᤞ\u{1920}-ᤫᤰ-\u{193b}᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧚ᨀ-\u{1a1b}ᨠ-\u{1a5e}\u{1a60}-\u{1a7c}\u{1a7f}-᪉᪐-᪙ᪧ\u{1ab0}-\u{1abd}\u{1b00}-ᭋ᭐-᭙\u{1b6b}-\u{1b73}\u{1b80}-᯳ᰀ-\u{1c37}᱀-᱉ᱍ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿ\u{1cd0}-\u{1cd2}\u{1cd4}-\u{1cf9}ᴀ-\u{1df9}\u{1dfb}-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿-⁀⁔ⁱⁿₐ-ₜ\u{20d0}-\u{20dc}\u{20e1}\u{20e5}-\u{20f0}ℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ\u{2d7f}-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ\u{2de0}-\u{2dff}々-〇〡-\u{302f}〱-〵〸-〼ぁ-ゖ\u{3099}-\u{309a}ゝ-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿯ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-\u{a66f}\u{a674}-\u{a67d}ꙿ-\u{a6f1}ꜗ-ꜟꜢ-ꞈꞋ-ꞹꟷ-ꠧꡀ-ꡳꢀ-\u{a8c5}꣐-꣙\u{a8e0}-ꣷꣻꣽ-\u{a92d}ꤰ-꥓ꥠ-ꥼ\u{a980}-꧀ꧏ-꧙ꧠ-ꧾꨀ-\u{aa36}ꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺ-ꫂꫛ-ꫝꫠ-ꫯꫲ-\u{aaf6}ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯪ꯬-\u{abed}꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﱝﱤ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷹ\u{fe00}-\u{fe0f}\u{fe20}-\u{fe2f}︳-︴﹍-﹏ﹱﹳﹷﹹﹻﹽﹿ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ𐀀-𐀋𐀍-𐀦𐀨-𐀺𐀼-𐀽𐀿-𐁍𐁐-𐁝𐂀-𐃺𐅀-𐅴\u{101fd}𐊀-𐊜𐊠-𐋐\u{102e0}𐌀-𐌟𐌭-𐍊𐍐-\u{1037a}𐎀-𐎝𐎠-𐏃𐏈-𐏏𐏑-𐏕𐐀-𐒝𐒠-𐒩𐒰-𐓓𐓘-𐓻𐔀-𐔧𐔰-𐕣𐘀-𐜶𐝀-𐝕𐝠-𐝧𐠀-𐠅𐠈𐠊-𐠵𐠷-𐠸𐠼𐠿-𐡕𐡠-𐡶𐢀-𐢞𐣠-𐣲𐣴-𐣵𐤀-𐤕𐤠-𐤹𐦀-𐦷𐦾-𐦿𐨀-\u{10a03}\u{10a05}-\u{10a06}\u{10a0c}-𐨓𐨕-𐨗𐨙-𐨵\u{10a38}-\u{10a3a}\u{10a3f}𐩠-𐩼𐪀-𐪜𐫀-𐫇𐫉-\u{10ae6}𐬀-𐬵𐭀-𐭕𐭠-𐭲𐮀-𐮑𐰀-𐱈𐲀-𐲲𐳀-𐳲𐴀-\u{10d27}𐴰-𐴹𐼀-𐼜𐼧𐼰-\u{10f50}𑀀-\u{11046}𑁦-𑁯\u{1107f}-\u{110ba}𑃐-𑃨𑃰-𑃹\u{11100}-\u{11134}𑄶-𑄿𑅄-𑅆𑅐-\u{11173}𑅶\u{11180}-𑇄\u{111c9}-\u{111cc}𑇐-𑇚𑇜𑈀-𑈑𑈓-\u{11237}\u{1123e}𑊀-𑊆𑊈𑊊-𑊍𑊏-𑊝𑊟-𑊨𑊰-\u{112ea}𑋰-𑋹\u{11300}-𑌃𑌅-𑌌𑌏-𑌐𑌓-𑌨𑌪-𑌰𑌲-𑌳𑌵-𑌹\u{1133b}-𑍄𑍇-𑍈𑍋-𑍍𑍐\u{11357}𑍝-𑍣\u{11366}-\u{1136c}\u{11370}-\u{11374}𑐀-𑑊𑑐-𑑙\u{1145e}𑒀-𑓅𑓇𑓐-𑓙𑖀-\u{115b5}𑖸-\u{115c0}𑗘-\u{115dd}𑘀-\u{11640}𑙄𑙐-𑙙𑚀-\u{116b7}𑛀-𑛉𑜀-𑜚\u{1171d}-\u{1172b}𑜰-𑜹𑠀-\u{1183a}𑢠-𑣩𑣿𑨀-\u{11a3e}\u{11a47}𑩐-𑪃𑪆-\u{11a99}𑪝𑫀-𑫸𑰀-𑰈𑰊-\u{11c36}\u{11c38}-𑱀𑱐-𑱙𑱲-𑲏\u{11c92}-\u{11ca7}𑲩-\u{11cb6}𑴀-𑴆𑴈-𑴉𑴋-\u{11d36}\u{11d3a}\u{11d3c}-\u{11d3d}\u{11d3f}-\u{11d47}𑵐-𑵙𑵠-𑵥𑵧-𑵨𑵪-𑶎\u{11d90}-\u{11d91}𑶓-𑶘𑶠-𑶩𑻠-𑻶𒀀-𒎙𒐀-𒑮𒒀-𒕃𓀀-𓐮𔐀-𔙆𖠀-𖨸𖩀-𖩞𖩠-𖩩𖫐-𖫭\u{16af0}-\u{16af4}𖬀-\u{16b36}𖭀-𖭃𖭐-𖭙𖭣-𖭷𖭽-𖮏𖹀-𖹿𖼀-𖽄𖽐-𖽾\u{16f8f}-𖾟𖿠-𖿡𗀀-𘟱𘠀-𘫲𛀀-𛄞𛅰-𛋻𛰀-𛱪𛱰-𛱼𛲀-𛲈𛲐-𛲙\u{1bc9d}-\u{1bc9e}\u{1d165}-\u{1d169}𝅭-\u{1d172}\u{1d17b}-\u{1d182}\u{1d185}-\u{1d18b}\u{1d1aa}-\u{1d1ad}\u{1d242}-\u{1d244}𝐀-𝑔𝑖-𝒜𝒞-𝒟𝒢𝒥-𝒦𝒩-𝒬𝒮-𝒹𝒻𝒽-𝓃𝓅-𝔅𝔇-𝔊𝔍-𝔔𝔖-𝔜𝔞-𝔹𝔻-𝔾𝕀-𝕄𝕆𝕊-𝕐𝕒-𝚥𝚨-𝛀𝛂-𝛚𝛜-𝛺𝛼-𝜔𝜖-𝜴𝜶-𝝎𝝐-𝝮𝝰-𝞈𝞊-𝞨𝞪-𝟂𝟄-𝟋𝟎-𝟿\u{1da00}-\u{1da36}\u{1da3b}-\u{1da6c}\u{1da75}\u{1da84}\u{1da9b}-\u{1da9f}\u{1daa1}-\u{1daaf}\u{1e000}-\u{1e006}\u{1e008}-\u{1e018}\u{1e01b}-\u{1e021}\u{1e023}-\u{1e024}\u{1e026}-\u{1e02a}𞠀-𞣄\u{1e8d0}-\u{1e8d6}𞤀-\u{1e94a}𞥐-𞥙𞸀-𞸃𞸅-𞸟𞸡-𞸢𞸤𞸧𞸩-𞸲𞸴-𞸷𞸹𞸻𞹂𞹇𞹉𞹋𞹍-𞹏𞹑-𞹒𞹔𞹗𞹙𞹛𞹝𞹟𞹡-𞹢𞹤𞹧-𞹪𞹬-𞹲𞹴-𞹷𞹹-𞹼𞹾𞺀-𞺉𞺋-𞺛𞺡-𞺣𞺥-𞺩𞺫-𞺻𠀀-𪛖𪜀-𫜴𫝀-𫠝𫠠-𬺡𬺰-𮯠丽-𪘀\u{e0100}-\u{e01ef}]|[!\\-\\?])*)").unwrap(), - __regex::Regex::new("^(!=)").unwrap(), - __regex::Regex::new("^(\\$false)").unwrap(), - __regex::Regex::new("^(\\$it)").unwrap(), - __regex::Regex::new("^(\\$true)").unwrap(), - __regex::Regex::new("^(\\()").unwrap(), - __regex::Regex::new("^(\\))").unwrap(), - __regex::Regex::new("^(\\-)").unwrap(), - __regex::Regex::new("^(\\-\\-)").unwrap(), - __regex::Regex::new("^(\\.)").unwrap(), - __regex::Regex::new("^(<)").unwrap(), - __regex::Regex::new("^(<=)").unwrap(), - __regex::Regex::new("^(==)").unwrap(), - __regex::Regex::new("^(>)").unwrap(), - __regex::Regex::new("^(>=)").unwrap(), - __regex::Regex::new("^(\\{)").unwrap(), - __regex::Regex::new("^(\\|)").unwrap(), - __regex::Regex::new("^(\\})").unwrap(), - ]; - __MatcherBuilder { regex_set: __regex_set, regex_vec: __regex_vec } - } - pub fn matcher<'input, 'builder>(&'builder self, s: &'input str) -> __Matcher<'input, 'builder> { - __Matcher { - text: s, - consumed: 0, - regex_set: &self.regex_set, - regex_vec: &self.regex_vec, - } - } - } - - pub struct __Matcher<'input, 'builder> { - text: &'input str, - consumed: usize, - regex_set: &'builder __regex::RegexSet, - regex_vec: &'builder Vec<__regex::Regex>, - } - - impl<'input, 'builder> Iterator for __Matcher<'input, 'builder> { - type Item = Result<(usize, Token<'input>, usize), __lalrpop_util::ParseError,&'static str>>; - - fn next(&mut self) -> Option { - let __text = self.text.trim_start(); - let __whitespace = self.text.len() - __text.len(); - let __start_offset = self.consumed + __whitespace; - if __text.is_empty() { - self.text = __text; - self.consumed = __start_offset; - None - } else { - let __matches = self.regex_set.matches(__text); - if !__matches.matched_any() { - Some(Err(__lalrpop_util::ParseError::InvalidToken { - location: __start_offset, - })) - } else { - let mut __longest_match = 0; - let mut __index = 0; - for __i in 0 .. 23 { - if __matches.matched(__i) { - let __match = self.regex_vec[__i].find(__text).unwrap(); - let __len = __match.end(); - if __len >= __longest_match { - __longest_match = __len; - __index = __i; - } - } - } - let __result = &__text[..__longest_match]; - let __remaining = &__text[__longest_match..]; - let __end_offset = __start_offset + __longest_match; - self.text = __remaining; - self.consumed = __end_offset; - Some(Ok((__start_offset, Token(__index, __result), __end_offset))) - } - } - } - } -} -pub use self::__intern_token::Token; - -#[allow(unused_variables)] fn __action0< 'input, >( - input: &'input str, (_, __0, _): (usize, Pipeline, usize), ) -> Pipeline { (__0) } -#[allow(unused_variables)] fn __action1< 'input, >( - input: &'input str, (_, first, _): (usize, ParsedCommand, usize), ) -> Pipeline { Pipeline::new(vec![first]) } -#[allow(unused_variables)] fn __action2< 'input, >( - input: &'input str, (_, first, _): (usize, ParsedCommand, usize), (_, rest, _): (usize, ::std::vec::Vec, usize), ) -> Pipeline @@ -2636,79 +2338,65 @@ fn __action2< Pipeline::from_parts(first, rest) } -#[allow(unused_variables)] fn __action3< 'input, >( - input: &'input str, - (_, command, _): (usize, String, usize), - (_, expr, _): (usize, ::std::vec::Vec, usize), + (_, command, _): (usize, BarePath, usize), ) -> ParsedCommand { - ParsedCommand::new(command, expr) + ParsedCommand::new(command.to_string(), vec![]) } -#[allow(unused_variables)] fn __action4< 'input, >( - input: &'input str, - (_, command, _): (usize, String, usize), - (_, expr, _): (usize, Expression, usize), + (_, command, _): (usize, BarePath, usize), + (_, expr, _): (usize, ::std::vec::Vec, usize), ) -> ParsedCommand { - ParsedCommand::new(command, vec![expr]) + ParsedCommand::new(command.to_string(), expr) } -#[allow(unused_variables)] fn __action5< 'input, >( - input: &'input str, + (_, command, _): (usize, BarePath, usize), + (_, expr, _): (usize, Expression, usize), +) -> ParsedCommand +{ + ParsedCommand::new(command.to_string(), vec![expr]) +} + +fn __action6< + 'input, +>( (_, __0, _): (usize, String, usize), ) -> Expression { Expression::Leaf(Leaf::String(__0)) } -#[allow(unused_variables)] -fn __action6< - 'input, ->( - input: &'input str, - (_, __0, _): (usize, i64, usize), -) -> Expression -{ - Expression::Leaf(Leaf::Int(__0)) -} - -#[allow(unused_variables)] fn __action7< 'input, >( - input: &'input str, (_, __0, _): (usize, i64, usize), ) -> Expression { Expression::Leaf(Leaf::Int(__0)) } -#[allow(unused_variables)] fn __action8< 'input, >( - input: &'input str, (_, __0, _): (usize, Variable, usize), ) -> Expression { Expression::VariableReference(__0) } -#[allow(unused_variables)] fn __action9< 'input, >( - input: &'input str, (_, left, _): (usize, Expression, usize), (_, op, _): (usize, Operator, usize), (_, right, _): (usize, Expression, usize), @@ -2717,107 +2405,107 @@ fn __action9< Expression::Binary(Box::new(Binary::new(left, op, right))) } -#[allow(unused_variables)] fn __action10< 'input, >( - input: &'input str, - (_, _, _): (usize, &'input str, usize), + (_, _, _): (usize, SpannedToken<'input>, usize), (_, __0, _): (usize, Expression, usize), - (_, _, _): (usize, &'input str, usize), + (_, _, _): (usize, SpannedToken<'input>, usize), ) -> Expression { Expression::Parenthesized(Box::new(Parenthesized::new(__0))) } -#[allow(unused_variables)] fn __action11< 'input, >( - input: &'input str, - (_, _, _): (usize, &'input str, usize), + (_, _, _): (usize, SpannedToken<'input>, usize), (_, __0, _): (usize, Expression, usize), - (_, _, _): (usize, &'input str, usize), + (_, _, _): (usize, SpannedToken<'input>, usize), ) -> Expression { Expression::Parenthesized(Box::new(Parenthesized::new(__0))) } -#[allow(unused_variables)] fn __action12< 'input, >( - input: &'input str, (_, __0, _): (usize, Expression, usize), ) -> Expression { (__0) } -#[allow(unused_variables)] fn __action13< 'input, >( - input: &'input str, (_, __0, _): (usize, Expression, usize), ) -> Expression { (__0) } -#[allow(unused_variables)] fn __action14< 'input, >( - input: &'input str, - (_, _, _): (usize, &'input str, usize), + (_, _, _): (usize, SpannedToken<'input>, usize), (_, __0, _): (usize, Expression, usize), - (_, _, _): (usize, &'input str, usize), + (_, _, _): (usize, SpannedToken<'input>, usize), ) -> Expression { Expression::Block(Box::new(Block::new(__0))) } -#[allow(unused_variables)] fn __action15< 'input, >( - input: &'input str, - (_, _, _): (usize, &'input str, usize), + (_, _, _): (usize, SpannedToken<'input>, usize), (_, __0, _): (usize, Expression, usize), - (_, _, _): (usize, &'input str, usize), + (_, _, _): (usize, SpannedToken<'input>, usize), ) -> Expression { Expression::Block(Box::new(Block::new(__0))) } -#[allow(unused_variables)] fn __action16< 'input, >( - input: &'input str, (_, __0, _): (usize, Expression, usize), ) -> Expression { (__0) } -#[allow(unused_variables)] fn __action17< 'input, >( - input: &'input str, (_, __0, _): (usize, Expression, usize), ) -> Expression { (__0) } -#[allow(unused_variables)] fn __action18< 'input, >( - input: &'input str, + (_, __0, _): (usize, Expression, usize), +) -> Expression +{ + (__0) +} + +fn __action19< + 'input, +>( + (_, __0, _): (usize, BarePath, usize), +) -> Expression +{ + Expression::Leaf(Leaf::Bare(__0)) +} + +fn __action20< + 'input, +>( (_, head, _): (usize, Expression, usize), (_, tail, _): (usize, ::std::vec::Vec, usize), ) -> Expression @@ -2825,310 +2513,204 @@ fn __action18< Expression::Path(Box::new(Path::new(head, tail))) } -#[allow(unused_variables)] -fn __action19< - 'input, ->( - input: &'input str, - (_, __0, _): (usize, String, usize), -) -> Expression -{ - Expression::Leaf(Leaf::Bare(__0)) -} - -#[allow(unused_variables)] -fn __action20< - 'input, ->( - input: &'input str, - (_, __0, _): (usize, Expression, usize), -) -> Expression -{ - __0 -} - -#[allow(unused_variables)] fn __action21< 'input, >( - input: &'input str, (_, __0, _): (usize, Expression, usize), ) -> Expression { (__0) } -#[allow(unused_variables)] fn __action22< 'input, >( - input: &'input str, - (_, __0, _): (usize, &'input str, usize), -) -> Variable + (_, __0, _): (usize, Expression, usize), +) -> Expression { - Variable::True + (__0) } -#[allow(unused_variables)] fn __action23< 'input, >( - input: &'input str, - (_, __0, _): (usize, &'input str, usize), + (_, _, _): (usize, SpannedToken<'input>, usize), + (_, __0, _): (usize, SpannedToken<'input>, usize), ) -> Variable { - Variable::False + Variable::from_str(__0.as_slice()).unwrap() } -#[allow(unused_variables)] fn __action24< 'input, >( - input: &'input str, - (_, __0, _): (usize, &'input str, usize), -) -> Variable + (_, __0, _): (usize, SpannedToken<'input>, usize), +) -> String { - Variable::It + __0.to_string() } -#[allow(unused_variables)] fn __action25< 'input, >( - input: &'input str, - (_, __0, _): (usize, &'input str, usize), -) -> Variable + (_, __0, _): (usize, String, usize), +) -> String { - Variable::Other(__0[1..].to_string()) + (__0) } -#[allow(unused_variables)] fn __action26< 'input, >( - input: &'input str, - (_, __0, _): (usize, String, usize), -) -> String -{ - (__0) -} - -#[allow(unused_variables)] -fn __action27< - 'input, ->( - input: &'input str, - (_, __0, _): (usize, String, usize), -) -> String -{ - (__0) -} - -#[allow(unused_variables)] -fn __action28< - 'input, ->( - input: &'input str, - (_, __0, _): (usize, &'input str, usize), + (_, __0, _): (usize, SpannedToken<'input>, usize), ) -> Operator { Operator::Equal } -#[allow(unused_variables)] -fn __action29< +fn __action27< 'input, >( - input: &'input str, - (_, __0, _): (usize, &'input str, usize), + (_, __0, _): (usize, SpannedToken<'input>, usize), ) -> Operator { Operator::NotEqual } -#[allow(unused_variables)] -fn __action30< +fn __action28< 'input, >( - input: &'input str, - (_, __0, _): (usize, &'input str, usize), + (_, __0, _): (usize, SpannedToken<'input>, usize), ) -> Operator { Operator::LessThan } -#[allow(unused_variables)] -fn __action31< +fn __action29< 'input, >( - input: &'input str, - (_, __0, _): (usize, &'input str, usize), + (_, __0, _): (usize, SpannedToken<'input>, usize), ) -> Operator { Operator::GreaterThan } -#[allow(unused_variables)] -fn __action32< +fn __action30< 'input, >( - input: &'input str, - (_, __0, _): (usize, &'input str, usize), + (_, __0, _): (usize, SpannedToken<'input>, usize), ) -> Operator { Operator::LessThanOrEqual } -#[allow(unused_variables)] -fn __action33< +fn __action31< 'input, >( - input: &'input str, - (_, __0, _): (usize, &'input str, usize), + (_, __0, _): (usize, SpannedToken<'input>, usize), ) -> Operator { Operator::GreaterThanOrEqual } -#[allow(unused_variables)] -fn __action34< +fn __action32< 'input, >( - input: &'input str, - (_, _, _): (usize, &'input str, usize), - (_, __0, _): (usize, String, usize), + (_, _, _): (usize, SpannedToken<'input>, usize), + (_, __0, _): (usize, BarePath, usize), ) -> Flag { Flag::Shorthand(__0.to_string()) } -#[allow(unused_variables)] -fn __action35< +fn __action33< 'input, >( - input: &'input str, - (_, _, _): (usize, &'input str, usize), - (_, __0, _): (usize, String, usize), + (_, _, _): (usize, SpannedToken<'input>, usize), + (_, __0, _): (usize, BarePath, usize), ) -> Flag { Flag::Longhand(__0.to_string()) } -#[allow(unused_variables)] +fn __action34< + 'input, +>( + (_, __0, _): (usize, SpannedToken<'input>, usize), +) -> String +{ + __0.as_slice()[1..(__0.as_slice().len() - 1)].to_string() +} + +fn __action35< + 'input, +>( + (_, __0, _): (usize, SpannedToken<'input>, usize), +) -> String +{ + __0.as_slice()[1..(__0.as_slice().len() - 1)].to_string() +} + fn __action36< 'input, >( - input: &'input str, - (_, __0, _): (usize, String, usize), -) -> String + (_, head, _): (usize, SpannedToken<'input>, usize), + (_, tail, _): (usize, ::std::vec::Vec>, usize), +) -> BarePath { - (__0) + BarePath::from_tokens(head, tail) } -#[allow(unused_variables)] fn __action37< 'input, >( - input: &'input str, - (_, __0, _): (usize, String, usize), -) -> String + (_, __0, _): (usize, SpannedToken<'input>, usize), +) -> i64 { - (__0) + i64::from_str(__0.as_slice()).unwrap() } -#[allow(unused_variables)] fn __action38< 'input, >( - input: &'input str, - (_, __0, _): (usize, String, usize), -) -> String + __lookbehind: &usize, + __lookahead: &usize, +) -> ::std::vec::Vec> +{ + vec![] +} + +fn __action39< + 'input, +>( + (_, v, _): (usize, ::std::vec::Vec>, usize), +) -> ::std::vec::Vec> +{ + v +} + +fn __action40< + 'input, +>( + (_, _, _): (usize, SpannedToken<'input>, usize), + (_, __0, _): (usize, SpannedToken<'input>, usize), +) -> SpannedToken<'input> { (__0) } -#[allow(unused_variables)] -fn __action39< - 'input, ->( - input: &'input str, - (_, s, _): (usize, &'input str, usize), -) -> &'input str -{ - s -} - -#[allow(unused_variables)] -fn __action40< - 'input, ->( - input: &'input str, - (_, s, _): (usize, &'input str, usize), -) -> String -{ - s.to_string() -} - -#[allow(unused_variables)] fn __action41< 'input, >( - input: &'input str, - (_, s, _): (usize, &'input str, usize), -) -> String -{ - s[1..s.len() - 1].to_string() -} - -#[allow(unused_variables)] -fn __action42< - 'input, ->( - input: &'input str, - (_, s, _): (usize, &'input str, usize), -) -> String -{ - s[1..s.len() - 1].to_string() -} - -#[allow(unused_variables)] -fn __action43< - 'input, ->( - input: &'input str, - (_, s, _): (usize, &'input str, usize), -) -> i64 -{ - i64::from_str(s).unwrap() -} - -#[allow(unused_variables)] -fn __action44< - 'input, ->( - input: &'input str, - (_, s, _): (usize, &'input str, usize), -) -> i64 -{ - Byte::from_string(s).unwrap().get_bytes() as i64 -} - -#[allow(unused_variables)] -fn __action45< - 'input, ->( - input: &'input str, (_, __0, _): (usize, String, usize), ) -> ::std::vec::Vec { vec![__0] } -#[allow(unused_variables)] -fn __action46< +fn __action42< 'input, >( - input: &'input str, (_, v, _): (usize, ::std::vec::Vec, usize), (_, e, _): (usize, String, usize), ) -> ::std::vec::Vec @@ -3136,92 +2718,28 @@ fn __action46< { let mut v = v; v.push(e); v } } -#[allow(unused_variables)] -fn __action47< +fn __action43< 'input, >( - input: &'input str, - (_, _, _): (usize, &'input str, usize), + (_, _, _): (usize, SpannedToken<'input>, usize), (_, __0, _): (usize, String, usize), ) -> String { (__0) } -#[allow(unused_variables)] -fn __action48< +fn __action44< 'input, >( - input: &'input str, - __lookbehind: &usize, - __lookahead: &usize, -) -> ::std::vec::Vec -{ - vec![] -} - -#[allow(unused_variables)] -fn __action49< - 'input, ->( - input: &'input str, - (_, v, _): (usize, ::std::vec::Vec, usize), -) -> ::std::vec::Vec -{ - v -} - -#[allow(unused_variables)] -fn __action50< - 'input, ->( - input: &'input str, - (_, __0, _): (usize, ParsedCommand, usize), -) -> ::std::vec::Vec -{ - vec![__0] -} - -#[allow(unused_variables)] -fn __action51< - 'input, ->( - input: &'input str, - (_, v, _): (usize, ::std::vec::Vec, usize), - (_, e, _): (usize, ParsedCommand, usize), -) -> ::std::vec::Vec -{ - { let mut v = v; v.push(e); v } -} - -#[allow(unused_variables)] -fn __action52< - 'input, ->( - input: &'input str, - (_, _, _): (usize, &'input str, usize), - (_, __0, _): (usize, ParsedCommand, usize), -) -> ParsedCommand -{ - (__0) -} - -#[allow(unused_variables)] -fn __action53< - 'input, ->( - input: &'input str, (_, __0, _): (usize, Expression, usize), ) -> ::std::vec::Vec { vec![__0] } -#[allow(unused_variables)] -fn __action54< +fn __action45< 'input, >( - input: &'input str, (_, v, _): (usize, ::std::vec::Vec, usize), (_, e, _): (usize, Expression, usize), ) -> ::std::vec::Vec @@ -3229,159 +2747,223 @@ fn __action54< { let mut v = v; v.push(e); v } } -#[allow(unused_variables)] +fn __action46< + 'input, +>( + (_, __0, _): (usize, ParsedCommand, usize), +) -> ::std::vec::Vec +{ + vec![__0] +} + +fn __action47< + 'input, +>( + (_, v, _): (usize, ::std::vec::Vec, usize), + (_, e, _): (usize, ParsedCommand, usize), +) -> ::std::vec::Vec +{ + { let mut v = v; v.push(e); v } +} + +fn __action48< + 'input, +>( + (_, _, _): (usize, SpannedToken<'input>, usize), + (_, __0, _): (usize, ParsedCommand, usize), +) -> ParsedCommand +{ + (__0) +} + +fn __action49< + 'input, +>( + (_, __0, _): (usize, SpannedToken<'input>, usize), +) -> ::std::vec::Vec> +{ + vec![__0] +} + +fn __action50< + 'input, +>( + (_, v, _): (usize, ::std::vec::Vec>, usize), + (_, e, _): (usize, SpannedToken<'input>, usize), +) -> ::std::vec::Vec> +{ + { let mut v = v; v.push(e); v } +} + +fn __action51< + 'input, +>( + __0: (usize, SpannedToken<'input>, usize), + __1: (usize, SpannedToken<'input>, usize), +) -> ::std::vec::Vec> +{ + let __start0 = __0.0.clone(); + let __end0 = __1.2.clone(); + let __temp0 = __action40( + __0, + __1, + ); + let __temp0 = (__start0, __temp0, __end0); + __action49( + __temp0, + ) +} + +fn __action52< + 'input, +>( + __0: (usize, ::std::vec::Vec>, usize), + __1: (usize, SpannedToken<'input>, usize), + __2: (usize, SpannedToken<'input>, usize), +) -> ::std::vec::Vec> +{ + let __start0 = __1.0.clone(); + let __end0 = __2.2.clone(); + let __temp0 = __action40( + __1, + __2, + ); + let __temp0 = (__start0, __temp0, __end0); + __action50( + __0, + __temp0, + ) +} + +fn __action53< + 'input, +>( + __0: (usize, SpannedToken<'input>, usize), +) -> BarePath +{ + let __start0 = __0.2.clone(); + let __end0 = __0.2.clone(); + let __temp0 = __action38( + &__start0, + &__end0, + ); + let __temp0 = (__start0, __temp0, __end0); + __action36( + __0, + __temp0, + ) +} + +fn __action54< + 'input, +>( + __0: (usize, SpannedToken<'input>, usize), + __1: (usize, ::std::vec::Vec>, usize), +) -> BarePath +{ + let __start0 = __1.0.clone(); + let __end0 = __1.2.clone(); + let __temp0 = __action39( + __1, + ); + let __temp0 = (__start0, __temp0, __end0); + __action36( + __0, + __temp0, + ) +} + fn __action55< 'input, >( - input: &'input str, - __0: (usize, &'input str, usize), + __0: (usize, SpannedToken<'input>, usize), __1: (usize, String, usize), ) -> ::std::vec::Vec { let __start0 = __0.0.clone(); let __end0 = __1.2.clone(); - let __temp0 = __action47( - input, + let __temp0 = __action43( __0, __1, ); let __temp0 = (__start0, __temp0, __end0); - __action45( - input, + __action41( __temp0, ) } -#[allow(unused_variables)] fn __action56< 'input, >( - input: &'input str, __0: (usize, ::std::vec::Vec, usize), - __1: (usize, &'input str, usize), + __1: (usize, SpannedToken<'input>, usize), __2: (usize, String, usize), ) -> ::std::vec::Vec { let __start0 = __1.0.clone(); let __end0 = __2.2.clone(); - let __temp0 = __action47( - input, + let __temp0 = __action43( __1, __2, ); let __temp0 = (__start0, __temp0, __end0); - __action46( - input, + __action42( __0, __temp0, ) } -#[allow(unused_variables)] fn __action57< 'input, >( - input: &'input str, - __0: (usize, &'input str, usize), + __0: (usize, SpannedToken<'input>, usize), __1: (usize, ParsedCommand, usize), ) -> ::std::vec::Vec { let __start0 = __0.0.clone(); let __end0 = __1.2.clone(); - let __temp0 = __action52( - input, + let __temp0 = __action48( __0, __1, ); let __temp0 = (__start0, __temp0, __end0); - __action50( - input, + __action46( __temp0, ) } -#[allow(unused_variables)] fn __action58< 'input, >( - input: &'input str, __0: (usize, ::std::vec::Vec, usize), - __1: (usize, &'input str, usize), + __1: (usize, SpannedToken<'input>, usize), __2: (usize, ParsedCommand, usize), ) -> ::std::vec::Vec { let __start0 = __1.0.clone(); let __end0 = __2.2.clone(); - let __temp0 = __action52( - input, + let __temp0 = __action48( __1, __2, ); let __temp0 = (__start0, __temp0, __end0); - __action51( - input, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -fn __action59< - 'input, ->( - input: &'input str, - __0: (usize, String, usize), -) -> ParsedCommand -{ - let __start0 = __0.2.clone(); - let __end0 = __0.2.clone(); - let __temp0 = __action48( - input, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action3( - input, - __0, - __temp0, - ) -} - -#[allow(unused_variables)] -fn __action60< - 'input, ->( - input: &'input str, - __0: (usize, String, usize), - __1: (usize, ::std::vec::Vec, usize), -) -> ParsedCommand -{ - let __start0 = __1.0.clone(); - let __end0 = __1.2.clone(); - let __temp0 = __action49( - input, - __1, - ); - let __temp0 = (__start0, __temp0, __end0); - __action3( - input, + __action47( __0, __temp0, ) } pub trait __ToTriple<'input, > { - fn to_triple(value: Self) -> Result<(usize,Token<'input>,usize), __lalrpop_util::ParseError, &'static str>>; + fn to_triple(value: Self) -> Result<(usize,SpannedToken<'input>,usize), __lalrpop_util::ParseError, ShellError>>; } -impl<'input, > __ToTriple<'input, > for (usize, Token<'input>, usize) { - fn to_triple(value: Self) -> Result<(usize,Token<'input>,usize), __lalrpop_util::ParseError, &'static str>> { +impl<'input, > __ToTriple<'input, > for (usize, SpannedToken<'input>, usize) { + fn to_triple(value: Self) -> Result<(usize,SpannedToken<'input>,usize), __lalrpop_util::ParseError, ShellError>> { Ok(value) } } -impl<'input, > __ToTriple<'input, > for Result<(usize, Token<'input>, usize), &'static str> { - fn to_triple(value: Self) -> Result<(usize,Token<'input>,usize), __lalrpop_util::ParseError, &'static str>> { +impl<'input, > __ToTriple<'input, > for Result<(usize, SpannedToken<'input>, usize), ShellError> { + fn to_triple(value: Self) -> Result<(usize,SpannedToken<'input>,usize), __lalrpop_util::ParseError, ShellError>> { match value { Ok(v) => Ok(v), Err(error) => Err(__lalrpop_util::ParseError::User { error }), diff --git a/src/parser/span.rs b/src/parser/span.rs new file mode 100644 index 0000000000..bd5dd19b01 --- /dev/null +++ b/src/parser/span.rs @@ -0,0 +1,80 @@ +#[allow(unused)] +use crate::prelude::*; + +use crate::parser::lexer::Span; +use derive_new::new; +use language_reporting::{FileName, Location, ReportingSpan}; + +#[derive(new, Debug, Clone)] +pub struct Files { + snippet: String, +} + +impl language_reporting::ReportingFiles for Files { + type Span = Span; + type FileId = usize; + + fn byte_span( + &self, + _file: Self::FileId, + from_index: usize, + to_index: usize, + ) -> Option { + Some(Span::from((from_index, to_index))) + } + fn file_id(&self, _span: Self::Span) -> Self::FileId { + 0 + } + fn file_name(&self, _file: Self::FileId) -> FileName { + FileName::Verbatim(format!("")) + } + fn byte_index(&self, _file: Self::FileId, _line: usize, _column: usize) -> Option { + unimplemented!("byte_index") + } + fn location(&self, _file: Self::FileId, byte_index: usize) -> Option { + let source = &self.snippet; + let mut seen_lines = 0; + let mut seen_bytes = 0; + + for (pos, _) in source.match_indices('\n') { + if pos > byte_index { + return Some(language_reporting::Location::new( + seen_lines, + byte_index - seen_bytes, + )); + } else { + seen_lines += 1; + seen_bytes = pos; + } + } + + if seen_lines == 0 { + Some(language_reporting::Location::new(0, byte_index)) + } else { + None + } + } + fn line_span(&self, _file: Self::FileId, lineno: usize) -> Option { + let source = &self.snippet; + let mut seen_lines = 0; + let mut seen_bytes = 0; + + for (pos, _) in source.match_indices('\n') { + if seen_lines == lineno { + return Some(Span::from((seen_bytes, pos))); + } else { + seen_lines += 1; + seen_bytes = pos + 1; + } + } + + if seen_lines == 0 { + Some(Span::from((0, self.snippet.len() - 1))) + } else { + None + } + } + fn source(&self, span: Self::Span) -> Option { + Some(self.snippet[span.start()..span.end()].to_string()) + } +}