diff --git a/CHANGELOG.md b/CHANGELOG.md index 338c21c3..d2fb1434 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## Version 0.19.0 (2021-12-15) + +[PR 196](https://github.com/fluencelabs/aquavm/pull/196): +Introduced fail instruction. + +[PR 194](https://github.com/fluencelabs/aquavm/pull/194): +Added variables names in resolve errors. + ## Version 0.18.0 (2021-12-14) [PR 192](https://github.com/fluencelabs/aquavm/pull/172): diff --git a/Cargo.lock b/Cargo.lock index e6d48f67..1949f64c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,7 +13,7 @@ dependencies = [ [[package]] name = "air" -version = "0.18.0" +version = "0.19.0" dependencies = [ "air-execution-info-collector", "air-interpreter-data", @@ -50,7 +50,7 @@ version = "0.1.0" [[package]] name = "air-interpreter" -version = "0.18.0" +version = "0.19.0" dependencies = [ "air", "air-log-targets", diff --git a/air-interpreter/Cargo.toml b/air-interpreter/Cargo.toml index 5ac3d1b3..c3b421aa 100644 --- a/air-interpreter/Cargo.toml +++ b/air-interpreter/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "air-interpreter" -version = "0.18.0" +version = "0.19.0" description = "Crate-wrapper for air" authors = ["Fluence Labs"] edition = "2018" diff --git a/air/Cargo.toml b/air/Cargo.toml index 7170644c..378fbf96 100644 --- a/air/Cargo.toml +++ b/air/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "air" -version = "0.18.0" +version = "0.19.0" description = "Interpreter of AIR scripts intended to coordinate request flow in the Fluence network" authors = ["Fluence Labs"] edition = "2018" diff --git a/air/src/execution_step/air/fail.rs b/air/src/execution_step/air/fail.rs new file mode 100644 index 00000000..5b191612 --- /dev/null +++ b/air/src/execution_step/air/fail.rs @@ -0,0 +1,90 @@ +/* + * Copyright 2020 Fluence Labs Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +use super::ExecutionCtx; +use super::ExecutionError; +use super::ExecutionResult; +use super::LastErrorDescriptor; +use super::TraceHandler; +use crate::log_instruction; + +use air_parser::ast::Fail; +use polyplets::SecurityTetraplet; + +use std::cell::RefCell; +use std::rc::Rc; + +impl<'i> super::ExecutableInstruction<'i> for Fail<'i> { + fn execute(&self, exec_ctx: &mut ExecutionCtx<'i>, trace_ctx: &mut TraceHandler) -> ExecutionResult<()> { + log_instruction!(fail, exec_ctx, trace_ctx); + + match self { + &Fail::Literal { + ret_code, + error_message, + } => fail_with_literals(ret_code, error_message, self, exec_ctx), + // bubble last error up + Fail::LastError => fail_with_last_error(exec_ctx), + } + } +} + +fn fail_with_literals<'i>( + ret_code: i64, + error_message: &str, + fail: &Fail<'_>, + exec_ctx: &mut ExecutionCtx<'i>, +) -> ExecutionResult<()> { + let fail_error = ExecutionError::FailWithoutXorError { + ret_code, + error_message: error_message.to_string(), + }; + let fail_error = Rc::new(fail_error); + let instruction = fail.to_string(); + + // TODO: wrap exec.init_peer_id in Rc + let literal_tetraplet = SecurityTetraplet::literal_tetraplet(exec_ctx.init_peer_id.clone()); + let literal_tetraplet = Rc::new(RefCell::new(literal_tetraplet)); + + let last_error = LastErrorDescriptor::new( + fail_error.clone(), + instruction, + // init_peer_id is used here in order to obtain determinism, + // so %last_error%.peer_id will produce the same result on each peer + exec_ctx.init_peer_id.clone(), + Some(literal_tetraplet), + ); + exec_ctx.last_error = Some(last_error); + + update_context_state(exec_ctx); + + Err(fail_error) +} + +fn fail_with_last_error(exec_ctx: &mut ExecutionCtx<'_>) -> ExecutionResult<()> { + let last_error = match &exec_ctx.last_error { + Some(last_error) => last_error.error.clone(), + None => return Ok(()), + }; + + update_context_state(exec_ctx); + Err(last_error) +} + +fn update_context_state(exec_ctx: &mut ExecutionCtx<'_>) { + exec_ctx.subtree_complete = false; + exec_ctx.last_error_could_be_set = false; +} diff --git a/air/src/execution_step/air/mod.rs b/air/src/execution_step/air/mod.rs index ab10c870..a60358a6 100644 --- a/air/src/execution_step/air/mod.rs +++ b/air/src/execution_step/air/mod.rs @@ -17,6 +17,7 @@ mod ap; mod call; mod compare_matchable; +mod fail; mod fold; mod fold_scalar; mod fold_stream; @@ -102,6 +103,7 @@ impl<'i> ExecutableInstruction<'i> for Instruction<'i> { Instruction::Call(call) => call.execute(exec_ctx, trace_ctx), Instruction::Ap(ap) => execute!(self, ap, exec_ctx, trace_ctx), + Instruction::Fail(fail) => execute!(self, fail, exec_ctx, trace_ctx), Instruction::FoldScalar(fold) => execute!(self, fold, exec_ctx, trace_ctx), Instruction::FoldStream(fold) => execute!(self, fold, exec_ctx, trace_ctx), Instruction::New(new) => execute!(self, new, exec_ctx, trace_ctx), diff --git a/air/src/execution_step/errors.rs b/air/src/execution_step/errors.rs index a83d4756..f3984bb1 100644 --- a/air/src/execution_step/errors.rs +++ b/air/src/execution_step/errors.rs @@ -92,6 +92,10 @@ pub(crate) enum ExecutionError { #[error("mismatch is used without corresponding xor")] MismatchWithoutXorError, + /// This error type is produced by a fail instruction. + #[error("fail with ret_code '{ret_code}' and error_message '{error_message}' is used without corresponding xor")] + FailWithoutXorError { ret_code: i64, error_message: String }, + /// Errors bubbled from a trace handler. #[error(transparent)] TraceError(#[from] TraceHandlerError), diff --git a/air/tests/test_module/instructions/fail.rs b/air/tests/test_module/instructions/fail.rs new file mode 100644 index 00000000..7c36301b --- /dev/null +++ b/air/tests/test_module/instructions/fail.rs @@ -0,0 +1,108 @@ +/* + * Copyright 2021 Fluence Labs Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +use air_test_utils::prelude::*; + +use fstrings::f; +use fstrings::format_args_f; + +#[test] +fn fail_with_last_error() { + let local_peer_id = "local_peer_id"; + let fallible_service_id = "service_id_1"; + let mut vm = create_avm(fallible_call_service(fallible_service_id), local_peer_id); + + let script = f!(r#" + (xor + (call "{local_peer_id}" ("service_id_1" "local_fn_name") [] result_1) + (fail %last_error%) + )"#); + + let result = call_vm!(vm, "", script, "", ""); + assert_eq!(result.ret_code, 1000); + assert_eq!( + result.error_message, + r#"Local service error, ret_code is 1, error message is '"failed result from fallible_call_service"'"# + ); +} + +#[test] +fn fail_with_literals() { + let local_peer_id = "local_peer_id"; + let mut vm = create_avm(echo_call_service(), local_peer_id); + + let script = format!( + r#" + (xor + (fail 1337 "error message") + (fail %last_error%) + )"#, + ); + + let result = call_vm!(vm, "", script, "", ""); + assert_eq!(result.ret_code, 1012); + assert_eq!( + result.error_message, + "fail with ret_code '1337' and error_message 'error message' is used without corresponding xor" + ); +} + +#[test] +fn fail_with_last_error_tetraplets() { + let local_peer_id = "local_peer_id"; + let fallible_service_id = "service_id_1"; + let (host_closure, tetraplet_anchor) = tetraplet_host_function(fallible_call_service(fallible_service_id)); + let mut vm = create_avm(host_closure, local_peer_id); + + let local_fn_name = "local_fn_name"; + let script = f!(r#" + (xor + (xor + (call "{local_peer_id}" ("{fallible_service_id}" "{local_fn_name}") [] result_1) + (fail %last_error%) + ) + (call "{local_peer_id}" ("" "") [%last_error%]) + ) + "#); + + let result = checked_call_vm!(vm, local_peer_id, script, "", ""); + assert_eq!( + tetraplet_anchor.borrow()[0][0], + SecurityTetraplet::new(local_peer_id, fallible_service_id, local_fn_name, "") + ); +} + +#[test] +fn fail_with_literals_tetraplets() { + let local_peer_id = "local_peer_id"; + let (host_closure, tetraplet_anchor) = tetraplet_host_function(echo_call_service()); + let mut vm = create_avm(host_closure, local_peer_id); + + let script = f!(r#" + (xor + (xor + (fail 1337 "error message") + (fail %last_error%) + ) + (call "{local_peer_id}" ("" "") [%last_error%]) + )"#); + + let _ = checked_call_vm!(vm, local_peer_id, script, "", ""); + assert_eq!( + tetraplet_anchor.borrow()[0][0], + SecurityTetraplet::literal_tetraplet(local_peer_id) + ); +} diff --git a/air/tests/test_module/instructions/mod.rs b/air/tests/test_module/instructions/mod.rs index 751a5a63..d8566679 100644 --- a/air/tests/test_module/instructions/mod.rs +++ b/air/tests/test_module/instructions/mod.rs @@ -16,6 +16,7 @@ mod ap; mod call; +mod fail; mod fold; mod match_; mod mismatch; diff --git a/air/tests/test_module/integration/last_error.rs b/air/tests/test_module/integration/last_error.rs index e73ec9b3..1d9bd5f8 100644 --- a/air/tests/test_module/integration/last_error.rs +++ b/air/tests/test_module/integration/last_error.rs @@ -222,7 +222,7 @@ fn variable_names_shown_in_error() { assert_eq!( trace[1], executed_state::scalar(json!( - "expected JValue type 'string' for variable `-relay-`, but got '1'" + "expected JValue type 'string' for the variable `-relay-`, but got '1'" )) ); } diff --git a/air/tests/test_module/integration/streams_early_exit.rs b/air/tests/test_module/integration/streams_early_exit.rs index fd152c34..2d5b516d 100644 --- a/air/tests/test_module/integration/streams_early_exit.rs +++ b/air/tests/test_module/integration/streams_early_exit.rs @@ -141,7 +141,7 @@ fn par_early_exit() { ]; let setter_3_malicious_data = raw_data_from_trace(setter_3_malicious_trace); let init_result_3 = call_vm!(init, "", &script, init_result_2.data.clone(), setter_3_malicious_data); - assert_eq!(init_result_3.ret_code, 1012); + assert_eq!(init_result_3.ret_code, 1013); let actual_trace = trace_from_result(&init_result_3); let expected_trace = trace_from_result(&init_result_2); diff --git a/crates/air-lib/air-parser/src/ast/instruction_arguments.rs b/crates/air-lib/air-parser/src/ast/instruction_arguments.rs index d5a3d5b2..8a3ba8e4 100644 --- a/crates/air-lib/air-parser/src/ast/instruction_arguments.rs +++ b/crates/air-lib/air-parser/src/ast/instruction_arguments.rs @@ -20,7 +20,6 @@ use super::Variable; use super::VariableWithLambda; use crate::ast::ScalarWithLambda; use crate::parser::lexer::LastErrorPath; -use crate::parser::lexer::Number; use serde::Deserialize; use serde::Serialize; @@ -86,3 +85,9 @@ pub enum ApArgument<'i> { EmptyArray, Scalar(ScalarWithLambda<'i>), } + +#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] +pub enum Number { + Int(i64), + Float(f64), +} diff --git a/crates/air-lib/air-parser/src/ast/instruction_arguments/traits.rs b/crates/air-lib/air-parser/src/ast/instruction_arguments/traits.rs index 16e9495a..077fa87b 100644 --- a/crates/air-lib/air-parser/src/ast/instruction_arguments/traits.rs +++ b/crates/air-lib/air-parser/src/ast/instruction_arguments/traits.rs @@ -105,3 +105,29 @@ impl fmt::Display for Triplet<'_> { ) } } + +impl fmt::Display for Number { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + use Number::*; + + match self { + Int(number) => write!(f, "{}", number), + Float(number) => write!(f, "{}", number), + } + } +} + +impl From for serde_json::Value { + fn from(number: Number) -> Self { + (&number).into() + } +} + +impl From<&Number> for serde_json::Value { + fn from(number: &Number) -> Self { + match number { + Number::Int(value) => (*value).into(), + Number::Float(value) => (*value).into(), + } + } +} diff --git a/crates/air-lib/air-parser/src/ast/instructions.rs b/crates/air-lib/air-parser/src/ast/instructions.rs index 05e339f0..648e005c 100644 --- a/crates/air-lib/air-parser/src/ast/instructions.rs +++ b/crates/air-lib/air-parser/src/ast/instructions.rs @@ -21,6 +21,7 @@ use super::*; use serde::Serialize; use std::rc::Rc; +// TODO: sort instruction in alphanumeric order #[allow(clippy::large_enum_variant)] // for Null and Error variants #[derive(Serialize, Debug, PartialEq)] pub enum Instruction<'i> { @@ -31,6 +32,7 @@ pub enum Instruction<'i> { Xor(Xor<'i>), Match(Match<'i>), MisMatch(MisMatch<'i>), + Fail(Fail<'i>), FoldScalar(FoldScalar<'i>), FoldStream(FoldStream<'i>), New(New<'i>), @@ -82,6 +84,17 @@ pub struct MisMatch<'i> { pub instruction: Box>, } +/// (fail 1337 "error message") +/// (fail %last_error%) +#[derive(Serialize, Debug, PartialEq)] +pub enum Fail<'i> { + Literal { + ret_code: i64, + error_message: &'i str, + }, + LastError, +} + /// (fold scalar_iterable iterator instruction) #[derive(Serialize, Debug, PartialEq)] pub struct FoldScalar<'i> { diff --git a/crates/air-lib/air-parser/src/ast/instructions/traits.rs b/crates/air-lib/air-parser/src/ast/instructions/traits.rs index 3daa36d4..0bffd763 100644 --- a/crates/air-lib/air-parser/src/ast/instructions/traits.rs +++ b/crates/air-lib/air-parser/src/ast/instructions/traits.rs @@ -30,6 +30,7 @@ impl fmt::Display for Instruction<'_> { Xor(xor) => write!(f, "{}", xor), Match(match_) => write!(f, "{}", match_), MisMatch(mismatch) => write!(f, "{}", mismatch), + Fail(fail) => write!(f, "{}", fail), FoldScalar(fold) => write!(f, "{}", fold), FoldStream(fold) => write!(f, "{}", fold), Next(next) => write!(f, "{}", next), @@ -55,6 +56,18 @@ impl fmt::Display for Ap<'_> { } } +impl fmt::Display for Fail<'_> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Fail::Literal { + ret_code, + error_message, + } => write!(f, "fail {} {}", ret_code, error_message), + Fail::LastError => write!(f, "fail %last_error%"), + } + } +} + impl fmt::Display for FoldScalar<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "fold {} {}", self.iterable, self.iterator) diff --git a/crates/air-lib/air-parser/src/ast/mod.rs b/crates/air-lib/air-parser/src/ast/mod.rs index 515b5b8a..6e8e7cc7 100644 --- a/crates/air-lib/air-parser/src/ast/mod.rs +++ b/crates/air-lib/air-parser/src/ast/mod.rs @@ -23,5 +23,4 @@ pub use instructions::*; pub use values::*; pub use crate::parser::lexer::LastErrorPath; -pub use crate::parser::lexer::Number; pub use crate::parser::Span; diff --git a/crates/air-lib/air-parser/src/parser/air.lalrpop b/crates/air-lib/air-parser/src/parser/air.lalrpop index 35b64b86..bbdd34e2 100644 --- a/crates/air-lib/air-parser/src/parser/air.lalrpop +++ b/crates/air-lib/air-parser/src/parser/air.lalrpop @@ -4,7 +4,6 @@ use crate::parser::VariableValidator; use crate::parser::Span; use crate::parser::lexer::Token; use crate::parser::lexer::LastErrorPath; -use crate::parser::lexer::Number; use crate::parser::air_utils::*; use crate::make_user_error; @@ -60,6 +59,10 @@ Instr: Box> = { Box::new(Instruction::New(new)) }, + "(" fail ")" => { + Box::new(Instruction::Fail(fail_body)) + }, + "(" fold ")" => { let iterator = Scalar::new(iterator.0, iterator.1); let span = Span::new(left, right); @@ -133,6 +136,20 @@ ScriptVariable: Variable<'input> = { => Variable::stream(stream.0, stream.1), }; +FailBody: Fail<'input> = { + => Fail::Literal { + ret_code, + error_message, + }, + => { + // it's possible to write smth like that `(fail %last_error%.msg)`, that would be ambigious + if !matches!(last_error_path, LastErrorPath::None) { + errors.push(make_user_error!(AmbiguousFailLastError, left, Token::Fail, right)); + } + Fail::LastError + } +} + FoldScalarIterable: ScalarWithLambda<'input> = { => ScalarWithLambda::new(scalar.0, None, scalar.1), => ScalarWithLambda::new(scalar.0, Some(scalar.1), scalar.2), @@ -151,6 +168,11 @@ CallInstrValue: CallInstrValue<'input> = { => CallInstrValue::Variable(VariableWithLambda::stream_wl(stream.0, stream.1, stream.2)), } +Number: Number = { + => Number::Int(integer), + => Number::Float(float), +} + Arg = Value; Value: Value<'input> = { @@ -187,12 +209,14 @@ extern { "[" => Token::OpenSquareBracket, "]" => Token::CloseSquareBracket, - Literal => Token::StringLiteral(<&'input str>), Scalar => Token::Scalar { name:<&'input str>, position: }, ScalarWithLambda => Token::ScalarWithLambda { name: <&'input str>, lambda: >, position: }, Stream => Token::Stream { name: <&'input str>, position: }, StreamWithLambda => Token::StreamWithLambda {name: <&'input str>, lambda:>, position: }, - Number => Token::Number(), + + Literal => Token::StringLiteral(<&'input str>), + I64 => Token::I64(), + F64 => Token::F64(), Boolean => Token::Boolean(), InitPeerId => Token::InitPeerId, @@ -202,6 +226,7 @@ extern { ap => Token::Ap, seq => Token::Seq, par => Token::Par, + fail => Token::Fail, fold => Token::Fold, xor => Token::Xor, new => Token::New, diff --git a/crates/air-lib/air-parser/src/parser/air.rs b/crates/air-lib/air-parser/src/parser/air.rs index c0e86178..d92ac468 100644 --- a/crates/air-lib/air-parser/src/parser/air.rs +++ b/crates/air-lib/air-parser/src/parser/air.rs @@ -1,12 +1,11 @@ // auto-generated: "lalrpop 0.19.6" -// sha3: 4054b676e3a83f623b634293743f612b76813d6f88d9afc39708a598f997e +// sha3: a9fea7309f6267251291bd4f29ca8c58ee262f11f7776aa17baec3f33edac3 use crate::ast::*; use crate::parser::ParserError; use crate::parser::VariableValidator; use crate::parser::Span; use crate::parser::lexer::Token; use crate::parser::lexer::LastErrorPath; -use crate::parser::lexer::Number; use crate::parser::air_utils::*; use crate::make_user_error; use air_lambda_parser::LambdaAST; @@ -29,7 +28,6 @@ mod __parse__AIR { use crate::parser::Span; use crate::parser::lexer::Token; use crate::parser::lexer::LastErrorPath; - use crate::parser::lexer::Number; use crate::parser::air_utils::*; use crate::make_user_error; use air_lambda_parser::LambdaAST; @@ -47,245 +45,264 @@ mod __parse__AIR { { Variant0(Token<'input>), Variant1(bool), - Variant2(LastErrorPath), - Variant3(&'input str), - Variant4(Number), - Variant5((&'input str, usize)), - Variant6((&'input str, LambdaAST<'input>, usize)), - Variant7(__lalrpop_util::ErrorRecovery, ParserError>), - Variant8(Value<'input>), - Variant9(alloc::vec::Vec>), - Variant10(usize), - Variant11(Box>), - Variant12(ApArgument<'input>), - Variant13(Variable<'input>), - Variant14(Vec>), - Variant15(CallInstrValue<'input>), - Variant16(core::option::Option>), - Variant17(FunctionPart<'input>), - Variant18(ScalarWithLambda<'input>), - Variant19(PeerPart<'input>), + Variant2(f64), + Variant3(i64), + Variant4(LastErrorPath), + Variant5(&'input str), + Variant6((&'input str, usize)), + Variant7((&'input str, LambdaAST<'input>, usize)), + Variant8(__lalrpop_util::ErrorRecovery, ParserError>), + Variant9(Value<'input>), + Variant10(alloc::vec::Vec>), + Variant11(usize), + Variant12(Box>), + Variant13(ApArgument<'input>), + Variant14(Variable<'input>), + Variant15(Vec>), + Variant16(CallInstrValue<'input>), + Variant17(core::option::Option>), + Variant18(FunctionPart<'input>), + Variant19(Fail<'input>), + Variant20(ScalarWithLambda<'input>), + Variant21(Number), + Variant22(PeerPart<'input>), } const __ACTION: &[i8] = &[ // State 0 - 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, + 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, 35, // State 1 - 0, 0, 37, 0, 38, 39, 40, 41, 42, 43, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 39, 0, 40, 41, 42, 43, 44, 45, 46, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 2 - 13, 0, 0, 0, 0, 47, 0, 48, 0, 49, 50, 51, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 0, 0, 0, 50, 0, 51, 52, 53, 54, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 3 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 55, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 57, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 4 - 0, 0, 57, 0, 58, 59, 60, 61, 62, 63, 64, 65, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 61, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 5 - 0, 0, 57, 0, 58, 59, 60, 61, 62, 63, 64, 65, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 64, 0, 65, 41, 42, 66, 67, 68, 69, 70, 71, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 6 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 64, 0, 65, 41, 42, 66, 67, 68, 69, 70, 71, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 7 - 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 8 - 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, + 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, 35, // State 9 - 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, + 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, 35, // State 10 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 35, // State 11 - 21, 0, 0, 0, 0, 47, 0, 48, 0, 49, 50, 51, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 12 - 0, 0, 0, 0, 0, 47, 0, 48, 0, 49, 50, 51, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 22, 0, 0, 0, 0, 0, 0, 50, 0, 51, 52, 53, 54, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 13 - 0, 0, 57, 0, 58, 59, 60, 61, 62, 63, 64, 65, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, 0, 51, 52, 53, 54, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 14 - 0, 0, 57, 0, 58, 59, 60, 61, 62, 63, 64, 65, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 64, 0, 65, 41, 42, 66, 67, 68, 69, 70, 71, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 15 - 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, + 0, 0, 64, 0, 65, 41, 42, 66, 67, 68, 69, 70, 71, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 16 - 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, + 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, 35, // State 17 - 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, + 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, 35, // State 18 - 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, + 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, 35, // State 19 - 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, + 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, 35, // State 20 - 0, 0, 0, 0, 0, 47, 0, 48, 0, 49, 50, 51, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 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, // State 21 - 0, 0, 0, 0, 0, 47, 0, 48, 0, 49, 50, 51, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, 0, 51, 52, 53, 54, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 22 - 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, + 0, 0, 0, 0, 0, 0, 0, 50, 0, 51, 52, 53, 54, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 23 - 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, + 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, 35, // State 24 - 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, + 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, 35, // State 25 - 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, + 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, 35, // State 26 - 0, 95, 0, 0, 0, 0, 0, 0, 0, 67, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 35, // State 27 - 0, 0, 57, 98, 58, 59, 60, 61, 62, 63, 64, 65, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 103, 0, 0, 0, 0, 0, 0, 0, 0, 73, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 28 - 0, 0, 0, 0, 0, 47, 0, 48, 0, 49, 50, 51, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 64, 106, 65, 41, 42, 66, 67, 68, 69, 70, 71, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 29 - 0, 0, 57, 107, 58, 59, 60, 61, 62, 63, 64, 65, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, 0, 51, 52, 53, 54, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 64, 115, 65, 41, 42, 66, 67, 68, 69, 70, 71, 72, 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, // State 32 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 35, 36, 8, 9, 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, // State 33 - -48, -48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -48, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 8, 36, 37, 9, 10, 11, 0, // State 34 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -51, -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, -51, // State 35 - 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 36 - 0, 0, 0, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 76, 0, 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, -13, 0, -13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -12, 0, -12, 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, -9, 0, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 39 - 0, 0, 0, 0, 0, 0, 0, 0, 0, -10, 0, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -13, 0, -13, 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, -11, 0, -11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -53, 0, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -53, // State 41 - 0, 0, 0, 0, 0, 0, 0, 0, 0, -12, 0, -12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -52, 0, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -52, // State 42 - 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, 0, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -9, 0, -9, 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, -16, 0, -16, 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, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 44 - -49, 0, 0, 0, 0, -49, 0, -49, 0, -49, -49, -49, -49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -11, 0, -11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 45 - -50, 0, 0, 0, 0, -50, 0, -50, 0, -50, -50, -50, -50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, 0, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 46 - -21, -21, -21, 0, 0, -21, 0, -21, 0, -21, -21, -21, -21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16, 0, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 47 - -22, -22, -22, 0, 0, -22, 0, -22, 0, -22, -22, -22, -22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -54, 0, 0, 0, 0, 0, 0, -54, 0, -54, -54, -54, -54, -54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 48 - -23, -23, -23, 0, 0, -23, 0, -23, 0, -23, -23, -23, -23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -55, 0, 0, 0, 0, 0, 0, -55, 0, -55, -55, -55, -55, -55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 49 - -24, -24, -24, 0, 0, -24, 0, -24, 0, -24, -24, -24, -24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -21, -21, -21, 0, 0, 0, 0, -21, 0, -21, -21, -21, -21, -21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 50 - -25, -25, -25, 0, 0, -25, 0, -25, 0, -25, -25, -25, -25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -22, -22, -22, 0, 0, 0, 0, -22, 0, -22, -22, -22, -22, -22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 51 - -26, -26, -26, 0, 0, -26, 0, -26, 0, -26, -26, -26, -26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -23, -23, -23, 0, 0, 0, 0, -23, 0, -23, -23, -23, -23, -23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 52 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -24, -24, -24, 0, 0, 0, 0, -24, 0, -24, -24, -24, -24, -24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 53 - 0, 0, 0, 0, 0, 0, 0, 0, 0, -32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -25, -25, -25, 0, 0, 0, 0, -25, 0, -25, -25, -25, -25, -25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 54 - 0, 0, 0, 0, 0, 0, 0, 0, 0, -33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -26, -26, -26, 0, 0, 0, 0, -26, 0, -26, -26, -26, -26, -26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 55 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 82, 0, 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, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 57 - -59, 0, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -59, + 0, -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, // State 58 - -55, 0, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -55, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 59 - -56, 0, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -56, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 60 - -57, 0, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -57, + 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, // State 61 - -58, 0, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -58, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 62 - -61, 0, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -61, + -63, 0, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -63, // State 63 - -62, 0, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -62, + 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 64 - -63, 0, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -63, + -64, 0, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -64, // State 65 - -64, 0, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -64, + -60, 0, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -60, // State 66 - -52, -52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -52, + -61, 0, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -61, // State 67 - -53, -53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -53, + -62, 0, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -62, // State 68 - 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -66, 0, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -66, // State 69 - -40, -40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -40, + -67, 0, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -67, // State 70 - 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -68, 0, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -68, // State 71 - 0, -17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -69, 0, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -69, // State 72 - 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, 0, -14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -57, -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, -57, // State 73 - 0, -34, -34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -58, -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, -58, // State 74 - 0, 0, -30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 86, 0, 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 75 - -60, 0, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -60, + -42, -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, -42, // State 76 - 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 90, 0, 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 77 - -44, -44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -44, + 0, -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, // State 78 - 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, 0, -14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 79 - 0, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -36, -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, // State 80 - 0, 92, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 81 - -37, -37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -37, + -44, -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, -44, // State 82 - 0, -54, 0, 0, 0, -54, 0, -54, 0, -54, -54, -54, -54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -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, // State 83 - 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -65, 0, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -65, // State 84 - 0, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 97, 0, 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 85 - 0, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -47, -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, -47, // State 86 - 0, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 98, 0, 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 87 - 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 99, 0, 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 88 - -41, -41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -41, + 0, 100, 0, 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 89 - -39, -39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -39, + -39, -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, -39, // State 90 - -38, -38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -38, + 0, -59, 0, 0, 0, 0, 0, -59, 0, -59, -59, -59, -59, -59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 91 - -45, -45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -45, + 0, 108, 0, 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 92 - 0, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 109, 0, 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 93 - 0, -27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 110, 0, 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 94 - -36, -36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -36, + 0, 111, 0, 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 95 - 0, 0, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 112, 0, 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 96 - 0, 0, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -43, -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, -43, // State 97 - 0, -19, 0, 0, 0, 0, 0, 0, 0, -19, 0, -19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -41, -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, -41, // State 98 - 0, 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -40, -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, -40, // State 99 - -51, 0, 0, 0, 0, -51, 0, -51, 0, -51, -51, -51, -51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -48, -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, -48, // State 100 - -42, -42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -42, + 0, 113, 0, 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 101 - -43, -43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -43, + 0, -27, 0, 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 102 - -46, -46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -46, + -38, -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, -38, // State 103 - -47, -47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -47, + 0, 0, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 104 - -35, -35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -35, + 0, 0, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 105 - 0, 0, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -19, 0, 0, 0, 0, 0, 0, 0, 0, -19, 0, -19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 106 - 0, -20, 0, 0, 0, 0, 0, 0, 0, -20, 0, -20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 116, 0, 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 107 - 0, 0, -31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -56, 0, 0, 0, 0, 0, 0, -56, 0, -56, -56, -56, -56, -56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // State 108 + -45, -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, -45, + // State 109 + -46, -46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -46, + // State 110 + -49, -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, -49, + // State 111 + -50, -50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -50, + // State 112 + -37, -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, -37, + // State 113 + 0, 0, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // State 114 + 0, -20, 0, 0, 0, 0, 0, 0, 0, 0, -20, 0, -20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // State 115 + 0, 0, -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, ]; fn __action(state: i8, integer: usize) -> i8 { - __ACTION[(state as usize) * 25 + integer] + __ACTION[(state as usize) * 27 + integer] } const __EOF_ACTION: &[i8] = &[ // State 0 @@ -349,15 +366,15 @@ mod __parse__AIR { // State 29 0, // State 30 - -65, + 0, // State 31 - -8, + -70, // State 32 - 0, + -8, // State 33 - -48, - // State 34 0, + // State 34 + -51, // State 35 0, // State 36 @@ -427,7 +444,7 @@ mod __parse__AIR { // State 68 0, // State 69 - -40, + 0, // State 70 0, // State 71 @@ -439,11 +456,11 @@ mod __parse__AIR { // State 74 0, // State 75 - 0, + -42, // State 76 0, // State 77 - -44, + 0, // State 78 0, // State 79 @@ -451,7 +468,7 @@ mod __parse__AIR { // State 80 0, // State 81 - -37, + -44, // State 82 0, // State 83 @@ -459,109 +476,130 @@ mod __parse__AIR { // State 84 0, // State 85 - 0, + -47, // State 86 0, // State 87 0, // State 88 - -41, + 0, // State 89 -39, // State 90 - -38, + 0, // State 91 - -45, + 0, // State 92 0, // State 93 0, // State 94 - -36, + 0, // State 95 0, // State 96 - 0, - // State 97 - 0, - // State 98 - 0, - // State 99 - 0, - // State 100 - -42, - // State 101 -43, + // State 97 + -41, + // State 98 + -40, + // State 99 + -48, + // State 100 + 0, + // State 101 + 0, // State 102 - -46, + -38, // State 103 - -47, + 0, // State 104 - -35, + 0, // State 105 0, // State 106 0, // State 107 0, + // State 108 + -45, + // State 109 + -46, + // State 110 + -49, + // State 111 + -50, + // State 112 + -37, + // State 113 + 0, + // State 114 + 0, + // State 115 + 0, ]; fn __goto(state: i8, nt: usize) -> i8 { match nt { - 2 => 29, - 5 => 30, - 6 => 10, - 7 => 70, + 2 => 30, + 5 => 31, + 6 => 11, + 7 => 76, 8 => match state { - 29 => 105, - _ => 95, + 30 => 113, + _ => 103, }, - 9 => 26, + 9 => 27, 10 => match state { - 11 | 28 => 73, - 20..=21 => 82, - _ => 44, - }, - 11 => 92, - 13 => 19, - 14 => 52, - 15 => match state { - 28 => 98, - _ => 74, + 12 | 29 => 79, + 21..=22 => 90, + _ => 47, }, + 11 => 100, + 13 => 20, + 14 => 55, + 15 => 58, 16 => match state { - 8 => 17, - 9 => 18, - 0 => 31, - 15 => 76, - 16 => 78, - 17 => 79, - 18 => 80, - 22 => 84, - 23 => 85, - 24 => 86, - 25 => 87, - _ => 16, + 29 => 106, + _ => 80, }, 17 => match state { - 2 => 45, - _ => 21, + 9 => 18, + 10 => 19, + 0 => 32, + 16 => 84, + 17 => 86, + 18 => 87, + 19 => 88, + 23 => 92, + 24 => 93, + 25 => 94, + 26 => 95, + _ => 17, + }, + 18 => match state { + 1 => 37, + _ => 62, }, - 18 => 11, 19 => match state { - 10 => 71, - 26 => 93, - _ => 15, - }, - 20 => match state { - 21 => 83, - _ => 28, + 2 => 48, + _ => 22, }, + 20 => 12, 21 => match state { - 4 => 13, + 11 => 77, + 27 => 101, + _ => 16, + }, + 22 => match state { + 22 => 91, + _ => 29, + }, + 23 => match state { 5 => 14, - 13 => 24, + 6 => 15, 14 => 25, - _ => 96, + 15 => 26, + _ => 104, }, _ => 0, } @@ -573,16 +611,18 @@ mod __parse__AIR { r###""[""###, r###""]""###, r###"Boolean"###, + r###"F64"###, + r###"I64"###, r###"InitPeerId"###, r###"LastError"###, r###"Literal"###, - r###"Number"###, r###"Scalar"###, r###"ScalarWithLambda"###, r###"Stream"###, r###"StreamWithLambda"###, r###"ap"###, r###"call"###, + r###"fail"###, r###"fold"###, r###"match_"###, r###"mismatch"###, @@ -646,7 +686,7 @@ mod __parse__AIR { #[inline] fn error_action(&self, state: i8) -> i8 { - __action(state, 25 - 1) + __action(state, 27 - 1) } #[inline] @@ -677,7 +717,7 @@ mod __parse__AIR { &self, recovery: __state_machine::ErrorRecovery, ) -> Self::Symbol { - __Symbol::Variant7(recovery) + __Symbol::Variant8(recovery) } fn reduce( @@ -718,25 +758,27 @@ mod __parse__AIR { Token::OpenSquareBracket if true => Some(2), Token::CloseSquareBracket if true => Some(3), Token::Boolean(_) if true => Some(4), - Token::InitPeerId if true => Some(5), - Token::LastError(_) if true => Some(6), - Token::StringLiteral(_) if true => Some(7), - Token::Number(_) if true => Some(8), - Token::Scalar { name: _, position: _ } if true => Some(9), - Token::ScalarWithLambda { name: _, lambda: _, position: _ } if true => Some(10), - Token::Stream { name: _, position: _ } if true => Some(11), - Token::StreamWithLambda { name: _, lambda: _, position: _ } if true => Some(12), - Token::Ap if true => Some(13), - Token::Call if true => Some(14), - Token::Fold if true => Some(15), - Token::Match if true => Some(16), - Token::MisMatch if true => Some(17), - Token::New if true => Some(18), - Token::Next if true => Some(19), - Token::Null if true => Some(20), - Token::Par if true => Some(21), - Token::Seq if true => Some(22), - Token::Xor if true => Some(23), + Token::F64(_) if true => Some(5), + Token::I64(_) if true => Some(6), + Token::InitPeerId if true => Some(7), + Token::LastError(_) if true => Some(8), + Token::StringLiteral(_) if true => Some(9), + Token::Scalar { name: _, position: _ } if true => Some(10), + Token::ScalarWithLambda { name: _, lambda: _, position: _ } if true => Some(11), + Token::Stream { name: _, position: _ } if true => Some(12), + Token::StreamWithLambda { name: _, lambda: _, position: _ } if true => Some(13), + Token::Ap if true => Some(14), + Token::Call if true => Some(15), + Token::Fail if true => Some(16), + Token::Fold if true => Some(17), + Token::Match if true => Some(18), + Token::MisMatch if true => Some(19), + Token::New if true => Some(20), + Token::Next if true => Some(21), + Token::Null if true => Some(22), + Token::Par if true => Some(23), + Token::Seq if true => Some(24), + Token::Xor if true => Some(25), _ => None, } } @@ -751,29 +793,33 @@ mod __parse__AIR { ) -> __Symbol<'input> { match __token_index { - 0 | 1 | 2 | 3 | 5 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 => __Symbol::Variant0(__token), + 0 | 1 | 2 | 3 | 7 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 => __Symbol::Variant0(__token), 4 => match __token { Token::Boolean(__tok0) if true => __Symbol::Variant1(__tok0), _ => unreachable!(), }, - 6 => match __token { - Token::LastError(__tok0) if true => __Symbol::Variant2(__tok0), + 5 => match __token { + Token::F64(__tok0) if true => __Symbol::Variant2(__tok0), _ => unreachable!(), }, - 7 => match __token { - Token::StringLiteral(__tok0) if true => __Symbol::Variant3(__tok0), + 6 => match __token { + Token::I64(__tok0) if true => __Symbol::Variant3(__tok0), _ => unreachable!(), }, 8 => match __token { - Token::Number(__tok0) if true => __Symbol::Variant4(__tok0), + Token::LastError(__tok0) if true => __Symbol::Variant4(__tok0), _ => unreachable!(), }, - 9 | 11 => match __token { - Token::Scalar { name: __tok0, position: __tok1 } | Token::Stream { name: __tok0, position: __tok1 } if true => __Symbol::Variant5((__tok0, __tok1)), + 9 => match __token { + Token::StringLiteral(__tok0) if true => __Symbol::Variant5(__tok0), _ => unreachable!(), }, 10 | 12 => match __token { - Token::ScalarWithLambda { name: __tok0, lambda: __tok1, position: __tok2 } | Token::StreamWithLambda { name: __tok0, lambda: __tok1, position: __tok2 } if true => __Symbol::Variant6((__tok0, __tok1, __tok2)), + Token::Scalar { name: __tok0, position: __tok1 } | Token::Stream { name: __tok0, position: __tok1 } if true => __Symbol::Variant6((__tok0, __tok1)), + _ => unreachable!(), + }, + 11 | 13 => match __token { + Token::ScalarWithLambda { name: __tok0, lambda: __tok1, position: __tok2 } | Token::StreamWithLambda { name: __tok0, lambda: __tok1, position: __tok2 } if true => __Symbol::Variant7((__tok0, __tok1, __tok2)), _ => unreachable!(), }, _ => unreachable!(), @@ -980,7 +1026,7 @@ mod __parse__AIR { } 31 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 2, nonterminal_produced: 14, } } @@ -998,134 +1044,134 @@ mod __parse__AIR { } 34 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 7, - nonterminal_produced: 16, + states_to_pop: 1, + nonterminal_produced: 15, } } 35 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, + states_to_pop: 1, nonterminal_produced: 16, } } 36 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 16, + states_to_pop: 7, + nonterminal_produced: 17, } } 37 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 16, + states_to_pop: 6, + nonterminal_produced: 17, } } 38 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 5, - nonterminal_produced: 16, + nonterminal_produced: 17, } } 39 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 16, + states_to_pop: 5, + nonterminal_produced: 17, } } 40 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 5, - nonterminal_produced: 16, + nonterminal_produced: 17, } } 41 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 16, + states_to_pop: 3, + nonterminal_produced: 17, } } 42 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 16, + states_to_pop: 5, + nonterminal_produced: 17, } } 43 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 4, - nonterminal_produced: 16, + nonterminal_produced: 17, } } 44 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 5, - nonterminal_produced: 16, + states_to_pop: 6, + nonterminal_produced: 17, } } 45 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 6, - nonterminal_produced: 16, + nonterminal_produced: 17, } } 46 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 16, + states_to_pop: 4, + nonterminal_produced: 17, } } 47 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 16, + states_to_pop: 5, + nonterminal_produced: 17, } } 48 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 6, nonterminal_produced: 17, } } 49 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 18, + states_to_pop: 6, + nonterminal_produced: 17, } } 50 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 18, + states_to_pop: 1, + nonterminal_produced: 17, } } 51 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 19, + nonterminal_produced: 18, } } 52 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 19, + nonterminal_produced: 18, } } 53 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 20, + nonterminal_produced: 19, } } 54 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 21, + nonterminal_produced: 20, } } 55 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 21, + states_to_pop: 4, + nonterminal_produced: 20, } } 56 => { @@ -1143,40 +1189,70 @@ mod __parse__AIR { 58 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 21, + nonterminal_produced: 22, } } 59 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 21, + states_to_pop: 1, + nonterminal_produced: 23, } } 60 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 21, + nonterminal_produced: 23, } } 61 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 21, + nonterminal_produced: 23, } } 62 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 21, + nonterminal_produced: 23, } } 63 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 21, + nonterminal_produced: 23, } } - 64 => __state_machine::SimulatedReduce::Accept, + 64 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 2, + nonterminal_produced: 23, + } + } + 65 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 23, + } + } + 66 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 23, + } + } + 67 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 23, + } + } + 68 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 23, + } + } + 69 => __state_machine::SimulatedReduce::Accept, _ => panic!("invalid reduction index {}", __reduce_index) } } @@ -1466,8 +1542,23 @@ mod __parse__AIR { __reduce63(input, errors, validator, __lookahead_start, __symbols, core::marker::PhantomData::<(&(), &(), &())>) } 64 => { + __reduce64(input, errors, validator, __lookahead_start, __symbols, core::marker::PhantomData::<(&(), &(), &())>) + } + 65 => { + __reduce65(input, errors, validator, __lookahead_start, __symbols, core::marker::PhantomData::<(&(), &(), &())>) + } + 66 => { + __reduce66(input, errors, validator, __lookahead_start, __symbols, core::marker::PhantomData::<(&(), &(), &())>) + } + 67 => { + __reduce67(input, errors, validator, __lookahead_start, __symbols, core::marker::PhantomData::<(&(), &(), &())>) + } + 68 => { + __reduce68(input, errors, validator, __lookahead_start, __symbols, core::marker::PhantomData::<(&(), &(), &())>) + } + 69 => { // __AIR = AIR => ActionFn(0); - let __sym0 = __pop_Variant11(__symbols); + let __sym0 = __pop_Variant12(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); let __nt = super::__action0::<>(input, errors, validator, __sym0); @@ -1486,25 +1577,36 @@ mod __parse__AIR { fn __symbol_type_mismatch() -> ! { panic!("symbol type mismatch") } - fn __pop_Variant6< + fn __pop_Variant7< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, (&'input str, LambdaAST<'input>, usize), usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant6(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant7(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant5< + fn __pop_Variant6< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, (&'input str, usize), usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant5(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant6(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant13< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, ApArgument<'input>, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant13(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } @@ -1512,65 +1614,21 @@ mod __parse__AIR { 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, ApArgument<'input>, usize) + ) -> (usize, Box>, usize) { match __symbols.pop() { Some((__l, __Symbol::Variant12(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant11< - 'input, - >( - __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, Box>, usize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant11(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant15< + fn __pop_Variant16< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, CallInstrValue<'input>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant15(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant17< - 'input, - >( - __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, FunctionPart<'input>, usize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant17(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant2< - 'input, - >( - __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, LastErrorPath, usize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant2(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant4< - 'input, - >( - __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, Number, usize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant4(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant16(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } @@ -1578,7 +1636,7 @@ mod __parse__AIR { 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, PeerPart<'input>, usize) + ) -> (usize, Fail<'input>, usize) { match __symbols.pop() { Some((__l, __Symbol::Variant19(__v), __r)) => (__l, __v, __r), @@ -1589,13 +1647,57 @@ mod __parse__AIR { 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, ScalarWithLambda<'input>, usize) + ) -> (usize, FunctionPart<'input>, usize) { match __symbols.pop() { Some((__l, __Symbol::Variant18(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } + fn __pop_Variant4< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, LastErrorPath, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant4(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant21< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, Number, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant21(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant22< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, PeerPart<'input>, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant22(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant20< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, ScalarWithLambda<'input>, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant20(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } fn __pop_Variant0< 'input, >( @@ -1607,25 +1709,14 @@ mod __parse__AIR { _ => __symbol_type_mismatch() } } - fn __pop_Variant8< + fn __pop_Variant9< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, Value<'input>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant8(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant13< - 'input, - >( - __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, Variable<'input>, usize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant13(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant9(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } @@ -1633,32 +1724,43 @@ mod __parse__AIR { 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, Vec>, usize) + ) -> (usize, Variable<'input>, usize) { match __symbols.pop() { Some((__l, __Symbol::Variant14(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant7< + fn __pop_Variant15< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, Vec>, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant15(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant8< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, __lalrpop_util::ErrorRecovery, ParserError>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant7(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant8(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant9< + fn __pop_Variant10< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, alloc::vec::Vec>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant9(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant10(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } @@ -1673,25 +1775,25 @@ mod __parse__AIR { _ => __symbol_type_mismatch() } } - fn __pop_Variant16< + fn __pop_Variant17< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, core::option::Option>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant16(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant17(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant10< + fn __pop_Variant2< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, usize, usize) + ) -> (usize, f64, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant10(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant2(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } @@ -1699,13 +1801,35 @@ mod __parse__AIR { 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, &'input str, usize) + ) -> (usize, i64, usize) { match __symbols.pop() { Some((__l, __Symbol::Variant3(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } + fn __pop_Variant11< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, usize, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant11(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant5< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, &'input str, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant5(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } pub(crate) fn __reduce0< 'err, 'input, @@ -1719,12 +1843,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // () = Arg => ActionFn(56); - let __sym0 = __pop_Variant8(__symbols); + // () = Arg => ActionFn(61); + let __sym0 = __pop_Variant9(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action56::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + let __nt = super::__action61::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant9(__nt), __end)); (1, 0) } pub(crate) fn __reduce1< @@ -1740,11 +1864,11 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // ()* = => ActionFn(54); + // ()* = => ActionFn(59); let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); let __end = __start.clone(); - let __nt = super::__action54::<>(input, errors, validator, &__start, &__end); - __symbols.push((__start, __Symbol::Variant9(__nt), __end)); + let __nt = super::__action59::<>(input, errors, validator, &__start, &__end); + __symbols.push((__start, __Symbol::Variant10(__nt), __end)); (0, 1) } pub(crate) fn __reduce2< @@ -1760,12 +1884,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // ()* = ()+ => ActionFn(55); - let __sym0 = __pop_Variant9(__symbols); + // ()* = ()+ => ActionFn(60); + let __sym0 = __pop_Variant10(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action55::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant9(__nt), __end)); + let __nt = super::__action60::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant10(__nt), __end)); (1, 1) } pub(crate) fn __reduce3< @@ -1781,12 +1905,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // ()+ = Arg => ActionFn(63); - let __sym0 = __pop_Variant8(__symbols); + // ()+ = Arg => ActionFn(68); + let __sym0 = __pop_Variant9(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action63::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant9(__nt), __end)); + let __nt = super::__action68::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant10(__nt), __end)); (1, 2) } pub(crate) fn __reduce4< @@ -1802,14 +1926,14 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // ()+ = ()+, Arg => ActionFn(64); + // ()+ = ()+, Arg => ActionFn(69); assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant8(__symbols); - let __sym0 = __pop_Variant9(__symbols); + let __sym1 = __pop_Variant9(__symbols); + let __sym0 = __pop_Variant10(__symbols); let __start = __sym0.0.clone(); let __end = __sym1.2.clone(); - let __nt = super::__action64::<>(input, errors, validator, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant9(__nt), __end)); + let __nt = super::__action69::<>(input, errors, validator, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant10(__nt), __end)); (2, 2) } pub(crate) fn __reduce5< @@ -1825,11 +1949,11 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // @L = => ActionFn(60); + // @L = => ActionFn(65); let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); let __end = __start.clone(); - let __nt = super::__action60::<>(input, errors, validator, &__start, &__end); - __symbols.push((__start, __Symbol::Variant10(__nt), __end)); + let __nt = super::__action65::<>(input, errors, validator, &__start, &__end); + __symbols.push((__start, __Symbol::Variant11(__nt), __end)); (0, 3) } pub(crate) fn __reduce6< @@ -1845,11 +1969,11 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // @R = => ActionFn(57); + // @R = => ActionFn(62); let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); let __end = __start.clone(); - let __nt = super::__action57::<>(input, errors, validator, &__start, &__end); - __symbols.push((__start, __Symbol::Variant10(__nt), __end)); + let __nt = super::__action62::<>(input, errors, validator, &__start, &__end); + __symbols.push((__start, __Symbol::Variant11(__nt), __end)); (0, 4) } pub(crate) fn __reduce7< @@ -1866,11 +1990,11 @@ mod __parse__AIR { ) -> (usize, usize) { // AIR = Instr => ActionFn(1); - let __sym0 = __pop_Variant11(__symbols); + let __sym0 = __pop_Variant12(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); let __nt = super::__action1::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); (1, 5) } pub(crate) fn __reduce8< @@ -1886,12 +2010,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // ApArgument = InitPeerId => ActionFn(46); + // ApArgument = InitPeerId => ActionFn(51); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action46::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + let __nt = super::__action51::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant13(__nt), __end)); (1, 6) } pub(crate) fn __reduce9< @@ -1907,12 +2031,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // ApArgument = LastError => ActionFn(47); - let __sym0 = __pop_Variant2(__symbols); + // ApArgument = LastError => ActionFn(52); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action47::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + let __nt = super::__action52::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant13(__nt), __end)); (1, 6) } pub(crate) fn __reduce10< @@ -1928,12 +2052,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // ApArgument = Literal => ActionFn(48); - let __sym0 = __pop_Variant3(__symbols); + // ApArgument = Literal => ActionFn(53); + let __sym0 = __pop_Variant5(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action48::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + let __nt = super::__action53::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant13(__nt), __end)); (1, 6) } pub(crate) fn __reduce11< @@ -1949,12 +2073,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // ApArgument = Number => ActionFn(49); - let __sym0 = __pop_Variant4(__symbols); + // ApArgument = Number => ActionFn(54); + let __sym0 = __pop_Variant21(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action49::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + let __nt = super::__action54::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant13(__nt), __end)); (1, 6) } pub(crate) fn __reduce12< @@ -1970,12 +2094,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // ApArgument = Boolean => ActionFn(50); + // ApArgument = Boolean => ActionFn(55); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action50::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + let __nt = super::__action55::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant13(__nt), __end)); (1, 6) } pub(crate) fn __reduce13< @@ -1991,14 +2115,14 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // ApArgument = "[", "]" => ActionFn(51); + // ApArgument = "[", "]" => ActionFn(56); assert!(__symbols.len() >= 2); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); let __end = __sym1.2.clone(); - let __nt = super::__action51::<>(input, errors, validator, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + let __nt = super::__action56::<>(input, errors, validator, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant13(__nt), __end)); (2, 6) } pub(crate) fn __reduce14< @@ -2014,12 +2138,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // ApArgument = Scalar => ActionFn(52); - let __sym0 = __pop_Variant5(__symbols); + // ApArgument = Scalar => ActionFn(57); + let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action52::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + let __nt = super::__action57::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant13(__nt), __end)); (1, 6) } pub(crate) fn __reduce15< @@ -2035,12 +2159,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // ApArgument = ScalarWithLambda => ActionFn(53); - let __sym0 = __pop_Variant6(__symbols); + // ApArgument = ScalarWithLambda => ActionFn(58); + let __sym0 = __pop_Variant7(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action53::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + let __nt = super::__action58::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant13(__nt), __end)); (1, 6) } pub(crate) fn __reduce16< @@ -2056,12 +2180,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // ApResult = ScriptVariable => ActionFn(20); - let __sym0 = __pop_Variant13(__symbols); + // ApResult = ScriptVariable => ActionFn(21); + let __sym0 = __pop_Variant14(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action20::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); + let __nt = super::__action21::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant14(__nt), __end)); (1, 7) } pub(crate) fn __reduce17< @@ -2077,12 +2201,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Arg = Value => ActionFn(35); - let __sym0 = __pop_Variant8(__symbols); + // Arg = Value => ActionFn(40); + let __sym0 = __pop_Variant9(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action35::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + let __nt = super::__action40::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant9(__nt), __end)); (1, 8) } pub(crate) fn __reduce18< @@ -2098,14 +2222,14 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Args = "[", "]" => ActionFn(65); + // Args = "[", "]" => ActionFn(70); assert!(__symbols.len() >= 2); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); let __end = __sym1.2.clone(); - let __nt = super::__action65::<>(input, errors, validator, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); + let __nt = super::__action70::<>(input, errors, validator, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant15(__nt), __end)); (2, 9) } pub(crate) fn __reduce19< @@ -2121,15 +2245,15 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Args = "[", ()+, "]" => ActionFn(66); + // Args = "[", ()+, "]" => ActionFn(71); assert!(__symbols.len() >= 3); let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant9(__symbols); + let __sym1 = __pop_Variant10(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); let __end = __sym2.2.clone(); - let __nt = super::__action66::<>(input, errors, validator, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); + let __nt = super::__action71::<>(input, errors, validator, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant15(__nt), __end)); (3, 9) } pub(crate) fn __reduce20< @@ -2145,12 +2269,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // CallInstrValue = InitPeerId => ActionFn(29); + // CallInstrValue = InitPeerId => ActionFn(32); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action29::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); + let __nt = super::__action32::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant16(__nt), __end)); (1, 10) } pub(crate) fn __reduce21< @@ -2166,12 +2290,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // CallInstrValue = Literal => ActionFn(30); - let __sym0 = __pop_Variant3(__symbols); + // CallInstrValue = Literal => ActionFn(33); + let __sym0 = __pop_Variant5(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action30::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); + let __nt = super::__action33::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant16(__nt), __end)); (1, 10) } pub(crate) fn __reduce22< @@ -2187,12 +2311,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // CallInstrValue = Scalar => ActionFn(31); - let __sym0 = __pop_Variant5(__symbols); + // CallInstrValue = Scalar => ActionFn(34); + let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action31::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); + let __nt = super::__action34::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant16(__nt), __end)); (1, 10) } pub(crate) fn __reduce23< @@ -2208,12 +2332,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // CallInstrValue = ScalarWithLambda => ActionFn(32); - let __sym0 = __pop_Variant6(__symbols); + // CallInstrValue = ScalarWithLambda => ActionFn(35); + let __sym0 = __pop_Variant7(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action32::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); + let __nt = super::__action35::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant16(__nt), __end)); (1, 10) } pub(crate) fn __reduce24< @@ -2229,12 +2353,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // CallInstrValue = Stream => ActionFn(33); - let __sym0 = __pop_Variant5(__symbols); + // CallInstrValue = Stream => ActionFn(36); + let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action33::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); + let __nt = super::__action36::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant16(__nt), __end)); (1, 10) } pub(crate) fn __reduce25< @@ -2250,12 +2374,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // CallInstrValue = StreamWithLambda => ActionFn(34); - let __sym0 = __pop_Variant6(__symbols); + // CallInstrValue = StreamWithLambda => ActionFn(37); + let __sym0 = __pop_Variant7(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action34::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); + let __nt = super::__action37::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant16(__nt), __end)); (1, 10) } pub(crate) fn __reduce26< @@ -2271,12 +2395,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // CallOutput = ScriptVariable => ActionFn(21); - let __sym0 = __pop_Variant13(__symbols); + // CallOutput = ScriptVariable => ActionFn(22); + let __sym0 = __pop_Variant14(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action21::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); + let __nt = super::__action22::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant14(__nt), __end)); (1, 11) } pub(crate) fn __reduce27< @@ -2292,12 +2416,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // CallOutput? = CallOutput => ActionFn(58); - let __sym0 = __pop_Variant13(__symbols); + // CallOutput? = CallOutput => ActionFn(63); + let __sym0 = __pop_Variant14(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action58::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant16(__nt), __end)); + let __nt = super::__action63::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant17(__nt), __end)); (1, 12) } pub(crate) fn __reduce28< @@ -2313,11 +2437,11 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // CallOutput? = => ActionFn(59); + // CallOutput? = => ActionFn(64); let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2.clone())).unwrap_or_default(); let __end = __start.clone(); - let __nt = super::__action59::<>(input, errors, validator, &__start, &__end); - __symbols.push((__start, __Symbol::Variant16(__nt), __end)); + let __nt = super::__action64::<>(input, errors, validator, &__start, &__end); + __symbols.push((__start, __Symbol::Variant17(__nt), __end)); (0, 12) } pub(crate) fn __reduce29< @@ -2333,12 +2457,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // FPart = Function => ActionFn(16); - let __sym0 = __pop_Variant15(__symbols); + // FPart = Function => ActionFn(17); + let __sym0 = __pop_Variant16(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action16::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant17(__nt), __end)); + let __nt = super::__action17::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant18(__nt), __end)); (1, 13) } pub(crate) fn __reduce30< @@ -2354,16 +2478,16 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // FPart = "(", ServiceId, Function, ")" => ActionFn(17); + // FPart = "(", ServiceId, Function, ")" => ActionFn(18); assert!(__symbols.len() >= 4); let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant15(__symbols); + let __sym2 = __pop_Variant16(__symbols); + let __sym1 = __pop_Variant16(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); let __end = __sym3.2.clone(); - let __nt = super::__action17::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant17(__nt), __end)); + let __nt = super::__action18::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant18(__nt), __end)); (4, 13) } pub(crate) fn __reduce31< @@ -2379,13 +2503,15 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // FoldScalarIterable = Scalar => ActionFn(24); - let __sym0 = __pop_Variant5(__symbols); + // FailBody = I64, Literal => ActionFn(25); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant5(__symbols); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0.clone(); - let __end = __sym0.2.clone(); - let __nt = super::__action24::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant18(__nt), __end)); - (1, 14) + let __end = __sym1.2.clone(); + let __nt = super::__action25::<>(input, errors, validator, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant19(__nt), __end)); + (2, 14) } pub(crate) fn __reduce32< 'err, @@ -2400,12 +2526,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // FoldScalarIterable = ScalarWithLambda => ActionFn(25); - let __sym0 = __pop_Variant6(__symbols); + // FailBody = LastError => ActionFn(81); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action25::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant18(__nt), __end)); + let __nt = super::__action81::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant19(__nt), __end)); (1, 14) } pub(crate) fn __reduce33< @@ -2421,12 +2547,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Function = CallInstrValue => ActionFn(26); - let __sym0 = __pop_Variant15(__symbols); + // FoldScalarIterable = Scalar => ActionFn(27); + let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action26::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); + let __nt = super::__action27::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant20(__nt), __end)); (1, 15) } pub(crate) fn __reduce34< @@ -2442,20 +2568,13 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Instr = "(", call, PeerPart, FPart, Args, CallOutput, ")" => ActionFn(83); - assert!(__symbols.len() >= 7); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant13(__symbols); - let __sym4 = __pop_Variant14(__symbols); - let __sym3 = __pop_Variant17(__symbols); - let __sym2 = __pop_Variant19(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); + // FoldScalarIterable = ScalarWithLambda => ActionFn(28); + let __sym0 = __pop_Variant7(__symbols); let __start = __sym0.0.clone(); - let __end = __sym6.2.clone(); - let __nt = super::__action83::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (7, 16) + let __end = __sym0.2.clone(); + let __nt = super::__action28::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant20(__nt), __end)); + (1, 15) } pub(crate) fn __reduce35< 'err, @@ -2470,19 +2589,13 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Instr = "(", call, PeerPart, FPart, Args, ")" => ActionFn(84); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant14(__symbols); - let __sym3 = __pop_Variant17(__symbols); - let __sym2 = __pop_Variant19(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); + // Function = CallInstrValue => ActionFn(29); + let __sym0 = __pop_Variant16(__symbols); let __start = __sym0.0.clone(); - let __end = __sym5.2.clone(); - let __nt = super::__action84::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (6, 16) + let __end = __sym0.2.clone(); + let __nt = super::__action29::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant16(__nt), __end)); + (1, 16) } pub(crate) fn __reduce36< 'err, @@ -2497,20 +2610,75 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Instr = "(", ap, ApArgument, ApResult, ")" => ActionFn(76); + // Instr = "(", call, PeerPart, FPart, Args, CallOutput, ")" => ActionFn(90); + assert!(__symbols.len() >= 7); + let __sym6 = __pop_Variant0(__symbols); + let __sym5 = __pop_Variant14(__symbols); + let __sym4 = __pop_Variant15(__symbols); + let __sym3 = __pop_Variant18(__symbols); + let __sym2 = __pop_Variant22(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym6.2.clone(); + let __nt = super::__action90::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6); + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + (7, 17) + } + pub(crate) fn __reduce37< + 'err, + 'input, + 'v, + >( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, + ) -> (usize, usize) + { + // Instr = "(", call, PeerPart, FPart, Args, ")" => ActionFn(91); + assert!(__symbols.len() >= 6); + let __sym5 = __pop_Variant0(__symbols); + let __sym4 = __pop_Variant15(__symbols); + let __sym3 = __pop_Variant18(__symbols); + let __sym2 = __pop_Variant22(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym5.2.clone(); + let __nt = super::__action91::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + (6, 17) + } + pub(crate) fn __reduce38< + 'err, + 'input, + 'v, + >( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, + ) -> (usize, usize) + { + // Instr = "(", ap, ApArgument, ApResult, ")" => ActionFn(83); assert!(__symbols.len() >= 5); let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant13(__symbols); - let __sym2 = __pop_Variant12(__symbols); + let __sym3 = __pop_Variant14(__symbols); + let __sym2 = __pop_Variant13(__symbols); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); let __end = __sym4.2.clone(); - let __nt = super::__action76::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (5, 16) + let __nt = super::__action83::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3, __sym4); + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + (5, 17) } - pub(crate) fn __reduce37< + pub(crate) fn __reduce39< 'err, 'input, 'v, @@ -2526,17 +2694,17 @@ mod __parse__AIR { // Instr = "(", seq, Instr, Instr, ")" => ActionFn(4); assert!(__symbols.len() >= 5); let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant11(__symbols); - let __sym2 = __pop_Variant11(__symbols); + let __sym3 = __pop_Variant12(__symbols); + let __sym2 = __pop_Variant12(__symbols); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); let __end = __sym4.2.clone(); let __nt = super::__action4::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (5, 16) + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + (5, 17) } - pub(crate) fn __reduce38< + pub(crate) fn __reduce40< 'err, 'input, 'v, @@ -2552,17 +2720,17 @@ mod __parse__AIR { // Instr = "(", par, Instr, Instr, ")" => ActionFn(5); assert!(__symbols.len() >= 5); let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant11(__symbols); - let __sym2 = __pop_Variant11(__symbols); + let __sym3 = __pop_Variant12(__symbols); + let __sym2 = __pop_Variant12(__symbols); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); let __end = __sym4.2.clone(); let __nt = super::__action5::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (5, 16) + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + (5, 17) } - pub(crate) fn __reduce39< + pub(crate) fn __reduce41< 'err, 'input, 'v, @@ -2583,61 +2751,8 @@ mod __parse__AIR { let __start = __sym0.0.clone(); let __end = __sym2.2.clone(); let __nt = super::__action6::<>(input, errors, validator, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (3, 16) - } - pub(crate) fn __reduce40< - 'err, - 'input, - 'v, - >( - input: &'input str, - errors: &'err mut Vec, ParserError>>, - validator: &'v mut VariableValidator<'input>, - __lookahead_start: Option<&usize>, - __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, - ) -> (usize, usize) - { - // Instr = "(", new, ScriptVariable, Instr, ")" => ActionFn(77); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant11(__symbols); - let __sym2 = __pop_Variant13(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0.clone(); - let __end = __sym4.2.clone(); - let __nt = super::__action77::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (5, 16) - } - pub(crate) fn __reduce41< - 'err, - 'input, - 'v, - >( - input: &'input str, - errors: &'err mut Vec, ParserError>>, - validator: &'v mut VariableValidator<'input>, - __lookahead_start: Option<&usize>, - __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, - ) -> (usize, usize) - { - // Instr = "(", fold, FoldScalarIterable, Scalar, Instr, ")" => ActionFn(78); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant11(__symbols); - let __sym3 = __pop_Variant5(__symbols); - let __sym2 = __pop_Variant18(__symbols); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0.clone(); - let __end = __sym5.2.clone(); - let __nt = super::__action78::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (6, 16) + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + (3, 17) } pub(crate) fn __reduce42< 'err, @@ -2652,19 +2767,18 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Instr = "(", fold, Stream, Scalar, Instr, ")" => ActionFn(79); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant11(__symbols); - let __sym3 = __pop_Variant5(__symbols); - let __sym2 = __pop_Variant5(__symbols); + // Instr = "(", new, ScriptVariable, Instr, ")" => ActionFn(84); + assert!(__symbols.len() >= 5); + let __sym4 = __pop_Variant0(__symbols); + let __sym3 = __pop_Variant12(__symbols); + let __sym2 = __pop_Variant14(__symbols); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); - let __end = __sym5.2.clone(); - let __nt = super::__action79::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (6, 16) + let __end = __sym4.2.clone(); + let __nt = super::__action84::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3, __sym4); + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + (5, 17) } pub(crate) fn __reduce43< 'err, @@ -2679,17 +2793,17 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Instr = "(", next, Scalar, ")" => ActionFn(80); + // Instr = "(", fail, FailBody, ")" => ActionFn(8); assert!(__symbols.len() >= 4); let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant5(__symbols); + let __sym2 = __pop_Variant19(__symbols); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); let __end = __sym3.2.clone(); - let __nt = super::__action80::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (4, 16) + let __nt = super::__action8::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + (4, 17) } pub(crate) fn __reduce44< 'err, @@ -2704,18 +2818,19 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Instr = "(", xor, Instr, Instr, ")" => ActionFn(11); - assert!(__symbols.len() >= 5); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant11(__symbols); - let __sym2 = __pop_Variant11(__symbols); + // Instr = "(", fold, FoldScalarIterable, Scalar, Instr, ")" => ActionFn(85); + assert!(__symbols.len() >= 6); + let __sym5 = __pop_Variant0(__symbols); + let __sym4 = __pop_Variant12(__symbols); + let __sym3 = __pop_Variant6(__symbols); + let __sym2 = __pop_Variant20(__symbols); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); - let __end = __sym4.2.clone(); - let __nt = super::__action11::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3, __sym4); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (5, 16) + let __end = __sym5.2.clone(); + let __nt = super::__action85::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + (6, 17) } pub(crate) fn __reduce45< 'err, @@ -2730,19 +2845,19 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Instr = "(", match_, Value, Value, Instr, ")" => ActionFn(81); + // Instr = "(", fold, Stream, Scalar, Instr, ")" => ActionFn(86); assert!(__symbols.len() >= 6); let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant11(__symbols); - let __sym3 = __pop_Variant8(__symbols); - let __sym2 = __pop_Variant8(__symbols); + let __sym4 = __pop_Variant12(__symbols); + let __sym3 = __pop_Variant6(__symbols); + let __sym2 = __pop_Variant6(__symbols); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); let __end = __sym5.2.clone(); - let __nt = super::__action81::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (6, 16) + let __nt = super::__action86::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + (6, 17) } pub(crate) fn __reduce46< 'err, @@ -2757,19 +2872,17 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Instr = "(", mismatch, Value, Value, Instr, ")" => ActionFn(82); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant11(__symbols); - let __sym3 = __pop_Variant8(__symbols); - let __sym2 = __pop_Variant8(__symbols); + // Instr = "(", next, Scalar, ")" => ActionFn(87); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant6(__symbols); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); - let __end = __sym5.2.clone(); - let __nt = super::__action82::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (6, 16) + let __end = __sym3.2.clone(); + let __nt = super::__action87::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + (4, 17) } pub(crate) fn __reduce47< 'err, @@ -2784,13 +2897,18 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Instr = error => ActionFn(14); - let __sym0 = __pop_Variant7(__symbols); + // Instr = "(", xor, Instr, Instr, ")" => ActionFn(12); + assert!(__symbols.len() >= 5); + let __sym4 = __pop_Variant0(__symbols); + let __sym3 = __pop_Variant12(__symbols); + let __sym2 = __pop_Variant12(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); - let __end = __sym0.2.clone(); - let __nt = super::__action14::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (1, 16) + let __end = __sym4.2.clone(); + let __nt = super::__action12::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3, __sym4); + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + (5, 17) } pub(crate) fn __reduce48< 'err, @@ -2805,13 +2923,19 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // PeerId = CallInstrValue => ActionFn(27); - let __sym0 = __pop_Variant15(__symbols); + // Instr = "(", match_, Value, Value, Instr, ")" => ActionFn(88); + assert!(__symbols.len() >= 6); + let __sym5 = __pop_Variant0(__symbols); + let __sym4 = __pop_Variant12(__symbols); + let __sym3 = __pop_Variant9(__symbols); + let __sym2 = __pop_Variant9(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); - let __end = __sym0.2.clone(); - let __nt = super::__action27::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 17) + let __end = __sym5.2.clone(); + let __nt = super::__action88::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + (6, 17) } pub(crate) fn __reduce49< 'err, @@ -2826,13 +2950,19 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // PeerPart = PeerId => ActionFn(18); - let __sym0 = __pop_Variant15(__symbols); + // Instr = "(", mismatch, Value, Value, Instr, ")" => ActionFn(89); + assert!(__symbols.len() >= 6); + let __sym5 = __pop_Variant0(__symbols); + let __sym4 = __pop_Variant12(__symbols); + let __sym3 = __pop_Variant9(__symbols); + let __sym2 = __pop_Variant9(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); - let __end = __sym0.2.clone(); - let __nt = super::__action18::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant19(__nt), __end)); - (1, 18) + let __end = __sym5.2.clone(); + let __nt = super::__action89::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + (6, 17) } pub(crate) fn __reduce50< 'err, @@ -2847,17 +2977,13 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // PeerPart = "(", PeerId, ServiceId, ")" => ActionFn(19); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant15(__symbols); - let __sym1 = __pop_Variant15(__symbols); - let __sym0 = __pop_Variant0(__symbols); + // Instr = error => ActionFn(15); + let __sym0 = __pop_Variant8(__symbols); let __start = __sym0.0.clone(); - let __end = __sym3.2.clone(); - let __nt = super::__action19::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant19(__nt), __end)); - (4, 18) + let __end = __sym0.2.clone(); + let __nt = super::__action15::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + (1, 17) } pub(crate) fn __reduce51< 'err, @@ -2872,13 +2998,13 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // ScriptVariable = Scalar => ActionFn(22); - let __sym0 = __pop_Variant5(__symbols); + // Number = I64 => ActionFn(38); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action22::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (1, 19) + let __nt = super::__action38::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant21(__nt), __end)); + (1, 18) } pub(crate) fn __reduce52< 'err, @@ -2893,13 +3019,13 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // ScriptVariable = Stream => ActionFn(23); - let __sym0 = __pop_Variant5(__symbols); + // Number = F64 => ActionFn(39); + let __sym0 = __pop_Variant2(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action23::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (1, 19) + let __nt = super::__action39::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant21(__nt), __end)); + (1, 18) } pub(crate) fn __reduce53< 'err, @@ -2914,13 +3040,13 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // ServiceId = CallInstrValue => ActionFn(28); - let __sym0 = __pop_Variant15(__symbols); + // PeerId = CallInstrValue => ActionFn(30); + let __sym0 = __pop_Variant16(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action28::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 20) + let __nt = super::__action30::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant16(__nt), __end)); + (1, 19) } pub(crate) fn __reduce54< 'err, @@ -2935,13 +3061,13 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Value = InitPeerId => ActionFn(36); - let __sym0 = __pop_Variant0(__symbols); + // PeerPart = PeerId => ActionFn(19); + let __sym0 = __pop_Variant16(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action36::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (1, 21) + let __nt = super::__action19::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant22(__nt), __end)); + (1, 20) } pub(crate) fn __reduce55< 'err, @@ -2956,13 +3082,17 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Value = LastError => ActionFn(37); - let __sym0 = __pop_Variant2(__symbols); + // PeerPart = "(", PeerId, ServiceId, ")" => ActionFn(20); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant16(__symbols); + let __sym1 = __pop_Variant16(__symbols); + let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); - let __end = __sym0.2.clone(); - let __nt = super::__action37::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (1, 21) + let __end = __sym3.2.clone(); + let __nt = super::__action20::<>(input, errors, validator, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant22(__nt), __end)); + (4, 20) } pub(crate) fn __reduce56< 'err, @@ -2977,12 +3107,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Value = Literal => ActionFn(38); - let __sym0 = __pop_Variant3(__symbols); + // ScriptVariable = Scalar => ActionFn(23); + let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action38::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + let __nt = super::__action23::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant14(__nt), __end)); (1, 21) } pub(crate) fn __reduce57< @@ -2998,12 +3128,12 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Value = Number => ActionFn(39); - let __sym0 = __pop_Variant4(__symbols); + // ScriptVariable = Stream => ActionFn(24); + let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action39::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + let __nt = super::__action24::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant14(__nt), __end)); (1, 21) } pub(crate) fn __reduce58< @@ -3019,13 +3149,13 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Value = Boolean => ActionFn(40); - let __sym0 = __pop_Variant1(__symbols); + // ServiceId = CallInstrValue => ActionFn(31); + let __sym0 = __pop_Variant16(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); - let __nt = super::__action40::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (1, 21) + let __nt = super::__action31::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant16(__nt), __end)); + (1, 22) } pub(crate) fn __reduce59< 'err, @@ -3040,15 +3170,13 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Value = "[", "]" => ActionFn(41); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); + // Value = InitPeerId => ActionFn(41); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0.clone(); - let __end = __sym1.2.clone(); - let __nt = super::__action41::<>(input, errors, validator, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (2, 21) + let __end = __sym0.2.clone(); + let __nt = super::__action41::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant9(__nt), __end)); + (1, 23) } pub(crate) fn __reduce60< 'err, @@ -3063,13 +3191,13 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Value = Scalar => ActionFn(42); - let __sym0 = __pop_Variant5(__symbols); + // Value = LastError => ActionFn(42); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); let __nt = super::__action42::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (1, 21) + __symbols.push((__start, __Symbol::Variant9(__nt), __end)); + (1, 23) } pub(crate) fn __reduce61< 'err, @@ -3084,13 +3212,13 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Value = ScalarWithLambda => ActionFn(43); - let __sym0 = __pop_Variant6(__symbols); + // Value = Literal => ActionFn(43); + let __sym0 = __pop_Variant5(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); let __nt = super::__action43::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (1, 21) + __symbols.push((__start, __Symbol::Variant9(__nt), __end)); + (1, 23) } pub(crate) fn __reduce62< 'err, @@ -3105,13 +3233,13 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Value = Stream => ActionFn(44); - let __sym0 = __pop_Variant5(__symbols); + // Value = Number => ActionFn(44); + let __sym0 = __pop_Variant21(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); let __nt = super::__action44::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (1, 21) + __symbols.push((__start, __Symbol::Variant9(__nt), __end)); + (1, 23) } pub(crate) fn __reduce63< 'err, @@ -3126,13 +3254,120 @@ mod __parse__AIR { _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, ) -> (usize, usize) { - // Value = StreamWithLambda => ActionFn(45); - let __sym0 = __pop_Variant6(__symbols); + // Value = Boolean => ActionFn(45); + let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0.clone(); let __end = __sym0.2.clone(); let __nt = super::__action45::<>(input, errors, validator, __sym0); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (1, 21) + __symbols.push((__start, __Symbol::Variant9(__nt), __end)); + (1, 23) + } + pub(crate) fn __reduce64< + 'err, + 'input, + 'v, + >( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, + ) -> (usize, usize) + { + // Value = "[", "]" => ActionFn(46); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym1.2.clone(); + let __nt = super::__action46::<>(input, errors, validator, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant9(__nt), __end)); + (2, 23) + } + pub(crate) fn __reduce65< + 'err, + 'input, + 'v, + >( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, + ) -> (usize, usize) + { + // Value = Scalar => ActionFn(47); + let __sym0 = __pop_Variant6(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action47::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant9(__nt), __end)); + (1, 23) + } + pub(crate) fn __reduce66< + 'err, + 'input, + 'v, + >( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, + ) -> (usize, usize) + { + // Value = ScalarWithLambda => ActionFn(48); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action48::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant9(__nt), __end)); + (1, 23) + } + pub(crate) fn __reduce67< + 'err, + 'input, + 'v, + >( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, + ) -> (usize, usize) + { + // Value = Stream => ActionFn(49); + let __sym0 = __pop_Variant6(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action49::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant9(__nt), __end)); + (1, 23) + } + pub(crate) fn __reduce68< + 'err, + 'input, + 'v, + >( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'err (), &'input (), &'v ())>, + ) -> (usize, usize) + { + // Value = StreamWithLambda => ActionFn(50); + let __sym0 = __pop_Variant7(__symbols); + let __start = __sym0.0.clone(); + let __end = __sym0.2.clone(); + let __nt = super::__action50::<>(input, errors, validator, __sym0); + __symbols.push((__start, __Symbol::Variant9(__nt), __end)); + (1, 23) } } pub use self::__parse__AIR::AIRParser; @@ -3324,6 +3559,26 @@ fn __action8< 'err, 'input, 'v, +>( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + (_, _, _): (usize, Token<'input>, usize), + (_, _, _): (usize, Token<'input>, usize), + (_, fail_body, _): (usize, Fail<'input>, usize), + (_, _, _): (usize, Token<'input>, usize), +) -> Box> +{ + { + Box::new(Instruction::Fail(fail_body)) + } +} + +#[allow(unused_variables)] +fn __action9< + 'err, + 'input, + 'v, >( input: &'input str, errors: &'err mut Vec, ParserError>>, @@ -3350,7 +3605,7 @@ fn __action8< } #[allow(unused_variables)] -fn __action9< +fn __action10< 'err, 'input, 'v, @@ -3381,7 +3636,7 @@ fn __action9< } #[allow(unused_variables)] -fn __action10< +fn __action11< 'err, 'input, 'v, @@ -3408,7 +3663,7 @@ fn __action10< } #[allow(unused_variables)] -fn __action11< +fn __action12< 'err, 'input, 'v, @@ -3427,7 +3682,7 @@ fn __action11< } #[allow(unused_variables)] -fn __action12< +fn __action13< 'err, 'input, 'v, @@ -3455,7 +3710,7 @@ fn __action12< } #[allow(unused_variables)] -fn __action13< +fn __action14< 'err, 'input, 'v, @@ -3483,7 +3738,7 @@ fn __action13< } #[allow(unused_variables)] -fn __action14< +fn __action15< 'err, 'input, 'v, @@ -3498,7 +3753,7 @@ fn __action14< } #[allow(unused_variables)] -fn __action15< +fn __action16< 'err, 'input, 'v, @@ -3515,7 +3770,7 @@ fn __action15< } #[allow(unused_variables)] -fn __action16< +fn __action17< 'err, 'input, 'v, @@ -3530,7 +3785,7 @@ fn __action16< } #[allow(unused_variables)] -fn __action17< +fn __action18< 'err, 'input, 'v, @@ -3548,7 +3803,7 @@ fn __action17< } #[allow(unused_variables)] -fn __action18< +fn __action19< 'err, 'input, 'v, @@ -3563,7 +3818,7 @@ fn __action18< } #[allow(unused_variables)] -fn __action19< +fn __action20< 'err, 'input, 'v, @@ -3580,21 +3835,6 @@ fn __action19< PeerPart::PeerPkWithServiceId(pid, sid) } -#[allow(unused_variables)] -fn __action20< - 'err, - 'input, - 'v, ->( - input: &'input str, - errors: &'err mut Vec, ParserError>>, - validator: &'v mut VariableValidator<'input>, - (_, __0, _): (usize, Variable<'input>, usize), -) -> Variable<'input> -{ - __0 -} - #[allow(unused_variables)] fn __action21< 'err, @@ -3615,6 +3855,21 @@ fn __action22< 'err, 'input, 'v, +>( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + (_, __0, _): (usize, Variable<'input>, usize), +) -> Variable<'input> +{ + __0 +} + +#[allow(unused_variables)] +fn __action23< + 'err, + 'input, + 'v, >( input: &'input str, errors: &'err mut Vec, ParserError>>, @@ -3626,7 +3881,7 @@ fn __action22< } #[allow(unused_variables)] -fn __action23< +fn __action24< 'err, 'input, 'v, @@ -3641,7 +3896,49 @@ fn __action23< } #[allow(unused_variables)] -fn __action24< +fn __action25< + 'err, + 'input, + 'v, +>( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + (_, ret_code, _): (usize, i64, usize), + (_, error_message, _): (usize, &'input str, usize), +) -> Fail<'input> +{ + Fail::Literal { + ret_code, + error_message, + } +} + +#[allow(unused_variables)] +fn __action26< + 'err, + 'input, + 'v, +>( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + (_, left, _): (usize, usize, usize), + (_, last_error_path, _): (usize, LastErrorPath, usize), + (_, right, _): (usize, usize, usize), +) -> Fail<'input> +{ + { + // it's possible to write smth like that `(fail %last_error%.msg)`, that would be ambigious + if !matches!(last_error_path, LastErrorPath::None) { + errors.push(make_user_error!(AmbiguousFailLastError, left, Token::Fail, right)); + } + Fail::LastError + } +} + +#[allow(unused_variables)] +fn __action27< 'err, 'input, 'v, @@ -3656,7 +3953,7 @@ fn __action24< } #[allow(unused_variables)] -fn __action25< +fn __action28< 'err, 'input, 'v, @@ -3670,56 +3967,56 @@ fn __action25< ScalarWithLambda::new(scalar.0, Some(scalar.1), scalar.2) } -#[allow(unused_variables)] -fn __action26< - 'err, - 'input, - 'v, ->( - input: &'input str, - errors: &'err mut Vec, ParserError>>, - validator: &'v mut VariableValidator<'input>, - (_, __0, _): (usize, CallInstrValue<'input>, usize), -) -> CallInstrValue<'input> -{ - __0 -} - -#[allow(unused_variables)] -fn __action27< - 'err, - 'input, - 'v, ->( - input: &'input str, - errors: &'err mut Vec, ParserError>>, - validator: &'v mut VariableValidator<'input>, - (_, __0, _): (usize, CallInstrValue<'input>, usize), -) -> CallInstrValue<'input> -{ - __0 -} - -#[allow(unused_variables)] -fn __action28< - 'err, - 'input, - 'v, ->( - input: &'input str, - errors: &'err mut Vec, ParserError>>, - validator: &'v mut VariableValidator<'input>, - (_, __0, _): (usize, CallInstrValue<'input>, usize), -) -> CallInstrValue<'input> -{ - __0 -} - #[allow(unused_variables)] fn __action29< 'err, 'input, 'v, +>( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + (_, __0, _): (usize, CallInstrValue<'input>, usize), +) -> CallInstrValue<'input> +{ + __0 +} + +#[allow(unused_variables)] +fn __action30< + 'err, + 'input, + 'v, +>( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + (_, __0, _): (usize, CallInstrValue<'input>, usize), +) -> CallInstrValue<'input> +{ + __0 +} + +#[allow(unused_variables)] +fn __action31< + 'err, + 'input, + 'v, +>( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + (_, __0, _): (usize, CallInstrValue<'input>, usize), +) -> CallInstrValue<'input> +{ + __0 +} + +#[allow(unused_variables)] +fn __action32< + 'err, + 'input, + 'v, >( input: &'input str, errors: &'err mut Vec, ParserError>>, @@ -3731,7 +4028,7 @@ fn __action29< } #[allow(unused_variables)] -fn __action30< +fn __action33< 'err, 'input, 'v, @@ -3746,7 +4043,7 @@ fn __action30< } #[allow(unused_variables)] -fn __action31< +fn __action34< 'err, 'input, 'v, @@ -3761,7 +4058,7 @@ fn __action31< } #[allow(unused_variables)] -fn __action32< +fn __action35< 'err, 'input, 'v, @@ -3776,7 +4073,7 @@ fn __action32< } #[allow(unused_variables)] -fn __action33< +fn __action36< 'err, 'input, 'v, @@ -3791,7 +4088,7 @@ fn __action33< } #[allow(unused_variables)] -fn __action34< +fn __action37< 'err, 'input, 'v, @@ -3806,7 +4103,37 @@ fn __action34< } #[allow(unused_variables)] -fn __action35< +fn __action38< + 'err, + 'input, + 'v, +>( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + (_, integer, _): (usize, i64, usize), +) -> Number +{ + Number::Int(integer) +} + +#[allow(unused_variables)] +fn __action39< + 'err, + 'input, + 'v, +>( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + (_, float, _): (usize, f64, usize), +) -> Number +{ + Number::Float(float) +} + +#[allow(unused_variables)] +fn __action40< 'err, 'input, 'v, @@ -3821,7 +4148,7 @@ fn __action35< } #[allow(unused_variables)] -fn __action36< +fn __action41< 'err, 'input, 'v, @@ -3836,7 +4163,7 @@ fn __action36< } #[allow(unused_variables)] -fn __action37< +fn __action42< 'err, 'input, 'v, @@ -3851,7 +4178,7 @@ fn __action37< } #[allow(unused_variables)] -fn __action38< +fn __action43< 'err, 'input, 'v, @@ -3866,7 +4193,7 @@ fn __action38< } #[allow(unused_variables)] -fn __action39< +fn __action44< 'err, 'input, 'v, @@ -3881,7 +4208,7 @@ fn __action39< } #[allow(unused_variables)] -fn __action40< +fn __action45< 'err, 'input, 'v, @@ -3896,7 +4223,7 @@ fn __action40< } #[allow(unused_variables)] -fn __action41< +fn __action46< 'err, 'input, 'v, @@ -3912,7 +4239,7 @@ fn __action41< } #[allow(unused_variables)] -fn __action42< +fn __action47< 'err, 'input, 'v, @@ -3927,7 +4254,7 @@ fn __action42< } #[allow(unused_variables)] -fn __action43< +fn __action48< 'err, 'input, 'v, @@ -3942,7 +4269,7 @@ fn __action43< } #[allow(unused_variables)] -fn __action44< +fn __action49< 'err, 'input, 'v, @@ -3957,7 +4284,7 @@ fn __action44< } #[allow(unused_variables)] -fn __action45< +fn __action50< 'err, 'input, 'v, @@ -3972,7 +4299,7 @@ fn __action45< } #[allow(unused_variables)] -fn __action46< +fn __action51< 'err, 'input, 'v, @@ -3987,7 +4314,7 @@ fn __action46< } #[allow(unused_variables)] -fn __action47< +fn __action52< 'err, 'input, 'v, @@ -4002,7 +4329,7 @@ fn __action47< } #[allow(unused_variables)] -fn __action48< +fn __action53< 'err, 'input, 'v, @@ -4017,7 +4344,7 @@ fn __action48< } #[allow(unused_variables)] -fn __action49< +fn __action54< 'err, 'input, 'v, @@ -4032,7 +4359,7 @@ fn __action49< } #[allow(unused_variables)] -fn __action50< +fn __action55< 'err, 'input, 'v, @@ -4047,7 +4374,7 @@ fn __action50< } #[allow(unused_variables)] -fn __action51< +fn __action56< 'err, 'input, 'v, @@ -4063,7 +4390,7 @@ fn __action51< } #[allow(unused_variables)] -fn __action52< +fn __action57< 'err, 'input, 'v, @@ -4078,7 +4405,7 @@ fn __action52< } #[allow(unused_variables)] -fn __action53< +fn __action58< 'err, 'input, 'v, @@ -4093,7 +4420,7 @@ fn __action53< } #[allow(unused_variables)] -fn __action54< +fn __action59< 'err, 'input, 'v, @@ -4109,7 +4436,7 @@ fn __action54< } #[allow(unused_variables)] -fn __action55< +fn __action60< 'err, 'input, 'v, @@ -4124,7 +4451,7 @@ fn __action55< } #[allow(unused_variables)] -fn __action56< +fn __action61< 'err, 'input, 'v, @@ -4139,7 +4466,7 @@ fn __action56< } #[allow(unused_variables)] -fn __action57< +fn __action62< 'err, 'input, 'v, @@ -4155,7 +4482,7 @@ fn __action57< } #[allow(unused_variables)] -fn __action58< +fn __action63< 'err, 'input, 'v, @@ -4170,7 +4497,7 @@ fn __action58< } #[allow(unused_variables)] -fn __action59< +fn __action64< 'err, 'input, 'v, @@ -4186,7 +4513,7 @@ fn __action59< } #[allow(unused_variables)] -fn __action60< +fn __action65< 'err, 'input, 'v, @@ -4202,7 +4529,7 @@ fn __action60< } #[allow(unused_variables)] -fn __action61< +fn __action66< 'err, 'input, 'v, @@ -4217,7 +4544,7 @@ fn __action61< } #[allow(unused_variables)] -fn __action62< +fn __action67< 'err, 'input, 'v, @@ -4233,7 +4560,7 @@ fn __action62< } #[allow(unused_variables)] -fn __action63< +fn __action68< 'err, 'input, 'v, @@ -4246,14 +4573,14 @@ fn __action63< { let __start0 = __0.0.clone(); let __end0 = __0.2.clone(); - let __temp0 = __action56( + let __temp0 = __action61( input, errors, validator, __0, ); let __temp0 = (__start0, __temp0, __end0); - __action61( + __action66( input, errors, validator, @@ -4262,7 +4589,7 @@ fn __action63< } #[allow(unused_variables)] -fn __action64< +fn __action69< 'err, 'input, 'v, @@ -4276,14 +4603,14 @@ fn __action64< { let __start0 = __1.0.clone(); let __end0 = __1.2.clone(); - let __temp0 = __action56( + let __temp0 = __action61( input, errors, validator, __1, ); let __temp0 = (__start0, __temp0, __end0); - __action62( + __action67( input, errors, validator, @@ -4293,7 +4620,7 @@ fn __action64< } #[allow(unused_variables)] -fn __action65< +fn __action70< 'err, 'input, 'v, @@ -4307,7 +4634,7 @@ fn __action65< { let __start0 = __0.2.clone(); let __end0 = __1.0.clone(); - let __temp0 = __action54( + let __temp0 = __action59( input, errors, validator, @@ -4315,7 +4642,7 @@ fn __action65< &__end0, ); let __temp0 = (__start0, __temp0, __end0); - __action15( + __action16( input, errors, validator, @@ -4326,7 +4653,7 @@ fn __action65< } #[allow(unused_variables)] -fn __action66< +fn __action71< 'err, 'input, 'v, @@ -4341,14 +4668,14 @@ fn __action66< { let __start0 = __1.0.clone(); let __end0 = __1.2.clone(); - let __temp0 = __action55( + let __temp0 = __action60( input, errors, validator, __1, ); let __temp0 = (__start0, __temp0, __end0); - __action15( + __action16( input, errors, validator, @@ -4359,7 +4686,40 @@ fn __action66< } #[allow(unused_variables)] -fn __action67< +fn __action72< + 'err, + 'input, + 'v, +>( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + __0: (usize, LastErrorPath, usize), + __1: (usize, usize, usize), +) -> Fail<'input> +{ + let __start0 = __0.0.clone(); + let __end0 = __0.0.clone(); + let __temp0 = __action65( + input, + errors, + validator, + &__start0, + &__end0, + ); + let __temp0 = (__start0, __temp0, __end0); + __action26( + input, + errors, + validator, + __temp0, + __0, + __1, + ) +} + +#[allow(unused_variables)] +fn __action73< 'err, 'input, 'v, @@ -4379,7 +4739,7 @@ fn __action67< { let __start0 = __0.0.clone(); let __end0 = __0.0.clone(); - let __temp0 = __action60( + let __temp0 = __action65( input, errors, validator, @@ -4404,7 +4764,7 @@ fn __action67< } #[allow(unused_variables)] -fn __action68< +fn __action74< 'err, 'input, 'v, @@ -4422,7 +4782,7 @@ fn __action68< { let __start0 = __0.0.clone(); let __end0 = __0.0.clone(); - let __temp0 = __action60( + let __temp0 = __action65( input, errors, validator, @@ -4445,7 +4805,7 @@ fn __action68< } #[allow(unused_variables)] -fn __action69< +fn __action75< 'err, 'input, 'v, @@ -4463,7 +4823,7 @@ fn __action69< { let __start0 = __0.0.clone(); let __end0 = __0.0.clone(); - let __temp0 = __action60( + let __temp0 = __action65( input, errors, validator, @@ -4486,7 +4846,7 @@ fn __action69< } #[allow(unused_variables)] -fn __action70< +fn __action76< 'err, 'input, 'v, @@ -4505,50 +4865,7 @@ fn __action70< { let __start0 = __0.0.clone(); let __end0 = __0.0.clone(); - let __temp0 = __action60( - input, - errors, - validator, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action8( - input, - errors, - validator, - __temp0, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - ) -} - -#[allow(unused_variables)] -fn __action71< - 'err, - 'input, - 'v, ->( - input: &'input str, - errors: &'err mut Vec, ParserError>>, - validator: &'v mut VariableValidator<'input>, - __0: (usize, Token<'input>, usize), - __1: (usize, Token<'input>, usize), - __2: (usize, (&'input str, usize), usize), - __3: (usize, (&'input str, usize), usize), - __4: (usize, Box>, usize), - __5: (usize, Token<'input>, usize), - __6: (usize, usize, usize), -) -> Box> -{ - let __start0 = __0.0.clone(); - let __end0 = __0.0.clone(); - let __temp0 = __action60( + let __temp0 = __action65( input, errors, validator, @@ -4572,7 +4889,7 @@ fn __action71< } #[allow(unused_variables)] -fn __action72< +fn __action77< 'err, 'input, 'v, @@ -4583,13 +4900,15 @@ fn __action72< __0: (usize, Token<'input>, usize), __1: (usize, Token<'input>, usize), __2: (usize, (&'input str, usize), usize), - __3: (usize, Token<'input>, usize), - __4: (usize, usize, usize), + __3: (usize, (&'input str, usize), usize), + __4: (usize, Box>, usize), + __5: (usize, Token<'input>, usize), + __6: (usize, usize, usize), ) -> Box> { let __start0 = __0.0.clone(); let __end0 = __0.0.clone(); - let __temp0 = __action60( + let __temp0 = __action65( input, errors, validator, @@ -4607,11 +4926,13 @@ fn __action72< __2, __3, __4, + __5, + __6, ) } #[allow(unused_variables)] -fn __action73< +fn __action78< 'err, 'input, 'v, @@ -4621,16 +4942,14 @@ fn __action73< validator: &'v mut VariableValidator<'input>, __0: (usize, Token<'input>, usize), __1: (usize, Token<'input>, usize), - __2: (usize, Value<'input>, usize), - __3: (usize, Value<'input>, usize), - __4: (usize, Box>, usize), - __5: (usize, Token<'input>, usize), - __6: (usize, usize, usize), + __2: (usize, (&'input str, usize), usize), + __3: (usize, Token<'input>, usize), + __4: (usize, usize, usize), ) -> Box> { let __start0 = __0.0.clone(); let __end0 = __0.0.clone(); - let __temp0 = __action60( + let __temp0 = __action65( input, errors, validator, @@ -4638,7 +4957,7 @@ fn __action73< &__end0, ); let __temp0 = (__start0, __temp0, __end0); - __action12( + __action11( input, errors, validator, @@ -4648,13 +4967,11 @@ fn __action73< __2, __3, __4, - __5, - __6, ) } #[allow(unused_variables)] -fn __action74< +fn __action79< 'err, 'input, 'v, @@ -4673,7 +4990,7 @@ fn __action74< { let __start0 = __0.0.clone(); let __end0 = __0.0.clone(); - let __temp0 = __action60( + let __temp0 = __action65( input, errors, validator, @@ -4697,7 +5014,81 @@ fn __action74< } #[allow(unused_variables)] -fn __action75< +fn __action80< + 'err, + 'input, + 'v, +>( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + __0: (usize, Token<'input>, usize), + __1: (usize, Token<'input>, usize), + __2: (usize, Value<'input>, usize), + __3: (usize, Value<'input>, usize), + __4: (usize, Box>, usize), + __5: (usize, Token<'input>, usize), + __6: (usize, usize, usize), +) -> Box> +{ + let __start0 = __0.0.clone(); + let __end0 = __0.0.clone(); + let __temp0 = __action65( + input, + errors, + validator, + &__start0, + &__end0, + ); + let __temp0 = (__start0, __temp0, __end0); + __action14( + input, + errors, + validator, + __temp0, + __0, + __1, + __2, + __3, + __4, + __5, + __6, + ) +} + +#[allow(unused_variables)] +fn __action81< + 'err, + 'input, + 'v, +>( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + __0: (usize, LastErrorPath, usize), +) -> Fail<'input> +{ + let __start0 = __0.2.clone(); + let __end0 = __0.2.clone(); + let __temp0 = __action62( + input, + errors, + validator, + &__start0, + &__end0, + ); + let __temp0 = (__start0, __temp0, __end0); + __action72( + input, + errors, + validator, + __0, + __temp0, + ) +} + +#[allow(unused_variables)] +fn __action82< 'err, 'input, 'v, @@ -4716,246 +5107,7 @@ fn __action75< { let __start0 = __6.2.clone(); let __end0 = __6.2.clone(); - let __temp0 = __action57( - input, - errors, - validator, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action67( - input, - errors, - validator, - __0, - __1, - __2, - __3, - __4, - __5, - __6, - __temp0, - ) -} - -#[allow(unused_variables)] -fn __action76< - 'err, - 'input, - 'v, ->( - input: &'input str, - errors: &'err mut Vec, ParserError>>, - validator: &'v mut VariableValidator<'input>, - __0: (usize, Token<'input>, usize), - __1: (usize, Token<'input>, usize), - __2: (usize, ApArgument<'input>, usize), - __3: (usize, Variable<'input>, usize), - __4: (usize, Token<'input>, usize), -) -> Box> -{ - let __start0 = __4.2.clone(); - let __end0 = __4.2.clone(); - let __temp0 = __action57( - input, - errors, - validator, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action68( - input, - errors, - validator, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -fn __action77< - 'err, - 'input, - 'v, ->( - input: &'input str, - errors: &'err mut Vec, ParserError>>, - validator: &'v mut VariableValidator<'input>, - __0: (usize, Token<'input>, usize), - __1: (usize, Token<'input>, usize), - __2: (usize, Variable<'input>, usize), - __3: (usize, Box>, usize), - __4: (usize, Token<'input>, usize), -) -> Box> -{ - let __start0 = __4.2.clone(); - let __end0 = __4.2.clone(); - let __temp0 = __action57( - input, - errors, - validator, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action69( - input, - errors, - validator, - __0, - __1, - __2, - __3, - __4, - __temp0, - ) -} - -#[allow(unused_variables)] -fn __action78< - 'err, - 'input, - 'v, ->( - input: &'input str, - errors: &'err mut Vec, ParserError>>, - validator: &'v mut VariableValidator<'input>, - __0: (usize, Token<'input>, usize), - __1: (usize, Token<'input>, usize), - __2: (usize, ScalarWithLambda<'input>, usize), - __3: (usize, (&'input str, usize), usize), - __4: (usize, Box>, usize), - __5: (usize, Token<'input>, usize), -) -> Box> -{ - let __start0 = __5.2.clone(); - let __end0 = __5.2.clone(); - let __temp0 = __action57( - input, - errors, - validator, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action70( - input, - errors, - validator, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - ) -} - -#[allow(unused_variables)] -fn __action79< - 'err, - 'input, - 'v, ->( - input: &'input str, - errors: &'err mut Vec, ParserError>>, - validator: &'v mut VariableValidator<'input>, - __0: (usize, Token<'input>, usize), - __1: (usize, Token<'input>, usize), - __2: (usize, (&'input str, usize), usize), - __3: (usize, (&'input str, usize), usize), - __4: (usize, Box>, usize), - __5: (usize, Token<'input>, usize), -) -> Box> -{ - let __start0 = __5.2.clone(); - let __end0 = __5.2.clone(); - let __temp0 = __action57( - input, - errors, - validator, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action71( - input, - errors, - validator, - __0, - __1, - __2, - __3, - __4, - __5, - __temp0, - ) -} - -#[allow(unused_variables)] -fn __action80< - 'err, - 'input, - 'v, ->( - input: &'input str, - errors: &'err mut Vec, ParserError>>, - validator: &'v mut VariableValidator<'input>, - __0: (usize, Token<'input>, usize), - __1: (usize, Token<'input>, usize), - __2: (usize, (&'input str, usize), usize), - __3: (usize, Token<'input>, usize), -) -> Box> -{ - let __start0 = __3.2.clone(); - let __end0 = __3.2.clone(); - let __temp0 = __action57( - input, - errors, - validator, - &__start0, - &__end0, - ); - let __temp0 = (__start0, __temp0, __end0); - __action72( - input, - errors, - validator, - __0, - __1, - __2, - __3, - __temp0, - ) -} - -#[allow(unused_variables)] -fn __action81< - 'err, - 'input, - 'v, ->( - input: &'input str, - errors: &'err mut Vec, ParserError>>, - validator: &'v mut VariableValidator<'input>, - __0: (usize, Token<'input>, usize), - __1: (usize, Token<'input>, usize), - __2: (usize, Value<'input>, usize), - __3: (usize, Value<'input>, usize), - __4: (usize, Box>, usize), - __5: (usize, Token<'input>, usize), -) -> Box> -{ - let __start0 = __5.2.clone(); - let __end0 = __5.2.clone(); - let __temp0 = __action57( + let __temp0 = __action62( input, errors, validator, @@ -4973,12 +5125,210 @@ fn __action81< __3, __4, __5, + __6, __temp0, ) } #[allow(unused_variables)] -fn __action82< +fn __action83< + 'err, + 'input, + 'v, +>( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + __0: (usize, Token<'input>, usize), + __1: (usize, Token<'input>, usize), + __2: (usize, ApArgument<'input>, usize), + __3: (usize, Variable<'input>, usize), + __4: (usize, Token<'input>, usize), +) -> Box> +{ + let __start0 = __4.2.clone(); + let __end0 = __4.2.clone(); + let __temp0 = __action62( + input, + errors, + validator, + &__start0, + &__end0, + ); + let __temp0 = (__start0, __temp0, __end0); + __action74( + input, + errors, + validator, + __0, + __1, + __2, + __3, + __4, + __temp0, + ) +} + +#[allow(unused_variables)] +fn __action84< + 'err, + 'input, + 'v, +>( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + __0: (usize, Token<'input>, usize), + __1: (usize, Token<'input>, usize), + __2: (usize, Variable<'input>, usize), + __3: (usize, Box>, usize), + __4: (usize, Token<'input>, usize), +) -> Box> +{ + let __start0 = __4.2.clone(); + let __end0 = __4.2.clone(); + let __temp0 = __action62( + input, + errors, + validator, + &__start0, + &__end0, + ); + let __temp0 = (__start0, __temp0, __end0); + __action75( + input, + errors, + validator, + __0, + __1, + __2, + __3, + __4, + __temp0, + ) +} + +#[allow(unused_variables)] +fn __action85< + 'err, + 'input, + 'v, +>( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + __0: (usize, Token<'input>, usize), + __1: (usize, Token<'input>, usize), + __2: (usize, ScalarWithLambda<'input>, usize), + __3: (usize, (&'input str, usize), usize), + __4: (usize, Box>, usize), + __5: (usize, Token<'input>, usize), +) -> Box> +{ + let __start0 = __5.2.clone(); + let __end0 = __5.2.clone(); + let __temp0 = __action62( + input, + errors, + validator, + &__start0, + &__end0, + ); + let __temp0 = (__start0, __temp0, __end0); + __action76( + input, + errors, + validator, + __0, + __1, + __2, + __3, + __4, + __5, + __temp0, + ) +} + +#[allow(unused_variables)] +fn __action86< + 'err, + 'input, + 'v, +>( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + __0: (usize, Token<'input>, usize), + __1: (usize, Token<'input>, usize), + __2: (usize, (&'input str, usize), usize), + __3: (usize, (&'input str, usize), usize), + __4: (usize, Box>, usize), + __5: (usize, Token<'input>, usize), +) -> Box> +{ + let __start0 = __5.2.clone(); + let __end0 = __5.2.clone(); + let __temp0 = __action62( + input, + errors, + validator, + &__start0, + &__end0, + ); + let __temp0 = (__start0, __temp0, __end0); + __action77( + input, + errors, + validator, + __0, + __1, + __2, + __3, + __4, + __5, + __temp0, + ) +} + +#[allow(unused_variables)] +fn __action87< + 'err, + 'input, + 'v, +>( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + __0: (usize, Token<'input>, usize), + __1: (usize, Token<'input>, usize), + __2: (usize, (&'input str, usize), usize), + __3: (usize, Token<'input>, usize), +) -> Box> +{ + let __start0 = __3.2.clone(); + let __end0 = __3.2.clone(); + let __temp0 = __action62( + input, + errors, + validator, + &__start0, + &__end0, + ); + let __temp0 = (__start0, __temp0, __end0); + __action78( + input, + errors, + validator, + __0, + __1, + __2, + __3, + __temp0, + ) +} + +#[allow(unused_variables)] +fn __action88< 'err, 'input, 'v, @@ -4996,7 +5346,7 @@ fn __action82< { let __start0 = __5.2.clone(); let __end0 = __5.2.clone(); - let __temp0 = __action57( + let __temp0 = __action62( input, errors, validator, @@ -5004,7 +5354,7 @@ fn __action82< &__end0, ); let __temp0 = (__start0, __temp0, __end0); - __action74( + __action79( input, errors, validator, @@ -5019,7 +5369,48 @@ fn __action82< } #[allow(unused_variables)] -fn __action83< +fn __action89< + 'err, + 'input, + 'v, +>( + input: &'input str, + errors: &'err mut Vec, ParserError>>, + validator: &'v mut VariableValidator<'input>, + __0: (usize, Token<'input>, usize), + __1: (usize, Token<'input>, usize), + __2: (usize, Value<'input>, usize), + __3: (usize, Value<'input>, usize), + __4: (usize, Box>, usize), + __5: (usize, Token<'input>, usize), +) -> Box> +{ + let __start0 = __5.2.clone(); + let __end0 = __5.2.clone(); + let __temp0 = __action62( + input, + errors, + validator, + &__start0, + &__end0, + ); + let __temp0 = (__start0, __temp0, __end0); + __action80( + input, + errors, + validator, + __0, + __1, + __2, + __3, + __4, + __5, + __temp0, + ) +} + +#[allow(unused_variables)] +fn __action90< 'err, 'input, 'v, @@ -5038,14 +5429,14 @@ fn __action83< { let __start0 = __5.0.clone(); let __end0 = __5.2.clone(); - let __temp0 = __action58( + let __temp0 = __action63( input, errors, validator, __5, ); let __temp0 = (__start0, __temp0, __end0); - __action75( + __action82( input, errors, validator, @@ -5060,7 +5451,7 @@ fn __action83< } #[allow(unused_variables)] -fn __action84< +fn __action91< 'err, 'input, 'v, @@ -5078,7 +5469,7 @@ fn __action84< { let __start0 = __4.2.clone(); let __end0 = __5.0.clone(); - let __temp0 = __action59( + let __temp0 = __action64( input, errors, validator, @@ -5086,7 +5477,7 @@ fn __action84< &__end0, ); let __temp0 = (__start0, __temp0, __end0); - __action75( + __action82( input, errors, validator, diff --git a/crates/air-lib/air-parser/src/parser/air_parser.rs b/crates/air-lib/air-parser/src/parser/air_parser.rs index b381bbe4..a1e69b1d 100644 --- a/crates/air-lib/air-parser/src/parser/air_parser.rs +++ b/crates/air-lib/air-parser/src/parser/air_parser.rs @@ -133,6 +133,9 @@ fn parser_error_to_label(file_id: usize, error: ParserError) -> Label { UndefinedVariable(start, end, _) => { Label::primary(file_id, start..end).with_message(error.to_string()) } + AmbiguousFailLastError(start, end) => { + Label::primary(file_id, start..end).with_message(error.to_string()) + } InvalidCallTriplet(start, end) => { Label::primary(file_id, start..end).with_message(error.to_string()) } diff --git a/crates/air-lib/air-parser/src/parser/errors.rs b/crates/air-lib/air-parser/src/parser/errors.rs index 09bf7a47..50fdacb5 100644 --- a/crates/air-lib/air-parser/src/parser/errors.rs +++ b/crates/air-lib/air-parser/src/parser/errors.rs @@ -31,6 +31,9 @@ pub enum ParserError { #[error("iterable '{2}' wasn't defined")] UndefinedIterable(usize, usize, String), + #[error("last error with non-empty path is ambiguous, please use just %last_error%")] + AmbiguousFailLastError(usize, usize), + /// Semantic errors in a call instructions. #[error("call should have service id specified by peer part or function part")] InvalidCallTriplet(usize, usize), diff --git a/crates/air-lib/air-parser/src/parser/lexer/air_lexer.rs b/crates/air-lib/air-parser/src/parser/lexer/air_lexer.rs index 9d542174..899077b8 100644 --- a/crates/air-lib/air-parser/src/parser/lexer/air_lexer.rs +++ b/crates/air-lib/air-parser/src/parser/lexer/air_lexer.rs @@ -180,6 +180,7 @@ fn string_to_token(input: &str, start_pos: usize) -> LexerResult { AP_INSTR => Ok(Token::Ap), SEQ_INSTR => Ok(Token::Seq), PAR_INSTR => Ok(Token::Par), + FAIL_INSTR => Ok(Token::Fail), FOLD_INSTR => Ok(Token::Fold), XOR_INSTR => Ok(Token::Xor), NEW_INSTR => Ok(Token::New), @@ -224,6 +225,7 @@ const CALL_INSTR: &str = "call"; const AP_INSTR: &str = "ap"; const SEQ_INSTR: &str = "seq"; const PAR_INSTR: &str = "par"; +const FAIL_INSTR: &str = "fail"; const FOLD_INSTR: &str = "fold"; const XOR_INSTR: &str = "xor"; const NEW_INSTR: &str = "new"; diff --git a/crates/air-lib/air-parser/src/parser/lexer/call_variable_parser.rs b/crates/air-lib/air-parser/src/parser/lexer/call_variable_parser.rs index 18c13ed4..344b9126 100644 --- a/crates/air-lib/air-parser/src/parser/lexer/call_variable_parser.rs +++ b/crates/air-lib/air-parser/src/parser/lexer/call_variable_parser.rs @@ -19,7 +19,6 @@ use super::LexerResult; use super::Token; use crate::LambdaAST; -use std::convert::TryInto; use std::iter::Peekable; use std::str::CharIndices; @@ -318,25 +317,45 @@ impl<'input> CallVariableParser<'input> { Ok(token) } - fn to_token(&self) -> LexerResult> { - use super::token::UnparsedNumber; - - let is_number = self.is_possible_to_parse_as_number(); - let token = match (is_number, self.state.first_dot_met_pos) { - (true, None) => { - let number = UnparsedNumber::Int(self.string_to_parse, self.start_pos); - let number: super::Number = number.try_into()?; - number.into() - } - (true, Some(_)) => { - let number = UnparsedNumber::Float(self.string_to_parse, self.start_pos); - let number: super::Number = number.try_into()?; - number.into() - } - (false, None) => self.to_variable_token(self.string_to_parse), - (false, Some(lambda_start_pos)) => self.try_to_variable_and_lambda(lambda_start_pos)?, - }; + fn try_to_i64(&self) -> LexerResult> { + let raw_value = self.string_to_parse; + let number = raw_value.parse::().map_err(|e| { + let start_pos = self.start_pos; + LexerError::ParseIntError(start_pos, start_pos + raw_value.len(), e) + })?; + let token = Token::I64(number); Ok(token) } + + fn try_to_f64(&self) -> LexerResult> { + // safe threshold for floating-point numbers to obtain determinism + const SAFE_FLOAT_SIGNIFICAND_SIZE: usize = 11; + + let raw_value = self.string_to_parse; + let start_pos = self.start_pos; + if raw_value.len() > SAFE_FLOAT_SIGNIFICAND_SIZE { + return Err(LexerError::TooBigFloat( + start_pos, + start_pos + raw_value.len(), + )); + } + + let number = raw_value + .parse::() + .map_err(|e| LexerError::ParseFloatError(start_pos, start_pos + raw_value.len(), e))?; + + let token = Token::F64(number); + Ok(token) + } + + fn to_token(&self) -> LexerResult> { + let is_number = self.is_possible_to_parse_as_number(); + match (is_number, self.state.first_dot_met_pos) { + (true, None) => self.try_to_i64(), + (true, Some(_)) => self.try_to_f64(), + (false, None) => Ok(self.to_variable_token(self.string_to_parse)), + (false, Some(lambda_start_pos)) => self.try_to_variable_and_lambda(lambda_start_pos), + } + } } diff --git a/crates/air-lib/air-parser/src/parser/lexer/mod.rs b/crates/air-lib/air-parser/src/parser/lexer/mod.rs index e31139c3..212efb46 100644 --- a/crates/air-lib/air-parser/src/parser/lexer/mod.rs +++ b/crates/air-lib/air-parser/src/parser/lexer/mod.rs @@ -26,7 +26,6 @@ mod tests; pub use air_lexer::AIRLexer; pub use errors::LexerError; pub use token::LastErrorPath; -pub use token::Number; pub use token::Token; pub(super) type LexerResult = std::result::Result; diff --git a/crates/air-lib/air-parser/src/parser/lexer/tests.rs b/crates/air-lib/air-parser/src/parser/lexer/tests.rs index c1ff07d4..d3feab40 100644 --- a/crates/air-lib/air-parser/src/parser/lexer/tests.rs +++ b/crates/air-lib/air-parser/src/parser/lexer/tests.rs @@ -18,7 +18,6 @@ use super::air_lexer::Spanned; use super::AIRLexer; use super::LastErrorPath; use super::LexerError; -use super::Number; use super::Token; use air_lambda_parser::{LambdaAST, ValueAccessor}; @@ -99,6 +98,8 @@ fn air_instructions() { ]), ); + lexer_test("fail", Single(Ok((0, Token::Fail, 4)))); + lexer_test("fold", Single(Ok((0, Token::Fold, 4)))); lexer_test( @@ -187,64 +188,66 @@ fn string_literal() { #[test] fn integer_numbers() { - const NUMBER_WITH_PLUS_SIGN: &str = "+123"; - let number = Number::Int(123); + let test_integer = 123; + let number_with_plus_sign = format!("+{}", test_integer); lexer_test( - NUMBER_WITH_PLUS_SIGN, + &number_with_plus_sign, Single(Ok(( 0, - Token::Number(number.clone()), - NUMBER_WITH_PLUS_SIGN.len(), + Token::I64(test_integer), + number_with_plus_sign.len(), ))), ); - const NUMBER: &str = "123"; + let number = format!("{}", test_integer); lexer_test( - NUMBER, - Single(Ok((0, Token::Number(number.clone()), NUMBER.len()))), + &number, + Single(Ok((0, Token::I64(test_integer), number.len()))), ); - const NUMBER_WITH_MINUS_SIGN: &str = "-123"; - let number = Number::Int(-123); + let number_with_minus_sign = format!("-{}", test_integer); lexer_test( - NUMBER_WITH_MINUS_SIGN, - Single(Ok((0, Token::Number(number), NUMBER_WITH_MINUS_SIGN.len()))), + &number_with_minus_sign, + Single(Ok(( + 0, + Token::I64(-test_integer), + number_with_minus_sign.len(), + ))), ); } #[test] fn float_number() { - const FNUMBER_WITH_PLUS_SIGN: &str = "+123.123"; - let number = Number::Float(123.123); + let test_float = 123.123; + let float_number_with_plus_sign = format!("+{}", test_float); lexer_test( - FNUMBER_WITH_PLUS_SIGN, + &float_number_with_plus_sign, Single(Ok(( 0, - Token::Number(number.clone()), - FNUMBER_WITH_PLUS_SIGN.len(), + Token::F64(test_float), + float_number_with_plus_sign.len(), ))), ); - const FNUMBER: &str = "123.123"; + let float_number = format!("{}", test_float); lexer_test( - FNUMBER, - Single(Ok((0, Token::Number(number), FNUMBER.len()))), + &float_number, + Single(Ok((0, Token::F64(test_float), float_number.len()))), ); - const FNUMBER_WITH_MINUS_SIGN: &str = "-123.123"; - let number = Number::Float(-123.123); + let float_number_with_minus_sign = format!("-{}", test_float); lexer_test( - FNUMBER_WITH_MINUS_SIGN, + &float_number_with_minus_sign, Single(Ok(( 0, - Token::Number(number), - FNUMBER_WITH_MINUS_SIGN.len(), + Token::F64(-test_float), + float_number_with_minus_sign.len(), ))), ); } diff --git a/crates/air-lib/air-parser/src/parser/lexer/token.rs b/crates/air-lib/air-parser/src/parser/lexer/token.rs index d8b675dd..203ea4f8 100644 --- a/crates/air-lib/air-parser/src/parser/lexer/token.rs +++ b/crates/air-lib/air-parser/src/parser/lexer/token.rs @@ -16,8 +16,6 @@ mod traits; -use super::LexerError; -use super::LexerResult; use crate::LambdaAST; use serde::Deserialize; @@ -30,7 +28,6 @@ pub enum Token<'input> { OpenSquareBracket, CloseSquareBracket, - StringLiteral(&'input str), Scalar { name: &'input str, position: usize, @@ -49,7 +46,10 @@ pub enum Token<'input> { lambda: LambdaAST<'input>, position: usize, }, - Number(Number), + + StringLiteral(&'input str), + I64(i64), + F64(f64), Boolean(bool), InitPeerId, @@ -59,6 +59,7 @@ pub enum Token<'input> { Ap, Seq, Par, + Fail, Fold, Xor, New, @@ -79,15 +80,3 @@ pub enum LastErrorPath { // %last_error% None, } - -#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] -pub enum Number { - Int(i64), - Float(f64), -} - -pub(crate) enum UnparsedNumber<'input> { - // raw value and starting pos - Int(&'input str, usize), - Float(&'input str, usize), -} diff --git a/crates/air-lib/air-parser/src/parser/lexer/token/traits.rs b/crates/air-lib/air-parser/src/parser/lexer/token/traits.rs index 10619fa6..b695416f 100644 --- a/crates/air-lib/air-parser/src/parser/lexer/token/traits.rs +++ b/crates/air-lib/air-parser/src/parser/lexer/token/traits.rs @@ -16,7 +16,6 @@ use super::*; -use std::convert::TryFrom; use std::fmt; impl fmt::Display for LastErrorPath { @@ -31,68 +30,3 @@ impl fmt::Display for LastErrorPath { } } } - -impl fmt::Display for Number { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - use Number::*; - - match self { - Int(number) => write!(f, "{}", number), - Float(number) => write!(f, "{}", number), - } - } -} - -impl From for Token<'_> { - fn from(value: Number) -> Self { - Token::Number(value) - } -} - -impl From for serde_json::Value { - fn from(number: Number) -> Self { - (&number).into() - } -} - -impl From<&Number> for serde_json::Value { - fn from(number: &Number) -> Self { - match number { - Number::Int(value) => (*value).into(), - Number::Float(value) => (*value).into(), - } - } -} - -impl TryFrom> for Number { - type Error = LexerError; - - fn try_from(value: UnparsedNumber<'_>) -> LexerResult { - match value { - UnparsedNumber::Int(raw_value, start_pos) => { - let number = raw_value.parse::().map_err(|e| { - LexerError::ParseIntError(start_pos, start_pos + raw_value.len(), e) - })?; - - let number = Self::Int(number); - Ok(number) - } - - UnparsedNumber::Float(raw_value, start_pos) => { - if raw_value.len() > 11 { - return Err(LexerError::TooBigFloat( - start_pos, - start_pos + raw_value.len(), - )); - } - - let number = raw_value.parse::().map_err(|e| { - LexerError::ParseFloatError(start_pos, start_pos + raw_value.len(), e) - })?; - - let number = Self::Float(number); - Ok(number) - } - } - } -} diff --git a/crates/air-lib/air-parser/src/parser/tests/dsl.rs b/crates/air-lib/air-parser/src/parser/tests/dsl.rs index 9ad8d67e..d8f3716c 100644 --- a/crates/air-lib/air-parser/src/parser/tests/dsl.rs +++ b/crates/air-lib/air-parser/src/parser/tests/dsl.rs @@ -37,15 +37,15 @@ pub(super) fn call<'i>( }) } -pub(super) fn seq<'a>(l: Instruction<'a>, r: Instruction<'a>) -> Instruction<'a> { +pub(super) fn seq<'i>(l: Instruction<'i>, r: Instruction<'i>) -> Instruction<'i> { Instruction::Seq(Seq(Box::new(l), Box::new(r))) } -pub(super) fn par<'a>(l: Instruction<'a>, r: Instruction<'a>) -> Instruction<'a> { +pub(super) fn par<'i>(l: Instruction<'i>, r: Instruction<'i>) -> Instruction<'i> { Instruction::Par(Par(Box::new(l), Box::new(r))) } -pub(super) fn xor<'a>(l: Instruction<'a>, r: Instruction<'a>) -> Instruction<'a> { +pub(super) fn xor<'i>(l: Instruction<'i>, r: Instruction<'i>) -> Instruction<'i> { Instruction::Xor(Xor(Box::new(l), Box::new(r))) } @@ -69,12 +69,23 @@ pub(super) fn null() -> Instruction<'static> { Instruction::Null(Null) } -pub(super) fn fold_scalar<'a>( - iterable: ScalarWithLambda<'a>, - iterator: Scalar<'a>, - instruction: Instruction<'a>, +pub(super) fn fail_literals(ret_code: i64, error_message: &str) -> Instruction<'_> { + Instruction::Fail(Fail::Literal { + ret_code, + error_message, + }) +} + +pub(super) fn fail_last_error() -> Instruction<'static> { + Instruction::Fail(Fail::LastError) +} + +pub(super) fn fold_scalar<'i>( + iterable: ScalarWithLambda<'i>, + iterator: Scalar<'i>, + instruction: Instruction<'i>, span: Span, -) -> Instruction<'a> { +) -> Instruction<'i> { Instruction::FoldScalar(FoldScalar { iterable, iterator, @@ -83,12 +94,12 @@ pub(super) fn fold_scalar<'a>( }) } -pub(super) fn fold_stream<'a>( - iterable: Stream<'a>, - iterator: Scalar<'a>, - instruction: Instruction<'a>, +pub(super) fn fold_stream<'i>( + iterable: Stream<'i>, + iterator: Scalar<'i>, + instruction: Instruction<'i>, span: Span, -) -> Instruction<'a> { +) -> Instruction<'i> { Instruction::FoldStream(FoldStream { iterable, iterator, @@ -97,11 +108,11 @@ pub(super) fn fold_stream<'a>( }) } -pub(super) fn match_<'a>( - left_value: Value<'a>, - right_value: Value<'a>, - instruction: Instruction<'a>, -) -> Instruction<'a> { +pub(super) fn match_<'i>( + left_value: Value<'i>, + right_value: Value<'i>, + instruction: Instruction<'i>, +) -> Instruction<'i> { Instruction::Match(Match { left_value, right_value, @@ -109,11 +120,11 @@ pub(super) fn match_<'a>( }) } -pub(super) fn mismatch<'a>( - left_value: Value<'a>, - right_value: Value<'a>, - instruction: Instruction<'a>, -) -> Instruction<'a> { +pub(super) fn mismatch<'i>( + left_value: Value<'i>, + right_value: Value<'i>, + instruction: Instruction<'i>, +) -> Instruction<'i> { Instruction::MisMatch(MisMatch { left_value, right_value, @@ -125,8 +136,8 @@ pub(super) fn ap<'i>(argument: ApArgument<'i>, result: Variable<'i>) -> Instruct Instruction::Ap(Ap { argument, result }) } -pub(super) fn binary_instruction<'a, 'b>( - name: &'a str, +pub(super) fn binary_instruction<'i, 'b>( + name: &'i str, ) -> impl Fn(Instruction<'b>, Instruction<'b>) -> Instruction<'b> { match name { "xor" => |l, r| xor(l, r), diff --git a/crates/air-lib/air-parser/src/parser/tests/fail.rs b/crates/air-lib/air-parser/src/parser/tests/fail.rs new file mode 100644 index 00000000..017a9cfa --- /dev/null +++ b/crates/air-lib/air-parser/src/parser/tests/fail.rs @@ -0,0 +1,38 @@ +/* + * Copyright 2021 Fluence Labs Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +use super::dsl::*; +use super::parse; + +#[test] +fn parse_fail_last_error() { + let source_code = r#" + (fail %last_error%) + "#; + let instruction = parse(source_code); + let expected = fail_last_error(); + assert_eq!(instruction, expected) +} + +#[test] +fn parse_fail_literals() { + let source_code = r#" + (fail 1 "error message") + "#; + let instruction = parse(source_code); + let expected = fail_literals(1, "error message"); + assert_eq!(instruction, expected) +} diff --git a/crates/air-lib/air-parser/src/parser/tests/mod.rs b/crates/air-lib/air-parser/src/parser/tests/mod.rs index 25dca187..f46acc4a 100644 --- a/crates/air-lib/air-parser/src/parser/tests/mod.rs +++ b/crates/air-lib/air-parser/src/parser/tests/mod.rs @@ -17,6 +17,7 @@ mod ap; mod call; mod dsl; +mod fail; mod fold; mod match_; mod new; diff --git a/crates/air-lib/air-parser/src/parser/tests/null.rs b/crates/air-lib/air-parser/src/parser/tests/null.rs index aaf94d7f..d199ce16 100644 --- a/crates/air-lib/air-parser/src/parser/tests/null.rs +++ b/crates/air-lib/air-parser/src/parser/tests/null.rs @@ -16,7 +16,6 @@ use super::dsl::*; use super::parse; -use crate::ast::*; #[test] fn parse_null() { @@ -28,6 +27,6 @@ fn parse_null() { ) "#; let instruction = parse(source_code); - let expected = Instruction::Seq(Seq(Box::new(null()), Box::new(null()))); + let expected = seq(null(), null()); assert_eq!(instruction, expected) } diff --git a/crates/air-lib/polyplets/src/tetraplet.rs b/crates/air-lib/polyplets/src/tetraplet.rs index 4611e2e7..3fb1150c 100644 --- a/crates/air-lib/polyplets/src/tetraplet.rs +++ b/crates/air-lib/polyplets/src/tetraplet.rs @@ -55,10 +55,10 @@ impl SecurityTetraplet { /// Create a tetraplet for string literals defined in the script /// such as variable here `(call ("" "") "" ["variable_1"])`. - pub fn literal_tetraplet(init_peer_id: String) -> Self { + pub fn literal_tetraplet(init_peer_id: impl Into) -> Self { Self { // these variables represent the initiator peer - peer_pk: init_peer_id, + peer_pk: init_peer_id.into(), service_id: String::new(), function_name: String::new(), // json path can't be applied to the string literals diff --git a/crates/air-lib/test-utils/src/call_services.rs b/crates/air-lib/test-utils/src/call_services.rs index 772cfbac..c9f5cf3a 100644 --- a/crates/air-lib/test-utils/src/call_services.rs +++ b/crates/air-lib/test-utils/src/call_services.rs @@ -17,7 +17,10 @@ use super::*; use serde_json::json; + +use std::cell::RefCell; use std::collections::HashMap; +use std::rc::Rc; pub fn unit_call_service() -> CallServiceClosure { Box::new(|_| -> CallServiceResult { @@ -85,3 +88,19 @@ pub fn fallible_call_service(fallible_service_id: impl Into) -> CallServ } }) } + +pub type ArgTetraplets = Vec>; + +pub fn tetraplet_host_function( + closure: impl Fn(CallRequestParams) -> CallServiceResult + 'static, +) -> (CallServiceClosure, Rc>) { + let arg_tetraplets = Rc::new(RefCell::new(ArgTetraplets::new())); + + let arg_tetraplets_inner = arg_tetraplets.clone(); + let host_function: CallServiceClosure = Box::new(move |params| -> CallServiceResult { + *arg_tetraplets_inner.borrow_mut() = params.tetraplets.clone(); + closure(params) + }); + + (host_function, arg_tetraplets) +}