From 21843e19229b31b3c3d5df7464cc5a92547b48aa Mon Sep 17 00:00:00 2001 From: jonathan Date: Tue, 24 Oct 2023 21:09:56 +0200 Subject: [PATCH 01/27] While parsing + tests --- Cargo.toml | 4 + compiler/Cargo.toml | 2 +- compiler/src/interpreter/cvar.rs | 2 +- compiler/src/interpreter/mod.rs | 3 +- compiler/src/interpreter/value.rs | 12 +- compiler/src/interpreter/x86var.rs | 2 +- compiler/src/language/alvar.rs | 2 +- compiler/src/language/cvar.rs | 2 +- compiler/src/language/lvar.rs | 155 - compiler/src/language/mod.rs | 1 - compiler/src/language/rlvar.rs | 2 +- compiler/src/passes/atomize.rs | 2 +- compiler/src/passes/explicate_control.rs | 3 +- compiler/src/passes/parse/grammar.lalrpop | 9 +- compiler/src/passes/parse/grammar.rs | 2677 +++++++++-------- .../lvar.rs => passes/parse/interpreter.rs} | 6 +- compiler/src/passes/parse/mod.rs | 137 +- compiler/src/passes/reveal_functions.rs | 6 +- compiler/src/passes/select/mod.rs | 2 +- compiler/src/passes/type_check.rs | 14 +- compiler/src/passes/uniquify.rs | 4 +- compiler/src/utils/split_test.rs | 2 +- compiler/tests/integration.rs | 2 +- parser_generator/Cargo.toml | 3 +- parser_generator/src/grammar.rs | 543 ---- programs/fail/type_check/unit_from_int_1.test | 4 + programs/fail/type_check/unit_from_int_2.test | 6 + programs/fail/type_check/unit_from_int_3.test | 5 + programs/good/loops/loop_bool.test | 8 + programs/good/loops/loop_let.test | 9 + programs/good/loops/loop_num.test | 8 + programs/good/loops/loop_void.test | 8 + programs/good/loops/unit.test | 6 + programs/good/loops/unit_bind.test | 7 + programs/good/loops/unit_fn.test | 6 + 35 files changed, 1742 insertions(+), 1922 deletions(-) delete mode 100644 compiler/src/language/lvar.rs rename compiler/src/{interpreter/lvar.rs => passes/parse/interpreter.rs} (97%) delete mode 100644 parser_generator/src/grammar.rs create mode 100644 programs/fail/type_check/unit_from_int_1.test create mode 100644 programs/fail/type_check/unit_from_int_2.test create mode 100644 programs/fail/type_check/unit_from_int_3.test create mode 100644 programs/good/loops/loop_bool.test create mode 100644 programs/good/loops/loop_let.test create mode 100644 programs/good/loops/loop_num.test create mode 100644 programs/good/loops/loop_void.test create mode 100644 programs/good/loops/unit.test create mode 100644 programs/good/loops/unit_bind.test create mode 100644 programs/good/loops/unit_fn.test diff --git a/Cargo.toml b/Cargo.toml index 5213520..b8b9b4b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,3 +10,7 @@ members = [ default-members = [ "compiler" ] + +[profile.release] +opt-level = 3 +lto = true diff --git a/compiler/Cargo.toml b/compiler/Cargo.toml index d206a7c..13b7f6b 100644 --- a/compiler/Cargo.toml +++ b/compiler/Cargo.toml @@ -13,7 +13,7 @@ serde = { version = "1.0.189", features = ["derive"] } clap = { version = "4.4.6", features = ["derive"] } miette = { version = "5.10.0", features = ["fancy"] } zerocopy = {version = "0.7.11", features = ["derive"] } -lalrpop-util = { version = "0.20.1", features = ["lexer", "unicode"] } +lalrpop-util = { version = "0.20", features = ["lexer", "unicode"] } [dev-dependencies] test_each_file = "0.1.0" diff --git a/compiler/src/interpreter/cvar.rs b/compiler/src/interpreter/cvar.rs index 4040951..5fb4510 100644 --- a/compiler/src/interpreter/cvar.rs +++ b/compiler/src/interpreter/cvar.rs @@ -2,7 +2,7 @@ use crate::interpreter::value::Val; use crate::interpreter::IO; use crate::language::alvar::Atom; use crate::language::cvar::{CExpr, PrgExplicated, Tail}; -use crate::language::lvar::{Lit, Op}; +use crate::passes::parse::{Lit, Op}; use crate::passes::uniquify::UniqueSym; use crate::utils::push_map::PushMap; diff --git a/compiler/src/interpreter/mod.rs b/compiler/src/interpreter/mod.rs index 38eb397..8377ee1 100644 --- a/compiler/src/interpreter/mod.rs +++ b/compiler/src/interpreter/mod.rs @@ -1,9 +1,8 @@ pub mod cvar; -pub mod lvar; pub mod value; pub mod x86var; -use crate::language::lvar::Lit; +use crate::passes::parse::Lit; use std::io::stdin; use std::vec::IntoIter; diff --git a/compiler/src/interpreter/value.rs b/compiler/src/interpreter/value.rs index 53a2b10..eac056a 100644 --- a/compiler/src/interpreter/value.rs +++ b/compiler/src/interpreter/value.rs @@ -1,4 +1,4 @@ -use crate::language::lvar::Lit; +use crate::passes::parse::Lit; use std::fmt::{Display, Formatter}; use std::hash::Hash; use std::str::FromStr; @@ -7,6 +7,7 @@ use std::str::FromStr; pub enum Val { Int { val: i64 }, Bool { val: bool }, + Unit, Function { sym: A }, } @@ -16,6 +17,7 @@ impl Val { Val::Int { val } => val, Val::Bool { .. } => panic!(), Val::Function { .. } => panic!(), + Val::Unit => panic!(), } } @@ -24,6 +26,7 @@ impl Val { Val::Int { .. } => panic!(), Val::Bool { val } => val, Val::Function { .. } => panic!(), + Val::Unit => panic!(), } } @@ -32,6 +35,7 @@ impl Val { Val::Int { .. } => panic!(), Val::Bool { .. } => panic!(), Val::Function { sym } => sym, + Val::Unit => panic!(), } } } @@ -41,6 +45,7 @@ impl From for i64 { match value { Lit::Int { val } => val, Lit::Bool { val } => val as i64, + Lit::Unit => 0, } } } @@ -65,12 +70,13 @@ impl Display for Val { Val::Int { val } => write!(f, "{val}"), Val::Bool { val } => { if *val { - write!(f, "t") + write!(f, "true") } else { - write!(f, "f") + write!(f, "false") } } Val::Function { sym, .. } => write!(f, "pointer to `{sym}``"), + Val::Unit => write!(f, "unit") } } } diff --git a/compiler/src/interpreter/x86var.rs b/compiler/src/interpreter/x86var.rs index 6314ac7..a5c8df8 100644 --- a/compiler/src/interpreter/x86var.rs +++ b/compiler/src/interpreter/x86var.rs @@ -1,5 +1,5 @@ use crate::interpreter::IO; -use crate::language::lvar::Lit; +use crate::passes::parse::Lit; use crate::language::x86var::{ Block, Cnd, Instr, Reg, VarArg, X86Concluded, X86Selected, CALLEE_SAVED, CALLER_SAVED, }; diff --git a/compiler/src/language/alvar.rs b/compiler/src/language/alvar.rs index 00b0452..ccb0c1e 100644 --- a/compiler/src/language/alvar.rs +++ b/compiler/src/language/alvar.rs @@ -1,4 +1,4 @@ -use crate::language::lvar::{Def, Expr, Lit, Op, PrgUniquified}; +use crate::passes::parse::{Def, Expr, Lit, Op, PrgUniquified}; use crate::passes::type_check::Type; use crate::passes::uniquify::UniqueSym; use std::collections::HashMap; diff --git a/compiler/src/language/cvar.rs b/compiler/src/language/cvar.rs index 0f2162a..e108552 100644 --- a/compiler/src/language/cvar.rs +++ b/compiler/src/language/cvar.rs @@ -1,5 +1,5 @@ use crate::language::alvar::Atom; -use crate::language::lvar::Op; +use crate::passes::parse::Op; use crate::passes::uniquify::UniqueSym; use std::collections::HashMap; diff --git a/compiler/src/language/lvar.rs b/compiler/src/language/lvar.rs deleted file mode 100644 index d788b57..0000000 --- a/compiler/src/language/lvar.rs +++ /dev/null @@ -1,155 +0,0 @@ -use crate::interpreter::value::Val; -use std::collections::HashMap; - -use crate::passes::type_check::Type; -use crate::passes::uniquify::UniqueSym; -use std::fmt::{Display, Formatter}; -use std::hash::Hash; - -#[derive(Debug, PartialEq)] -pub struct PrgParsed<'p> { - pub defs: Vec>, - pub entry: &'p str, -} - -pub type PrgTypeChecked<'p> = PrgGenericVar<&'p str>; -pub type PrgUniquified<'p> = PrgGenericVar>; - -#[derive(Debug, PartialEq)] -pub struct PrgGenericVar { - pub defs: HashMap>, - pub entry: A, -} - -#[derive(Copy, Clone, Debug, PartialEq)] -pub enum Op { - Read, - Print, - Plus, - Minus, - Mul, - Div, - Mod, - LAnd, - LOr, - Not, - Xor, - GT, - GE, - EQ, - LE, - LT, - NE, -} - -impl Display for Op { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - write!( - f, - "{}", - match self { - Op::Read => "read", - Op::Print => "print", - Op::Plus => "plus", - Op::Minus => "minus", - Op::Mul => "multiply", - Op::Div => "divide", - Op::Mod => "modulo", - Op::LAnd => "logical and", - Op::LOr => "logical or", - Op::Not => "not", - Op::Xor => "xor", - Op::GT => "greater", - Op::GE => "greater or equal", - Op::EQ => "equal", - Op::LE => "less or equal", - Op::LT => "less", - Op::NE => "not equal", - } - ) - } -} - -#[derive(Debug, PartialEq)] -pub enum Def { - Fn { - sym: A, - params: Vec<(A, Type)>, - typ: Type, - bdy: Expr, - }, -} - -#[derive(Copy, Clone, Debug, PartialEq)] -pub enum Lit { - Int { val: i64 }, - Bool { val: bool }, -} - -impl Lit { - pub fn int(self) -> i64 { - match self { - Lit::Int { val } => val, - Lit::Bool { .. } => panic!(), - } - } - - pub fn bool(self) -> bool { - match self { - Lit::Int { .. } => panic!(), - Lit::Bool { val } => val, - } - } -} - -impl Display for Lit { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - match self { - Lit::Int { val } => write!(f, "{val}"), - Lit::Bool { val } => { - if *val { - write!(f, "true") - } else { - write!(f, "false") - } - } - } - } -} - -impl From for Val { - fn from(value: Lit) -> Self { - match value { - Lit::Int { val } => Val::Int { val }, - Lit::Bool { val } => Val::Bool { val }, - } - } -} - -#[derive(Debug, PartialEq)] -pub enum Expr { - Lit { - val: Lit, - }, - Var { - sym: A, - }, - Prim { - op: Op, - args: Vec>, - }, - Let { - sym: A, - bnd: Box>, - bdy: Box>, - }, - If { - cnd: Box>, - thn: Box>, - els: Box>, - }, - Apply { - fun: Box>, - args: Vec>, - }, -} diff --git a/compiler/src/language/mod.rs b/compiler/src/language/mod.rs index 3c29e60..932d31f 100644 --- a/compiler/src/language/mod.rs +++ b/compiler/src/language/mod.rs @@ -1,6 +1,5 @@ pub mod alvar; pub mod cvar; -pub mod lvar; pub mod rlvar; pub mod x86var; pub mod x86var_format; diff --git a/compiler/src/language/rlvar.rs b/compiler/src/language/rlvar.rs index 12f3b75..a62eb88 100644 --- a/compiler/src/language/rlvar.rs +++ b/compiler/src/language/rlvar.rs @@ -1,4 +1,4 @@ -use crate::language::lvar::{Def, Expr, Lit, Op, PrgUniquified}; +use crate::passes::parse::{Def, Expr, Lit, Op, PrgUniquified}; use crate::passes::type_check::Type; use crate::passes::uniquify::UniqueSym; use std::collections::HashMap; diff --git a/compiler/src/passes/atomize.rs b/compiler/src/passes/atomize.rs index 7f5c7af..261a7ab 100644 --- a/compiler/src/passes/atomize.rs +++ b/compiler/src/passes/atomize.rs @@ -120,7 +120,7 @@ fn rco_atom(expr: RExpr) -> (Atom, Option<(UniqueSym, AExpr)>) { #[cfg(test)] mod tests { use crate::interpreter::TestIO; - use crate::language::lvar::PrgGenericVar; + use crate::passes::parse::PrgGenericVar; use crate::utils::split_test::split_test; use test_each_file::test_each_file; diff --git a/compiler/src/passes/explicate_control.rs b/compiler/src/passes/explicate_control.rs index 45ef6f3..85f8e1d 100644 --- a/compiler/src/passes/explicate_control.rs +++ b/compiler/src/passes/explicate_control.rs @@ -6,7 +6,7 @@ use crate::language::alvar::ADef; use crate::language::alvar::{AExpr, Atom, PrgAtomized}; use crate::language::cvar::{CExpr, PrgExplicated, Tail}; -use crate::language::lvar::{Lit, Op}; +use crate::passes::parse::{Lit, Op}; use crate::passes::uniquify::{gen_sym, UniqueSym}; use std::collections::HashMap; @@ -247,6 +247,7 @@ fn explicate_pred<'p>( val: Lit::Int { .. }, }, } => unreachable!(), + AExpr::Atom { atm: Atom::Val { val: Lit::Unit } } => todo!() } } diff --git a/compiler/src/passes/parse/grammar.lalrpop b/compiler/src/passes/parse/grammar.lalrpop index 95c937f..0d0eb7b 100644 --- a/compiler/src/passes/parse/grammar.lalrpop +++ b/compiler/src/passes/parse/grammar.lalrpop @@ -1,5 +1,5 @@ use std::str::FromStr; -use crate::language::lvar::*; +use crate::passes::parse::*; use crate::passes::parse::PrgParsed; use crate::passes::type_check::Type; @@ -11,6 +11,8 @@ match { "let", "if", "else", + "loop", + "break", // Structural tokens "(", @@ -40,10 +42,12 @@ match { // Types "Int", "Bool", + "Unit", // Literals "true", "false", + "unit", r"[0-9]+", // Logical operators @@ -79,6 +83,7 @@ Param = ":" ; Type: Type = { "Int" => Type::Int, "Bool" => Type::Bool, + "Unit" => Type::Unit, } BinaryOps: Expr<&'input str> = { @@ -91,6 +96,8 @@ Expr = ExprStmt; ExprStmt: Expr<&'input str> = { "let" "=" ";" => Expr::Let { sym, bnd: Box::new(bnd), bdy: Box::new(bdy) }, "if" "{" "}" "else" "{" "}" => Expr::If { cnd: Box::new(cnd), thn: Box::new(thn), els: Box::new(els) }, + "loop" "{" "}" => Expr::Loop { bdy: Box::new(bdy) }, + "break" => Expr::Break { e: e.map(Box::new) }, ExprLogicalOr, } diff --git a/compiler/src/passes/parse/grammar.rs b/compiler/src/passes/parse/grammar.rs index e55e45e..a868959 100644 --- a/compiler/src/passes/parse/grammar.rs +++ b/compiler/src/passes/parse/grammar.rs @@ -1,22 +1,22 @@ // auto-generated: "lalrpop 0.20.1" -// sha3: c8ac99d54ab4ee03af2545f83995c16492898b11a4e7469c018de7c7dbd90193 -use crate::language::lvar::*; +// sha3: e96ee58666334e6479be6108467200e495ac77aeb55bfcf2b78b4c1e8d3cd21f +use std::str::FromStr; +use crate::passes::parse::*; use crate::passes::parse::PrgParsed; use crate::passes::type_check::Type; -use std::str::FromStr; #[allow(unused_extern_crates)] extern crate lalrpop_util as __lalrpop_util; #[allow(unused_imports)] use self::__lalrpop_util::state_machine as __state_machine; -extern crate alloc; extern crate core; +extern crate alloc; #[rustfmt::skip] #[allow(non_snake_case, non_camel_case_types, unused_mut, unused_variables, unused_imports, unused_parens, clippy::needless_lifetimes, clippy::type_complexity, clippy::needless_return, clippy::too_many_arguments, clippy::never_loop, clippy::match_single_binding, clippy::needless_raw_string_hashes)] mod __parse__Program { use std::str::FromStr; - use crate::language::lvar::*; + use crate::passes::parse::*; use crate::passes::parse::PrgParsed; use crate::passes::type_check::Type; #[allow(unused_extern_crates)] @@ -48,238 +48,252 @@ mod __parse__Program { } const __ACTION: &[i8] = &[ // State 0 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 1 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 2 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 3 - 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, 0, 0, 0, 0, 37, + 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, 0, 0, 0, 0, 0, 0, 0, 0, 39, // State 4 - 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, 0, 0, 0, 0, 37, + 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, 0, 0, 0, 0, 0, 0, 0, 0, 39, // State 5 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 49, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 6 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 49, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 7 - 63, 0, 0, 0, 16, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 17, 18, 66, 67, 68, 0, 0, 0, 69, 37, + 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 68, 0, 18, 19, 69, 70, 71, 72, 0, 0, 0, 0, 73, 39, // State 8 - 0, -49, 0, -49, 0, -49, 0, 70, -49, 71, 0, 0, 0, -49, -49, -49, 0, -49, -49, -49, 0, 0, -49, 0, 0, 0, 0, 0, 0, 0, 0, -49, -49, -49, 0, 0, + 0, -49, 0, -49, 0, -49, 0, 74, -49, 75, 0, 0, 0, -49, -49, -49, 0, -49, -49, -49, 0, 0, 0, -49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -49, -49, -49, 0, 0, // State 9 - 0, 72, 0, -58, 0, -58, 0, 0, -58, 0, 0, 0, 0, -58, 73, 74, 0, 75, 76, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -58, -58, -58, 0, 0, + 0, 76, 0, -58, 0, -58, 0, 0, -58, 0, 0, 0, 0, -58, 77, 78, 0, 79, 80, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -58, -58, -58, 0, 0, // State 10 - 0, 0, 0, 78, 0, -59, 0, 0, -59, 0, 0, 0, 0, -59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -59, -59, -59, 0, 0, + 0, 0, 0, 82, 0, -59, 0, 0, -59, 0, 0, 0, 0, -59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -59, -59, -59, 0, 0, // State 11 - 0, 0, 0, 0, 0, -60, 0, 0, -60, 0, 0, 0, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -60, 79, -60, 0, 0, + 0, 0, 0, 0, 0, -60, 0, 0, -60, 0, 0, 0, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -60, 83, -60, 0, 0, // State 12 - 0, -61, 80, -61, 0, -61, 81, -61, -61, -61, 0, 82, 0, -61, -61, -61, 0, -61, -61, -61, 0, 0, -61, 0, 0, 0, 0, 0, 0, 0, 0, -61, -61, -61, 0, 0, + 0, -61, 84, -61, 0, -61, 85, -61, -61, -61, 0, 86, 0, -61, -61, -61, 0, -61, -61, -61, 0, 0, 0, -61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -61, -61, -61, 0, 0, // State 13 - 0, -67, 0, -67, 0, -67, 0, 0, -67, 0, 0, 0, 0, -67, -67, -67, 0, -67, -67, -67, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 0, -67, -67, -67, 0, 0, + 0, -70, 0, -70, 0, -70, 0, 0, -70, 0, 0, 0, 0, -70, -70, -70, 0, -70, -70, -70, 0, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -70, -70, -70, 0, 0, // State 14 - 63, 0, 0, 0, 16, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 66, 67, 68, 0, 0, 0, 69, 37, + 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 70, 71, 72, 0, 0, 0, 0, 73, 39, // State 15 - 63, 0, 0, 0, 16, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 17, 18, 66, 67, 68, 0, 0, 0, 69, 37, + 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 68, 0, 18, 19, 69, 70, 71, 72, 0, 0, 0, 0, 73, 39, // State 16 - 63, 0, 0, 0, 16, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 66, 67, 68, 0, 0, 0, 69, 37, + 66, 0, 0, 0, 16, -66, 0, 0, -66, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 68, 0, 18, 19, 69, 70, 71, 72, 0, 0, 0, -66, 73, 39, // State 17 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, + 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 70, 71, 72, 0, 0, 0, 0, 73, 39, // State 18 - 63, 0, 0, 0, 16, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 66, 67, 68, 0, 0, 0, 69, 37, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, // State 19 - 63, 0, 0, 0, 16, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 66, 67, 68, 0, 0, 0, 69, 37, + 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 70, 71, 72, 0, 0, 0, 0, 73, 39, // State 20 - 63, 0, 0, 0, 16, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 66, 67, 68, 0, 0, 0, 69, 37, + 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 70, 71, 72, 0, 0, 0, 0, 73, 39, // State 21 - 63, 0, 0, 0, 16, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 66, 67, 68, 0, 0, 0, 69, 37, + 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 70, 71, 72, 0, 0, 0, 0, 73, 39, // State 22 - 63, 0, 0, 0, 16, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 66, 67, 68, 0, 0, 0, 69, 37, + 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 70, 71, 72, 0, 0, 0, 0, 73, 39, // State 23 - 63, 0, 0, 0, 16, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 66, 67, 68, 0, 0, 0, 69, 37, + 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 70, 71, 72, 0, 0, 0, 0, 73, 39, // State 24 - 63, 0, 0, 0, 16, -28, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 17, 18, 66, 67, 68, 0, 0, 0, 69, 37, + 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 70, 71, 72, 0, 0, 0, 0, 73, 39, // State 25 - 63, 0, 0, 0, 16, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 17, 18, 66, 67, 68, 0, 0, 0, 69, 37, + 66, 0, 0, 0, 16, -28, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 68, 0, 18, 19, 69, 70, 71, 72, 0, 0, 0, 0, 73, 39, // State 26 - 63, 0, 0, 0, 16, -30, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 17, 18, 66, 67, 68, 0, 0, 0, 69, 37, + 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 68, 0, 18, 19, 69, 70, 71, 72, 0, 0, 0, 0, 73, 39, // State 27 - 63, 0, 0, 0, 16, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 17, 18, 66, 67, 68, 0, 0, 0, 69, 37, + 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 68, 0, 18, 19, 69, 70, 71, 72, 0, 0, 0, 0, 73, 39, // State 28 - 63, 0, 0, 0, 16, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 66, 67, 68, 0, 0, 0, 69, 37, + 66, 0, 0, 0, 16, -30, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 68, 0, 18, 19, 69, 70, 71, 72, 0, 0, 0, 0, 73, 39, // State 29 - 63, 0, 0, 0, 16, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 17, 18, 66, 67, 68, 0, 0, 0, 69, 37, + 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 68, 0, 18, 19, 69, 70, 71, 72, 0, 0, 0, 0, 73, 39, // State 30 - 63, 0, 0, 0, 16, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 17, 18, 66, 67, 68, 0, 0, 0, 69, 37, + 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 70, 71, 72, 0, 0, 0, 0, 73, 39, // 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, -44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 68, 0, 18, 19, 69, 70, 71, 72, 0, 0, 0, 0, 73, 39, // State 32 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 68, 0, 18, 19, 69, 70, 71, 72, 0, 0, 0, 0, 73, 39, // State 33 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 34 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 35 - 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 36 - 0, -69, -69, -69, -69, -69, -69, -69, -69, -69, 0, -69, -69, -69, -69, -69, -69, -69, -69, -69, 0, 0, -69, 0, 0, 0, 0, 0, 0, 0, 0, -69, -69, -69, 0, 0, + 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 37 - 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 38 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -72, -72, -72, -72, -72, -72, -72, -72, -72, 0, -72, -72, -72, -72, -72, -72, -72, -72, -72, 0, 0, 0, -72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -72, -72, -72, 0, 0, // State 39 - 0, 0, 0, 0, 0, -31, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 40 - 0, 0, 0, 0, 0, -33, 0, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 41 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -31, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 42 - 0, 0, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -9, + 0, 0, 0, 0, 0, -33, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, // State 43 - 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, -10, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 44 - 0, 0, 0, 0, 0, -76, 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, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -9, // State 45 - 0, 0, 0, 0, 0, -82, 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, -82, 0, 0, 0, 0, + 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10, // State 46 - 0, 0, 0, 0, 0, -81, 0, 0, -81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -81, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -79, 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, 0, 0, 0, 0, 0, 0, 0, 0, // State 47 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -85, 0, 0, -85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -85, 0, 0, 0, 0, // State 48 - 0, -51, -51, -51, -51, -51, -51, -51, -51, -51, 0, -51, 0, -51, -51, -51, 0, -51, -51, -51, 0, 0, -51, 0, 0, 0, 0, 0, 0, 0, 0, -51, -51, -51, 0, 0, + 0, 0, 0, 0, 0, -84, 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, 0, 0, 0, -84, 0, 0, 0, 0, // State 49 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 0, 0, + 0, 0, 0, 0, 0, -86, 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, 0, -86, 0, 0, 0, 0, // State 50 - 0, -24, 0, -24, 0, -24, 0, 0, -24, 0, 0, 0, 0, -24, -24, -24, 0, -24, -24, -24, 0, 0, -24, 0, 0, 0, 0, 0, 0, 0, 0, -24, -24, -24, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, // State 51 - 0, -57, -57, -57, 25, -57, -57, -57, -57, -57, 0, -57, 0, -57, -57, -57, 0, -57, -57, -57, 0, 0, -57, 0, 0, 0, 0, 0, 0, 0, 0, -57, -57, -57, 0, 0, + 0, -51, -51, -51, -51, -51, -51, -51, -51, -51, 0, -51, 0, -51, -51, -51, 0, -51, -51, -51, 0, 0, 0, -51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -51, -51, -51, 0, 0, // State 52 - 0, -66, -66, -66, 0, -66, -66, -66, -66, -66, 0, -66, 0, -66, -66, -66, 0, -66, -66, -66, 0, 0, -66, 0, 0, 0, 0, 0, 0, 0, 0, -66, -66, -66, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 0, 0, // State 53 - 0, 0, 0, -18, 0, -18, 0, 0, -18, 0, 0, 0, 0, -18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -18, -18, -18, 0, 0, + 0, -24, 0, -24, 0, -24, 0, 0, -24, 0, 0, 0, 0, -24, -24, -24, 0, -24, -24, -24, 0, 0, 0, -24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -24, -24, -24, 0, 0, // State 54 - 0, 0, 0, 0, 0, -20, 0, 0, -20, 0, 0, 0, 0, -20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -20, -20, -20, 0, 0, + 0, -57, -57, -57, 26, -57, -57, -57, -57, -57, 0, -57, 0, -57, -57, -57, 0, -57, -57, -57, 0, 0, 0, -57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -57, -57, -57, 0, 0, // State 55 - 0, 0, 0, 0, 0, -64, 0, 0, -64, 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, 0, 0, + 0, -69, -69, -69, 0, -69, -69, -69, -69, -69, 0, -69, 0, -69, -69, -69, 0, -69, -69, -69, 0, 0, 0, -69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -69, -69, -69, 0, 0, // State 56 - 0, -14, 0, -14, 0, -14, 0, -14, -14, -14, 0, 0, 0, -14, -14, -14, 0, -14, -14, -14, 0, 0, -14, 0, 0, 0, 0, 0, 0, 0, 0, -14, -14, -14, 0, 0, + 0, 0, 0, -18, 0, -18, 0, 0, -18, 0, 0, 0, 0, -18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -18, -18, -18, 0, 0, // State 57 - 0, 0, 0, 0, 0, -46, 0, 0, -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, 0, 0, + 0, 0, 0, 0, 0, -20, 0, 0, -20, 0, 0, 0, 0, -20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -20, -20, -20, 0, 0, // State 58 - 0, -22, -22, -22, 0, -22, -22, -22, -22, -22, 0, -22, 0, -22, -22, -22, 0, -22, -22, -22, 0, 0, -22, 0, 0, 0, 0, 0, 0, 0, 0, -22, -22, -22, 0, 0, + 0, 0, 0, 0, 0, -67, 0, 0, -67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -67, 0, 0, // State 59 - 0, -16, 0, -16, 0, -16, 0, 0, -16, 0, 0, 0, 0, -16, -16, -16, 0, -16, -16, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16, -16, -16, 0, 0, + 0, -14, 0, -14, 0, -14, 0, -14, -14, -14, 0, 0, 0, -14, -14, -14, 0, -14, -14, -14, 0, 0, 0, -14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, -14, -14, 0, 0, // State 60 - 0, -52, -52, -52, -52, -52, -52, -52, -52, -52, 0, -52, 0, -52, -52, -52, 0, -52, -52, -52, 0, 0, -52, 0, 0, 0, 0, 0, 0, 0, 0, -52, -52, -52, 0, 0, + 0, 0, 0, 0, 0, -46, 0, 0, -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, 0, 0, 0, 0, -46, 0, 0, // State 61 - 0, -50, -50, -50, -50, -50, -50, -50, -50, -50, 0, -50, 0, -50, -50, -50, 0, -50, -50, -50, 0, 0, -50, 0, 0, 0, 0, 0, 0, 0, 0, -50, -50, -50, 0, 0, + 0, -22, -22, -22, 0, -22, -22, -22, -22, -22, 0, -22, 0, -22, -22, -22, 0, -22, -22, -22, 0, 0, 0, -22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -22, -22, -22, 0, 0, // State 62 - -84, 0, 0, 0, -84, 0, 0, 0, 0, -84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -84, 0, 0, 0, -84, -84, -84, 0, 0, 0, -84, -84, + 0, -16, 0, -16, 0, -16, 0, 0, -16, 0, 0, 0, 0, -16, -16, -16, 0, -16, -16, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16, -16, -16, 0, 0, // State 63 - -83, 0, 0, 0, -83, 0, 0, 0, 0, -83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -83, 0, 0, 0, -83, -83, -83, 0, 0, 0, -83, -83, + 0, -52, -52, -52, -52, -52, -52, -52, -52, -52, 0, -52, 0, -52, -52, -52, 0, -52, -52, -52, 0, 0, 0, -52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -52, -52, -52, 0, 0, // State 64 - 0, -26, -26, -26, -26, -26, -26, -26, -26, -26, 0, -26, 0, -26, -26, -26, 0, -26, -26, -26, 0, 0, -26, 0, 0, 0, 0, 0, 0, 0, 0, -26, -26, -26, 0, 0, + 0, -50, -50, -50, -50, -50, -50, -50, -50, -50, 0, -50, 0, -50, -50, -50, 0, -50, -50, -50, 0, 0, 0, -50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -50, -50, -50, 0, 0, // State 65 - 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -88, 0, 0, 0, -88, 0, 0, 0, 0, -88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -88, 0, 0, 0, 0, -88, -88, -88, 0, 0, 0, 0, -88, -88, // State 66 - 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, + -87, 0, 0, 0, -87, 0, 0, 0, 0, -87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -87, 0, 0, 0, 0, -87, -87, -87, 0, 0, 0, 0, -87, -87, // State 67 - 0, -25, -25, -25, -25, -25, -25, -25, -25, -25, 0, -25, 0, -25, -25, -25, 0, -25, -25, -25, 0, 0, -25, 0, 0, 0, 0, 0, 0, 0, 0, -25, -25, -25, 0, 0, + 0, -26, -26, -26, -26, -26, -26, -26, -26, -26, 0, -26, 0, -26, -26, -26, 0, -26, -26, -26, 0, 0, 0, -26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -26, -26, -26, 0, 0, // State 68 - 0, -75, -75, -75, -75, -75, -75, -75, -75, -75, 0, -75, 0, -75, -75, -75, 0, -75, -75, -75, 0, 0, -75, 0, 0, 0, 0, 0, 0, 0, 0, -75, -75, -75, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, // State 69 - -11, 0, 0, 0, -11, 0, 0, 0, 0, -11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -11, 0, 0, 0, -11, -11, -11, 0, 0, 0, -11, -11, + 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 70 - -12, 0, 0, 0, -12, 0, 0, 0, 0, -12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -12, 0, 0, 0, -12, -12, -12, 0, 0, 0, -12, -12, + 0, 0, 0, 0, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 71 - -36, 0, 0, 0, -36, 0, 0, 0, 0, -36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -36, 0, 0, 0, -36, -36, -36, 0, 0, 0, -36, -36, + 0, -25, -25, -25, -25, -25, -25, -25, -25, -25, 0, -25, 0, -25, -25, -25, 0, -25, -25, -25, 0, 0, 0, -25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -25, -25, -25, 0, 0, // State 72 - -39, 0, 0, 0, -39, 0, 0, 0, 0, -39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -39, 0, 0, 0, -39, -39, -39, 0, 0, 0, -39, -39, + 0, -78, -78, -78, -78, -78, -78, -78, -78, -78, 0, -78, 0, -78, -78, -78, 0, -78, -78, -78, 0, 0, 0, -78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -78, -78, -78, 0, 0, // State 73 - -40, 0, 0, 0, -40, 0, 0, 0, 0, -40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -40, 0, 0, 0, -40, -40, -40, 0, 0, 0, -40, -40, + -11, 0, 0, 0, -11, 0, 0, 0, 0, -11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -11, 0, 0, 0, 0, -11, -11, -11, 0, 0, 0, 0, -11, -11, // State 74 - -35, 0, 0, 0, -35, 0, 0, 0, 0, -35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -35, 0, 0, 0, -35, -35, -35, 0, 0, 0, -35, -35, + -12, 0, 0, 0, -12, 0, 0, 0, 0, -12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -12, 0, 0, 0, 0, -12, -12, -12, 0, 0, 0, 0, -12, -12, // State 75 - -37, 0, 0, 0, -37, 0, 0, 0, 0, -37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -37, 0, 0, 0, -37, -37, -37, 0, 0, 0, -37, -37, + -36, 0, 0, 0, -36, 0, 0, 0, 0, -36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -36, 0, 0, 0, 0, -36, -36, -36, 0, 0, 0, 0, -36, -36, // State 76 - -38, 0, 0, 0, -38, 0, 0, 0, 0, -38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -38, 0, 0, 0, -38, -38, -38, 0, 0, 0, -38, -38, + -39, 0, 0, 0, -39, 0, 0, 0, 0, -39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -39, 0, 0, 0, 0, -39, -39, -39, 0, 0, 0, 0, -39, -39, // State 77 - -70, 0, 0, 0, -70, 0, 0, 0, 0, -70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -70, 0, 0, 0, -70, -70, -70, 0, 0, 0, -70, -70, + -40, 0, 0, 0, -40, 0, 0, 0, 0, -40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -40, 0, 0, 0, 0, -40, -40, -40, 0, 0, 0, 0, -40, -40, // State 78 - -71, 0, 0, 0, -71, 0, 0, 0, 0, -71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -71, 0, 0, 0, -71, -71, -71, 0, 0, 0, -71, -71, + -35, 0, 0, 0, -35, 0, 0, 0, 0, -35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -35, 0, 0, 0, 0, -35, -35, -35, 0, 0, 0, 0, -35, -35, // State 79 - -74, 0, 0, 0, -74, 0, 0, 0, 0, -74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -74, 0, 0, 0, -74, -74, -74, 0, 0, 0, -74, -74, + -37, 0, 0, 0, -37, 0, 0, 0, 0, -37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -37, 0, 0, 0, 0, -37, -37, -37, 0, 0, 0, 0, -37, -37, // State 80 - -72, 0, 0, 0, -72, 0, 0, 0, 0, -72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -72, 0, 0, 0, -72, -72, -72, 0, 0, 0, -72, -72, + -38, 0, 0, 0, -38, 0, 0, 0, 0, -38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -38, 0, 0, 0, 0, -38, -38, -38, 0, 0, 0, 0, -38, -38, // State 81 - -73, 0, 0, 0, -73, 0, 0, 0, 0, -73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -73, 0, 0, 0, -73, -73, -73, 0, 0, 0, -73, -73, + -73, 0, 0, 0, -73, 0, 0, 0, 0, -73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -73, 0, 0, 0, 0, -73, -73, -73, 0, 0, 0, 0, -73, -73, // State 82 - -85, 0, 0, 0, -85, 0, 0, 0, 0, -85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -85, 0, 0, 0, -85, -85, -85, 0, 0, 0, -85, -85, + -74, 0, 0, 0, -74, 0, 0, 0, 0, -74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -74, 0, 0, 0, 0, -74, -74, -74, 0, 0, 0, 0, -74, -74, // State 83 - 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -77, 0, 0, 0, -77, 0, 0, 0, 0, -77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -77, 0, 0, 0, 0, -77, -77, -77, 0, 0, 0, 0, -77, -77, // State 84 - 0, -65, -65, -65, 0, -65, -65, -65, -65, -65, 0, -65, 0, -65, -65, -65, 0, -65, -65, -65, 0, 0, -65, 0, 0, 0, 0, 0, 0, 0, 0, -65, -65, -65, 0, 0, + -75, 0, 0, 0, -75, 0, 0, 0, 0, -75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -75, 0, 0, 0, 0, -75, -75, -75, 0, 0, 0, 0, -75, -75, // State 85 - 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, 0, 0, 0, 0, 0, + -76, 0, 0, 0, -76, 0, 0, 0, 0, -76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -76, 0, 0, 0, 0, -76, -76, -76, 0, 0, 0, 0, -76, -76, // State 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, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, + -89, 0, 0, 0, -89, 0, 0, 0, 0, -89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -89, 0, 0, 0, 0, -89, -89, -89, 0, 0, 0, 0, -89, -89, // State 87 - 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 88 - 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, + 0, -68, -68, -68, 0, -68, -68, -68, -68, -68, 0, -68, 0, -68, -68, -68, 0, -68, -68, -68, 0, 0, 0, -68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -68, -68, -68, 0, 0, // State 89 - 0, -13, 0, -13, 0, -13, 0, -13, -13, -13, 0, 0, 0, -13, -13, -13, 0, -13, -13, -13, 0, 0, -13, 0, 0, 0, 0, 0, 0, 0, 0, -13, -13, -13, 0, 0, + 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 90 - 0, -15, 0, -15, 0, -15, 0, 0, -15, 0, 0, 0, 0, -15, -15, -15, 0, -15, -15, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, -15, -15, 0, 0, + 0, 0, 0, 0, 0, -65, 0, 0, -65, 0, 0, 0, 0, 0, 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, 0, // State 91 - 0, 0, 0, -17, 0, -17, 0, 0, -17, 0, 0, 0, 0, -17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -17, -17, -17, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, // State 92 - 0, 0, 0, 0, 0, -19, 0, 0, -19, 0, 0, 0, 0, -19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -19, -19, -19, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, // State 93 - 0, -21, -21, -21, 0, -21, -21, -21, -21, -21, 0, -21, 0, -21, -21, -21, 0, -21, -21, -21, 0, 0, -21, 0, 0, 0, 0, 0, 0, 0, 0, -21, -21, -21, 0, 0, + 0, 0, 0, 0, 0, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 - 0, -23, 0, -23, 0, -23, 0, 0, -23, 0, 0, 0, 0, -23, -23, -23, 0, -23, -23, -23, 0, 0, -23, 0, 0, 0, 0, 0, 0, 0, 0, -23, -23, -23, 0, 0, + 0, -13, 0, -13, 0, -13, 0, -13, -13, -13, 0, 0, 0, -13, -13, -13, 0, -13, -13, -13, 0, 0, 0, -13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -13, -13, -13, 0, 0, // State 95 - 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, + 0, -15, 0, -15, 0, -15, 0, 0, -15, 0, 0, 0, 0, -15, -15, -15, 0, -15, -15, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, -15, -15, 0, 0, // State 96 - 0, 0, 0, 0, 0, -27, 0, 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, 0, 0, 0, + 0, 0, 0, -17, 0, -17, 0, 0, -17, 0, 0, 0, 0, -17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -17, -17, -17, 0, 0, // State 97 - 0, -53, -53, -53, -53, -53, -53, -53, -53, -53, 0, -53, 0, -53, -53, -53, 0, -53, -53, -53, 0, 0, -53, 0, 0, 0, 0, 0, 0, 0, 0, -53, -53, -53, 0, 0, + 0, 0, 0, 0, 0, -19, 0, 0, -19, 0, 0, 0, 0, -19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -19, -19, -19, 0, 0, // State 98 - 0, 0, 0, 0, 0, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -21, -21, -21, 0, -21, -21, -21, -21, -21, 0, -21, 0, -21, -21, -21, 0, -21, -21, -21, 0, 0, 0, -21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -21, -21, -21, 0, 0, // State 99 - 0, -54, -54, -54, 0, -54, -54, -54, -54, -54, 0, -54, 0, -54, -54, -54, 0, -54, -54, -54, 0, 0, -54, 0, 0, 0, 0, 0, 0, 0, 0, -54, -54, -54, 0, 0, + 0, -23, 0, -23, 0, -23, 0, 0, -23, 0, 0, 0, 0, -23, -23, -23, 0, -23, -23, -23, 0, 0, 0, -23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -23, -23, -23, 0, 0, // State 100 - 0, 0, 0, 0, 0, -29, 0, 0, 107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 101 - 0, -56, -56, -56, 0, -56, -56, -56, -56, -56, 0, -56, 0, -56, -56, -56, 0, -56, -56, -56, 0, 0, -56, 0, 0, 0, 0, 0, 0, 0, 0, -56, -56, -56, 0, 0, + 0, 0, 0, 0, 0, -27, 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, 0, 0, 0, 0, 0, 0, // State 102 - -4, 0, 0, 0, -4, -4, 0, 0, 0, -4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4, 0, -4, -4, -4, -4, -4, 0, 0, 0, -4, -4, + 0, -53, -53, -53, -53, -53, -53, -53, -53, -53, 0, -53, 0, -53, -53, -53, 0, -53, -53, -53, 0, 0, 0, -53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -53, -53, -53, 0, 0, // State 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, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, 0, 0, // State 104 - 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, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 105 - 0, -55, -55, -55, 0, -55, -55, -55, -55, -55, 0, -55, 0, -55, -55, -55, 0, -55, -55, -55, 0, 0, -55, 0, 0, 0, 0, 0, 0, 0, 0, -55, -55, -55, 0, 0, + 0, -54, -54, -54, 0, -54, -54, -54, -54, -54, 0, -54, 0, -54, -54, -54, 0, -54, -54, -54, 0, 0, 0, -54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -54, -54, -54, 0, 0, // State 106 - -5, 0, 0, 0, -5, -5, 0, 0, 0, -5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -5, 0, -5, -5, -5, -5, -5, 0, 0, 0, -5, -5, + 0, 0, 0, 0, 0, -29, 0, 0, 114, 0, 0, 0, 0, 0, 0, 0, 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, 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, -56, -56, -56, 0, -56, -56, -56, -56, -56, 0, -56, 0, -56, -56, -56, 0, -56, -56, -56, 0, 0, 0, -56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -56, -56, -56, 0, 0, // State 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, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, + -4, 0, 0, 0, -4, -4, 0, 0, 0, -4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4, 0, -4, 0, -4, -4, -4, -4, -4, -4, 0, 0, 0, 0, -4, -4, // State 109 - 0, 0, 0, 0, 0, -62, 0, 0, -62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -62, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 115, 0, 0, // State 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, 0, 0, 0, 0, 0, 0, 0, 0, 112, 0, 0, + 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, 0, // State 111 - 0, 0, 0, 0, 0, -63, 0, 0, -63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -63, 0, 0, + 0, 0, 0, 0, 0, -64, 0, 0, -64, 0, 0, 0, 0, 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, 0, 0, + // State 112 + 0, -55, -55, -55, 0, -55, -55, -55, -55, -55, 0, -55, 0, -55, -55, -55, 0, -55, -55, -55, 0, 0, 0, -55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -55, -55, -55, 0, 0, + // State 113 + -5, 0, 0, 0, -5, -5, 0, 0, 0, -5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -5, 0, -5, 0, -5, -5, -5, -5, -5, -5, 0, 0, 0, 0, -5, -5, + // State 114 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, + // State 115 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, + // State 116 + 0, 0, 0, 0, 0, -62, 0, 0, -62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -62, 0, 0, + // State 117 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 119, 0, 0, + // State 118 + 0, 0, 0, 0, 0, -63, 0, 0, -63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -63, 0, 0, ]; fn __action(state: i8, integer: usize) -> i8 { - __ACTION[(state as usize) * 36 + integer] + __ACTION[(state as usize) * 40 + integer] } const __EOF_ACTION: &[i8] = &[ // State 0 - -79, + -82, // State 1 - -80, + -83, // State 2 0, // State 3 @@ -339,17 +353,17 @@ mod __parse__Program { // State 30 0, // State 31 - -44, + 0, // State 32 - -41, + 0, // State 33 - -86, + -44, // State 34 - -45, + -41, // State 35 - 0, + -90, // State 36 - 0, + -45, // State 37 0, // State 38 @@ -443,7 +457,7 @@ mod __parse__Program { // State 82 0, // State 83 - -68, + 0, // State 84 0, // State 85 @@ -451,7 +465,7 @@ mod __parse__Program { // State 86 0, // State 87 - 0, + -71, // State 88 0, // State 89 @@ -500,94 +514,110 @@ mod __parse__Program { 0, // State 111 0, + // State 112 + 0, + // State 113 + 0, + // State 114 + 0, + // State 115 + 0, + // State 116 + 0, + // State 117 + 0, + // State 118 + 0, ]; fn __goto(state: i8, nt: usize) -> i8 { match nt { - 2 => 26, + 2 => 28, 5 => 4, - 6 => 18, + 6 => 19, 7 => 8, 8 => 9, 9 => 10, 10 => 11, 11 => 12, 12 => 13, - 13 => 48, - 14 => 95, - 15 => 37, - 16 => 19, + 13 => 51, + 14 => 100, + 15 => 39, + 16 => 20, 17 => match state { - 1 => 34, - _ => 31, + 1 => 36, + _ => 33, }, 19 => 1, 20 => match state { - 15 => 85, - 24 => 96, - 25 => 98, - 26 => 100, - 27 => 103, - 30 => 110, - _ => 49, + 15 => 89, + 16 => 90, + 25 => 101, + 27 => 104, + 28 => 106, + 29 => 109, + 32 => 117, + _ => 52, }, 22 => match state { - 23 => 94, - _ => 50, + 24 => 99, + _ => 53, }, - 23 => 51, - 24 => 52, + 23 => 54, + 24 => 55, 25 => match state { - 20 => 91, - _ => 53, + 21 => 96, + _ => 56, }, 26 => match state { - 21 => 92, - _ => 54, + 22 => 97, + _ => 57, }, 27 => match state { - 16 => 86, - 28 => 104, - _ => 55, + 17 => 91, + 30 => 110, + _ => 58, }, 28 => match state { - 18 => 89, - _ => 56, + 19 => 94, + _ => 59, }, 29 => match state { - 29 => 109, - _ => 57, + 26 => 103, + 31 => 116, + _ => 60, }, 30 => match state { - 14 => 84, - 22 => 93, - _ => 58, + 14 => 88, + 23 => 98, + _ => 61, }, 31 => match state { - 19 => 90, - _ => 59, + 20 => 95, + _ => 62, }, - 32 => 32, + 32 => 34, 33 => match state { - 2 => 35, - 3..=4 => 38, - 17 => 87, - _ => 60, + 2 => 37, + 3..=4 => 40, + 18 => 92, + _ => 63, }, - 34 => 20, - 35 => 21, - 36 => 22, - 37 => 61, + 34 => 21, + 35 => 22, + 36 => 23, + 37 => 64, 38 => match state { - 4 => 40, - _ => 39, + 4 => 42, + _ => 41, }, - 40 => 33, + 40 => 35, 41 => match state { - 6 => 47, - _ => 44, + 6 => 50, + _ => 46, }, 42 => 14, - 43 => 23, + 43 => 24, _ => 0, } } @@ -614,15 +644,19 @@ mod __parse__Program { r###"">=""###, r###""Bool""###, r###""Int""###, + r###""Unit""###, r###""^""###, + r###""break""###, r###""else""###, r###""false""###, r###""fn""###, r###""if""###, r###""let""###, + r###""loop""###, r###""print""###, r###""read""###, r###""true""###, + r###""unit""###, r###""{""###, r###""||""###, r###""}""###, @@ -696,7 +730,7 @@ mod __parse__Program { #[inline] fn error_action(&self, state: i8) -> i8 { - __action(state, 36 - 1) + __action(state, 40 - 1) } #[inline] @@ -797,8 +831,12 @@ mod __parse__Program { Token(34, _) if true => Some(31), Token(35, _) if true => Some(32), Token(36, _) if true => Some(33), - Token(0, _) if true => Some(34), - Token(1, _) if true => Some(35), + Token(37, _) if true => Some(34), + Token(38, _) if true => Some(35), + Token(39, _) if true => Some(36), + Token(40, _) if true => Some(37), + Token(0, _) if true => Some(38), + Token(1, _) if true => Some(39), _ => None, } } @@ -811,8 +849,8 @@ mod __parse__Program { ) -> __Symbol<'input> { #[allow(clippy::manual_range_patterns)]match __token_index { - 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 => match __token { - Token(3, __tok0) | Token(4, __tok0) | Token(5, __tok0) | Token(6, __tok0) | Token(7, __tok0) | Token(8, __tok0) | Token(9, __tok0) | Token(10, __tok0) | Token(11, __tok0) | Token(12, __tok0) | Token(13, __tok0) | Token(14, __tok0) | Token(15, __tok0) | Token(16, __tok0) | Token(17, __tok0) | Token(18, __tok0) | Token(19, __tok0) | Token(20, __tok0) | Token(21, __tok0) | Token(22, __tok0) | Token(23, __tok0) | Token(24, __tok0) | Token(25, __tok0) | Token(26, __tok0) | Token(27, __tok0) | Token(28, __tok0) | Token(29, __tok0) | Token(30, __tok0) | Token(31, __tok0) | Token(32, __tok0) | Token(33, __tok0) | Token(34, __tok0) | Token(35, __tok0) | Token(36, __tok0) | Token(0, __tok0) | Token(1, __tok0) if true => __Symbol::Variant0(__tok0), + 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 => match __token { + Token(3, __tok0) | Token(4, __tok0) | Token(5, __tok0) | Token(6, __tok0) | Token(7, __tok0) | Token(8, __tok0) | Token(9, __tok0) | Token(10, __tok0) | Token(11, __tok0) | Token(12, __tok0) | Token(13, __tok0) | Token(14, __tok0) | Token(15, __tok0) | Token(16, __tok0) | Token(17, __tok0) | Token(18, __tok0) | Token(19, __tok0) | Token(20, __tok0) | Token(21, __tok0) | Token(22, __tok0) | Token(23, __tok0) | Token(24, __tok0) | Token(25, __tok0) | Token(26, __tok0) | Token(27, __tok0) | Token(28, __tok0) | Token(29, __tok0) | Token(30, __tok0) | Token(31, __tok0) | Token(32, __tok0) | Token(33, __tok0) | Token(34, __tok0) | Token(35, __tok0) | Token(36, __tok0) | Token(37, __tok0) | Token(38, __tok0) | Token(39, __tok0) | Token(40, __tok0) | Token(0, __tok0) | Token(1, __tok0) if true => __Symbol::Variant0(__tok0), _ => unreachable!(), }, _ => unreachable!(), @@ -1206,137 +1244,161 @@ mod __parse__Program { } 63 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 4, nonterminal_produced: 29, } } 64 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 2, - nonterminal_produced: 30, + nonterminal_produced: 29, } } 65 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 30, + nonterminal_produced: 29, } } 66 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 31, + nonterminal_produced: 29, } } 67 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 2, + nonterminal_produced: 30, + } + } + 68 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 30, + } + } + 69 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 31, + } + } + 70 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 10, nonterminal_produced: 32, } } - 68 => { + 71 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, nonterminal_produced: 33, } } - 69 => { + 72 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, nonterminal_produced: 34, } } - 70 => { + 73 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, nonterminal_produced: 35, } } - 71 => { + 74 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, nonterminal_produced: 36, } } - 72 => { + 75 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, nonterminal_produced: 36, } } - 73 => { + 76 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, nonterminal_produced: 36, } } - 74 => { + 77 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, nonterminal_produced: 37, } } - 75 => { + 78 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 3, nonterminal_produced: 38, } } - 76 => { + 79 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, nonterminal_produced: 39, } } - 77 => { + 80 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 0, nonterminal_produced: 39, } } - 78 => { + 81 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 0, nonterminal_produced: 40, } } - 79 => { + 82 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, nonterminal_produced: 40, } } - 80 => { + 83 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, nonterminal_produced: 41, } } - 81 => { + 84 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, nonterminal_produced: 41, } } - 82 => { + 85 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 41, + } + } + 86 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, nonterminal_produced: 42, } } - 83 => { + 87 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, nonterminal_produced: 42, } } - 84 => { + 88 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, nonterminal_produced: 43, } } - 85 => __state_machine::SimulatedReduce::Accept, + 89 => __state_machine::SimulatedReduce::Accept, _ => panic!("invalid reduction index {}", __reduce_index) } } @@ -1674,6 +1736,18 @@ mod __parse__Program { __reduce84(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) } 85 => { + __reduce85(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 86 => { + __reduce86(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 87 => { + __reduce87(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 88 => { + __reduce88(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 89 => { // __Program = Program => ActionFn(0); let __sym0 = __pop_Variant14(__symbols); let __start = __sym0.0; @@ -1879,13 +1953,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",") = Expr, "," => ActionFn(74); + // ( ",") = Expr, "," => ActionFn(77); assert!(__symbols.len() >= 2); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym1.2; - let __nt = super::__action74::<>(input, __sym0, __sym1); + let __nt = super::__action77::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (2, 0) } @@ -1898,10 +1972,10 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")* = => ActionFn(72); + // ( ",")* = => ActionFn(75); let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); let __end = __start; - let __nt = super::__action72::<>(input, &__start, &__end); + let __nt = super::__action75::<>(input, &__start, &__end); __symbols.push((__start, __Symbol::Variant2(__nt), __end)); (0, 1) } @@ -1914,11 +1988,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")* = ( ",")+ => ActionFn(73); + // ( ",")* = ( ",")+ => ActionFn(76); let __sym0 = __pop_Variant2(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action73::<>(input, __sym0); + let __nt = super::__action76::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant2(__nt), __end)); (1, 1) } @@ -1931,13 +2005,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")+ = Expr, "," => ActionFn(79); + // ( ",")+ = Expr, "," => ActionFn(82); assert!(__symbols.len() >= 2); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym1.2; - let __nt = super::__action79::<>(input, __sym0, __sym1); + let __nt = super::__action82::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant2(__nt), __end)); (2, 2) } @@ -1950,14 +2024,14 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")+ = ( ",")+, Expr, "," => ActionFn(80); + // ( ",")+ = ( ",")+, Expr, "," => ActionFn(83); assert!(__symbols.len() >= 3); let __sym2 = __pop_Variant0(__symbols); let __sym1 = __pop_Variant1(__symbols); let __sym0 = __pop_Variant2(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action80::<>(input, __sym0, __sym1, __sym2); + let __nt = super::__action83::<>(input, __sym0, __sym1, __sym2); __symbols.push((__start, __Symbol::Variant2(__nt), __end)); (3, 2) } @@ -1970,13 +2044,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",") = Param, "," => ActionFn(69); + // ( ",") = Param, "," => ActionFn(74); assert!(__symbols.len() >= 2); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym1.2; - let __nt = super::__action69::<>(input, __sym0, __sym1); + let __nt = super::__action74::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant3(__nt), __end)); (2, 3) } @@ -1989,10 +2063,10 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")* = => ActionFn(67); + // ( ",")* = => ActionFn(72); let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); let __end = __start; - let __nt = super::__action67::<>(input, &__start, &__end); + let __nt = super::__action72::<>(input, &__start, &__end); __symbols.push((__start, __Symbol::Variant4(__nt), __end)); (0, 4) } @@ -2005,11 +2079,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")* = ( ",")+ => ActionFn(68); + // ( ",")* = ( ",")+ => ActionFn(73); let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action68::<>(input, __sym0); + let __nt = super::__action73::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant4(__nt), __end)); (1, 4) } @@ -2022,13 +2096,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")+ = Param, "," => ActionFn(83); + // ( ",")+ = Param, "," => ActionFn(86); assert!(__symbols.len() >= 2); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym1.2; - let __nt = super::__action83::<>(input, __sym0, __sym1); + let __nt = super::__action86::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant4(__nt), __end)); (2, 5) } @@ -2041,14 +2115,14 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")+ = ( ",")+, Param, "," => ActionFn(84); + // ( ",")+ = ( ",")+, Param, "," => ActionFn(87); assert!(__symbols.len() >= 3); let __sym2 = __pop_Variant0(__symbols); let __sym1 = __pop_Variant3(__symbols); let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action84::<>(input, __sym0, __sym1, __sym2); + let __nt = super::__action87::<>(input, __sym0, __sym1, __sym2); __symbols.push((__start, __Symbol::Variant4(__nt), __end)); (3, 5) } @@ -2061,11 +2135,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // AdditiveOp = "+" => ActionFn(26); + // AdditiveOp = "+" => ActionFn(29); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action26::<>(input, __sym0); + let __nt = super::__action29::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant5(__nt), __end)); (1, 6) } @@ -2078,11 +2152,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // AdditiveOp = "-" => ActionFn(27); + // AdditiveOp = "-" => ActionFn(30); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action27::<>(input, __sym0); + let __nt = super::__action30::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant5(__nt), __end)); (1, 6) } @@ -2095,14 +2169,14 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = BinaryOps, AdditiveOp, ExprMultiplicative => ActionFn(50); + // BinaryOps = BinaryOps, AdditiveOp, ExprMultiplicative => ActionFn(53); assert!(__symbols.len() >= 3); let __sym2 = __pop_Variant1(__symbols); let __sym1 = __pop_Variant5(__symbols); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action50::<>(input, __sym0, __sym1, __sym2); + let __nt = super::__action53::<>(input, __sym0, __sym1, __sym2); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (3, 7) } @@ -2115,11 +2189,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = ExprMultiplicative => ActionFn(51); + // BinaryOps = ExprMultiplicative => ActionFn(54); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action51::<>(input, __sym0); + let __nt = super::__action54::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (1, 7) } @@ -2132,14 +2206,14 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = BinaryOps, ComparativeOp, ExprXor => ActionFn(54); + // BinaryOps = BinaryOps, ComparativeOp, ExprXor => ActionFn(57); assert!(__symbols.len() >= 3); let __sym2 = __pop_Variant1(__symbols); let __sym1 = __pop_Variant5(__symbols); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action54::<>(input, __sym0, __sym1, __sym2); + let __nt = super::__action57::<>(input, __sym0, __sym1, __sym2); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (3, 8) } @@ -2152,11 +2226,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = ExprXor => ActionFn(55); + // BinaryOps = ExprXor => ActionFn(58); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action55::<>(input, __sym0); + let __nt = super::__action58::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (1, 8) } @@ -2169,14 +2243,14 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = BinaryOps, LogicalAndOp, ExprComparative => ActionFn(56); + // BinaryOps = BinaryOps, LogicalAndOp, ExprComparative => ActionFn(59); assert!(__symbols.len() >= 3); let __sym2 = __pop_Variant1(__symbols); let __sym1 = __pop_Variant5(__symbols); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action56::<>(input, __sym0, __sym1, __sym2); + let __nt = super::__action59::<>(input, __sym0, __sym1, __sym2); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (3, 9) } @@ -2189,11 +2263,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = ExprComparative => ActionFn(57); + // BinaryOps = ExprComparative => ActionFn(60); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action57::<>(input, __sym0); + let __nt = super::__action60::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (1, 9) } @@ -2206,14 +2280,14 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = BinaryOps, LogicalOrOp, ExprLogicalAnd => ActionFn(58); + // BinaryOps = BinaryOps, LogicalOrOp, ExprLogicalAnd => ActionFn(61); assert!(__symbols.len() >= 3); let __sym2 = __pop_Variant1(__symbols); let __sym1 = __pop_Variant5(__symbols); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action58::<>(input, __sym0, __sym1, __sym2); + let __nt = super::__action61::<>(input, __sym0, __sym1, __sym2); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (3, 10) } @@ -2226,11 +2300,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = ExprLogicalAnd => ActionFn(59); + // BinaryOps = ExprLogicalAnd => ActionFn(62); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action59::<>(input, __sym0); + let __nt = super::__action62::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (1, 10) } @@ -2243,14 +2317,14 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = BinaryOps, MultiplicativeOp, ExprUnary => ActionFn(48); + // BinaryOps = BinaryOps, MultiplicativeOp, ExprUnary => ActionFn(51); assert!(__symbols.len() >= 3); let __sym2 = __pop_Variant1(__symbols); let __sym1 = __pop_Variant5(__symbols); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action48::<>(input, __sym0, __sym1, __sym2); + let __nt = super::__action51::<>(input, __sym0, __sym1, __sym2); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (3, 11) } @@ -2263,11 +2337,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = ExprUnary => ActionFn(49); + // BinaryOps = ExprUnary => ActionFn(52); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action49::<>(input, __sym0); + let __nt = super::__action52::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (1, 11) } @@ -2280,14 +2354,14 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = BinaryOps, XorOp, ExprAdditive => ActionFn(52); + // BinaryOps = BinaryOps, XorOp, ExprAdditive => ActionFn(55); assert!(__symbols.len() >= 3); let __sym2 = __pop_Variant1(__symbols); let __sym1 = __pop_Variant5(__symbols); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action52::<>(input, __sym0, __sym1, __sym2); + let __nt = super::__action55::<>(input, __sym0, __sym1, __sym2); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (3, 12) } @@ -2300,11 +2374,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = ExprAdditive => ActionFn(53); + // BinaryOps = ExprAdditive => ActionFn(56); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action53::<>(input, __sym0); + let __nt = super::__action56::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (1, 12) } @@ -2317,11 +2391,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Bool = "true" => ActionFn(45); + // Bool = "true" => ActionFn(48); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action45::<>(input, __sym0); + let __nt = super::__action48::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant6(__nt), __end)); (1, 13) } @@ -2334,11 +2408,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Bool = "false" => ActionFn(46); + // Bool = "false" => ActionFn(49); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action46::<>(input, __sym0); + let __nt = super::__action49::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant6(__nt), __end)); (1, 13) } @@ -2351,11 +2425,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = Expr => ActionFn(89); + // Comma = Expr => ActionFn(92); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action89::<>(input, __sym0); + let __nt = super::__action92::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant7(__nt), __end)); (1, 14) } @@ -2368,10 +2442,10 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = => ActionFn(90); + // Comma = => ActionFn(93); let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); let __end = __start; - let __nt = super::__action90::<>(input, &__start, &__end); + let __nt = super::__action93::<>(input, &__start, &__end); __symbols.push((__start, __Symbol::Variant7(__nt), __end)); (0, 14) } @@ -2384,13 +2458,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = ( ",")+, Expr => ActionFn(91); + // Comma = ( ",")+, Expr => ActionFn(94); assert!(__symbols.len() >= 2); let __sym1 = __pop_Variant1(__symbols); let __sym0 = __pop_Variant2(__symbols); let __start = __sym0.0; let __end = __sym1.2; - let __nt = super::__action91::<>(input, __sym0, __sym1); + let __nt = super::__action94::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant7(__nt), __end)); (2, 14) } @@ -2403,11 +2477,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = ( ",")+ => ActionFn(92); + // Comma = ( ",")+ => ActionFn(95); let __sym0 = __pop_Variant2(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action92::<>(input, __sym0); + let __nt = super::__action95::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant7(__nt), __end)); (1, 14) } @@ -2420,11 +2494,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = Param => ActionFn(93); + // Comma = Param => ActionFn(98); let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action93::<>(input, __sym0); + let __nt = super::__action98::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant8(__nt), __end)); (1, 15) } @@ -2437,10 +2511,10 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = => ActionFn(94); + // Comma = => ActionFn(99); let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); let __end = __start; - let __nt = super::__action94::<>(input, &__start, &__end); + let __nt = super::__action99::<>(input, &__start, &__end); __symbols.push((__start, __Symbol::Variant8(__nt), __end)); (0, 15) } @@ -2453,13 +2527,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = ( ",")+, Param => ActionFn(95); + // Comma = ( ",")+, Param => ActionFn(100); assert!(__symbols.len() >= 2); let __sym1 = __pop_Variant3(__symbols); let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym1.2; - let __nt = super::__action95::<>(input, __sym0, __sym1); + let __nt = super::__action100::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant8(__nt), __end)); (2, 15) } @@ -2472,11 +2546,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = ( ",")+ => ActionFn(96); + // Comma = ( ",")+ => ActionFn(101); let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action96::<>(input, __sym0); + let __nt = super::__action101::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant8(__nt), __end)); (1, 15) } @@ -2489,11 +2563,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ComparativeOp = "==" => ActionFn(19); + // ComparativeOp = "==" => ActionFn(22); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action19::<>(input, __sym0); + let __nt = super::__action22::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant5(__nt), __end)); (1, 16) } @@ -2506,11 +2580,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ComparativeOp = "!=" => ActionFn(20); + // ComparativeOp = "!=" => ActionFn(23); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action20::<>(input, __sym0); + let __nt = super::__action23::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant5(__nt), __end)); (1, 16) } @@ -2523,11 +2597,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ComparativeOp = ">" => ActionFn(21); + // ComparativeOp = ">" => ActionFn(24); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action21::<>(input, __sym0); + let __nt = super::__action24::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant5(__nt), __end)); (1, 16) } @@ -2540,11 +2614,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ComparativeOp = ">=" => ActionFn(22); + // ComparativeOp = ">=" => ActionFn(25); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action22::<>(input, __sym0); + let __nt = super::__action25::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant5(__nt), __end)); (1, 16) } @@ -2557,11 +2631,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ComparativeOp = "<" => ActionFn(23); + // ComparativeOp = "<" => ActionFn(26); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action23::<>(input, __sym0); + let __nt = super::__action26::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant5(__nt), __end)); (1, 16) } @@ -2574,11 +2648,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ComparativeOp = "<=" => ActionFn(24); + // ComparativeOp = "<=" => ActionFn(27); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action24::<>(input, __sym0); + let __nt = super::__action27::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant5(__nt), __end)); (1, 16) } @@ -2608,10 +2682,10 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Def* = => ActionFn(61); + // Def* = => ActionFn(66); let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); let __end = __start; - let __nt = super::__action61::<>(input, &__start, &__end); + let __nt = super::__action66::<>(input, &__start, &__end); __symbols.push((__start, __Symbol::Variant10(__nt), __end)); (0, 18) } @@ -2624,11 +2698,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Def* = Def+ => ActionFn(62); + // Def* = Def+ => ActionFn(67); let __sym0 = __pop_Variant10(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action62::<>(input, __sym0); + let __nt = super::__action67::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant10(__nt), __end)); (1, 18) } @@ -2641,11 +2715,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Def+ = Def => ActionFn(63); + // Def+ = Def => ActionFn(68); let __sym0 = __pop_Variant9(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action63::<>(input, __sym0); + let __nt = super::__action68::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant10(__nt), __end)); (1, 19) } @@ -2658,13 +2732,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Def+ = Def+, Def => ActionFn(64); + // Def+ = Def+, Def => ActionFn(69); assert!(__symbols.len() >= 2); let __sym1 = __pop_Variant9(__symbols); let __sym0 = __pop_Variant10(__symbols); let __start = __sym0.0; let __end = __sym1.2; - let __nt = super::__action64::<>(input, __sym0, __sym1); + let __nt = super::__action69::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant10(__nt), __end)); (2, 19) } @@ -2677,11 +2751,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Expr = ExprStmt => ActionFn(7); + // Expr = ExprStmt => ActionFn(8); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action7::<>(input, __sym0); + let __nt = super::__action8::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (1, 20) } @@ -2694,11 +2768,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Expr? = Expr => ActionFn(70); + // Expr? = Expr => ActionFn(63); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action70::<>(input, __sym0); + let __nt = super::__action63::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant11(__nt), __end)); (1, 21) } @@ -2711,10 +2785,10 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Expr? = => ActionFn(71); + // Expr? = => ActionFn(64); let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); let __end = __start; - let __nt = super::__action71::<>(input, &__start, &__end); + let __nt = super::__action64::<>(input, &__start, &__end); __symbols.push((__start, __Symbol::Variant11(__nt), __end)); (0, 21) } @@ -2727,11 +2801,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprAdditive = BinaryOps => ActionFn(15); + // ExprAdditive = BinaryOps => ActionFn(18); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action15::<>(input, __sym0); + let __nt = super::__action18::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (1, 22) } @@ -2744,11 +2818,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprAtom = Num => ActionFn(39); + // ExprAtom = Num => ActionFn(42); let __sym0 = __pop_Variant12(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action39::<>(input, __sym0); + let __nt = super::__action42::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (1, 23) } @@ -2761,11 +2835,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprAtom = Bool => ActionFn(40); + // ExprAtom = Bool => ActionFn(43); let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action40::<>(input, __sym0); + let __nt = super::__action43::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (1, 23) } @@ -2778,11 +2852,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprAtom = Ident => ActionFn(41); + // ExprAtom = Ident => ActionFn(44); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action41::<>(input, __sym0); + let __nt = super::__action44::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (1, 23) } @@ -2795,14 +2869,14 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprAtom = "(", Expr, ")" => ActionFn(42); + // ExprAtom = "(", Expr, ")" => ActionFn(45); assert!(__symbols.len() >= 3); let __sym2 = __pop_Variant0(__symbols); let __sym1 = __pop_Variant1(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action42::<>(input, __sym0, __sym1, __sym2); + let __nt = super::__action45::<>(input, __sym0, __sym1, __sym2); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (3, 23) } @@ -2815,14 +2889,14 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprCall = "read", "(", ")" => ActionFn(35); + // ExprCall = "read", "(", ")" => ActionFn(38); assert!(__symbols.len() >= 3); let __sym2 = __pop_Variant0(__symbols); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action35::<>(input, __sym0, __sym1, __sym2); + let __nt = super::__action38::<>(input, __sym0, __sym1, __sym2); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (3, 24) } @@ -2835,7 +2909,7 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprCall = "print", "(", Expr, ")" => ActionFn(36); + // ExprCall = "print", "(", Expr, ")" => ActionFn(39); assert!(__symbols.len() >= 4); let __sym3 = __pop_Variant0(__symbols); let __sym2 = __pop_Variant1(__symbols); @@ -2843,7 +2917,7 @@ mod __parse__Program { let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym3.2; - let __nt = super::__action36::<>(input, __sym0, __sym1, __sym2, __sym3); + let __nt = super::__action39::<>(input, __sym0, __sym1, __sym2, __sym3); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (4, 24) } @@ -2856,7 +2930,7 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprCall = ExprAtom, "(", Comma, ")" => ActionFn(37); + // ExprCall = ExprAtom, "(", Comma, ")" => ActionFn(40); assert!(__symbols.len() >= 4); let __sym3 = __pop_Variant0(__symbols); let __sym2 = __pop_Variant7(__symbols); @@ -2864,7 +2938,7 @@ mod __parse__Program { let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym3.2; - let __nt = super::__action37::<>(input, __sym0, __sym1, __sym2, __sym3); + let __nt = super::__action40::<>(input, __sym0, __sym1, __sym2, __sym3); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (4, 24) } @@ -2877,11 +2951,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprCall = ExprAtom => ActionFn(38); + // ExprCall = ExprAtom => ActionFn(41); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action38::<>(input, __sym0); + let __nt = super::__action41::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (1, 24) } @@ -2894,11 +2968,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprComparative = BinaryOps => ActionFn(13); + // ExprComparative = BinaryOps => ActionFn(16); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action13::<>(input, __sym0); + let __nt = super::__action16::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (1, 25) } @@ -2911,11 +2985,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprLogicalAnd = BinaryOps => ActionFn(12); + // ExprLogicalAnd = BinaryOps => ActionFn(15); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action12::<>(input, __sym0); + let __nt = super::__action15::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (1, 26) } @@ -2928,11 +3002,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprLogicalOr = BinaryOps => ActionFn(11); + // ExprLogicalOr = BinaryOps => ActionFn(14); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action11::<>(input, __sym0); + let __nt = super::__action14::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (1, 27) } @@ -2945,11 +3019,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprMultiplicative = BinaryOps => ActionFn(16); + // ExprMultiplicative = BinaryOps => ActionFn(19); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action16::<>(input, __sym0); + let __nt = super::__action19::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (1, 28) } @@ -2962,7 +3036,7 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprStmt = "let", Ident, "=", ExprLogicalOr, ";", ExprStmt => ActionFn(8); + // ExprStmt = "let", Ident, "=", ExprLogicalOr, ";", ExprStmt => ActionFn(9); assert!(__symbols.len() >= 6); let __sym5 = __pop_Variant1(__symbols); let __sym4 = __pop_Variant0(__symbols); @@ -2972,7 +3046,7 @@ mod __parse__Program { let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym5.2; - let __nt = super::__action8::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); + let __nt = super::__action9::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (6, 29) } @@ -2985,7 +3059,7 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprStmt = "if", ExprLogicalOr, "{", Expr, "}", "else", "{", Expr, "}" => ActionFn(9); + // ExprStmt = "if", ExprLogicalOr, "{", Expr, "}", "else", "{", Expr, "}" => ActionFn(10); assert!(__symbols.len() >= 9); let __sym8 = __pop_Variant0(__symbols); let __sym7 = __pop_Variant1(__symbols); @@ -2998,7 +3072,7 @@ mod __parse__Program { let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym8.2; - let __nt = super::__action9::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8); + let __nt = super::__action10::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (9, 29) } @@ -3011,15 +3085,72 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprStmt = ExprLogicalOr => ActionFn(10); + // ExprStmt = "loop", "{", ExprStmt, "}" => ActionFn(11); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant1(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0; + let __end = __sym3.2; + let __nt = super::__action11::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (4, 29) + } + fn __reduce64< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ExprStmt = "break", Expr => ActionFn(96); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant1(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0; + let __end = __sym1.2; + let __nt = super::__action96::<>(input, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (2, 29) + } + fn __reduce65< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ExprStmt = "break" => ActionFn(97); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0; + let __end = __sym0.2; + let __nt = super::__action97::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (1, 29) + } + fn __reduce66< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ExprStmt = ExprLogicalOr => ActionFn(13); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action10::<>(input, __sym0); + let __nt = super::__action13::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (1, 29) } - fn __reduce64< + fn __reduce67< 'input, >( input: &'input str, @@ -3028,17 +3159,17 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprUnary = UnaryOp, ExprUnary => ActionFn(33); + // ExprUnary = UnaryOp, ExprUnary => ActionFn(36); assert!(__symbols.len() >= 2); let __sym1 = __pop_Variant1(__symbols); let __sym0 = __pop_Variant5(__symbols); let __start = __sym0.0; let __end = __sym1.2; - let __nt = super::__action33::<>(input, __sym0, __sym1); + let __nt = super::__action36::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (2, 30) } - fn __reduce65< + fn __reduce68< 'input, >( input: &'input str, @@ -3047,15 +3178,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprUnary = ExprCall => ActionFn(34); + // ExprUnary = ExprCall => ActionFn(37); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action34::<>(input, __sym0); + let __nt = super::__action37::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (1, 30) } - fn __reduce66< + fn __reduce69< 'input, >( input: &'input str, @@ -3064,15 +3195,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprXor = BinaryOps => ActionFn(14); + // ExprXor = BinaryOps => ActionFn(17); let __sym0 = __pop_Variant1(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action14::<>(input, __sym0); + let __nt = super::__action17::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (1, 31) } - fn __reduce67< + fn __reduce70< 'input, >( input: &'input str, @@ -3099,7 +3230,7 @@ mod __parse__Program { __symbols.push((__start, __Symbol::Variant9(__nt), __end)); (10, 32) } - fn __reduce68< + fn __reduce71< 'input, >( input: &'input str, @@ -3108,15 +3239,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Ident = r#"[_a-zA-Z][_a-zA-Z0-9]*"# => ActionFn(43); + // Ident = r#"[_a-zA-Z][_a-zA-Z0-9]*"# => ActionFn(46); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action43::<>(input, __sym0); + let __nt = super::__action46::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant0(__nt), __end)); (1, 33) } - fn __reduce69< + fn __reduce72< 'input, >( input: &'input str, @@ -3125,15 +3256,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // LogicalAndOp = "&&" => ActionFn(18); + // LogicalAndOp = "&&" => ActionFn(21); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action18::<>(input, __sym0); + let __nt = super::__action21::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant5(__nt), __end)); (1, 34) } - fn __reduce70< + fn __reduce73< 'input, >( input: &'input str, @@ -3142,15 +3273,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // LogicalOrOp = "||" => ActionFn(17); + // LogicalOrOp = "||" => ActionFn(20); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action17::<>(input, __sym0); + let __nt = super::__action20::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant5(__nt), __end)); (1, 35) } - fn __reduce71< + fn __reduce74< 'input, >( input: &'input str, @@ -3159,15 +3290,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // MultiplicativeOp = "*" => ActionFn(28); + // MultiplicativeOp = "*" => ActionFn(31); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action28::<>(input, __sym0); + let __nt = super::__action31::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant5(__nt), __end)); (1, 36) } - fn __reduce72< + fn __reduce75< 'input, >( input: &'input str, @@ -3176,15 +3307,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // MultiplicativeOp = "/" => ActionFn(29); + // MultiplicativeOp = "/" => ActionFn(32); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action29::<>(input, __sym0); + let __nt = super::__action32::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant5(__nt), __end)); (1, 36) } - fn __reduce73< + fn __reduce76< 'input, >( input: &'input str, @@ -3193,15 +3324,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // MultiplicativeOp = "%" => ActionFn(30); + // MultiplicativeOp = "%" => ActionFn(33); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action30::<>(input, __sym0); + let __nt = super::__action33::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant5(__nt), __end)); (1, 36) } - fn __reduce74< + fn __reduce77< 'input, >( input: &'input str, @@ -3210,15 +3341,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Num = r#"[0-9]+"# => ActionFn(44); + // Num = r#"[0-9]+"# => ActionFn(47); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action44::<>(input, __sym0); + let __nt = super::__action47::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant12(__nt), __end)); (1, 37) } - fn __reduce75< + fn __reduce78< 'input, >( input: &'input str, @@ -3238,7 +3369,7 @@ mod __parse__Program { __symbols.push((__start, __Symbol::Variant3(__nt), __end)); (3, 38) } - fn __reduce76< + fn __reduce79< 'input, >( input: &'input str, @@ -3247,15 +3378,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Param? = Param => ActionFn(65); + // Param? = Param => ActionFn(70); let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action65::<>(input, __sym0); + let __nt = super::__action70::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant13(__nt), __end)); (1, 39) } - fn __reduce77< + fn __reduce80< 'input, >( input: &'input str, @@ -3264,14 +3395,14 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Param? = => ActionFn(66); + // Param? = => ActionFn(71); let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); let __end = __start; - let __nt = super::__action66::<>(input, &__start, &__end); + let __nt = super::__action71::<>(input, &__start, &__end); __symbols.push((__start, __Symbol::Variant13(__nt), __end)); (0, 39) } - fn __reduce78< + fn __reduce81< 'input, >( input: &'input str, @@ -3280,14 +3411,14 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Program = => ActionFn(87); + // Program = => ActionFn(90); let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); let __end = __start; - let __nt = super::__action87::<>(input, &__start, &__end); + let __nt = super::__action90::<>(input, &__start, &__end); __symbols.push((__start, __Symbol::Variant14(__nt), __end)); (0, 40) } - fn __reduce79< + fn __reduce82< 'input, >( input: &'input str, @@ -3296,15 +3427,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Program = Def+ => ActionFn(88); + // Program = Def+ => ActionFn(91); let __sym0 = __pop_Variant10(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action88::<>(input, __sym0); + let __nt = super::__action91::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant14(__nt), __end)); (1, 40) } - fn __reduce80< + fn __reduce83< 'input, >( input: &'input str, @@ -3321,7 +3452,7 @@ mod __parse__Program { __symbols.push((__start, __Symbol::Variant15(__nt), __end)); (1, 41) } - fn __reduce81< + fn __reduce84< 'input, >( input: &'input str, @@ -3338,7 +3469,7 @@ mod __parse__Program { __symbols.push((__start, __Symbol::Variant15(__nt), __end)); (1, 41) } - fn __reduce82< + fn __reduce85< 'input, >( input: &'input str, @@ -3347,15 +3478,32 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // UnaryOp = "-" => ActionFn(31); + // Type = "Unit" => ActionFn(7); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action31::<>(input, __sym0); + let __nt = super::__action7::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant15(__nt), __end)); + (1, 41) + } + fn __reduce86< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // UnaryOp = "-" => ActionFn(34); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0; + let __end = __sym0.2; + let __nt = super::__action34::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant5(__nt), __end)); (1, 42) } - fn __reduce83< + fn __reduce87< 'input, >( input: &'input str, @@ -3364,15 +3512,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // UnaryOp = "!" => ActionFn(32); + // UnaryOp = "!" => ActionFn(35); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action32::<>(input, __sym0); + let __nt = super::__action35::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant5(__nt), __end)); (1, 42) } - fn __reduce84< + fn __reduce88< 'input, >( input: &'input str, @@ -3381,11 +3529,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // XorOp = "^" => ActionFn(25); + // XorOp = "^" => ActionFn(28); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action25::<>(input, __sym0); + let __nt = super::__action28::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant5(__nt), __end)); (1, 43) } @@ -3395,7 +3543,7 @@ pub use self::__parse__Program::ProgramParser; mod __intern_token { #![allow(unused_imports)] use std::str::FromStr; - use crate::language::lvar::*; + use crate::passes::parse::*; use crate::passes::parse::PrgParsed; use crate::passes::type_check::Type; #[allow(unused_extern_crates)] @@ -3431,15 +3579,19 @@ mod __intern_token { ("(?:>=)", false), ("(?:Bool)", false), ("(?:Int)", false), + ("(?:Unit)", false), ("\\^", false), + ("(?:break)", false), ("(?:else)", false), ("(?:false)", false), ("(?:fn)", false), ("(?:if)", false), ("(?:let)", false), + ("(?:loop)", false), ("(?:print)", false), ("(?:read)", false), ("(?:true)", false), + ("(?:unit)", false), ("\\{", false), ("(?:\\|\\|)", false), ("\\}", false), @@ -3450,54 +3602,46 @@ mod __intern_token { pub(crate) use self::__lalrpop_util::lexer::Token; #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action0<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action0< + 'input, +>( input: &'input str, (_, __0, _): (usize, PrgParsed<'input>, usize), -) -> PrgParsed<'input> { +) -> PrgParsed<'input> +{ __0 } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action1<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action1< + 'input, +>( input: &'input str, (_, defs, _): (usize, alloc::vec::Vec>, usize), -) -> PrgParsed<'input> { - PrgParsed { - defs, - entry: "main", - } +) -> PrgParsed<'input> +{ + PrgParsed{ defs, entry: "main" } } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action2<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action2< + 'input, +>( input: &'input str, (_, __0, _): (usize, Def<&'input str>, usize), -) -> Def<&'input str> { +) -> Def<&'input str> +{ __0 } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action3<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action3< + 'input, +>( input: &'input str, (_, _, _): (usize, &'input str, usize), (_, sym, _): (usize, &'input str, usize), @@ -3509,70 +3653,78 @@ fn __action3<'input>( (_, _, _): (usize, &'input str, usize), (_, bdy, _): (usize, Expr<&'input str>, usize), (_, _, _): (usize, &'input str, usize), -) -> Def<&'input str> { - Def::Fn { - sym, - params, - typ, - bdy, - } +) -> Def<&'input str> +{ + Def::Fn { sym, params, typ, bdy } } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action4<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action4< + 'input, +>( input: &'input str, (_, __0, _): (usize, &'input str, usize), (_, _, _): (usize, &'input str, usize), (_, __1, _): (usize, Type, usize), -) -> (&'input str, Type) { +) -> (&'input str, Type) +{ (__0, __1) } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action5<'input>(input: &'input str, (_, __0, _): (usize, &'input str, usize)) -> Type { +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action5< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> Type +{ Type::Int } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action6<'input>(input: &'input str, (_, __0, _): (usize, &'input str, usize)) -> Type { +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action6< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> Type +{ Type::Bool } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action7<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action7< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> Type +{ + Type::Unit +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action8< + 'input, +>( input: &'input str, (_, __0, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { +) -> Expr<&'input str> +{ __0 } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action8<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action9< + 'input, +>( input: &'input str, (_, _, _): (usize, &'input str, usize), (_, sym, _): (usize, &'input str, usize), @@ -3580,21 +3732,16 @@ fn __action8<'input>( (_, bnd, _): (usize, Expr<&'input str>, usize), (_, _, _): (usize, &'input str, usize), (_, bdy, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { - Expr::Let { - sym, - bnd: Box::new(bnd), - bdy: Box::new(bdy), - } +) -> Expr<&'input str> +{ + Expr::Let { sym, bnd: Box::new(bnd), bdy: Box::new(bdy) } } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action9<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action10< + 'input, +>( input: &'input str, (_, _, _): (usize, &'input str, usize), (_, cnd, _): (usize, Expr<&'input str>, usize), @@ -3605,466 +3752,506 @@ fn __action9<'input>( (_, _, _): (usize, &'input str, usize), (_, els, _): (usize, Expr<&'input str>, usize), (_, _, _): (usize, &'input str, usize), -) -> Expr<&'input str> { - Expr::If { - cnd: Box::new(cnd), - thn: Box::new(thn), - els: Box::new(els), - } +) -> Expr<&'input str> +{ + Expr::If { cnd: Box::new(cnd), thn: Box::new(thn), els: Box::new(els) } +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action11< + 'input, +>( + input: &'input str, + (_, _, _): (usize, &'input str, usize), + (_, _, _): (usize, &'input str, usize), + (_, bdy, _): (usize, Expr<&'input str>, usize), + (_, _, _): (usize, &'input str, usize), +) -> Expr<&'input str> +{ + Expr::Loop { bdy: Box::new(bdy) } +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action12< + 'input, +>( + input: &'input str, + (_, _, _): (usize, &'input str, usize), + (_, e, _): (usize, core::option::Option>, usize), +) -> Expr<&'input str> +{ + Expr::Break { e: e.map(Box::new) } } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action10<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action13< + 'input, +>( input: &'input str, (_, __0, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { +) -> Expr<&'input str> +{ __0 } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action11<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action14< + 'input, +>( input: &'input str, (_, __0, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { +) -> Expr<&'input str> +{ __0 } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action12<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action15< + 'input, +>( input: &'input str, (_, __0, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { +) -> Expr<&'input str> +{ __0 } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action13<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action16< + 'input, +>( input: &'input str, (_, __0, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { +) -> Expr<&'input str> +{ __0 } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action14<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action17< + 'input, +>( input: &'input str, (_, __0, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { +) -> Expr<&'input str> +{ __0 } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action15<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action18< + 'input, +>( input: &'input str, (_, __0, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { +) -> Expr<&'input str> +{ __0 } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action16<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action19< + 'input, +>( input: &'input str, (_, __0, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { +) -> Expr<&'input str> +{ __0 } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action17<'input>(input: &'input str, (_, __0, _): (usize, &'input str, usize)) -> Op { +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action20< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> Op +{ Op::LOr } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action18<'input>(input: &'input str, (_, __0, _): (usize, &'input str, usize)) -> Op { +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action21< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> Op +{ Op::LAnd } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action19<'input>(input: &'input str, (_, __0, _): (usize, &'input str, usize)) -> Op { +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action22< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> Op +{ Op::EQ } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action20<'input>(input: &'input str, (_, __0, _): (usize, &'input str, usize)) -> Op { +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action23< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> Op +{ Op::NE } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action21<'input>(input: &'input str, (_, __0, _): (usize, &'input str, usize)) -> Op { +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action24< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> Op +{ Op::GT } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action22<'input>(input: &'input str, (_, __0, _): (usize, &'input str, usize)) -> Op { +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action25< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> Op +{ Op::GE } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action23<'input>(input: &'input str, (_, __0, _): (usize, &'input str, usize)) -> Op { +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action26< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> Op +{ Op::LT } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action24<'input>(input: &'input str, (_, __0, _): (usize, &'input str, usize)) -> Op { +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action27< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> Op +{ Op::LE } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action25<'input>(input: &'input str, (_, __0, _): (usize, &'input str, usize)) -> Op { +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action28< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> Op +{ Op::Xor } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action26<'input>(input: &'input str, (_, __0, _): (usize, &'input str, usize)) -> Op { +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action29< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> Op +{ Op::Plus } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action27<'input>(input: &'input str, (_, __0, _): (usize, &'input str, usize)) -> Op { +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action30< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> Op +{ Op::Minus } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action28<'input>(input: &'input str, (_, __0, _): (usize, &'input str, usize)) -> Op { +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action31< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> Op +{ Op::Mul } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action29<'input>(input: &'input str, (_, __0, _): (usize, &'input str, usize)) -> Op { +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action32< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> Op +{ Op::Div } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action30<'input>(input: &'input str, (_, __0, _): (usize, &'input str, usize)) -> Op { +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action33< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> Op +{ Op::Mod } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action31<'input>(input: &'input str, (_, __0, _): (usize, &'input str, usize)) -> Op { +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action34< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> Op +{ Op::Minus } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action32<'input>(input: &'input str, (_, __0, _): (usize, &'input str, usize)) -> Op { +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action35< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> Op +{ Op::Not } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action33<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action36< + 'input, +>( input: &'input str, (_, op, _): (usize, Op, usize), (_, e, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { - Expr::Prim { op, args: vec![e] } +) -> Expr<&'input str> +{ + Expr::Prim{op, args: vec![e]} } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action34<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action37< + 'input, +>( input: &'input str, (_, __0, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { +) -> Expr<&'input str> +{ __0 } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action35<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action38< + 'input, +>( input: &'input str, (_, __0, _): (usize, &'input str, usize), (_, __1, _): (usize, &'input str, usize), (_, __2, _): (usize, &'input str, usize), -) -> Expr<&'input str> { - Expr::Prim { - op: Op::Read, - args: vec![], - } +) -> Expr<&'input str> +{ + Expr::Prim{ op: Op::Read, args: vec![] } } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action36<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action39< + 'input, +>( input: &'input str, (_, _, _): (usize, &'input str, usize), (_, _, _): (usize, &'input str, usize), (_, e, _): (usize, Expr<&'input str>, usize), (_, _, _): (usize, &'input str, usize), -) -> Expr<&'input str> { - Expr::Prim { - op: Op::Print, - args: vec![e], - } +) -> Expr<&'input str> +{ + Expr::Prim{ op: Op::Print, args: vec![e] } } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action37<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action40< + 'input, +>( input: &'input str, (_, fun, _): (usize, Expr<&'input str>, usize), (_, _, _): (usize, &'input str, usize), (_, args, _): (usize, Vec>, usize), (_, _, _): (usize, &'input str, usize), -) -> Expr<&'input str> { - Expr::Apply { - fun: Box::new(fun), - args, - } +) -> Expr<&'input str> +{ + Expr::Apply{ fun: Box::new(fun), args } } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action38<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action41< + 'input, +>( input: &'input str, (_, __0, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { +) -> Expr<&'input str> +{ __0 } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action39<'input>(input: &'input str, (_, __0, _): (usize, i64, usize)) -> Expr<&'input str> { - Expr::Lit { - val: Lit::Int { val: __0 }, - } +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action42< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, i64, usize), +) -> Expr<&'input str> +{ + Expr::Lit{ val: Lit::Int { val: __0 }} } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action40<'input>(input: &'input str, (_, __0, _): (usize, bool, usize)) -> Expr<&'input str> { - Expr::Lit { - val: Lit::Bool { val: __0 }, - } +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action43< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, bool, usize), +) -> Expr<&'input str> +{ + Expr::Lit { val: Lit::Bool { val: __0 }} } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action41<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action44< + 'input, +>( input: &'input str, (_, __0, _): (usize, &'input str, usize), -) -> Expr<&'input str> { +) -> Expr<&'input str> +{ Expr::Var { sym: __0 } } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action42<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action45< + 'input, +>( input: &'input str, (_, _, _): (usize, &'input str, usize), (_, __0, _): (usize, Expr<&'input str>, usize), (_, _, _): (usize, &'input str, usize), -) -> Expr<&'input str> { +) -> Expr<&'input str> +{ __0 } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action43<'input>(input: &'input str, (_, __0, _): (usize, &'input str, usize)) -> &'input str { +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action46< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> &'input str +{ __0 } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action44<'input>(input: &'input str, (_, s, _): (usize, &'input str, usize)) -> i64 { +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action47< + 'input, +>( + input: &'input str, + (_, s, _): (usize, &'input str, usize), +) -> i64 +{ i64::from_str(s).unwrap() } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action45<'input>(input: &'input str, (_, __0, _): (usize, &'input str, usize)) -> bool { +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action48< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> bool +{ true } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action46<'input>(input: &'input str, (_, __0, _): (usize, &'input str, usize)) -> bool { +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action49< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> bool +{ false } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action47<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action50< + 'input, +>( input: &'input str, (_, v, _): (usize, alloc::vec::Vec>, usize), (_, e, _): (usize, core::option::Option>, usize), -) -> Vec> { +) -> Vec> +{ match e { - None => v, + None=> v, Some(e) => { let mut v = v; v.push(e); @@ -4074,204 +4261,198 @@ fn __action47<'input>( } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action48<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action51< + 'input, +>( input: &'input str, (_, e1, _): (usize, Expr<&'input str>, usize), (_, op, _): (usize, Op, usize), (_, e2, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { - Expr::Prim { - op, - args: vec![e1, e2], - } +) -> Expr<&'input str> +{ + Expr::Prim{op, args: vec![e1, e2] } } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action49<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action52< + 'input, +>( input: &'input str, (_, __0, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { +) -> Expr<&'input str> +{ __0 } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action50<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action53< + 'input, +>( input: &'input str, (_, e1, _): (usize, Expr<&'input str>, usize), (_, op, _): (usize, Op, usize), (_, e2, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { - Expr::Prim { - op, - args: vec![e1, e2], - } +) -> Expr<&'input str> +{ + Expr::Prim{op, args: vec![e1, e2] } } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action51<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action54< + 'input, +>( input: &'input str, (_, __0, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { +) -> Expr<&'input str> +{ __0 } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action52<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action55< + 'input, +>( input: &'input str, (_, e1, _): (usize, Expr<&'input str>, usize), (_, op, _): (usize, Op, usize), (_, e2, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { - Expr::Prim { - op, - args: vec![e1, e2], - } +) -> Expr<&'input str> +{ + Expr::Prim{op, args: vec![e1, e2] } } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action53<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action56< + 'input, +>( input: &'input str, (_, __0, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { +) -> Expr<&'input str> +{ __0 } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action54<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action57< + 'input, +>( input: &'input str, (_, e1, _): (usize, Expr<&'input str>, usize), (_, op, _): (usize, Op, usize), (_, e2, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { - Expr::Prim { - op, - args: vec![e1, e2], - } +) -> Expr<&'input str> +{ + Expr::Prim{op, args: vec![e1, e2] } } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action55<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action58< + 'input, +>( input: &'input str, (_, __0, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { +) -> Expr<&'input str> +{ __0 } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action56<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action59< + 'input, +>( input: &'input str, (_, e1, _): (usize, Expr<&'input str>, usize), (_, op, _): (usize, Op, usize), (_, e2, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { - Expr::Prim { - op, - args: vec![e1, e2], - } +) -> Expr<&'input str> +{ + Expr::Prim{op, args: vec![e1, e2] } } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action57<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action60< + 'input, +>( input: &'input str, (_, __0, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { +) -> Expr<&'input str> +{ __0 } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action58<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action61< + 'input, +>( input: &'input str, (_, e1, _): (usize, Expr<&'input str>, usize), (_, op, _): (usize, Op, usize), (_, e2, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { - Expr::Prim { - op, - args: vec![e1, e2], - } +) -> Expr<&'input str> +{ + Expr::Prim{op, args: vec![e1, e2] } } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action59<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action62< + 'input, +>( input: &'input str, (_, __0, _): (usize, Expr<&'input str>, usize), -) -> Expr<&'input str> { +) -> Expr<&'input str> +{ __0 } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action60<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action63< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, Expr<&'input str>, usize), +) -> core::option::Option> +{ + Some(__0) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action64< + 'input, +>( + input: &'input str, + __lookbehind: &usize, + __lookahead: &usize, +) -> core::option::Option> +{ + None +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action65< + 'input, +>( input: &'input str, (_, v, _): (usize, alloc::vec::Vec<(&'input str, Type)>, usize), (_, e, _): (usize, core::option::Option<(&'input str, Type)>, usize), -) -> Vec<(&'input str, Type)> { +) -> Vec<(&'input str, Type)> +{ match e { - None => v, + None=> v, Some(e) => { let mut v = v; v.push(e); @@ -4281,607 +4462,719 @@ fn __action60<'input>( } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action61<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action66< + 'input, +>( input: &'input str, __lookbehind: &usize, __lookahead: &usize, -) -> alloc::vec::Vec> { +) -> alloc::vec::Vec> +{ alloc::vec![] } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action62<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action67< + 'input, +>( input: &'input str, (_, v, _): (usize, alloc::vec::Vec>, usize), -) -> alloc::vec::Vec> { +) -> alloc::vec::Vec> +{ v } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action63<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action68< + 'input, +>( input: &'input str, (_, __0, _): (usize, Def<&'input str>, usize), -) -> alloc::vec::Vec> { +) -> alloc::vec::Vec> +{ alloc::vec![__0] } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action64<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action69< + 'input, +>( input: &'input str, (_, v, _): (usize, alloc::vec::Vec>, usize), (_, e, _): (usize, Def<&'input str>, usize), -) -> alloc::vec::Vec> { - { - let mut v = v; - v.push(e); - v - } +) -> alloc::vec::Vec> +{ + { let mut v = v; v.push(e); v } } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action65<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action70< + 'input, +>( input: &'input str, (_, __0, _): (usize, (&'input str, Type), usize), -) -> core::option::Option<(&'input str, Type)> { +) -> core::option::Option<(&'input str, Type)> +{ Some(__0) } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action66<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action71< + 'input, +>( input: &'input str, __lookbehind: &usize, __lookahead: &usize, -) -> core::option::Option<(&'input str, Type)> { +) -> core::option::Option<(&'input str, Type)> +{ None } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action67<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action72< + 'input, +>( input: &'input str, __lookbehind: &usize, __lookahead: &usize, -) -> alloc::vec::Vec<(&'input str, Type)> { +) -> alloc::vec::Vec<(&'input str, Type)> +{ alloc::vec![] } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action68<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action73< + 'input, +>( input: &'input str, (_, v, _): (usize, alloc::vec::Vec<(&'input str, Type)>, usize), -) -> alloc::vec::Vec<(&'input str, Type)> { +) -> alloc::vec::Vec<(&'input str, Type)> +{ v } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action69<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action74< + 'input, +>( input: &'input str, (_, __0, _): (usize, (&'input str, Type), usize), (_, _, _): (usize, &'input str, usize), -) -> (&'input str, Type) { +) -> (&'input str, Type) +{ __0 } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action70<'input>( - input: &'input str, - (_, __0, _): (usize, Expr<&'input str>, usize), -) -> core::option::Option> { - Some(__0) -} - -#[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action71<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action75< + 'input, +>( input: &'input str, __lookbehind: &usize, __lookahead: &usize, -) -> core::option::Option> { - None -} - -#[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action72<'input>( - input: &'input str, - __lookbehind: &usize, - __lookahead: &usize, -) -> alloc::vec::Vec> { +) -> alloc::vec::Vec> +{ alloc::vec![] } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action73<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action76< + 'input, +>( input: &'input str, (_, v, _): (usize, alloc::vec::Vec>, usize), -) -> alloc::vec::Vec> { +) -> alloc::vec::Vec> +{ v } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action74<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action77< + 'input, +>( input: &'input str, (_, __0, _): (usize, Expr<&'input str>, usize), (_, _, _): (usize, &'input str, usize), -) -> Expr<&'input str> { +) -> Expr<&'input str> +{ __0 } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action75<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action78< + 'input, +>( input: &'input str, (_, __0, _): (usize, Expr<&'input str>, usize), -) -> alloc::vec::Vec> { +) -> alloc::vec::Vec> +{ alloc::vec![__0] } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action76<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action79< + 'input, +>( input: &'input str, (_, v, _): (usize, alloc::vec::Vec>, usize), (_, e, _): (usize, Expr<&'input str>, usize), -) -> alloc::vec::Vec> { - { - let mut v = v; - v.push(e); - v - } +) -> alloc::vec::Vec> +{ + { let mut v = v; v.push(e); v } } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action77<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action80< + 'input, +>( input: &'input str, (_, __0, _): (usize, (&'input str, Type), usize), -) -> alloc::vec::Vec<(&'input str, Type)> { +) -> alloc::vec::Vec<(&'input str, Type)> +{ alloc::vec![__0] } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action78<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action81< + 'input, +>( input: &'input str, (_, v, _): (usize, alloc::vec::Vec<(&'input str, Type)>, usize), (_, e, _): (usize, (&'input str, Type), usize), -) -> alloc::vec::Vec<(&'input str, Type)> { - { - let mut v = v; - v.push(e); - v - } +) -> alloc::vec::Vec<(&'input str, Type)> +{ + { let mut v = v; v.push(e); v } } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action79<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action82< + 'input, +>( input: &'input str, __0: (usize, Expr<&'input str>, usize), __1: (usize, &'input str, usize), -) -> alloc::vec::Vec> { +) -> alloc::vec::Vec> +{ let __start0 = __0.0; let __end0 = __1.2; - let __temp0 = __action74(input, __0, __1); + let __temp0 = __action77( + input, + __0, + __1, + ); let __temp0 = (__start0, __temp0, __end0); - __action75(input, __temp0) + __action78( + input, + __temp0, + ) } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action80<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action83< + 'input, +>( input: &'input str, __0: (usize, alloc::vec::Vec>, usize), __1: (usize, Expr<&'input str>, usize), __2: (usize, &'input str, usize), -) -> alloc::vec::Vec> { +) -> alloc::vec::Vec> +{ let __start0 = __1.0; let __end0 = __2.2; - let __temp0 = __action74(input, __1, __2); + let __temp0 = __action77( + input, + __1, + __2, + ); let __temp0 = (__start0, __temp0, __end0); - __action76(input, __0, __temp0) + __action79( + input, + __0, + __temp0, + ) } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action81<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action84< + 'input, +>( input: &'input str, __0: (usize, core::option::Option>, usize), -) -> Vec> { +) -> Vec> +{ let __start0 = __0.0; let __end0 = __0.0; - let __temp0 = __action72(input, &__start0, &__end0); + let __temp0 = __action75( + input, + &__start0, + &__end0, + ); let __temp0 = (__start0, __temp0, __end0); - __action47(input, __temp0, __0) + __action50( + input, + __temp0, + __0, + ) } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action82<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action85< + 'input, +>( input: &'input str, __0: (usize, alloc::vec::Vec>, usize), __1: (usize, core::option::Option>, usize), -) -> Vec> { +) -> Vec> +{ let __start0 = __0.0; let __end0 = __0.2; - let __temp0 = __action73(input, __0); + let __temp0 = __action76( + input, + __0, + ); let __temp0 = (__start0, __temp0, __end0); - __action47(input, __temp0, __1) + __action50( + input, + __temp0, + __1, + ) } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action83<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action86< + 'input, +>( input: &'input str, __0: (usize, (&'input str, Type), usize), __1: (usize, &'input str, usize), -) -> alloc::vec::Vec<(&'input str, Type)> { +) -> alloc::vec::Vec<(&'input str, Type)> +{ let __start0 = __0.0; let __end0 = __1.2; - let __temp0 = __action69(input, __0, __1); + let __temp0 = __action74( + input, + __0, + __1, + ); let __temp0 = (__start0, __temp0, __end0); - __action77(input, __temp0) + __action80( + input, + __temp0, + ) } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action84<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action87< + 'input, +>( input: &'input str, __0: (usize, alloc::vec::Vec<(&'input str, Type)>, usize), __1: (usize, (&'input str, Type), usize), __2: (usize, &'input str, usize), -) -> alloc::vec::Vec<(&'input str, Type)> { +) -> alloc::vec::Vec<(&'input str, Type)> +{ let __start0 = __1.0; let __end0 = __2.2; - let __temp0 = __action69(input, __1, __2); + let __temp0 = __action74( + input, + __1, + __2, + ); let __temp0 = (__start0, __temp0, __end0); - __action78(input, __0, __temp0) + __action81( + input, + __0, + __temp0, + ) } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action85<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action88< + 'input, +>( input: &'input str, __0: (usize, core::option::Option<(&'input str, Type)>, usize), -) -> Vec<(&'input str, Type)> { +) -> Vec<(&'input str, Type)> +{ let __start0 = __0.0; let __end0 = __0.0; - let __temp0 = __action67(input, &__start0, &__end0); + let __temp0 = __action72( + input, + &__start0, + &__end0, + ); let __temp0 = (__start0, __temp0, __end0); - __action60(input, __temp0, __0) + __action65( + input, + __temp0, + __0, + ) } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action86<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action89< + 'input, +>( input: &'input str, __0: (usize, alloc::vec::Vec<(&'input str, Type)>, usize), __1: (usize, core::option::Option<(&'input str, Type)>, usize), -) -> Vec<(&'input str, Type)> { +) -> Vec<(&'input str, Type)> +{ let __start0 = __0.0; let __end0 = __0.2; - let __temp0 = __action68(input, __0); + let __temp0 = __action73( + input, + __0, + ); let __temp0 = (__start0, __temp0, __end0); - __action60(input, __temp0, __1) + __action65( + input, + __temp0, + __1, + ) } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action87<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action90< + 'input, +>( input: &'input str, __lookbehind: &usize, __lookahead: &usize, -) -> PrgParsed<'input> { +) -> PrgParsed<'input> +{ let __start0 = *__lookbehind; let __end0 = *__lookahead; - let __temp0 = __action61(input, &__start0, &__end0); + let __temp0 = __action66( + input, + &__start0, + &__end0, + ); let __temp0 = (__start0, __temp0, __end0); - __action1(input, __temp0) + __action1( + input, + __temp0, + ) } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action88<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action91< + 'input, +>( input: &'input str, __0: (usize, alloc::vec::Vec>, usize), -) -> PrgParsed<'input> { +) -> PrgParsed<'input> +{ let __start0 = __0.0; let __end0 = __0.2; - let __temp0 = __action62(input, __0); + let __temp0 = __action67( + input, + __0, + ); let __temp0 = (__start0, __temp0, __end0); - __action1(input, __temp0) + __action1( + input, + __temp0, + ) } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action89<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action92< + 'input, +>( input: &'input str, __0: (usize, Expr<&'input str>, usize), -) -> Vec> { +) -> Vec> +{ let __start0 = __0.0; let __end0 = __0.2; - let __temp0 = __action70(input, __0); + let __temp0 = __action63( + input, + __0, + ); let __temp0 = (__start0, __temp0, __end0); - __action81(input, __temp0) + __action84( + input, + __temp0, + ) } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action90<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action93< + 'input, +>( input: &'input str, __lookbehind: &usize, __lookahead: &usize, -) -> Vec> { +) -> Vec> +{ let __start0 = *__lookbehind; let __end0 = *__lookahead; - let __temp0 = __action71(input, &__start0, &__end0); + let __temp0 = __action64( + input, + &__start0, + &__end0, + ); let __temp0 = (__start0, __temp0, __end0); - __action81(input, __temp0) + __action84( + input, + __temp0, + ) } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action91<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action94< + 'input, +>( input: &'input str, __0: (usize, alloc::vec::Vec>, usize), __1: (usize, Expr<&'input str>, usize), -) -> Vec> { +) -> Vec> +{ let __start0 = __1.0; let __end0 = __1.2; - let __temp0 = __action70(input, __1); + let __temp0 = __action63( + input, + __1, + ); let __temp0 = (__start0, __temp0, __end0); - __action82(input, __0, __temp0) + __action85( + input, + __0, + __temp0, + ) } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action92<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action95< + 'input, +>( input: &'input str, __0: (usize, alloc::vec::Vec>, usize), -) -> Vec> { +) -> Vec> +{ + let __start0 = __0.2; + let __end0 = __0.2; + let __temp0 = __action64( + input, + &__start0, + &__end0, + ); + let __temp0 = (__start0, __temp0, __end0); + __action85( + input, + __0, + __temp0, + ) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action96< + 'input, +>( + input: &'input str, + __0: (usize, &'input str, usize), + __1: (usize, Expr<&'input str>, usize), +) -> Expr<&'input str> +{ + let __start0 = __1.0; + let __end0 = __1.2; + let __temp0 = __action63( + input, + __1, + ); + let __temp0 = (__start0, __temp0, __end0); + __action12( + input, + __0, + __temp0, + ) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action97< + 'input, +>( + input: &'input str, + __0: (usize, &'input str, usize), +) -> Expr<&'input str> +{ let __start0 = __0.2; let __end0 = __0.2; - let __temp0 = __action71(input, &__start0, &__end0); + let __temp0 = __action64( + input, + &__start0, + &__end0, + ); let __temp0 = (__start0, __temp0, __end0); - __action82(input, __0, __temp0) + __action12( + input, + __0, + __temp0, + ) } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action93<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action98< + 'input, +>( input: &'input str, __0: (usize, (&'input str, Type), usize), -) -> Vec<(&'input str, Type)> { +) -> Vec<(&'input str, Type)> +{ let __start0 = __0.0; let __end0 = __0.2; - let __temp0 = __action65(input, __0); + let __temp0 = __action70( + input, + __0, + ); let __temp0 = (__start0, __temp0, __end0); - __action85(input, __temp0) + __action88( + input, + __temp0, + ) } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action94<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action99< + 'input, +>( input: &'input str, __lookbehind: &usize, __lookahead: &usize, -) -> Vec<(&'input str, Type)> { +) -> Vec<(&'input str, Type)> +{ let __start0 = *__lookbehind; let __end0 = *__lookahead; - let __temp0 = __action66(input, &__start0, &__end0); + let __temp0 = __action71( + input, + &__start0, + &__end0, + ); let __temp0 = (__start0, __temp0, __end0); - __action85(input, __temp0) + __action88( + input, + __temp0, + ) } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action95<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action100< + 'input, +>( input: &'input str, __0: (usize, alloc::vec::Vec<(&'input str, Type)>, usize), __1: (usize, (&'input str, Type), usize), -) -> Vec<(&'input str, Type)> { +) -> Vec<(&'input str, Type)> +{ let __start0 = __1.0; let __end0 = __1.2; - let __temp0 = __action65(input, __1); + let __temp0 = __action70( + input, + __1, + ); let __temp0 = (__start0, __temp0, __end0); - __action86(input, __0, __temp0) + __action89( + input, + __0, + __temp0, + ) } #[allow(unused_variables)] -#[allow( - clippy::too_many_arguments, - clippy::needless_lifetimes, - clippy::just_underscores_and_digits -)] -fn __action96<'input>( +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action101< + 'input, +>( input: &'input str, __0: (usize, alloc::vec::Vec<(&'input str, Type)>, usize), -) -> Vec<(&'input str, Type)> { +) -> Vec<(&'input str, Type)> +{ let __start0 = __0.2; let __end0 = __0.2; - let __temp0 = __action66(input, &__start0, &__end0); + let __temp0 = __action71( + input, + &__start0, + &__end0, + ); let __temp0 = (__start0, __temp0, __end0); - __action86(input, __0, __temp0) + __action89( + input, + __0, + __temp0, + ) } #[allow(clippy::type_complexity)] -pub trait __ToTriple<'input> { - fn to_triple( - value: Self, - ) -> Result< - (usize, Token<'input>, usize), - __lalrpop_util::ParseError, &'static str>, - >; +pub trait __ToTriple<'input, > +{ + fn to_triple(value: Self) -> Result<(usize,Token<'input>,usize), __lalrpop_util::ParseError, &'static str>>; } -impl<'input> __ToTriple<'input> for (usize, Token<'input>, usize) { - fn to_triple( - value: Self, - ) -> Result< - (usize, Token<'input>, usize), - __lalrpop_util::ParseError, &'static str>, - > { +impl<'input, > __ToTriple<'input, > for (usize, Token<'input>, usize) +{ + fn to_triple(value: Self) -> Result<(usize,Token<'input>,usize), __lalrpop_util::ParseError, &'static str>> { Ok(value) } } -impl<'input> __ToTriple<'input> for Result<(usize, Token<'input>, usize), &'static str> { - fn to_triple( - value: Self, - ) -> Result< - (usize, Token<'input>, usize), - __lalrpop_util::ParseError, &'static str>, - > { +impl<'input, > __ToTriple<'input, > for Result<(usize, Token<'input>, usize), &'static str> +{ + fn to_triple(value: Self) -> Result<(usize,Token<'input>,usize), __lalrpop_util::ParseError, &'static str>> { match value { Ok(v) => Ok(v), Err(error) => Err(__lalrpop_util::ParseError::User { error }), diff --git a/compiler/src/interpreter/lvar.rs b/compiler/src/passes/parse/interpreter.rs similarity index 97% rename from compiler/src/interpreter/lvar.rs rename to compiler/src/passes/parse/interpreter.rs index 2267b41..ae787fa 100644 --- a/compiler/src/interpreter/lvar.rs +++ b/compiler/src/passes/parse/interpreter.rs @@ -1,6 +1,6 @@ use crate::interpreter::value::Val; use crate::interpreter::IO; -use crate::language::lvar::{Def, Expr, Lit, Op, PrgGenericVar}; +use crate::passes::parse::{Def, Expr, Lit, Op, PrgGenericVar}; use crate::utils::push_map::PushMap; use std::fmt::Debug; use std::hash::Hash; @@ -149,6 +149,8 @@ impl PrgGenericVar { .collect(); self.interpret_fn(sym, args, scope, io) } + Expr::Loop { .. } => todo!(), + Expr::Break { .. } => todo!(), } } } @@ -165,7 +167,7 @@ mod tests { let result = program.type_check().unwrap().interpret(&mut io); assert_eq!(result, expected_return.into()); - assert_eq!(io.outputs, expected_output); + assert_eq!(io.outputs(), &expected_output); } test_each_file! { for ["test"] in "./programs/good" as interpreter => interpret } diff --git a/compiler/src/passes/parse/mod.rs b/compiler/src/passes/parse/mod.rs index fdd404d..dfb53f5 100644 --- a/compiler/src/passes/parse/mod.rs +++ b/compiler/src/passes/parse/mod.rs @@ -1,11 +1,17 @@ #[rustfmt::skip] #[allow(clippy::all)] mod grammar; +pub mod interpreter; -use crate::language::lvar::PrgParsed; use crate::passes::parse::grammar::ProgramParser; use miette::{Diagnostic, SourceSpan}; use thiserror::Error; +use crate::interpreter::value::Val; +use std::collections::HashMap; +use crate::passes::type_check::Type; +use crate::passes::uniquify::UniqueSym; +use std::fmt::{Display, Formatter}; +use std::hash::Hash; #[derive(Error, Debug, Diagnostic)] #[error("Parse error!")] @@ -28,3 +34,132 @@ pub fn parse_program(src: &str) -> Result { panic!(); }) } + +#[derive(Debug, PartialEq)] +pub struct PrgParsed<'p> { + pub defs: Vec>, + pub entry: &'p str, +} + +pub type PrgTypeChecked<'p> = PrgGenericVar<&'p str>; +pub type PrgUniquified<'p> = PrgGenericVar>; + +#[derive(Debug, PartialEq)] +pub struct PrgGenericVar { + pub defs: HashMap>, + pub entry: A, +} + +#[derive(Debug, PartialEq)] +pub enum Def { + Fn { + sym: A, + params: Vec<(A, Type)>, + typ: Type, + bdy: Expr, + }, +} + +#[derive(Debug, PartialEq)] +pub enum Expr { + Lit { + val: Lit, + }, + Var { + sym: A, + }, + Prim { + op: Op, + args: Vec>, + }, + Let { + sym: A, + bnd: Box>, + bdy: Box>, + }, + If { + cnd: Box>, + thn: Box>, + els: Box>, + }, + Apply { + fun: Box>, + args: Vec>, + }, + Loop { + bdy: Box>, + }, + Break { + e: Option>>, + } +} + +#[derive(Copy, Clone, Debug, PartialEq)] +pub enum Op { + Read, + Print, + Plus, + Minus, + Mul, + Div, + Mod, + LAnd, + LOr, + Not, + Xor, + GT, + GE, + EQ, + LE, + LT, + NE, +} + +#[derive(Copy, Clone, Debug, PartialEq)] +pub enum Lit { + Int { val: i64 }, + Bool { val: bool }, + Unit +} + +impl Lit { + pub fn int(self) -> i64 { + match self { + Lit::Int { val } => val, + _ => panic!(), + } + } + + pub fn bool(self) -> bool { + match self { + Lit::Bool { val } => val, + _ => panic!(), + } + } +} + +impl Display for Lit { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self { + Lit::Int { val } => write!(f, "{val}"), + Lit::Bool { val } => { + if *val { + write!(f, "true") + } else { + write!(f, "false") + } + } + Lit::Unit => write!(f, "unit") + } + } +} + +impl From for Val { + fn from(value: Lit) -> Self { + match value { + Lit::Int { val } => Val::Int { val }, + Lit::Bool { val } => Val::Bool { val }, + Lit::Unit => Val::Unit + } + } +} diff --git a/compiler/src/passes/reveal_functions.rs b/compiler/src/passes/reveal_functions.rs index 6cba50e..077e97a 100644 --- a/compiler/src/passes/reveal_functions.rs +++ b/compiler/src/passes/reveal_functions.rs @@ -1,4 +1,4 @@ -use crate::language::lvar::{Def, Expr, PrgUniquified}; +use crate::passes::parse::{Def, Expr, PrgUniquified}; use crate::language::rlvar::{PrgRevealed, RDef, RExpr}; use crate::passes::uniquify::UniqueSym; use crate::utils::push_map::PushMap; @@ -71,13 +71,15 @@ fn reveal_expr<'p>(expr: Expr>, scope: &mut PushMap, .map(|arg| reveal_expr(arg, scope)) .collect(), }, + Expr::Loop { .. } => todo!(), + Expr::Break { .. } => todo!(), } } #[cfg(test)] mod tests { use crate::interpreter::TestIO; - use crate::language::lvar::PrgUniquified; + use crate::passes::parse::PrgUniquified; use crate::utils::split_test::split_test; use test_each_file::test_each_file; diff --git a/compiler/src/passes/select/mod.rs b/compiler/src/passes/select/mod.rs index dfab0e1..b0f0eb4 100644 --- a/compiler/src/passes/select/mod.rs +++ b/compiler/src/passes/select/mod.rs @@ -7,7 +7,7 @@ pub mod io; use crate::language::alvar::Atom; use crate::language::cvar::{CExpr, PrgExplicated, Tail}; -use crate::language::lvar::Op; +use crate::passes::parse::Op; use crate::language::x86var::{ Block, Cnd, Instr, VarArg, X86Selected, ARG_PASSING_REGS, CALLEE_SAVED_NO_STACK, }; diff --git a/compiler/src/passes/type_check.rs b/compiler/src/passes/type_check.rs index a3b90f2..f9dcb3d 100644 --- a/compiler/src/passes/type_check.rs +++ b/compiler/src/passes/type_check.rs @@ -1,4 +1,4 @@ -use crate::language::lvar::{Def, Expr, Lit, Op, PrgParsed, PrgTypeChecked}; +use crate::passes::parse::{Def, Expr, Lit, Op, PrgParsed, PrgTypeChecked}; use crate::passes::type_check::TypeError::*; use crate::utils::expect::expect; use crate::utils::push_map::PushMap; @@ -12,6 +12,7 @@ use thiserror::Error; pub enum Type { Int, Bool, + Unit, Fn { typ: Box, args: Vec }, } @@ -20,6 +21,7 @@ impl Display for Type { match self { Type::Int => write!(f, "Int"), Type::Bool => write!(f, "Bool"), + Type::Unit => write!(f, "Unit"), Type::Fn { typ, args } => write!(f, "fn({}) -> {}", args.iter().format(", "), typ), } } @@ -30,8 +32,6 @@ impl Display for Type { pub enum TypeError { #[error("Variable '{sym}' was not declared yet.")] UndeclaredVar { sym: String }, - #[error("Operation '{op}' had incorrect arity of {arity}.")] - IncorrectArity { op: Op, arity: usize }, #[error("Types were mismatched. Expected '{expect}', but found '{got}'.")] TypeMismatchExpect { expect: Type, got: Type }, #[error("Types were mismatched. Expected function, but found '{got}'.")] @@ -163,10 +163,7 @@ fn type_check_expr<'p>( expect_type(e2, scope, Type::Bool)?; Ok(Type::Bool) } - _ => Err(IncorrectArity { - op: *op, - arity: args.len(), - }), + _ => panic!("Found incorrect operator during type checking"), }, Expr::Let { sym, bnd, bdy } => { let t = type_check_expr(bnd, scope)?; @@ -196,6 +193,9 @@ fn type_check_expr<'p>( } got => Err(TypeMismatchExpectFn { got }), }, + Expr::Loop { .. } => todo!(), + Expr::Break { .. } => todo!(), + Expr::Lit { val: Lit::Unit } => todo!(), } } diff --git a/compiler/src/passes/uniquify.rs b/compiler/src/passes/uniquify.rs index 96ada67..79325d8 100644 --- a/compiler/src/passes/uniquify.rs +++ b/compiler/src/passes/uniquify.rs @@ -3,7 +3,7 @@ //! This is useful because in later passes we will be changing the structure of the program, //! and after selecting instructions we will only have a list of X86 instructions left. -use crate::language::lvar::{Def, Expr, PrgTypeChecked, PrgUniquified}; +use crate::passes::parse::{Def, Expr, PrgTypeChecked, PrgUniquified}; use crate::utils::push_map::PushMap; use std::sync::atomic::{AtomicUsize, Ordering}; @@ -92,6 +92,8 @@ fn uniquify_expression<'p>( .map(|arg| uniquify_expression(arg, scope)) .collect(), }, + Expr::Loop { .. } => todo!(), + Expr::Break { .. } => todo!(), } } diff --git a/compiler/src/utils/split_test.rs b/compiler/src/utils/split_test.rs index 0e019e7..378adc8 100644 --- a/compiler/src/utils/split_test.rs +++ b/compiler/src/utils/split_test.rs @@ -1,5 +1,5 @@ use crate::interpreter::value::Val; -use crate::language::lvar::{Lit, PrgParsed}; +use crate::passes::parse::{Lit, PrgParsed}; use crate::passes::parse::parse_program; use std::hash::Hash; diff --git a/compiler/tests/integration.rs b/compiler/tests/integration.rs index 890c07f..45a8d2e 100644 --- a/compiler/tests/integration.rs +++ b/compiler/tests/integration.rs @@ -1,7 +1,7 @@ #![cfg(unix)] use compiler::elf::ElfFile; -use compiler::language::lvar::Lit; +use compiler::passes::parse::Lit; use compiler::utils::split_test::split_test; use std::fs::OpenOptions; use std::io::{BufRead, Write}; diff --git a/parser_generator/Cargo.toml b/parser_generator/Cargo.toml index 7511f72..e1add36 100644 --- a/parser_generator/Cargo.toml +++ b/parser_generator/Cargo.toml @@ -5,4 +5,5 @@ edition = "2021" authors = ["joooooooonaaaaa", "juuuuuuuuuuuuuuuuuuliaaaaaaaaaa"] [dependencies] -lalrpop = "0.20.1" +lalrpop = "0.20" + diff --git a/parser_generator/src/grammar.rs b/parser_generator/src/grammar.rs deleted file mode 100644 index ac46dd6..0000000 --- a/parser_generator/src/grammar.rs +++ /dev/null @@ -1,543 +0,0 @@ -// auto-generated: "lalrpop 0.20.1" -// sha3: f4217a1309d6bd1111eee0db47c61833cfc5fa5cc351e41c645be1e7c76d2f69 -use std::str::FromStr; -#[allow(unused_extern_crates)] -extern crate lalrpop_util as __lalrpop_util; -#[allow(unused_imports)] -use self::__lalrpop_util::state_machine as __state_machine; -extern crate core; -extern crate alloc; - -#[rustfmt::skip] -#[allow(non_snake_case, non_camel_case_types, unused_mut, unused_variables, unused_imports, unused_parens, clippy::needless_lifetimes, clippy::type_complexity, clippy::needless_return, clippy::too_many_arguments, clippy::never_loop, clippy::match_single_binding, clippy::needless_raw_string_hashes)] -mod __parse__Term { - - use std::str::FromStr; - #[allow(unused_extern_crates)] - extern crate lalrpop_util as __lalrpop_util; - #[allow(unused_imports)] - use self::__lalrpop_util::state_machine as __state_machine; - extern crate core; - extern crate alloc; - use self::__lalrpop_util::lexer::Token; - #[allow(dead_code)] - pub(crate) enum __Symbol<'input> - { - Variant0(&'input str), - Variant1(i32), - } - const __ACTION: &[i8] = &[ - // State 0 - 2, 0, 5, - // State 1 - 2, 0, 5, - // State 2 - 0, -2, 0, - // State 3 - 0, 0, 0, - // State 4 - 0, -1, 0, - // State 5 - 0, 7, 0, - // State 6 - 0, -3, 0, - ]; - fn __action(state: i8, integer: usize) -> i8 { - __ACTION[(state as usize) * 3 + integer] - } - const __EOF_ACTION: &[i8] = &[ - // State 0 - 0, - // State 1 - 0, - // State 2 - -2, - // State 3 - -4, - // State 4 - -1, - // State 5 - 0, - // State 6 - -3, - ]; - fn __goto(state: i8, nt: usize) -> i8 { - match nt { - 0 => 2, - 1 => match state { - 1 => 5, - _ => 3, - }, - _ => 0, - } - } - const __TERMINAL: &[&str] = &[ - r###""(""###, - r###"")""###, - r###"r#"[0-9]+"#"###, - ]; - fn __expected_tokens(__state: i8) -> alloc::vec::Vec { - __TERMINAL.iter().enumerate().filter_map(|(index, terminal)| { - let next_state = __action(__state, index); - if next_state == 0 { - None - } else { - Some(alloc::string::ToString::to_string(terminal)) - } - }).collect() - } - fn __expected_tokens_from_states< - 'input, - >( - __states: &[i8], - _: core::marker::PhantomData<(&'input ())>, - ) -> alloc::vec::Vec - { - __TERMINAL.iter().enumerate().filter_map(|(index, terminal)| { - if __accepts(None, __states, Some(index), core::marker::PhantomData::<(&())>) { - Some(alloc::string::ToString::to_string(terminal)) - } else { - None - } - }).collect() - } - struct __StateMachine<'input> - where - { - input: &'input str, - __phantom: core::marker::PhantomData<(&'input ())>, - } - impl<'input> __state_machine::ParserDefinition for __StateMachine<'input> - where - { - type Location = usize; - type Error = &'static str; - type Token = Token<'input>; - type TokenIndex = usize; - type Symbol = __Symbol<'input>; - type Success = i32; - type StateIndex = i8; - type Action = i8; - type ReduceIndex = i8; - type NonterminalIndex = usize; - - #[inline] - fn start_location(&self) -> Self::Location { - Default::default() - } - - #[inline] - fn start_state(&self) -> Self::StateIndex { - 0 - } - - #[inline] - fn token_to_index(&self, token: &Self::Token) -> Option { - __token_to_integer(token, core::marker::PhantomData::<(&())>) - } - - #[inline] - fn action(&self, state: i8, integer: usize) -> i8 { - __action(state, integer) - } - - #[inline] - fn error_action(&self, state: i8) -> i8 { - __action(state, 3 - 1) - } - - #[inline] - fn eof_action(&self, state: i8) -> i8 { - __EOF_ACTION[state as usize] - } - - #[inline] - fn goto(&self, state: i8, nt: usize) -> i8 { - __goto(state, nt) - } - - fn token_to_symbol(&self, token_index: usize, token: Self::Token) -> Self::Symbol { - __token_to_symbol(token_index, token, core::marker::PhantomData::<(&())>) - } - - fn expected_tokens(&self, state: i8) -> alloc::vec::Vec { - __expected_tokens(state) - } - - fn expected_tokens_from_states(&self, states: &[i8]) -> alloc::vec::Vec { - __expected_tokens_from_states(states, core::marker::PhantomData::<(&())>) - } - - #[inline] - fn uses_error_recovery(&self) -> bool { - false - } - - #[inline] - fn error_recovery_symbol( - &self, - recovery: __state_machine::ErrorRecovery, - ) -> Self::Symbol { - panic!("error recovery not enabled for this grammar") - } - - fn reduce( - &mut self, - action: i8, - start_location: Option<&Self::Location>, - states: &mut alloc::vec::Vec, - symbols: &mut alloc::vec::Vec<__state_machine::SymbolTriple>, - ) -> Option<__state_machine::ParseResult> { - __reduce( - self.input, - action, - start_location, - states, - symbols, - core::marker::PhantomData::<(&())>, - ) - } - - fn simulate_reduce(&self, action: i8) -> __state_machine::SimulatedReduce { - __simulate_reduce(action, core::marker::PhantomData::<(&())>) - } - } - fn __token_to_integer< - 'input, - >( - __token: &Token<'input>, - _: core::marker::PhantomData<(&'input ())>, - ) -> Option - { - match *__token { - Token(1, _) if true => Some(0), - Token(2, _) if true => Some(1), - Token(0, _) if true => Some(2), - _ => None, - } - } - fn __token_to_symbol< - 'input, - >( - __token_index: usize, - __token: Token<'input>, - _: core::marker::PhantomData<(&'input ())>, - ) -> __Symbol<'input> - { - #[allow(clippy::manual_range_patterns)]match __token_index { - 0 | 1 | 2 => match __token { - Token(1, __tok0) | Token(2, __tok0) | Token(0, __tok0) if true => __Symbol::Variant0(__tok0), - _ => unreachable!(), - }, - _ => unreachable!(), - } - } - fn __simulate_reduce< - 'input, - >( - __reduce_index: i8, - _: core::marker::PhantomData<(&'input ())>, - ) -> __state_machine::SimulatedReduce<__StateMachine<'input>> - { - match __reduce_index { - 0 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 0, - } - } - 1 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 1, - } - } - 2 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 1, - } - } - 3 => __state_machine::SimulatedReduce::Accept, - _ => panic!("invalid reduction index {}", __reduce_index) - } - } - pub struct TermParser { - builder: __lalrpop_util::lexer::MatcherBuilder, - _priv: (), - } - - impl Default for TermParser { fn default() -> Self { Self::new() } } - impl TermParser { - pub fn new() -> TermParser { - let __builder = super::__intern_token::new_builder(); - TermParser { - builder: __builder, - _priv: (), - } - } - - #[allow(dead_code)] - pub fn parse< - 'input, - >( - &self, - input: &'input str, - ) -> Result, &'static str>> - { - let mut __tokens = self.builder.matcher(input); - __state_machine::Parser::drive( - __StateMachine { - input, - __phantom: core::marker::PhantomData::<(&())>, - }, - __tokens, - ) - } - } - fn __accepts< - 'input, - >( - __error_state: Option, - __states: &[i8], - __opt_integer: Option, - _: core::marker::PhantomData<(&'input ())>, - ) -> bool - { - let mut __states = __states.to_vec(); - __states.extend(__error_state); - loop { - let mut __states_len = __states.len(); - let __top = __states[__states_len - 1]; - let __action = match __opt_integer { - None => __EOF_ACTION[__top as usize], - Some(__integer) => __action(__top, __integer), - }; - if __action == 0 { return false; } - if __action > 0 { return true; } - let (__to_pop, __nt) = match __simulate_reduce(-(__action + 1), core::marker::PhantomData::<(&())>) { - __state_machine::SimulatedReduce::Reduce { - states_to_pop, nonterminal_produced - } => (states_to_pop, nonterminal_produced), - __state_machine::SimulatedReduce::Accept => return true, - }; - __states_len -= __to_pop; - __states.truncate(__states_len); - let __top = __states[__states_len - 1]; - let __next_state = __goto(__top, __nt); - __states.push(__next_state); - } - } - fn __reduce< - 'input, - >( - input: &'input str, - __action: i8, - __lookahead_start: Option<&usize>, - __states: &mut alloc::vec::Vec, - __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: core::marker::PhantomData<(&'input ())>, - ) -> Option, &'static str>>> - { - let (__pop_states, __nonterminal) = match __action { - 0 => { - __reduce0(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) - } - 1 => { - __reduce1(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) - } - 2 => { - __reduce2(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) - } - 3 => { - // __Term = Term => ActionFn(0); - let __sym0 = __pop_Variant1(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action0::<>(input, __sym0); - return Some(Ok(__nt)); - } - _ => panic!("invalid action code {}", __action) - }; - let __states_len = __states.len(); - __states.truncate(__states_len - __pop_states); - let __state = *__states.last().unwrap(); - let __next_state = __goto(__state, __nonterminal); - __states.push(__next_state); - None - } - #[inline(never)] - fn __symbol_type_mismatch() -> ! { - panic!("symbol type mismatch") - } - fn __pop_Variant1< - 'input, - >( - __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, i32, usize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant1(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __pop_Variant0< - 'input, - >( - __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, &'input str, usize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant0(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } - fn __reduce0< - 'input, - >( - input: &'input str, - __lookahead_start: Option<&usize>, - __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: core::marker::PhantomData<(&'input ())>, - ) -> (usize, usize) - { - // Num = r#"[0-9]+"# => ActionFn(3); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action3::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (1, 0) - } - fn __reduce1< - 'input, - >( - input: &'input str, - __lookahead_start: Option<&usize>, - __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: core::marker::PhantomData<(&'input ())>, - ) -> (usize, usize) - { - // Term = Num => ActionFn(1); - let __sym0 = __pop_Variant1(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action1::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (1, 1) - } - fn __reduce2< - 'input, - >( - input: &'input str, - __lookahead_start: Option<&usize>, - __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: core::marker::PhantomData<(&'input ())>, - ) -> (usize, usize) - { - // Term = "(", Term, ")" => ActionFn(2); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant1(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action2::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (3, 1) - } -} -pub use self::__parse__Term::TermParser; -#[rustfmt::skip] -mod __intern_token { - #![allow(unused_imports)] - use std::str::FromStr; - #[allow(unused_extern_crates)] - extern crate lalrpop_util as __lalrpop_util; - #[allow(unused_imports)] - use self::__lalrpop_util::state_machine as __state_machine; - extern crate core; - extern crate alloc; - pub fn new_builder() -> __lalrpop_util::lexer::MatcherBuilder { - let __strs: &[(&str, bool)] = &[ - ("[0-9]+", false), - ("\\(", false), - ("\\)", false), - (r"\s+", true), - ]; - __lalrpop_util::lexer::MatcherBuilder::new(__strs.iter().copied()).unwrap() - } -} -pub(crate) use self::__lalrpop_util::lexer::Token; - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action0< - 'input, ->( - input: &'input str, - (_, __0, _): (usize, i32, usize), -) -> i32 -{ - __0 -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action1< - 'input, ->( - input: &'input str, - (_, n, _): (usize, i32, usize), -) -> i32 -{ - n -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action2< - 'input, ->( - input: &'input str, - (_, _, _): (usize, &'input str, usize), - (_, t, _): (usize, i32, usize), - (_, _, _): (usize, &'input str, usize), -) -> i32 -{ - t -} - -#[allow(unused_variables)] -#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action3< - 'input, ->( - input: &'input str, - (_, s, _): (usize, &'input str, usize), -) -> i32 -{ - i32::from_str(s).unwrap() -} -#[allow(clippy::type_complexity)] - -pub trait __ToTriple<'input, > -{ - fn to_triple(value: Self) -> Result<(usize,Token<'input>,usize), __lalrpop_util::ParseError, &'static str>>; -} - -impl<'input, > __ToTriple<'input, > for (usize, Token<'input>, usize) -{ - fn to_triple(value: Self) -> Result<(usize,Token<'input>,usize), __lalrpop_util::ParseError, &'static str>> { - Ok(value) - } -} -impl<'input, > __ToTriple<'input, > for Result<(usize, Token<'input>, usize), &'static str> -{ - fn to_triple(value: Self) -> Result<(usize,Token<'input>,usize), __lalrpop_util::ParseError, &'static str>> { - match value { - Ok(v) => Ok(v), - Err(error) => Err(__lalrpop_util::ParseError::User { error }), - } - } -} diff --git a/programs/fail/type_check/unit_from_int_1.test b/programs/fail/type_check/unit_from_int_1.test new file mode 100644 index 0000000..b3f4ccc --- /dev/null +++ b/programs/fail/type_check/unit_from_int_1.test @@ -0,0 +1,4 @@ +### +fn main() -> Int { + unit +} \ No newline at end of file diff --git a/programs/fail/type_check/unit_from_int_2.test b/programs/fail/type_check/unit_from_int_2.test new file mode 100644 index 0000000..2430d47 --- /dev/null +++ b/programs/fail/type_check/unit_from_int_2.test @@ -0,0 +1,6 @@ +### +fn main() -> Int { + loop { + break + } +} \ No newline at end of file diff --git a/programs/fail/type_check/unit_from_int_3.test b/programs/fail/type_check/unit_from_int_3.test new file mode 100644 index 0000000..8781c8f --- /dev/null +++ b/programs/fail/type_check/unit_from_int_3.test @@ -0,0 +1,5 @@ +### +fn main() -> Int { + let x = unit; + x +} \ No newline at end of file diff --git a/programs/good/loops/loop_bool.test b/programs/good/loops/loop_bool.test new file mode 100644 index 0000000..500b94d --- /dev/null +++ b/programs/good/loops/loop_bool.test @@ -0,0 +1,8 @@ +## +5 +# +fn main() -> Int { + loop { + break 5 + } +} diff --git a/programs/good/loops/loop_let.test b/programs/good/loops/loop_let.test new file mode 100644 index 0000000..2cbcad1 --- /dev/null +++ b/programs/good/loops/loop_let.test @@ -0,0 +1,9 @@ +## +42 +# +fn main() -> Int { + loop { + let x = 42; + break x + } +} diff --git a/programs/good/loops/loop_num.test b/programs/good/loops/loop_num.test new file mode 100644 index 0000000..500b94d --- /dev/null +++ b/programs/good/loops/loop_num.test @@ -0,0 +1,8 @@ +## +5 +# +fn main() -> Int { + loop { + break 5 + } +} diff --git a/programs/good/loops/loop_void.test b/programs/good/loops/loop_void.test new file mode 100644 index 0000000..c1654d3 --- /dev/null +++ b/programs/good/loops/loop_void.test @@ -0,0 +1,8 @@ +## +unit +# +fn main() -> Unit { + loop { + break + } +} diff --git a/programs/good/loops/unit.test b/programs/good/loops/unit.test new file mode 100644 index 0000000..447247b --- /dev/null +++ b/programs/good/loops/unit.test @@ -0,0 +1,6 @@ +## +unit +# +fn main() -> Unit { + unit +} diff --git a/programs/good/loops/unit_bind.test b/programs/good/loops/unit_bind.test new file mode 100644 index 0000000..0049815 --- /dev/null +++ b/programs/good/loops/unit_bind.test @@ -0,0 +1,7 @@ +## +unit +# +fn main() -> Unit { + let x = unit; + x +} diff --git a/programs/good/loops/unit_fn.test b/programs/good/loops/unit_fn.test new file mode 100644 index 0000000..3b61bbe --- /dev/null +++ b/programs/good/loops/unit_fn.test @@ -0,0 +1,6 @@ +## +unit +# +fn main() { + unit +} From d5316efb5b925b4c75ad34a9c6075425083ddfa1 Mon Sep 17 00:00:00 2001 From: jonathan Date: Tue, 24 Oct 2023 21:20:58 +0200 Subject: [PATCH 02/27] Reeefactor --- compiler/src/interpreter/value.rs | 11 +++++ compiler/src/language/alvar.rs | 4 +- compiler/src/language/rlvar.rs | 4 +- compiler/src/lib.rs | 2 +- compiler/src/main.rs | 4 +- compiler/src/passes/parse/mod.rs | 41 +------------------ compiler/src/passes/parse/parse.rs | 26 ++++++++++++ compiler/src/passes/reveal_functions.rs | 6 +-- .../{type_check.rs => type_check/check.rs} | 29 +++---------- compiler/src/passes/type_check/mod.rs | 26 ++++++++++++ compiler/src/passes/uniquify.rs | 5 ++- compiler/src/utils/split_test.rs | 2 +- 12 files changed, 84 insertions(+), 76 deletions(-) create mode 100644 compiler/src/passes/parse/parse.rs rename compiler/src/passes/{type_check.rs => type_check/check.rs} (91%) create mode 100644 compiler/src/passes/type_check/mod.rs diff --git a/compiler/src/interpreter/value.rs b/compiler/src/interpreter/value.rs index eac056a..1591c98 100644 --- a/compiler/src/interpreter/value.rs +++ b/compiler/src/interpreter/value.rs @@ -11,6 +11,17 @@ pub enum Val { Function { sym: A }, } +impl From for Val { + fn from(value: Lit) -> Self { + match value { + Lit::Int { val } => Val::Int { val }, + Lit::Bool { val } => Val::Bool { val }, + Lit::Unit => Val::Unit + } + } +} + + impl Val { pub fn int(self) -> i64 { match self { diff --git a/compiler/src/language/alvar.rs b/compiler/src/language/alvar.rs index ccb0c1e..c088d18 100644 --- a/compiler/src/language/alvar.rs +++ b/compiler/src/language/alvar.rs @@ -1,6 +1,6 @@ -use crate::passes::parse::{Def, Expr, Lit, Op, PrgUniquified}; +use crate::passes::parse::{Def, Expr, Lit, Op}; use crate::passes::type_check::Type; -use crate::passes::uniquify::UniqueSym; +use crate::passes::uniquify::{PrgUniquified, UniqueSym}; use std::collections::HashMap; #[derive(Debug, PartialEq)] diff --git a/compiler/src/language/rlvar.rs b/compiler/src/language/rlvar.rs index a62eb88..a582a3d 100644 --- a/compiler/src/language/rlvar.rs +++ b/compiler/src/language/rlvar.rs @@ -1,6 +1,6 @@ -use crate::passes::parse::{Def, Expr, Lit, Op, PrgUniquified}; +use crate::passes::parse::{Def, Expr, Lit, Op}; use crate::passes::type_check::Type; -use crate::passes::uniquify::UniqueSym; +use crate::passes::uniquify::{PrgUniquified, UniqueSym}; use std::collections::HashMap; #[derive(Debug, PartialEq)] diff --git a/compiler/src/lib.rs b/compiler/src/lib.rs index 27c3621..3b9e51d 100644 --- a/compiler/src/lib.rs +++ b/compiler/src/lib.rs @@ -1,7 +1,7 @@ use crate::elf::ElfFile; -use crate::passes::parse::parse_program; use std::fs::File; use std::path::Path; +use crate::passes::parse::parse::parse_program; pub mod elf; pub mod interpreter; diff --git a/compiler/src/main.rs b/compiler/src/main.rs index 4d8714d..f15c56c 100644 --- a/compiler/src/main.rs +++ b/compiler/src/main.rs @@ -1,13 +1,13 @@ use crate::MainError::IOResult; use clap::Parser; use compiler::compile; -use compiler::passes::parse::PrettyParseError; -use compiler::passes::type_check::TypeError; use miette::Diagnostic; use std::io::Read; use std::path::Path; use std::{fs, io}; use thiserror::Error; +use compiler::passes::parse::parse::PrettyParseError; +use compiler::passes::type_check::check::TypeError; #[derive(Debug, Error, Diagnostic)] enum MainError { diff --git a/compiler/src/passes/parse/mod.rs b/compiler/src/passes/parse/mod.rs index dfb53f5..63647f8 100644 --- a/compiler/src/passes/parse/mod.rs +++ b/compiler/src/passes/parse/mod.rs @@ -2,48 +2,19 @@ #[allow(clippy::all)] mod grammar; pub mod interpreter; +pub mod parse; -use crate::passes::parse::grammar::ProgramParser; -use miette::{Diagnostic, SourceSpan}; -use thiserror::Error; -use crate::interpreter::value::Val; use std::collections::HashMap; use crate::passes::type_check::Type; -use crate::passes::uniquify::UniqueSym; use std::fmt::{Display, Formatter}; use std::hash::Hash; -#[derive(Error, Debug, Diagnostic)] -#[error("Parse error!")] -#[diagnostic( - code(oops::my::bad), - url(docsrs), - help("try doing it better next time?") -)] -pub struct PrettyParseError { - #[source_code] - src: String, - - #[label("Failed to parse here")] - fail: SourceSpan, -} - -pub fn parse_program(src: &str) -> Result { - ProgramParser::new().parse(src).map_err(|e| { - dbg!(e); - panic!(); - }) -} - #[derive(Debug, PartialEq)] pub struct PrgParsed<'p> { pub defs: Vec>, pub entry: &'p str, } -pub type PrgTypeChecked<'p> = PrgGenericVar<&'p str>; -pub type PrgUniquified<'p> = PrgGenericVar>; - #[derive(Debug, PartialEq)] pub struct PrgGenericVar { pub defs: HashMap>, @@ -153,13 +124,3 @@ impl Display for Lit { } } } - -impl From for Val { - fn from(value: Lit) -> Self { - match value { - Lit::Int { val } => Val::Int { val }, - Lit::Bool { val } => Val::Bool { val }, - Lit::Unit => Val::Unit - } - } -} diff --git a/compiler/src/passes/parse/parse.rs b/compiler/src/passes/parse/parse.rs new file mode 100644 index 0000000..27f018b --- /dev/null +++ b/compiler/src/passes/parse/parse.rs @@ -0,0 +1,26 @@ +use miette::{Diagnostic, SourceSpan}; +use thiserror::Error; +use crate::passes::parse::grammar::ProgramParser; +use crate::passes::parse::PrgParsed; + +#[derive(Error, Debug, Diagnostic)] +#[error("Parse error!")] +#[diagnostic( + code(oops::my::bad), + url(docsrs), + help("try doing it better next time?") +)] +pub struct PrettyParseError { + #[source_code] + src: String, + + #[label("Failed to parse here")] + fail: SourceSpan, +} + +pub fn parse_program(src: &str) -> Result { + ProgramParser::new().parse(src).map_err(|e| { + dbg!(e); + panic!(); + }) +} diff --git a/compiler/src/passes/reveal_functions.rs b/compiler/src/passes/reveal_functions.rs index 077e97a..faf1922 100644 --- a/compiler/src/passes/reveal_functions.rs +++ b/compiler/src/passes/reveal_functions.rs @@ -1,6 +1,6 @@ -use crate::passes::parse::{Def, Expr, PrgUniquified}; +use crate::passes::parse::{Def, Expr}; use crate::language::rlvar::{PrgRevealed, RDef, RExpr}; -use crate::passes::uniquify::UniqueSym; +use crate::passes::uniquify::{PrgUniquified, UniqueSym}; use crate::utils::push_map::PushMap; impl<'p> PrgUniquified<'p> { @@ -79,7 +79,7 @@ fn reveal_expr<'p>(expr: Expr>, scope: &mut PushMap, #[cfg(test)] mod tests { use crate::interpreter::TestIO; - use crate::passes::parse::PrgUniquified; + use crate::passes::uniquify::PrgUniquified; use crate::utils::split_test::split_test; use test_each_file::test_each_file; diff --git a/compiler/src/passes/type_check.rs b/compiler/src/passes/type_check/check.rs similarity index 91% rename from compiler/src/passes/type_check.rs rename to compiler/src/passes/type_check/check.rs index f9dcb3d..d007a80 100644 --- a/compiler/src/passes/type_check.rs +++ b/compiler/src/passes/type_check/check.rs @@ -1,31 +1,12 @@ -use crate::passes::parse::{Def, Expr, Lit, Op, PrgParsed, PrgTypeChecked}; -use crate::passes::type_check::TypeError::*; +use crate::passes::parse::{Def, Expr, Lit, Op, PrgParsed}; use crate::utils::expect::expect; use crate::utils::push_map::PushMap; -use itertools::Itertools; use miette::Diagnostic; use std::collections::{HashMap, HashSet}; -use std::fmt::{Display, Formatter}; use thiserror::Error; - -#[derive(Debug, Clone, PartialEq)] -pub enum Type { - Int, - Bool, - Unit, - Fn { typ: Box, args: Vec }, -} - -impl Display for Type { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - match self { - Type::Int => write!(f, "Int"), - Type::Bool => write!(f, "Bool"), - Type::Unit => write!(f, "Unit"), - Type::Fn { typ, args } => write!(f, "fn({}) -> {}", args.iter().format(", "), typ), - } - } -} +use crate::passes::type_check::*; +use crate::passes::type_check::check::TypeError::*; +use crate::passes::type_check::PrgTypeChecked; #[derive(Debug, Error, Diagnostic)] #[diagnostic()] @@ -227,8 +208,8 @@ fn expect_type<'p>( #[cfg(test)] mod tests { - use crate::passes::parse::parse_program; use test_each_file::test_each_file; + use crate::passes::parse::parse::parse_program; fn check([test]: [&str; 1], should_fail: bool) { let mut test = test.split('#'); diff --git a/compiler/src/passes/type_check/mod.rs b/compiler/src/passes/type_check/mod.rs new file mode 100644 index 0000000..ff93692 --- /dev/null +++ b/compiler/src/passes/type_check/mod.rs @@ -0,0 +1,26 @@ +pub mod check; + +use std::fmt::{Display, Formatter}; +use crate::passes::parse::PrgGenericVar; +use itertools::Itertools; + +pub type PrgTypeChecked<'p> = PrgGenericVar<&'p str>; + +#[derive(Debug, Clone, PartialEq)] +pub enum Type { + Int, + Bool, + Unit, + Fn { typ: Box, args: Vec }, +} + +impl Display for Type { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self { + Type::Int => write!(f, "Int"), + Type::Bool => write!(f, "Bool"), + Type::Unit => write!(f, "Unit"), + Type::Fn { typ, args } => write!(f, "fn({}) -> {}", args.iter().format(", "), typ), + } + } +} diff --git a/compiler/src/passes/uniquify.rs b/compiler/src/passes/uniquify.rs index 79325d8..12bf582 100644 --- a/compiler/src/passes/uniquify.rs +++ b/compiler/src/passes/uniquify.rs @@ -3,9 +3,10 @@ //! This is useful because in later passes we will be changing the structure of the program, //! and after selecting instructions we will only have a list of X86 instructions left. -use crate::passes::parse::{Def, Expr, PrgTypeChecked, PrgUniquified}; +use crate::passes::parse::{Def, Expr, PrgGenericVar}; use crate::utils::push_map::PushMap; use std::sync::atomic::{AtomicUsize, Ordering}; +use crate::passes::type_check::PrgTypeChecked; static COUNT: AtomicUsize = AtomicUsize::new(0); @@ -128,3 +129,5 @@ mod tests { test_each_file! { for ["test"] in "./programs/good" as uniquify => unique } } + +pub type PrgUniquified<'p> = PrgGenericVar>; diff --git a/compiler/src/utils/split_test.rs b/compiler/src/utils/split_test.rs index 378adc8..63118cc 100644 --- a/compiler/src/utils/split_test.rs +++ b/compiler/src/utils/split_test.rs @@ -1,7 +1,7 @@ use crate::interpreter::value::Val; use crate::passes::parse::{Lit, PrgParsed}; -use crate::passes::parse::parse_program; use std::hash::Hash; +use crate::passes::parse::parse::parse_program; pub fn split_test_raw(test: &str) -> (Vec, Vec, Lit, &str) { let mut test = test.split('#'); From 94ba6038109a13be593c0148dd7db4b90ea1d5f7 Mon Sep 17 00:00:00 2001 From: jonathan Date: Tue, 24 Oct 2023 22:43:45 +0200 Subject: [PATCH 03/27] Type checking looooooops --- compiler/src/passes/parse/grammar.lalrpop | 7 +- compiler/src/passes/parse/grammar.rs | 2393 ++++++++++------- compiler/src/passes/parse/mod.rs | 2 +- compiler/src/passes/type_check/check.rs | 135 +- compiler/src/passes/type_check/mod.rs | 2 + compiler/src/utils/push_map.rs | 8 +- .../fail/type_check/break_outside_loop.test | 4 + programs/good/loops/loop_in_loop.test | 15 + programs/good/loops/loop_never.test | 10 + .../loops/{loop_void.test => loop_unit.test} | 0 10 files changed, 1521 insertions(+), 1055 deletions(-) create mode 100644 programs/fail/type_check/break_outside_loop.test create mode 100644 programs/good/loops/loop_in_loop.test create mode 100644 programs/good/loops/loop_never.test rename programs/good/loops/{loop_void.test => loop_unit.test} (100%) diff --git a/compiler/src/passes/parse/grammar.lalrpop b/compiler/src/passes/parse/grammar.lalrpop index 0d0eb7b..ab9e70e 100644 --- a/compiler/src/passes/parse/grammar.lalrpop +++ b/compiler/src/passes/parse/grammar.lalrpop @@ -43,6 +43,7 @@ match { "Int", "Bool", "Unit", + "Never", // Literals "true", @@ -75,7 +76,7 @@ pub Program: PrgParsed<'input> = { Def: Def<&'input str> = Fn; Fn: Def<&'input str> = { - "fn" "(" > ")" "->" "{" "}" => Def::Fn { sym, params, typ, bdy } + "fn" "(" > ")" " )?> "{" "}" => Def::Fn { sym, params, typ: typ.unwrap_or(Type::Unit), bdy } } Param = ":" ; @@ -84,6 +85,7 @@ Type: Type = { "Int" => Type::Int, "Bool" => Type::Bool, "Unit" => Type::Unit, + "Never" => Type::Never, } BinaryOps: Expr<&'input str> = { @@ -97,7 +99,7 @@ ExprStmt: Expr<&'input str> = { "let" "=" ";" => Expr::Let { sym, bnd: Box::new(bnd), bdy: Box::new(bdy) }, "if" "{" "}" "else" "{" "}" => Expr::If { cnd: Box::new(cnd), thn: Box::new(thn), els: Box::new(els) }, "loop" "{" "}" => Expr::Loop { bdy: Box::new(bdy) }, - "break" => Expr::Break { e: e.map(Box::new) }, + "break" => Expr::Break { bdy: bdy.map(Box::new) }, ExprLogicalOr, } @@ -148,6 +150,7 @@ ExprCall: Expr<&'input str> = { ExprAtom: Expr<&'input str> = { Num => Expr::Lit{ val: Lit::Int { val: <> }}, Bool => Expr::Lit { val: Lit::Bool { val: <> }}, + "unit" => Expr::Lit { val: Lit::Unit }, Ident => Expr::Var { sym: <> }, "(" ")", } diff --git a/compiler/src/passes/parse/grammar.rs b/compiler/src/passes/parse/grammar.rs index a868959..ec1a238 100644 --- a/compiler/src/passes/parse/grammar.rs +++ b/compiler/src/passes/parse/grammar.rs @@ -1,5 +1,5 @@ // auto-generated: "lalrpop 0.20.1" -// sha3: e96ee58666334e6479be6108467200e495ac77aeb55bfcf2b78b4c1e8d3cd21f +// sha3: 64c166fbc73816d41147ecc4223f3fc5110879e198b167ca6ced0e0af6d31919 use std::str::FromStr; use crate::passes::parse::*; use crate::passes::parse::PrgParsed; @@ -30,270 +30,281 @@ mod __parse__Program { pub(crate) enum __Symbol<'input> { Variant0(&'input str), - Variant1(Expr<&'input str>), - Variant2(alloc::vec::Vec>), - Variant3((&'input str, Type)), - Variant4(alloc::vec::Vec<(&'input str, Type)>), - Variant5(Op), - Variant6(bool), - Variant7(Vec>), - Variant8(Vec<(&'input str, Type)>), - Variant9(Def<&'input str>), - Variant10(alloc::vec::Vec>), - Variant11(core::option::Option>), - Variant12(i64), - Variant13(core::option::Option<(&'input str, Type)>), - Variant14(PrgParsed<'input>), - Variant15(Type), + Variant1(Type), + Variant2(core::option::Option), + Variant3(Expr<&'input str>), + Variant4(alloc::vec::Vec>), + Variant5((&'input str, Type)), + Variant6(alloc::vec::Vec<(&'input str, Type)>), + Variant7(Op), + Variant8(bool), + Variant9(Vec>), + Variant10(Vec<(&'input str, Type)>), + Variant11(Def<&'input str>), + Variant12(alloc::vec::Vec>), + Variant13(core::option::Option>), + Variant14(i64), + Variant15(core::option::Option<(&'input str, Type)>), + Variant16(PrgParsed<'input>), } const __ACTION: &[i8] = &[ // State 0 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 1 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 2 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 3 - 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, 0, 0, 0, 0, 0, 0, 0, 0, 39, + 0, 0, 0, 0, 0, -35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, // State 4 - 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, 0, 0, 0, 0, 0, 0, 0, 0, 39, + 0, 0, 0, 0, 0, -37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, // State 5 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 49, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 50, 51, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 6 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 49, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 50, 51, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 7 - 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 68, 0, 18, 19, 69, 70, 71, 72, 0, 0, 0, 0, 73, 39, + 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 70, 0, 18, 19, 71, 72, 73, 74, 75, 0, 0, 0, 76, 40, // State 8 - 0, -49, 0, -49, 0, -49, 0, 74, -49, 75, 0, 0, 0, -49, -49, -49, 0, -49, -49, -49, 0, 0, 0, -49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -49, -49, -49, 0, 0, + 0, -52, 0, -52, 0, -52, 0, 77, -52, 78, 0, 0, 0, -52, -52, -52, 0, -52, -52, -52, 0, 0, 0, 0, -52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -52, -52, -52, 0, 0, // State 9 - 0, 76, 0, -58, 0, -58, 0, 0, -58, 0, 0, 0, 0, -58, 77, 78, 0, 79, 80, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -58, -58, -58, 0, 0, + 0, 79, 0, -62, 0, -62, 0, 0, -62, 0, 0, 0, 0, -62, 80, 81, 0, 82, 83, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -62, -62, -62, 0, 0, // State 10 - 0, 0, 0, 82, 0, -59, 0, 0, -59, 0, 0, 0, 0, -59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -59, -59, -59, 0, 0, + 0, 0, 0, 85, 0, -63, 0, 0, -63, 0, 0, 0, 0, -63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -63, -63, -63, 0, 0, // State 11 - 0, 0, 0, 0, 0, -60, 0, 0, -60, 0, 0, 0, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -60, 83, -60, 0, 0, + 0, 0, 0, 0, 0, -64, 0, 0, -64, 0, 0, 0, 0, -64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -64, 86, -64, 0, 0, // State 12 - 0, -61, 84, -61, 0, -61, 85, -61, -61, -61, 0, 86, 0, -61, -61, -61, 0, -61, -61, -61, 0, 0, 0, -61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -61, -61, -61, 0, 0, + 0, -65, 87, -65, 0, -65, 88, -65, -65, -65, 0, 89, 0, -65, -65, -65, 0, -65, -65, -65, 0, 0, 0, 0, -65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -65, -65, -65, 0, 0, // State 13 - 0, -70, 0, -70, 0, -70, 0, 0, -70, 0, 0, 0, 0, -70, -70, -70, 0, -70, -70, -70, 0, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -70, -70, -70, 0, 0, + 0, -74, 0, -74, 0, -74, 0, 0, -74, 0, 0, 0, 0, -74, -74, -74, 0, -74, -74, -74, 0, 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -74, -74, -74, 0, 0, // State 14 - 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 70, 71, 72, 0, 0, 0, 0, 73, 39, + 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 72, 73, 74, 75, 0, 0, 0, 76, 40, // State 15 - 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 68, 0, 18, 19, 69, 70, 71, 72, 0, 0, 0, 0, 73, 39, + 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 70, 0, 18, 19, 71, 72, 73, 74, 75, 0, 0, 0, 76, 40, // State 16 - 66, 0, 0, 0, 16, -66, 0, 0, -66, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 68, 0, 18, 19, 69, 70, 71, 72, 0, 0, 0, -66, 73, 39, + 68, 0, 0, 0, 16, -70, 0, 0, -70, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 70, 0, 18, 19, 71, 72, 73, 74, 75, 0, 0, -70, 76, 40, // State 17 - 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 70, 71, 72, 0, 0, 0, 0, 73, 39, + 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 72, 73, 74, 75, 0, 0, 0, 76, 40, // State 18 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, // State 19 - 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 70, 71, 72, 0, 0, 0, 0, 73, 39, + 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 70, 0, 18, 19, 71, 72, 73, 74, 75, 0, 0, 0, 76, 40, // State 20 - 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 70, 71, 72, 0, 0, 0, 0, 73, 39, + 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 72, 73, 74, 75, 0, 0, 0, 76, 40, // State 21 - 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 70, 71, 72, 0, 0, 0, 0, 73, 39, + 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 72, 73, 74, 75, 0, 0, 0, 76, 40, // State 22 - 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 70, 71, 72, 0, 0, 0, 0, 73, 39, + 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 72, 73, 74, 75, 0, 0, 0, 76, 40, // State 23 - 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 70, 71, 72, 0, 0, 0, 0, 73, 39, + 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 72, 73, 74, 75, 0, 0, 0, 76, 40, // State 24 - 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 70, 71, 72, 0, 0, 0, 0, 73, 39, + 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 72, 73, 74, 75, 0, 0, 0, 76, 40, // State 25 - 66, 0, 0, 0, 16, -28, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 68, 0, 18, 19, 69, 70, 71, 72, 0, 0, 0, 0, 73, 39, + 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 72, 73, 74, 75, 0, 0, 0, 76, 40, // State 26 - 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 68, 0, 18, 19, 69, 70, 71, 72, 0, 0, 0, 0, 73, 39, + 68, 0, 0, 0, 16, -31, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 70, 0, 18, 19, 71, 72, 73, 74, 75, 0, 0, 0, 76, 40, // State 27 - 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 68, 0, 18, 19, 69, 70, 71, 72, 0, 0, 0, 0, 73, 39, + 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 70, 0, 18, 19, 71, 72, 73, 74, 75, 0, 0, 0, 76, 40, // State 28 - 66, 0, 0, 0, 16, -30, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 68, 0, 18, 19, 69, 70, 71, 72, 0, 0, 0, 0, 73, 39, + 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 70, 0, 18, 19, 71, 72, 73, 74, 75, 0, 0, 0, 76, 40, // State 29 - 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 68, 0, 18, 19, 69, 70, 71, 72, 0, 0, 0, 0, 73, 39, + 68, 0, 0, 0, 16, -33, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 70, 0, 18, 19, 71, 72, 73, 74, 75, 0, 0, 0, 76, 40, // State 30 - 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 70, 71, 72, 0, 0, 0, 0, 73, 39, + 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 70, 0, 18, 19, 71, 72, 73, 74, 75, 0, 0, 0, 76, 40, // State 31 - 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 68, 0, 18, 19, 69, 70, 71, 72, 0, 0, 0, 0, 73, 39, + 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 72, 73, 74, 75, 0, 0, 0, 76, 40, // State 32 - 66, 0, 0, 0, 16, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 68, 0, 18, 19, 69, 70, 71, 72, 0, 0, 0, 0, 73, 39, + 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 70, 0, 18, 19, 71, 72, 73, 74, 75, 0, 0, 0, 76, 40, // State 33 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 70, 0, 18, 19, 71, 72, 73, 74, 75, 0, 0, 0, 76, 40, // State 34 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 35 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 36 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 37 - 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 38 - 0, -72, -72, -72, -72, -72, -72, -72, -72, -72, 0, -72, -72, -72, -72, -72, -72, -72, -72, -72, 0, 0, 0, -72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -72, -72, -72, 0, 0, + 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 39 - 0, 0, 0, 0, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -77, -77, -77, -77, -77, -77, -77, -77, -77, 0, -77, -77, -77, -77, -77, -77, -77, -77, -77, 0, 0, 0, 0, -77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -77, -77, -77, 0, 0, // State 40 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 41 - 0, 0, 0, 0, 0, -31, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 42 - 0, 0, 0, 0, 0, -33, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -34, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, // State 43 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -36, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 44 - 0, 0, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -9, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, // State 45 - 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10, + 0, 0, 0, 0, 0, -12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -12, // State 46 - 0, 0, 0, 0, 0, -79, 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, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -13, // State 47 - 0, 0, 0, 0, 0, -85, 0, 0, -85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -85, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -84, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 48 - 0, 0, 0, 0, 0, -84, 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, 0, 0, 0, -84, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -90, 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, 0, 0, -90, 0, 0, 0, 0, // State 49 - 0, 0, 0, 0, 0, -86, 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, 0, -86, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -89, 0, 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, 0, 0, 0, -89, 0, 0, 0, 0, // State 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -92, 0, 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, 0, 0, -92, 0, 0, 0, 0, // State 51 - 0, -51, -51, -51, -51, -51, -51, -51, -51, -51, 0, -51, 0, -51, -51, -51, 0, -51, -51, -51, 0, 0, 0, -51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -51, -51, -51, 0, 0, + 0, 0, 0, 0, 0, -91, 0, 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, 0, 0, 0, -91, 0, 0, 0, 0, // State 52 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, // State 53 - 0, -24, 0, -24, 0, -24, 0, 0, -24, 0, 0, 0, 0, -24, -24, -24, 0, -24, -24, -24, 0, 0, 0, -24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -24, -24, -24, 0, 0, + 0, -54, -54, -54, -54, -54, -54, -54, -54, -54, 0, -54, 0, -54, -54, -54, 0, -54, -54, -54, 0, 0, 0, 0, -54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -54, -54, -54, 0, 0, // State 54 - 0, -57, -57, -57, 26, -57, -57, -57, -57, -57, 0, -57, 0, -57, -57, -57, 0, -57, -57, -57, 0, 0, 0, -57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -57, -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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91, 0, 0, // State 55 - 0, -69, -69, -69, 0, -69, -69, -69, -69, -69, 0, -69, 0, -69, -69, -69, 0, -69, -69, -69, 0, 0, 0, -69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -69, -69, -69, 0, 0, + 0, -27, 0, -27, 0, -27, 0, 0, -27, 0, 0, 0, 0, -27, -27, -27, 0, -27, -27, -27, 0, 0, 0, 0, -27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -27, -27, -27, 0, 0, // State 56 - 0, 0, 0, -18, 0, -18, 0, 0, -18, 0, 0, 0, 0, -18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -18, -18, -18, 0, 0, + 0, -61, -61, -61, 27, -61, -61, -61, -61, -61, 0, -61, 0, -61, -61, -61, 0, -61, -61, -61, 0, 0, 0, 0, -61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -61, -61, -61, 0, 0, // State 57 - 0, 0, 0, 0, 0, -20, 0, 0, -20, 0, 0, 0, 0, -20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -20, -20, -20, 0, 0, + 0, -73, -73, -73, 0, -73, -73, -73, -73, -73, 0, -73, 0, -73, -73, -73, 0, -73, -73, -73, 0, 0, 0, 0, -73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -73, -73, -73, 0, 0, // State 58 - 0, 0, 0, 0, 0, -67, 0, 0, -67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -67, 0, 0, + 0, 0, 0, -21, 0, -21, 0, 0, -21, 0, 0, 0, 0, -21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -21, -21, -21, 0, 0, // State 59 - 0, -14, 0, -14, 0, -14, 0, -14, -14, -14, 0, 0, 0, -14, -14, -14, 0, -14, -14, -14, 0, 0, 0, -14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, -14, -14, 0, 0, + 0, 0, 0, 0, 0, -23, 0, 0, -23, 0, 0, 0, 0, -23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -23, -23, -23, 0, 0, // State 60 - 0, 0, 0, 0, 0, -46, 0, 0, -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, 0, 0, 0, 0, -46, 0, 0, + 0, 0, 0, 0, 0, -71, 0, 0, -71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -71, 0, 0, // State 61 - 0, -22, -22, -22, 0, -22, -22, -22, -22, -22, 0, -22, 0, -22, -22, -22, 0, -22, -22, -22, 0, 0, 0, -22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -22, -22, -22, 0, 0, + 0, -17, 0, -17, 0, -17, 0, -17, -17, -17, 0, 0, 0, -17, -17, -17, 0, -17, -17, -17, 0, 0, 0, 0, -17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -17, -17, -17, 0, 0, // State 62 - 0, -16, 0, -16, 0, -16, 0, 0, -16, 0, 0, 0, 0, -16, -16, -16, 0, -16, -16, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16, -16, -16, 0, 0, + 0, 0, 0, 0, 0, -49, 0, 0, -49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -49, 0, 0, // State 63 - 0, -52, -52, -52, -52, -52, -52, -52, -52, -52, 0, -52, 0, -52, -52, -52, 0, -52, -52, -52, 0, 0, 0, -52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -52, -52, -52, 0, 0, + 0, -25, -25, -25, 0, -25, -25, -25, -25, -25, 0, -25, 0, -25, -25, -25, 0, -25, -25, -25, 0, 0, 0, 0, -25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -25, -25, -25, 0, 0, // State 64 - 0, -50, -50, -50, -50, -50, -50, -50, -50, -50, 0, -50, 0, -50, -50, -50, 0, -50, -50, -50, 0, 0, 0, -50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -50, -50, -50, 0, 0, + 0, -19, 0, -19, 0, -19, 0, 0, -19, 0, 0, 0, 0, -19, -19, -19, 0, -19, -19, -19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -19, -19, -19, 0, 0, // State 65 - -88, 0, 0, 0, -88, 0, 0, 0, 0, -88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -88, 0, 0, 0, 0, -88, -88, -88, 0, 0, 0, 0, -88, -88, + 0, -56, -56, -56, -56, -56, -56, -56, -56, -56, 0, -56, 0, -56, -56, -56, 0, -56, -56, -56, 0, 0, 0, 0, -56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -56, -56, -56, 0, 0, // State 66 - -87, 0, 0, 0, -87, 0, 0, 0, 0, -87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -87, 0, 0, 0, 0, -87, -87, -87, 0, 0, 0, 0, -87, -87, + 0, -53, -53, -53, -53, -53, -53, -53, -53, -53, 0, -53, 0, -53, -53, -53, 0, -53, -53, -53, 0, 0, 0, 0, -53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -53, -53, -53, 0, 0, // State 67 - 0, -26, -26, -26, -26, -26, -26, -26, -26, -26, 0, -26, 0, -26, -26, -26, 0, -26, -26, -26, 0, 0, 0, -26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -26, -26, -26, 0, 0, + -94, 0, 0, 0, -94, 0, 0, 0, 0, -94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -94, 0, 0, 0, 0, -94, -94, -94, -94, 0, 0, 0, -94, -94, // State 68 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, + -93, 0, 0, 0, -93, 0, 0, 0, 0, -93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -93, 0, 0, 0, 0, -93, -93, -93, -93, 0, 0, 0, -93, -93, // State 69 - 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -29, -29, -29, -29, -29, -29, -29, -29, -29, 0, -29, 0, -29, -29, -29, 0, -29, -29, -29, 0, 0, 0, 0, -29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -29, -29, -29, 0, 0, // State 70 - 0, 0, 0, 0, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, // State 71 - 0, -25, -25, -25, -25, -25, -25, -25, -25, -25, 0, -25, 0, -25, -25, -25, 0, -25, -25, -25, 0, 0, 0, -25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -25, -25, -25, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 72 - 0, -78, -78, -78, -78, -78, -78, -78, -78, -78, 0, -78, 0, -78, -78, -78, 0, -78, -78, -78, 0, 0, 0, -78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -78, -78, -78, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 73 - -11, 0, 0, 0, -11, 0, 0, 0, 0, -11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -11, 0, 0, 0, 0, -11, -11, -11, 0, 0, 0, 0, -11, -11, + 0, -28, -28, -28, -28, -28, -28, -28, -28, -28, 0, -28, 0, -28, -28, -28, 0, -28, -28, -28, 0, 0, 0, 0, -28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -28, -28, -28, 0, 0, // State 74 - -12, 0, 0, 0, -12, 0, 0, 0, 0, -12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -12, 0, 0, 0, 0, -12, -12, -12, 0, 0, 0, 0, -12, -12, + 0, -55, -55, -55, -55, -55, -55, -55, -55, -55, 0, -55, 0, -55, -55, -55, 0, -55, -55, -55, 0, 0, 0, 0, -55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -55, -55, -55, 0, 0, // State 75 - -36, 0, 0, 0, -36, 0, 0, 0, 0, -36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -36, 0, 0, 0, 0, -36, -36, -36, 0, 0, 0, 0, -36, -36, + 0, -83, -83, -83, -83, -83, -83, -83, -83, -83, 0, -83, 0, -83, -83, -83, 0, -83, -83, -83, 0, 0, 0, 0, -83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -83, -83, -83, 0, 0, // State 76 - -39, 0, 0, 0, -39, 0, 0, 0, 0, -39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -39, 0, 0, 0, 0, -39, -39, -39, 0, 0, 0, 0, -39, -39, + -14, 0, 0, 0, -14, 0, 0, 0, 0, -14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, 0, 0, 0, 0, -14, -14, -14, -14, 0, 0, 0, -14, -14, // State 77 - -40, 0, 0, 0, -40, 0, 0, 0, 0, -40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -40, 0, 0, 0, 0, -40, -40, -40, 0, 0, 0, 0, -40, -40, + -15, 0, 0, 0, -15, 0, 0, 0, 0, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, 0, 0, 0, 0, -15, -15, -15, -15, 0, 0, 0, -15, -15, // State 78 - -35, 0, 0, 0, -35, 0, 0, 0, 0, -35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -35, 0, 0, 0, 0, -35, -35, -35, 0, 0, 0, 0, -35, -35, + -39, 0, 0, 0, -39, 0, 0, 0, 0, -39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -39, 0, 0, 0, 0, -39, -39, -39, -39, 0, 0, 0, -39, -39, // State 79 - -37, 0, 0, 0, -37, 0, 0, 0, 0, -37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -37, 0, 0, 0, 0, -37, -37, -37, 0, 0, 0, 0, -37, -37, + -42, 0, 0, 0, -42, 0, 0, 0, 0, -42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -42, 0, 0, 0, 0, -42, -42, -42, -42, 0, 0, 0, -42, -42, // State 80 - -38, 0, 0, 0, -38, 0, 0, 0, 0, -38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -38, 0, 0, 0, 0, -38, -38, -38, 0, 0, 0, 0, -38, -38, + -43, 0, 0, 0, -43, 0, 0, 0, 0, -43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -43, 0, 0, 0, 0, -43, -43, -43, -43, 0, 0, 0, -43, -43, // State 81 - -73, 0, 0, 0, -73, 0, 0, 0, 0, -73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -73, 0, 0, 0, 0, -73, -73, -73, 0, 0, 0, 0, -73, -73, + -38, 0, 0, 0, -38, 0, 0, 0, 0, -38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -38, 0, 0, 0, 0, -38, -38, -38, -38, 0, 0, 0, -38, -38, // State 82 - -74, 0, 0, 0, -74, 0, 0, 0, 0, -74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -74, 0, 0, 0, 0, -74, -74, -74, 0, 0, 0, 0, -74, -74, + -40, 0, 0, 0, -40, 0, 0, 0, 0, -40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -40, 0, 0, 0, 0, -40, -40, -40, -40, 0, 0, 0, -40, -40, // State 83 - -77, 0, 0, 0, -77, 0, 0, 0, 0, -77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -77, 0, 0, 0, 0, -77, -77, -77, 0, 0, 0, 0, -77, -77, + -41, 0, 0, 0, -41, 0, 0, 0, 0, -41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -41, 0, 0, 0, 0, -41, -41, -41, -41, 0, 0, 0, -41, -41, // State 84 - -75, 0, 0, 0, -75, 0, 0, 0, 0, -75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -75, 0, 0, 0, 0, -75, -75, -75, 0, 0, 0, 0, -75, -75, + -78, 0, 0, 0, -78, 0, 0, 0, 0, -78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -78, 0, 0, 0, 0, -78, -78, -78, -78, 0, 0, 0, -78, -78, // State 85 - -76, 0, 0, 0, -76, 0, 0, 0, 0, -76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -76, 0, 0, 0, 0, -76, -76, -76, 0, 0, 0, 0, -76, -76, + -79, 0, 0, 0, -79, 0, 0, 0, 0, -79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -79, 0, 0, 0, 0, -79, -79, -79, -79, 0, 0, 0, -79, -79, // State 86 - -89, 0, 0, 0, -89, 0, 0, 0, 0, -89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -89, 0, 0, 0, 0, -89, -89, -89, 0, 0, 0, 0, -89, -89, + -82, 0, 0, 0, -82, 0, 0, 0, 0, -82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -82, 0, 0, 0, 0, -82, -82, -82, -82, 0, 0, 0, -82, -82, // State 87 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -80, 0, 0, 0, -80, 0, 0, 0, 0, -80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -80, 0, 0, 0, 0, -80, -80, -80, -80, 0, 0, 0, -80, -80, // State 88 - 0, -68, -68, -68, 0, -68, -68, -68, -68, -68, 0, -68, 0, -68, -68, -68, 0, -68, -68, -68, 0, 0, 0, -68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -68, -68, -68, 0, 0, + -81, 0, 0, 0, -81, 0, 0, 0, 0, -81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -81, 0, 0, 0, 0, -81, -81, -81, -81, 0, 0, 0, -81, -81, // State 89 - 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -95, 0, 0, 0, -95, 0, 0, 0, 0, -95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -95, 0, 0, 0, 0, -95, -95, -95, -95, 0, 0, 0, -95, -95, // State 90 - 0, 0, 0, 0, 0, -65, 0, 0, -65, 0, 0, 0, 0, 0, 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, 0, + 0, 0, 0, 0, 0, 0, 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, // State 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, + 0, -72, -72, -72, 0, -72, -72, -72, -72, -72, 0, -72, 0, -72, -72, -72, 0, -72, -72, -72, 0, 0, 0, 0, -72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -72, -72, -72, 0, 0, // State 92 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, -69, 0, 0, 0, 0, 0, 0, 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, 0, // State 94 - 0, -13, 0, -13, 0, -13, 0, -13, -13, -13, 0, 0, 0, -13, -13, -13, 0, -13, -13, -13, 0, 0, 0, -13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -13, -13, -13, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, // State 95 - 0, -15, 0, -15, 0, -15, 0, 0, -15, 0, 0, 0, 0, -15, -15, -15, 0, -15, -15, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, -15, -15, 0, 0, + 0, 0, 0, 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, // State 96 - 0, 0, 0, -17, 0, -17, 0, 0, -17, 0, 0, 0, 0, -17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -17, -17, -17, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 97 - 0, 0, 0, 0, 0, -19, 0, 0, -19, 0, 0, 0, 0, -19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -19, -19, -19, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, 0, 0, // State 98 - 0, -21, -21, -21, 0, -21, -21, -21, -21, -21, 0, -21, 0, -21, -21, -21, 0, -21, -21, -21, 0, 0, 0, -21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -21, -21, -21, 0, 0, + 0, -16, 0, -16, 0, -16, 0, -16, -16, -16, 0, 0, 0, -16, -16, -16, 0, -16, -16, -16, 0, 0, 0, 0, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16, -16, -16, 0, 0, // State 99 - 0, -23, 0, -23, 0, -23, 0, 0, -23, 0, 0, 0, 0, -23, -23, -23, 0, -23, -23, -23, 0, 0, 0, -23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -23, -23, -23, 0, 0, + 0, -18, 0, -18, 0, -18, 0, 0, -18, 0, 0, 0, 0, -18, -18, -18, 0, -18, -18, -18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -18, -18, -18, 0, 0, // State 100 - 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, -20, 0, -20, 0, 0, -20, 0, 0, 0, 0, -20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -20, -20, -20, 0, 0, // State 101 - 0, 0, 0, 0, 0, -27, 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, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -22, 0, 0, -22, 0, 0, 0, 0, -22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -22, -22, -22, 0, 0, // State 102 - 0, -53, -53, -53, -53, -53, -53, -53, -53, -53, 0, -53, 0, -53, -53, -53, 0, -53, -53, -53, 0, 0, 0, -53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -53, -53, -53, 0, 0, + 0, -24, -24, -24, 0, -24, -24, -24, -24, -24, 0, -24, 0, -24, -24, -24, 0, -24, -24, -24, 0, 0, 0, 0, -24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -24, -24, -24, 0, 0, // State 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, 0, 0, + 0, -26, 0, -26, 0, -26, 0, 0, -26, 0, 0, 0, 0, -26, -26, -26, 0, -26, -26, -26, 0, 0, 0, 0, -26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -26, -26, -26, 0, 0, // State 104 - 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 105 - 0, -54, -54, -54, 0, -54, -54, -54, -54, -54, 0, -54, 0, -54, -54, -54, 0, -54, -54, -54, 0, 0, 0, -54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -54, -54, -54, 0, 0, + 0, 0, 0, 0, 0, -30, 0, 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, 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 106 - 0, 0, 0, 0, 0, -29, 0, 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, 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, -57, -57, -57, -57, -57, -57, -57, -57, 0, -57, 0, -57, -57, -57, 0, -57, -57, -57, 0, 0, 0, 0, -57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -57, -57, -57, 0, 0, // State 107 - 0, -56, -56, -56, 0, -56, -56, -56, -56, -56, 0, -56, 0, -56, -56, -56, 0, -56, -56, -56, 0, 0, 0, -56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -56, -56, -56, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 117, 0, 0, // State 108 - -4, 0, 0, 0, -4, -4, 0, 0, 0, -4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4, 0, -4, 0, -4, -4, -4, -4, -4, -4, 0, 0, 0, 0, -4, -4, + 0, 0, 0, 0, 0, 118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 115, 0, 0, + 0, -58, -58, -58, 0, -58, -58, -58, -58, -58, 0, -58, 0, -58, -58, -58, 0, -58, -58, -58, 0, 0, 0, 0, -58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -58, -58, -58, 0, 0, // State 110 - 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, 0, + 0, 0, 0, 0, 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, // State 111 - 0, 0, 0, 0, 0, -64, 0, 0, -64, 0, 0, 0, 0, 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, 0, 0, + 0, 0, 0, 0, 0, -32, 0, 0, 119, 0, 0, 0, 0, 0, 0, 0, 0, 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 112 - 0, -55, -55, -55, 0, -55, -55, -55, -55, -55, 0, -55, 0, -55, -55, -55, 0, -55, -55, -55, 0, 0, 0, -55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -55, -55, -55, 0, 0, + 0, -60, -60, -60, 0, -60, -60, -60, -60, -60, 0, -60, 0, -60, -60, -60, 0, -60, -60, -60, 0, 0, 0, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -60, -60, -60, 0, 0, // State 113 - -5, 0, 0, 0, -5, -5, 0, 0, 0, -5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -5, 0, -5, 0, -5, -5, -5, -5, -5, -5, 0, 0, 0, 0, -5, -5, + -7, 0, 0, 0, -7, -7, 0, 0, 0, -7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -7, 0, -7, 0, -7, -7, -7, -7, -7, -7, -7, 0, 0, 0, -7, -7, // State 114 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 0, 0, // State 115 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 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, 0, 0, // State 116 - 0, 0, 0, 0, 0, -62, 0, 0, -62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -62, 0, 0, + 0, 0, 0, 0, 0, -68, 0, 0, -68, 0, 0, 0, 0, 0, 0, 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, 0, // State 117 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 119, 0, 0, + 0, -59, -59, -59, 0, -59, -59, -59, -59, -59, 0, -59, 0, -59, -59, -59, 0, -59, -59, -59, 0, 0, 0, 0, -59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -59, -59, -59, 0, 0, // State 118 - 0, 0, 0, 0, 0, -63, 0, 0, -63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -63, 0, 0, + -8, 0, 0, 0, -8, -8, 0, 0, 0, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -8, 0, -8, 0, -8, -8, -8, -8, -8, -8, -8, 0, 0, 0, -8, -8, + // State 119 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // State 120 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, + // State 121 + 0, 0, 0, 0, 0, -66, 0, 0, -66, 0, 0, 0, 0, 0, 0, 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, 0, + // State 122 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 0, 0, + // State 123 + 0, 0, 0, 0, 0, -67, 0, 0, -67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -67, 0, 0, ]; fn __action(state: i8, integer: usize) -> i8 { - __ACTION[(state as usize) * 40 + integer] + __ACTION[(state as usize) * 41 + integer] } const __EOF_ACTION: &[i8] = &[ // State 0 - -82, + -87, // State 1 - -83, + -88, // State 2 0, // State 3 @@ -357,15 +368,15 @@ mod __parse__Program { // State 32 0, // State 33 - -44, + 0, // State 34 - -41, + -47, // State 35 - -90, + -44, // State 36 - -45, + -96, // State 37 - 0, + -48, // State 38 0, // State 39 @@ -465,13 +476,13 @@ mod __parse__Program { // State 86 0, // State 87 - -71, + 0, // State 88 0, // State 89 0, // State 90 - 0, + -76, // State 91 0, // State 92 @@ -511,7 +522,7 @@ mod __parse__Program { // State 109 0, // State 110 - 0, + -75, // State 111 0, // State 112 @@ -528,96 +539,107 @@ mod __parse__Program { 0, // State 118 0, + // State 119 + 0, + // State 120 + 0, + // State 121 + 0, + // State 122 + 0, + // State 123 + 0, ]; fn __goto(state: i8, nt: usize) -> i8 { match nt { - 2 => 28, - 5 => 4, - 6 => 19, - 7 => 8, - 8 => 9, - 9 => 10, - 10 => 11, - 11 => 12, - 12 => 13, - 13 => 51, - 14 => 100, - 15 => 39, - 16 => 20, - 17 => match state { - 1 => 36, - _ => 33, - }, - 19 => 1, - 20 => match state { - 15 => 89, - 16 => 90, - 25 => 101, - 27 => 104, - 28 => 106, - 29 => 109, - 32 => 117, - _ => 52, + 4 => 29, + 7 => 4, + 8 => 20, + 9 => 8, + 10 => 9, + 11 => 10, + 12 => 11, + 13 => 12, + 14 => 13, + 15 => 53, + 16 => 104, + 17 => 40, + 18 => 21, + 19 => match state { + 1 => 37, + _ => 34, }, + 21 => 1, 22 => match state { - 24 => 99, - _ => 53, - }, - 23 => 54, - 24 => 55, - 25 => match state { - 21 => 96, - _ => 56, + 15 => 92, + 16 => 93, + 19 => 97, + 26 => 105, + 28 => 108, + 29 => 111, + 30 => 114, + 33 => 122, + _ => 54, }, - 26 => match state { - 22 => 97, - _ => 57, + 24 => match state { + 25 => 103, + _ => 55, }, + 25 => 56, + 26 => 57, 27 => match state { - 17 => 91, - 30 => 110, + 22 => 100, _ => 58, }, 28 => match state { - 19 => 94, + 23 => 101, _ => 59, }, 29 => match state { - 26 => 103, - 31 => 116, + 17 => 94, + 31 => 115, _ => 60, }, 30 => match state { - 14 => 88, - 23 => 98, + 20 => 98, _ => 61, }, 31 => match state { - 20 => 95, + 27 => 107, + 32 => 121, _ => 62, }, - 32 => 34, - 33 => match state { - 2 => 37, - 3..=4 => 40, - 18 => 92, + 32 => match state { + 14 => 91, + 24 => 102, _ => 63, }, - 34 => 21, - 35 => 22, - 36 => 23, - 37 => 64, - 38 => match state { - 4 => 42, - _ => 41, + 33 => match state { + 21 => 99, + _ => 64, + }, + 34 => 35, + 35 => match state { + 2 => 38, + 3..=4 => 41, + 18 => 95, + _ => 65, + }, + 36 => 22, + 37 => 23, + 38 => 24, + 39 => 66, + 40 => match state { + 4 => 43, + _ => 42, }, - 40 => 35, - 41 => match state { - 6 => 50, - _ => 46, + 42 => 36, + 43 => match state { + 6 => 52, + _ => 47, }, - 42 => 14, - 43 => 24, + 44 => 14, + 45 => 25, _ => 0, } } @@ -644,6 +666,7 @@ mod __parse__Program { r###"">=""###, r###""Bool""###, r###""Int""###, + r###""Never""###, r###""Unit""###, r###""^""###, r###""break""###, @@ -730,7 +753,7 @@ mod __parse__Program { #[inline] fn error_action(&self, state: i8) -> i8 { - __action(state, 40 - 1) + __action(state, 41 - 1) } #[inline] @@ -835,8 +858,9 @@ mod __parse__Program { Token(38, _) if true => Some(35), Token(39, _) if true => Some(36), Token(40, _) if true => Some(37), - Token(0, _) if true => Some(38), - Token(1, _) if true => Some(39), + Token(41, _) if true => Some(38), + Token(0, _) if true => Some(39), + Token(1, _) if true => Some(40), _ => None, } } @@ -849,8 +873,8 @@ mod __parse__Program { ) -> __Symbol<'input> { #[allow(clippy::manual_range_patterns)]match __token_index { - 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 => match __token { - Token(3, __tok0) | Token(4, __tok0) | Token(5, __tok0) | Token(6, __tok0) | Token(7, __tok0) | Token(8, __tok0) | Token(9, __tok0) | Token(10, __tok0) | Token(11, __tok0) | Token(12, __tok0) | Token(13, __tok0) | Token(14, __tok0) | Token(15, __tok0) | Token(16, __tok0) | Token(17, __tok0) | Token(18, __tok0) | Token(19, __tok0) | Token(20, __tok0) | Token(21, __tok0) | Token(22, __tok0) | Token(23, __tok0) | Token(24, __tok0) | Token(25, __tok0) | Token(26, __tok0) | Token(27, __tok0) | Token(28, __tok0) | Token(29, __tok0) | Token(30, __tok0) | Token(31, __tok0) | Token(32, __tok0) | Token(33, __tok0) | Token(34, __tok0) | Token(35, __tok0) | Token(36, __tok0) | Token(37, __tok0) | Token(38, __tok0) | Token(39, __tok0) | Token(40, __tok0) | Token(0, __tok0) | Token(1, __tok0) if true => __Symbol::Variant0(__tok0), + 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 => match __token { + Token(3, __tok0) | Token(4, __tok0) | Token(5, __tok0) | Token(6, __tok0) | Token(7, __tok0) | Token(8, __tok0) | Token(9, __tok0) | Token(10, __tok0) | Token(11, __tok0) | Token(12, __tok0) | Token(13, __tok0) | Token(14, __tok0) | Token(15, __tok0) | Token(16, __tok0) | Token(17, __tok0) | Token(18, __tok0) | Token(19, __tok0) | Token(20, __tok0) | Token(21, __tok0) | Token(22, __tok0) | Token(23, __tok0) | Token(24, __tok0) | Token(25, __tok0) | Token(26, __tok0) | Token(27, __tok0) | Token(28, __tok0) | Token(29, __tok0) | Token(30, __tok0) | Token(31, __tok0) | Token(32, __tok0) | Token(33, __tok0) | Token(34, __tok0) | Token(35, __tok0) | Token(36, __tok0) | Token(37, __tok0) | Token(38, __tok0) | Token(39, __tok0) | Token(40, __tok0) | Token(41, __tok0) | Token(0, __tok0) | Token(1, __tok0) if true => __Symbol::Variant0(__tok0), _ => unreachable!(), }, _ => unreachable!(), @@ -872,13 +896,13 @@ mod __parse__Program { } 1 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, + states_to_pop: 2, nonterminal_produced: 1, } } 2 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 0, nonterminal_produced: 1, } } @@ -890,25 +914,25 @@ mod __parse__Program { } 4 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 2, + states_to_pop: 0, + nonterminal_produced: 3, } } 5 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, + states_to_pop: 1, nonterminal_produced: 3, } } 6 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, + states_to_pop: 2, nonterminal_produced: 4, } } 7 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 3, nonterminal_produced: 4, } } @@ -920,8 +944,8 @@ mod __parse__Program { } 9 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 5, + states_to_pop: 0, + nonterminal_produced: 6, } } 10 => { @@ -932,8 +956,8 @@ mod __parse__Program { } 11 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 6, + states_to_pop: 2, + nonterminal_produced: 7, } } 12 => { @@ -945,69 +969,69 @@ mod __parse__Program { 13 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 7, - } - } - 14 => { - __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, nonterminal_produced: 8, } } - 15 => { + 14 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, nonterminal_produced: 8, } } - 16 => { + 15 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 3, nonterminal_produced: 9, } } - 17 => { + 16 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, nonterminal_produced: 9, } } - 18 => { + 17 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 3, nonterminal_produced: 10, } } - 19 => { + 18 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, nonterminal_produced: 10, } } - 20 => { + 19 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 3, nonterminal_produced: 11, } } - 21 => { + 20 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, nonterminal_produced: 11, } } - 22 => { + 21 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 3, nonterminal_produced: 12, } } - 23 => { + 22 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, nonterminal_produced: 12, } } + 23 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 13, + } + } 24 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, @@ -1016,8 +1040,8 @@ mod __parse__Program { } 25 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 13, + states_to_pop: 3, + nonterminal_produced: 14, } } 26 => { @@ -1028,91 +1052,91 @@ mod __parse__Program { } 27 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 14, + states_to_pop: 1, + nonterminal_produced: 15, } } 28 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 14, + states_to_pop: 1, + nonterminal_produced: 15, } } 29 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 14, + nonterminal_produced: 16, } } 30 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 15, + states_to_pop: 0, + nonterminal_produced: 16, } } 31 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 15, + states_to_pop: 2, + nonterminal_produced: 16, } } 32 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 15, + states_to_pop: 1, + nonterminal_produced: 16, } } 33 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 15, + nonterminal_produced: 17, } } 34 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 16, + states_to_pop: 0, + nonterminal_produced: 17, } } 35 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 16, + states_to_pop: 2, + nonterminal_produced: 17, } } 36 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 16, + nonterminal_produced: 17, } } 37 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 16, + nonterminal_produced: 18, } } 38 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 16, + nonterminal_produced: 18, } } 39 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 16, + nonterminal_produced: 18, } } 40 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 17, + nonterminal_produced: 18, } } 41 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, + states_to_pop: 1, nonterminal_produced: 18, } } @@ -1130,8 +1154,8 @@ mod __parse__Program { } 44 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 19, + states_to_pop: 0, + nonterminal_produced: 20, } } 45 => { @@ -1148,7 +1172,7 @@ mod __parse__Program { } 47 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, + states_to_pop: 2, nonterminal_produced: 21, } } @@ -1166,116 +1190,116 @@ mod __parse__Program { } 50 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 0, nonterminal_produced: 23, } } 51 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 23, + nonterminal_produced: 24, } } 52 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 23, + states_to_pop: 1, + nonterminal_produced: 25, } } 53 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 24, + states_to_pop: 1, + nonterminal_produced: 25, } } 54 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 24, + states_to_pop: 1, + nonterminal_produced: 25, } } 55 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 24, + states_to_pop: 1, + nonterminal_produced: 25, } } 56 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 24, + states_to_pop: 3, + nonterminal_produced: 25, } } 57 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 25, + states_to_pop: 3, + nonterminal_produced: 26, } } 58 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 4, nonterminal_produced: 26, } } 59 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 27, + states_to_pop: 4, + nonterminal_produced: 26, } } 60 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 28, + nonterminal_produced: 26, } } 61 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 29, + states_to_pop: 1, + nonterminal_produced: 27, } } 62 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 9, - nonterminal_produced: 29, + states_to_pop: 1, + nonterminal_produced: 28, } } 63 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, + states_to_pop: 1, nonterminal_produced: 29, } } 64 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 29, + states_to_pop: 1, + nonterminal_produced: 30, } } 65 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 29, + states_to_pop: 6, + nonterminal_produced: 31, } } 66 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 29, + states_to_pop: 9, + nonterminal_produced: 31, } } 67 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 30, + states_to_pop: 4, + nonterminal_produced: 31, } } 68 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 30, + states_to_pop: 2, + nonterminal_produced: 31, } } 69 => { @@ -1286,86 +1310,86 @@ mod __parse__Program { } 70 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 10, - nonterminal_produced: 32, + states_to_pop: 1, + nonterminal_produced: 31, } } 71 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 33, + states_to_pop: 2, + nonterminal_produced: 32, } } 72 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 34, + nonterminal_produced: 32, } } 73 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 35, + nonterminal_produced: 33, } } 74 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 36, + states_to_pop: 10, + nonterminal_produced: 34, } } 75 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 36, + states_to_pop: 8, + nonterminal_produced: 34, } } 76 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 36, + nonterminal_produced: 35, } } 77 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 37, + nonterminal_produced: 36, } } 78 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 38, + states_to_pop: 1, + nonterminal_produced: 37, } } 79 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 39, + nonterminal_produced: 38, } } 80 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 39, + states_to_pop: 1, + nonterminal_produced: 38, } } 81 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 40, + states_to_pop: 1, + nonterminal_produced: 38, } } 82 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 40, + nonterminal_produced: 39, } } 83 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 41, + states_to_pop: 3, + nonterminal_produced: 40, } } 84 => { @@ -1376,13 +1400,13 @@ mod __parse__Program { } 85 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 0, nonterminal_produced: 41, } } 86 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 0, nonterminal_produced: 42, } } @@ -1398,26 +1422,62 @@ mod __parse__Program { nonterminal_produced: 43, } } - 89 => __state_machine::SimulatedReduce::Accept, - _ => panic!("invalid reduction index {}", __reduce_index) - } - } - pub struct ProgramParser { - builder: __lalrpop_util::lexer::MatcherBuilder, - _priv: (), - } - - impl Default for ProgramParser { fn default() -> Self { Self::new() } } - impl ProgramParser { - pub fn new() -> ProgramParser { - let __builder = super::__intern_token::new_builder(); - ProgramParser { - builder: __builder, - _priv: (), - } - } - - #[allow(dead_code)] + 89 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 43, + } + } + 90 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 43, + } + } + 91 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 43, + } + } + 92 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 44, + } + } + 93 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 44, + } + } + 94 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 45, + } + } + 95 => __state_machine::SimulatedReduce::Accept, + _ => panic!("invalid reduction index {}", __reduce_index) + } + } + pub struct ProgramParser { + builder: __lalrpop_util::lexer::MatcherBuilder, + _priv: (), + } + + impl Default for ProgramParser { fn default() -> Self { Self::new() } } + impl ProgramParser { + pub fn new() -> ProgramParser { + let __builder = super::__intern_token::new_builder(); + ProgramParser { + builder: __builder, + _priv: (), + } + } + + #[allow(dead_code)] pub fn parse< 'input, >( @@ -1748,8 +1808,26 @@ mod __parse__Program { __reduce88(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) } 89 => { + __reduce89(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 90 => { + __reduce90(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 91 => { + __reduce91(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 92 => { + __reduce92(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 93 => { + __reduce93(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 94 => { + __reduce94(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 95 => { // __Program = Program => ActionFn(0); - let __sym0 = __pop_Variant14(__symbols); + let __sym0 = __pop_Variant16(__symbols); let __start = __sym0.0; let __end = __sym0.2; let __nt = super::__action0::<>(input, __sym0); @@ -1768,168 +1846,179 @@ mod __parse__Program { fn __symbol_type_mismatch() -> ! { panic!("symbol type mismatch") } - fn __pop_Variant3< + fn __pop_Variant5< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, (&'input str, Type), usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant3(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant5(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant9< + fn __pop_Variant11< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, Def<&'input str>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant9(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant11(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant1< + fn __pop_Variant3< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, Expr<&'input str>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant1(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant3(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant5< + fn __pop_Variant7< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, Op, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant5(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant7(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant14< + fn __pop_Variant16< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, PrgParsed<'input>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant14(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant16(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant15< + fn __pop_Variant1< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, Type, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant15(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant1(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant8< + fn __pop_Variant10< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, Vec<(&'input str, Type)>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant8(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant10(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant7< + fn __pop_Variant9< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, Vec>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant7(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant9(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant4< + fn __pop_Variant6< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, alloc::vec::Vec<(&'input str, Type)>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant4(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant6(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant10< + fn __pop_Variant12< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, alloc::vec::Vec>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant10(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant12(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant2< + fn __pop_Variant4< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, alloc::vec::Vec>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant2(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant4(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant6< + fn __pop_Variant8< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, bool, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant6(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant8(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant13< + fn __pop_Variant15< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, core::option::Option<(&'input str, Type)>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant13(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant15(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant11< + fn __pop_Variant13< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, core::option::Option>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant11(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant13(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant12< + fn __pop_Variant2< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, core::option::Option, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant2(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant14< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, i64, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant12(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant14(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } @@ -1953,13 +2042,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",") = Expr, "," => ActionFn(77); + // ("->" ) = "->", Type => ActionFn(69); assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant1(__symbols); + let __sym1 = __pop_Variant1(__symbols); + let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym1.2; - let __nt = super::__action77::<>(input, __sym0, __sym1); + let __nt = super::__action69::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); (2, 0) } @@ -1972,12 +2061,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")* = => ActionFn(75); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); - let __end = __start; - let __nt = super::__action75::<>(input, &__start, &__end); + // ("->" )? = "->", Type => ActionFn(87); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant1(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0; + let __end = __sym1.2; + let __nt = super::__action87::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant2(__nt), __end)); - (0, 1) + (2, 1) } fn __reduce2< 'input, @@ -1988,13 +2080,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")* = ( ",")+ => ActionFn(76); - let __sym0 = __pop_Variant2(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action76::<>(input, __sym0); + // ("->" )? = => ActionFn(68); + let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); + let __end = __start; + let __nt = super::__action68::<>(input, &__start, &__end); __symbols.push((__start, __Symbol::Variant2(__nt), __end)); - (1, 1) + (0, 1) } fn __reduce3< 'input, @@ -2005,14 +2096,14 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")+ = Expr, "," => ActionFn(82); + // ( ",") = Expr, "," => ActionFn(82); assert!(__symbols.len() >= 2); let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant1(__symbols); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym1.2; let __nt = super::__action82::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); (2, 2) } fn __reduce4< @@ -2024,16 +2115,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")+ = ( ",")+, Expr, "," => ActionFn(83); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant1(__symbols); - let __sym0 = __pop_Variant2(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action83::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant2(__nt), __end)); - (3, 2) + // ( ",")* = => ActionFn(80); + let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); + let __end = __start; + let __nt = super::__action80::<>(input, &__start, &__end); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (0, 3) } fn __reduce5< 'input, @@ -2044,15 +2131,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",") = Param, "," => ActionFn(74); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant3(__symbols); + // ( ",")* = ( ",")+ => ActionFn(81); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action74::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (2, 3) + let __end = __sym0.2; + let __nt = super::__action81::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 3) } fn __reduce6< 'input, @@ -2063,12 +2148,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")* = => ActionFn(72); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); - let __end = __start; - let __nt = super::__action72::<>(input, &__start, &__end); + // ( ",")+ = Expr, "," => ActionFn(90); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant3(__symbols); + let __start = __sym0.0; + let __end = __sym1.2; + let __nt = super::__action90::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant4(__nt), __end)); - (0, 4) + (2, 4) } fn __reduce7< 'input, @@ -2079,13 +2167,16 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")* = ( ",")+ => ActionFn(73); + // ( ",")+ = ( ",")+, Expr, "," => ActionFn(91); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant3(__symbols); let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action73::<>(input, __sym0); + let __end = __sym2.2; + let __nt = super::__action91::<>(input, __sym0, __sym1, __sym2); __symbols.push((__start, __Symbol::Variant4(__nt), __end)); - (1, 4) + (3, 4) } fn __reduce8< 'input, @@ -2096,14 +2187,14 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")+ = Param, "," => ActionFn(86); + // ( ",") = Param, "," => ActionFn(79); assert!(__symbols.len() >= 2); let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant3(__symbols); + let __sym0 = __pop_Variant5(__symbols); let __start = __sym0.0; let __end = __sym1.2; - let __nt = super::__action86::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + let __nt = super::__action79::<>(input, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); (2, 5) } fn __reduce9< @@ -2115,16 +2206,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")+ = ( ",")+, Param, "," => ActionFn(87); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant3(__symbols); - let __sym0 = __pop_Variant4(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action87::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant4(__nt), __end)); - (3, 5) + // ( ",")* = => ActionFn(77); + let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); + let __end = __start; + let __nt = super::__action77::<>(input, &__start, &__end); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (0, 6) } fn __reduce10< 'input, @@ -2135,12 +2222,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // AdditiveOp = "+" => ActionFn(29); - let __sym0 = __pop_Variant0(__symbols); + // ( ",")* = ( ",")+ => ActionFn(78); + let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action29::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + let __nt = super::__action78::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); (1, 6) } fn __reduce11< @@ -2152,13 +2239,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // AdditiveOp = "-" => ActionFn(30); - let __sym0 = __pop_Variant0(__symbols); + // ( ",")+ = Param, "," => ActionFn(94); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant5(__symbols); let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action30::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 6) + let __end = __sym1.2; + let __nt = super::__action94::<>(input, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (2, 7) } fn __reduce12< 'input, @@ -2169,15 +2258,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = BinaryOps, AdditiveOp, ExprMultiplicative => ActionFn(53); + // ( ",")+ = ( ",")+, Param, "," => ActionFn(95); assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant1(__symbols); + let __sym2 = __pop_Variant0(__symbols); let __sym1 = __pop_Variant5(__symbols); - let __sym0 = __pop_Variant1(__symbols); + let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action53::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + let __nt = super::__action95::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); (3, 7) } fn __reduce13< @@ -2189,13 +2278,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = ExprMultiplicative => ActionFn(54); - let __sym0 = __pop_Variant1(__symbols); + // AdditiveOp = "+" => ActionFn(30); + let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action54::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (1, 7) + let __nt = super::__action30::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 8) } fn __reduce14< 'input, @@ -2206,35 +2295,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = BinaryOps, ComparativeOp, ExprXor => ActionFn(57); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant1(__symbols); - let __sym1 = __pop_Variant5(__symbols); - let __sym0 = __pop_Variant1(__symbols); - let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action57::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (3, 8) - } - fn __reduce15< - 'input, - >( - input: &'input str, - __lookahead_start: Option<&usize>, - __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, - _: core::marker::PhantomData<(&'input ())>, - ) -> (usize, usize) - { - // BinaryOps = ExprXor => ActionFn(58); - let __sym0 = __pop_Variant1(__symbols); + // AdditiveOp = "-" => ActionFn(31); + let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action58::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + let __nt = super::__action31::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); (1, 8) } - fn __reduce16< + fn __reduce15< 'input, >( input: &'input str, @@ -2243,18 +2312,18 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = BinaryOps, LogicalAndOp, ExprComparative => ActionFn(59); + // BinaryOps = BinaryOps, AdditiveOp, ExprMultiplicative => ActionFn(55); assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant1(__symbols); - let __sym1 = __pop_Variant5(__symbols); - let __sym0 = __pop_Variant1(__symbols); + let __sym2 = __pop_Variant3(__symbols); + let __sym1 = __pop_Variant7(__symbols); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action59::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + let __nt = super::__action55::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); (3, 9) } - fn __reduce17< + fn __reduce16< 'input, >( input: &'input str, @@ -2263,15 +2332,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = ExprComparative => ActionFn(60); - let __sym0 = __pop_Variant1(__symbols); + // BinaryOps = ExprMultiplicative => ActionFn(56); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action60::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + let __nt = super::__action56::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); (1, 9) } - fn __reduce18< + fn __reduce17< 'input, >( input: &'input str, @@ -2280,18 +2349,18 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = BinaryOps, LogicalOrOp, ExprLogicalAnd => ActionFn(61); + // BinaryOps = BinaryOps, ComparativeOp, ExprXor => ActionFn(59); assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant1(__symbols); - let __sym1 = __pop_Variant5(__symbols); - let __sym0 = __pop_Variant1(__symbols); + let __sym2 = __pop_Variant3(__symbols); + let __sym1 = __pop_Variant7(__symbols); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action61::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + let __nt = super::__action59::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); (3, 10) } - fn __reduce19< + fn __reduce18< 'input, >( input: &'input str, @@ -2300,15 +2369,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = ExprLogicalAnd => ActionFn(62); - let __sym0 = __pop_Variant1(__symbols); + // BinaryOps = ExprXor => ActionFn(60); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action62::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + let __nt = super::__action60::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); (1, 10) } - fn __reduce20< + fn __reduce19< 'input, >( input: &'input str, @@ -2317,18 +2386,18 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = BinaryOps, MultiplicativeOp, ExprUnary => ActionFn(51); + // BinaryOps = BinaryOps, LogicalAndOp, ExprComparative => ActionFn(61); assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant1(__symbols); - let __sym1 = __pop_Variant5(__symbols); - let __sym0 = __pop_Variant1(__symbols); + let __sym2 = __pop_Variant3(__symbols); + let __sym1 = __pop_Variant7(__symbols); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action51::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + let __nt = super::__action61::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); (3, 11) } - fn __reduce21< + fn __reduce20< 'input, >( input: &'input str, @@ -2337,15 +2406,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = ExprUnary => ActionFn(52); - let __sym0 = __pop_Variant1(__symbols); + // BinaryOps = ExprComparative => ActionFn(62); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action52::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + let __nt = super::__action62::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); (1, 11) } - fn __reduce22< + fn __reduce21< 'input, >( input: &'input str, @@ -2354,18 +2423,18 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = BinaryOps, XorOp, ExprAdditive => ActionFn(55); + // BinaryOps = BinaryOps, LogicalOrOp, ExprLogicalAnd => ActionFn(63); assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant1(__symbols); - let __sym1 = __pop_Variant5(__symbols); - let __sym0 = __pop_Variant1(__symbols); + let __sym2 = __pop_Variant3(__symbols); + let __sym1 = __pop_Variant7(__symbols); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action55::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + let __nt = super::__action63::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); (3, 12) } - fn __reduce23< + fn __reduce22< 'input, >( input: &'input str, @@ -2374,14 +2443,34 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = ExprAdditive => ActionFn(56); - let __sym0 = __pop_Variant1(__symbols); + // BinaryOps = ExprLogicalAnd => ActionFn(64); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action56::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + let __nt = super::__action64::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); (1, 12) } + fn __reduce23< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // BinaryOps = BinaryOps, MultiplicativeOp, ExprUnary => ActionFn(53); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant3(__symbols); + let __sym1 = __pop_Variant7(__symbols); + let __sym0 = __pop_Variant3(__symbols); + let __start = __sym0.0; + let __end = __sym2.2; + let __nt = super::__action53::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (3, 13) + } fn __reduce24< 'input, >( @@ -2391,12 +2480,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Bool = "true" => ActionFn(48); - let __sym0 = __pop_Variant0(__symbols); + // BinaryOps = ExprUnary => ActionFn(54); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action48::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + let __nt = super::__action54::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); (1, 13) } fn __reduce25< @@ -2408,13 +2497,16 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Bool = "false" => ActionFn(49); - let __sym0 = __pop_Variant0(__symbols); + // BinaryOps = BinaryOps, XorOp, ExprAdditive => ActionFn(57); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant3(__symbols); + let __sym1 = __pop_Variant7(__symbols); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action49::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant6(__nt), __end)); - (1, 13) + let __end = __sym2.2; + let __nt = super::__action57::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (3, 14) } fn __reduce26< 'input, @@ -2425,12 +2517,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = Expr => ActionFn(92); - let __sym0 = __pop_Variant1(__symbols); + // BinaryOps = ExprAdditive => ActionFn(58); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action92::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + let __nt = super::__action58::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); (1, 14) } fn __reduce27< @@ -2442,12 +2534,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = => ActionFn(93); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); - let __end = __start; - let __nt = super::__action93::<>(input, &__start, &__end); - __symbols.push((__start, __Symbol::Variant7(__nt), __end)); - (0, 14) + // Bool = "true" => ActionFn(50); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0; + let __end = __sym0.2; + let __nt = super::__action50::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (1, 15) } fn __reduce28< 'input, @@ -2458,15 +2551,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = ( ",")+, Expr => ActionFn(94); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant1(__symbols); - let __sym0 = __pop_Variant2(__symbols); + // Bool = "false" => ActionFn(51); + let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action94::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant7(__nt), __end)); - (2, 14) + let __end = __sym0.2; + let __nt = super::__action51::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (1, 15) } fn __reduce29< 'input, @@ -2477,13 +2568,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = ( ",")+ => ActionFn(95); - let __sym0 = __pop_Variant2(__symbols); + // Comma = Expr => ActionFn(100); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action95::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant7(__nt), __end)); - (1, 14) + let __nt = super::__action100::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant9(__nt), __end)); + (1, 16) } fn __reduce30< 'input, @@ -2494,13 +2585,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = Param => ActionFn(98); - let __sym0 = __pop_Variant3(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action98::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (1, 15) + // Comma = => ActionFn(101); + let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); + let __end = __start; + let __nt = super::__action101::<>(input, &__start, &__end); + __symbols.push((__start, __Symbol::Variant9(__nt), __end)); + (0, 16) } fn __reduce31< 'input, @@ -2511,12 +2601,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = => ActionFn(99); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); - let __end = __start; - let __nt = super::__action99::<>(input, &__start, &__end); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (0, 15) + // Comma = ( ",")+, Expr => ActionFn(102); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant3(__symbols); + let __sym0 = __pop_Variant4(__symbols); + let __start = __sym0.0; + let __end = __sym1.2; + let __nt = super::__action102::<>(input, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant9(__nt), __end)); + (2, 16) } fn __reduce32< 'input, @@ -2527,15 +2620,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = ( ",")+, Param => ActionFn(100); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant3(__symbols); + // Comma = ( ",")+ => ActionFn(103); let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action100::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (2, 15) + let __end = __sym0.2; + let __nt = super::__action103::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant9(__nt), __end)); + (1, 16) } fn __reduce33< 'input, @@ -2546,13 +2637,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = ( ",")+ => ActionFn(101); - let __sym0 = __pop_Variant4(__symbols); + // Comma = Param => ActionFn(106); + let __sym0 = __pop_Variant5(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action101::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (1, 15) + let __nt = super::__action106::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant10(__nt), __end)); + (1, 17) } fn __reduce34< 'input, @@ -2563,13 +2654,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ComparativeOp = "==" => ActionFn(22); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action22::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 16) + // Comma = => ActionFn(107); + let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); + let __end = __start; + let __nt = super::__action107::<>(input, &__start, &__end); + __symbols.push((__start, __Symbol::Variant10(__nt), __end)); + (0, 17) } fn __reduce35< 'input, @@ -2580,13 +2670,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ComparativeOp = "!=" => ActionFn(23); - let __sym0 = __pop_Variant0(__symbols); + // Comma = ( ",")+, Param => ActionFn(108); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant5(__symbols); + let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action23::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 16) + let __end = __sym1.2; + let __nt = super::__action108::<>(input, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant10(__nt), __end)); + (2, 17) } fn __reduce36< 'input, @@ -2597,13 +2689,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ComparativeOp = ">" => ActionFn(24); - let __sym0 = __pop_Variant0(__symbols); + // Comma = ( ",")+ => ActionFn(109); + let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action24::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 16) + let __nt = super::__action109::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant10(__nt), __end)); + (1, 17) } fn __reduce37< 'input, @@ -2614,13 +2706,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ComparativeOp = ">=" => ActionFn(25); + // ComparativeOp = "==" => ActionFn(23); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action25::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 16) + let __nt = super::__action23::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 18) } fn __reduce38< 'input, @@ -2631,13 +2723,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ComparativeOp = "<" => ActionFn(26); + // ComparativeOp = "!=" => ActionFn(24); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action26::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 16) + let __nt = super::__action24::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 18) } fn __reduce39< 'input, @@ -2648,13 +2740,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ComparativeOp = "<=" => ActionFn(27); + // ComparativeOp = ">" => ActionFn(25); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action27::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 16) + let __nt = super::__action25::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 18) } fn __reduce40< 'input, @@ -2665,13 +2757,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Def = Fn => ActionFn(2); - let __sym0 = __pop_Variant9(__symbols); + // ComparativeOp = ">=" => ActionFn(26); + let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action2::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant9(__nt), __end)); - (1, 17) + let __nt = super::__action26::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 18) } fn __reduce41< 'input, @@ -2682,12 +2774,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Def* = => ActionFn(66); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); - let __end = __start; - let __nt = super::__action66::<>(input, &__start, &__end); - __symbols.push((__start, __Symbol::Variant10(__nt), __end)); - (0, 18) + // ComparativeOp = "<" => ActionFn(27); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0; + let __end = __sym0.2; + let __nt = super::__action27::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 18) } fn __reduce42< 'input, @@ -2698,12 +2791,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Def* = Def+ => ActionFn(67); - let __sym0 = __pop_Variant10(__symbols); + // ComparativeOp = "<=" => ActionFn(28); + let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action67::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant10(__nt), __end)); + let __nt = super::__action28::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); (1, 18) } fn __reduce43< @@ -2715,12 +2808,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Def+ = Def => ActionFn(68); - let __sym0 = __pop_Variant9(__symbols); + // Def = Fn => ActionFn(2); + let __sym0 = __pop_Variant11(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action68::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant10(__nt), __end)); + let __nt = super::__action2::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant11(__nt), __end)); (1, 19) } fn __reduce44< @@ -2732,15 +2825,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Def+ = Def+, Def => ActionFn(69); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant9(__symbols); - let __sym0 = __pop_Variant10(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action69::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant10(__nt), __end)); - (2, 19) + // Def* = => ActionFn(71); + let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); + let __end = __start; + let __nt = super::__action71::<>(input, &__start, &__end); + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + (0, 20) } fn __reduce45< 'input, @@ -2751,12 +2841,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Expr = ExprStmt => ActionFn(8); - let __sym0 = __pop_Variant1(__symbols); + // Def* = Def+ => ActionFn(72); + let __sym0 = __pop_Variant12(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action8::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + let __nt = super::__action72::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); (1, 20) } fn __reduce46< @@ -2768,12 +2858,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Expr? = Expr => ActionFn(63); - let __sym0 = __pop_Variant1(__symbols); + // Def+ = Def => ActionFn(73); + let __sym0 = __pop_Variant11(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action63::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); + let __nt = super::__action73::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); (1, 21) } fn __reduce47< @@ -2785,12 +2875,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Expr? = => ActionFn(64); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); - let __end = __start; - let __nt = super::__action64::<>(input, &__start, &__end); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (0, 21) + // Def+ = Def+, Def => ActionFn(74); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant11(__symbols); + let __sym0 = __pop_Variant12(__symbols); + let __start = __sym0.0; + let __end = __sym1.2; + let __nt = super::__action74::<>(input, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + (2, 21) } fn __reduce48< 'input, @@ -2801,12 +2894,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprAdditive = BinaryOps => ActionFn(18); - let __sym0 = __pop_Variant1(__symbols); + // Expr = ExprStmt => ActionFn(9); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action18::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + let __nt = super::__action9::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); (1, 22) } fn __reduce49< @@ -2818,12 +2911,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprAtom = Num => ActionFn(42); - let __sym0 = __pop_Variant12(__symbols); + // Expr? = Expr => ActionFn(65); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action42::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + let __nt = super::__action65::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant13(__nt), __end)); (1, 23) } fn __reduce50< @@ -2835,15 +2928,48 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprAtom = Bool => ActionFn(43); - let __sym0 = __pop_Variant6(__symbols); + // Expr? = => ActionFn(66); + let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); + let __end = __start; + let __nt = super::__action66::<>(input, &__start, &__end); + __symbols.push((__start, __Symbol::Variant13(__nt), __end)); + (0, 23) + } + fn __reduce51< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ExprAdditive = BinaryOps => ActionFn(19); + let __sym0 = __pop_Variant3(__symbols); + let __start = __sym0.0; + let __end = __sym0.2; + let __nt = super::__action19::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 24) + } + fn __reduce52< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ExprAtom = Num => ActionFn(43); + let __sym0 = __pop_Variant14(__symbols); let __start = __sym0.0; let __end = __sym0.2; let __nt = super::__action43::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (1, 23) + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 25) } - fn __reduce51< + fn __reduce53< 'input, >( input: &'input str, @@ -2852,15 +2978,32 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprAtom = Ident => ActionFn(44); - let __sym0 = __pop_Variant0(__symbols); + // ExprAtom = Bool => ActionFn(44); + let __sym0 = __pop_Variant8(__symbols); let __start = __sym0.0; let __end = __sym0.2; let __nt = super::__action44::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (1, 23) + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 25) } - fn __reduce52< + fn __reduce54< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ExprAtom = "unit" => ActionFn(45); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0; + let __end = __sym0.2; + let __nt = super::__action45::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 25) + } + fn __reduce55< 'input, >( input: &'input str, @@ -2869,18 +3012,35 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprAtom = "(", Expr, ")" => ActionFn(45); + // ExprAtom = Ident => ActionFn(46); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0; + let __end = __sym0.2; + let __nt = super::__action46::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 25) + } + fn __reduce56< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ExprAtom = "(", Expr, ")" => ActionFn(47); assert!(__symbols.len() >= 3); let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant1(__symbols); + let __sym1 = __pop_Variant3(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action45::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (3, 23) + let __nt = super::__action47::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (3, 25) } - fn __reduce53< + fn __reduce57< 'input, >( input: &'input str, @@ -2889,18 +3049,18 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprCall = "read", "(", ")" => ActionFn(38); + // ExprCall = "read", "(", ")" => ActionFn(39); assert!(__symbols.len() >= 3); let __sym2 = __pop_Variant0(__symbols); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action38::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (3, 24) + let __nt = super::__action39::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (3, 26) } - fn __reduce54< + fn __reduce58< 'input, >( input: &'input str, @@ -2909,19 +3069,19 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprCall = "print", "(", Expr, ")" => ActionFn(39); + // ExprCall = "print", "(", Expr, ")" => ActionFn(40); assert!(__symbols.len() >= 4); let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant1(__symbols); + let __sym2 = __pop_Variant3(__symbols); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym3.2; - let __nt = super::__action39::<>(input, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (4, 24) + let __nt = super::__action40::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (4, 26) } - fn __reduce55< + fn __reduce59< 'input, >( input: &'input str, @@ -2930,19 +3090,19 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprCall = ExprAtom, "(", Comma, ")" => ActionFn(40); + // ExprCall = ExprAtom, "(", Comma, ")" => ActionFn(41); assert!(__symbols.len() >= 4); let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant7(__symbols); + let __sym2 = __pop_Variant9(__symbols); let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant1(__symbols); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym3.2; - let __nt = super::__action40::<>(input, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (4, 24) + let __nt = super::__action41::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (4, 26) } - fn __reduce56< + fn __reduce60< 'input, >( input: &'input str, @@ -2951,15 +3111,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprCall = ExprAtom => ActionFn(41); - let __sym0 = __pop_Variant1(__symbols); + // ExprCall = ExprAtom => ActionFn(42); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action41::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (1, 24) + let __nt = super::__action42::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 26) } - fn __reduce57< + fn __reduce61< 'input, >( input: &'input str, @@ -2968,15 +3128,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprComparative = BinaryOps => ActionFn(16); - let __sym0 = __pop_Variant1(__symbols); + // ExprComparative = BinaryOps => ActionFn(17); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action16::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (1, 25) + let __nt = super::__action17::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 27) } - fn __reduce58< + fn __reduce62< 'input, >( input: &'input str, @@ -2985,15 +3145,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprLogicalAnd = BinaryOps => ActionFn(15); - let __sym0 = __pop_Variant1(__symbols); + // ExprLogicalAnd = BinaryOps => ActionFn(16); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action15::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (1, 26) + let __nt = super::__action16::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 28) } - fn __reduce59< + fn __reduce63< 'input, >( input: &'input str, @@ -3002,15 +3162,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprLogicalOr = BinaryOps => ActionFn(14); - let __sym0 = __pop_Variant1(__symbols); + // ExprLogicalOr = BinaryOps => ActionFn(15); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action14::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (1, 27) + let __nt = super::__action15::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 29) } - fn __reduce60< + fn __reduce64< 'input, >( input: &'input str, @@ -3019,15 +3179,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprMultiplicative = BinaryOps => ActionFn(19); - let __sym0 = __pop_Variant1(__symbols); + // ExprMultiplicative = BinaryOps => ActionFn(20); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action19::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (1, 28) + let __nt = super::__action20::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 30) } - fn __reduce61< + fn __reduce65< 'input, >( input: &'input str, @@ -3036,21 +3196,21 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprStmt = "let", Ident, "=", ExprLogicalOr, ";", ExprStmt => ActionFn(9); + // ExprStmt = "let", Ident, "=", ExprLogicalOr, ";", ExprStmt => ActionFn(10); assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant1(__symbols); + let __sym5 = __pop_Variant3(__symbols); let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant1(__symbols); + let __sym3 = __pop_Variant3(__symbols); let __sym2 = __pop_Variant0(__symbols); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym5.2; - let __nt = super::__action9::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (6, 29) + let __nt = super::__action10::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (6, 31) } - fn __reduce62< + fn __reduce66< 'input, >( input: &'input str, @@ -3059,24 +3219,24 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprStmt = "if", ExprLogicalOr, "{", Expr, "}", "else", "{", Expr, "}" => ActionFn(10); + // ExprStmt = "if", ExprLogicalOr, "{", Expr, "}", "else", "{", Expr, "}" => ActionFn(11); assert!(__symbols.len() >= 9); let __sym8 = __pop_Variant0(__symbols); - let __sym7 = __pop_Variant1(__symbols); + let __sym7 = __pop_Variant3(__symbols); let __sym6 = __pop_Variant0(__symbols); let __sym5 = __pop_Variant0(__symbols); let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant1(__symbols); + let __sym3 = __pop_Variant3(__symbols); let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant1(__symbols); + let __sym1 = __pop_Variant3(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym8.2; - let __nt = super::__action10::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (9, 29) + let __nt = super::__action11::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (9, 31) } - fn __reduce63< + fn __reduce67< 'input, >( input: &'input str, @@ -3085,19 +3245,19 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprStmt = "loop", "{", ExprStmt, "}" => ActionFn(11); + // ExprStmt = "loop", "{", ExprStmt, "}" => ActionFn(12); assert!(__symbols.len() >= 4); let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant1(__symbols); + let __sym2 = __pop_Variant3(__symbols); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym3.2; - let __nt = super::__action11::<>(input, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (4, 29) + let __nt = super::__action12::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (4, 31) } - fn __reduce64< + fn __reduce68< 'input, >( input: &'input str, @@ -3106,17 +3266,17 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprStmt = "break", Expr => ActionFn(96); + // ExprStmt = "break", Expr => ActionFn(104); assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant1(__symbols); + let __sym1 = __pop_Variant3(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym1.2; - let __nt = super::__action96::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (2, 29) + let __nt = super::__action104::<>(input, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (2, 31) } - fn __reduce65< + fn __reduce69< 'input, >( input: &'input str, @@ -3125,15 +3285,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprStmt = "break" => ActionFn(97); + // ExprStmt = "break" => ActionFn(105); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action97::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (1, 29) + let __nt = super::__action105::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 31) } - fn __reduce66< + fn __reduce70< 'input, >( input: &'input str, @@ -3142,15 +3302,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprStmt = ExprLogicalOr => ActionFn(13); - let __sym0 = __pop_Variant1(__symbols); + // ExprStmt = ExprLogicalOr => ActionFn(14); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action13::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (1, 29) + let __nt = super::__action14::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 31) } - fn __reduce67< + fn __reduce71< 'input, >( input: &'input str, @@ -3159,17 +3319,17 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprUnary = UnaryOp, ExprUnary => ActionFn(36); + // ExprUnary = UnaryOp, ExprUnary => ActionFn(37); assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant1(__symbols); - let __sym0 = __pop_Variant5(__symbols); + let __sym1 = __pop_Variant3(__symbols); + let __sym0 = __pop_Variant7(__symbols); let __start = __sym0.0; let __end = __sym1.2; - let __nt = super::__action36::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (2, 30) + let __nt = super::__action37::<>(input, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (2, 32) } - fn __reduce68< + fn __reduce72< 'input, >( input: &'input str, @@ -3178,15 +3338,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprUnary = ExprCall => ActionFn(37); - let __sym0 = __pop_Variant1(__symbols); + // ExprUnary = ExprCall => ActionFn(38); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action37::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (1, 30) + let __nt = super::__action38::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 32) } - fn __reduce69< + fn __reduce73< 'input, >( input: &'input str, @@ -3195,15 +3355,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprXor = BinaryOps => ActionFn(17); - let __sym0 = __pop_Variant1(__symbols); + // ExprXor = BinaryOps => ActionFn(18); + let __sym0 = __pop_Variant3(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action17::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (1, 31) + let __nt = super::__action18::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (1, 33) } - fn __reduce70< + fn __reduce74< 'input, >( input: &'input str, @@ -3212,25 +3372,25 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Fn = "fn", Ident, "(", Comma, ")", "->", Type, "{", Expr, "}" => ActionFn(3); + // Fn = "fn", Ident, "(", Comma, ")", "->", Type, "{", Expr, "}" => ActionFn(88); assert!(__symbols.len() >= 10); let __sym9 = __pop_Variant0(__symbols); - let __sym8 = __pop_Variant1(__symbols); + let __sym8 = __pop_Variant3(__symbols); let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant15(__symbols); + let __sym6 = __pop_Variant1(__symbols); let __sym5 = __pop_Variant0(__symbols); let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant8(__symbols); + let __sym3 = __pop_Variant10(__symbols); let __sym2 = __pop_Variant0(__symbols); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym9.2; - let __nt = super::__action3::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8, __sym9); - __symbols.push((__start, __Symbol::Variant9(__nt), __end)); - (10, 32) + let __nt = super::__action88::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8, __sym9); + __symbols.push((__start, __Symbol::Variant11(__nt), __end)); + (10, 34) } - fn __reduce71< + fn __reduce75< 'input, >( input: &'input str, @@ -3239,15 +3399,23 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Ident = r#"[_a-zA-Z][_a-zA-Z0-9]*"# => ActionFn(46); + // Fn = "fn", Ident, "(", Comma, ")", "{", Expr, "}" => ActionFn(89); + assert!(__symbols.len() >= 8); + let __sym7 = __pop_Variant0(__symbols); + let __sym6 = __pop_Variant3(__symbols); + let __sym5 = __pop_Variant0(__symbols); + let __sym4 = __pop_Variant0(__symbols); + let __sym3 = __pop_Variant10(__symbols); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action46::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant0(__nt), __end)); - (1, 33) + let __end = __sym7.2; + let __nt = super::__action89::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7); + __symbols.push((__start, __Symbol::Variant11(__nt), __end)); + (8, 34) } - fn __reduce72< + fn __reduce76< 'input, >( input: &'input str, @@ -3256,15 +3424,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // LogicalAndOp = "&&" => ActionFn(21); + // Ident = r#"[_a-zA-Z][_a-zA-Z0-9]*"# => ActionFn(48); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action21::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 34) + let __nt = super::__action48::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant0(__nt), __end)); + (1, 35) } - fn __reduce73< + fn __reduce77< 'input, >( input: &'input str, @@ -3273,15 +3441,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // LogicalOrOp = "||" => ActionFn(20); + // LogicalAndOp = "&&" => ActionFn(22); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action20::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 35) + let __nt = super::__action22::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 36) } - fn __reduce74< + fn __reduce78< 'input, >( input: &'input str, @@ -3290,15 +3458,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // MultiplicativeOp = "*" => ActionFn(31); + // LogicalOrOp = "||" => ActionFn(21); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action31::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 36) + let __nt = super::__action21::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 37) } - fn __reduce75< + fn __reduce79< 'input, >( input: &'input str, @@ -3307,15 +3475,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // MultiplicativeOp = "/" => ActionFn(32); + // MultiplicativeOp = "*" => ActionFn(32); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; let __nt = super::__action32::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 36) + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 38) } - fn __reduce76< + fn __reduce80< 'input, >( input: &'input str, @@ -3324,15 +3492,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // MultiplicativeOp = "%" => ActionFn(33); + // MultiplicativeOp = "/" => ActionFn(33); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; let __nt = super::__action33::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 36) + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 38) } - fn __reduce77< + fn __reduce81< 'input, >( input: &'input str, @@ -3341,15 +3509,32 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Num = r#"[0-9]+"# => ActionFn(47); + // MultiplicativeOp = "%" => ActionFn(34); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action47::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant12(__nt), __end)); - (1, 37) + let __nt = super::__action34::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 38) } - fn __reduce78< + fn __reduce82< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Num = r#"[0-9]+"# => ActionFn(49); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0; + let __end = __sym0.2; + let __nt = super::__action49::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant14(__nt), __end)); + (1, 39) + } + fn __reduce83< 'input, >( input: &'input str, @@ -3360,16 +3545,16 @@ mod __parse__Program { { // Param = Ident, ":", Type => ActionFn(4); assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant15(__symbols); + let __sym2 = __pop_Variant1(__symbols); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym2.2; let __nt = super::__action4::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (3, 38) + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 40) } - fn __reduce79< + fn __reduce84< 'input, >( input: &'input str, @@ -3378,15 +3563,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Param? = Param => ActionFn(70); - let __sym0 = __pop_Variant3(__symbols); + // Param? = Param => ActionFn(75); + let __sym0 = __pop_Variant5(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action70::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (1, 39) + let __nt = super::__action75::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant15(__nt), __end)); + (1, 41) } - fn __reduce80< + fn __reduce85< 'input, >( input: &'input str, @@ -3395,14 +3580,14 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Param? = => ActionFn(71); + // Param? = => ActionFn(76); let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); let __end = __start; - let __nt = super::__action71::<>(input, &__start, &__end); - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (0, 39) + let __nt = super::__action76::<>(input, &__start, &__end); + __symbols.push((__start, __Symbol::Variant15(__nt), __end)); + (0, 41) } - fn __reduce81< + fn __reduce86< 'input, >( input: &'input str, @@ -3411,14 +3596,14 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Program = => ActionFn(90); + // Program = => ActionFn(98); let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); let __end = __start; - let __nt = super::__action90::<>(input, &__start, &__end); - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (0, 40) + let __nt = super::__action98::<>(input, &__start, &__end); + __symbols.push((__start, __Symbol::Variant16(__nt), __end)); + (0, 42) } - fn __reduce82< + fn __reduce87< 'input, >( input: &'input str, @@ -3427,15 +3612,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Program = Def+ => ActionFn(91); - let __sym0 = __pop_Variant10(__symbols); + // Program = Def+ => ActionFn(99); + let __sym0 = __pop_Variant12(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action91::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (1, 40) + let __nt = super::__action99::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant16(__nt), __end)); + (1, 42) } - fn __reduce83< + fn __reduce88< 'input, >( input: &'input str, @@ -3449,10 +3634,10 @@ mod __parse__Program { let __start = __sym0.0; let __end = __sym0.2; let __nt = super::__action5::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 41) + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (1, 43) } - fn __reduce84< + fn __reduce89< 'input, >( input: &'input str, @@ -3466,10 +3651,10 @@ mod __parse__Program { let __start = __sym0.0; let __end = __sym0.2; let __nt = super::__action6::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 41) + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (1, 43) } - fn __reduce85< + fn __reduce90< 'input, >( input: &'input str, @@ -3483,10 +3668,10 @@ mod __parse__Program { let __start = __sym0.0; let __end = __sym0.2; let __nt = super::__action7::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 41) + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (1, 43) } - fn __reduce86< + fn __reduce91< 'input, >( input: &'input str, @@ -3495,15 +3680,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // UnaryOp = "-" => ActionFn(34); + // Type = "Never" => ActionFn(8); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action34::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 42) + let __nt = super::__action8::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (1, 43) } - fn __reduce87< + fn __reduce92< 'input, >( input: &'input str, @@ -3512,15 +3697,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // UnaryOp = "!" => ActionFn(35); + // UnaryOp = "-" => ActionFn(35); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; let __nt = super::__action35::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 42) + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 44) } - fn __reduce88< + fn __reduce93< 'input, >( input: &'input str, @@ -3529,13 +3714,30 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // XorOp = "^" => ActionFn(28); + // UnaryOp = "!" => ActionFn(36); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action28::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (1, 43) + let __nt = super::__action36::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 44) + } + fn __reduce94< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // XorOp = "^" => ActionFn(29); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0; + let __end = __sym0.2; + let __nt = super::__action29::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 45) } } pub use self::__parse__Program::ProgramParser; @@ -3579,6 +3781,7 @@ mod __intern_token { ("(?:>=)", false), ("(?:Bool)", false), ("(?:Int)", false), + ("(?:Never)", false), ("(?:Unit)", false), ("\\^", false), ("(?:break)", false), @@ -3648,14 +3851,13 @@ fn __action3< (_, _, _): (usize, &'input str, usize), (_, params, _): (usize, Vec<(&'input str, Type)>, usize), (_, _, _): (usize, &'input str, usize), - (_, _, _): (usize, &'input str, usize), - (_, typ, _): (usize, Type, usize), + (_, typ, _): (usize, core::option::Option, usize), (_, _, _): (usize, &'input str, usize), (_, bdy, _): (usize, Expr<&'input str>, usize), (_, _, _): (usize, &'input str, usize), ) -> Def<&'input str> { - Def::Fn { sym, params, typ, bdy } + Def::Fn { sym, params, typ: typ.unwrap_or(Type::Unit), bdy } } #[allow(unused_variables)] @@ -3712,6 +3914,18 @@ fn __action7< #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] fn __action8< 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> Type +{ + Type::Never +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action9< + 'input, >( input: &'input str, (_, __0, _): (usize, Expr<&'input str>, usize), @@ -3722,7 +3936,7 @@ fn __action8< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action9< +fn __action10< 'input, >( input: &'input str, @@ -3739,7 +3953,7 @@ fn __action9< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action10< +fn __action11< 'input, >( input: &'input str, @@ -3759,7 +3973,7 @@ fn __action10< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action11< +fn __action12< 'input, >( input: &'input str, @@ -3774,20 +3988,20 @@ fn __action11< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action12< +fn __action13< 'input, >( input: &'input str, (_, _, _): (usize, &'input str, usize), - (_, e, _): (usize, core::option::Option>, usize), + (_, bdy, _): (usize, core::option::Option>, usize), ) -> Expr<&'input str> { - Expr::Break { e: e.map(Box::new) } + Expr::Break { bdy: bdy.map(Box::new) } } #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action13< +fn __action14< 'input, >( input: &'input str, @@ -3799,7 +4013,7 @@ fn __action13< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action14< +fn __action15< 'input, >( input: &'input str, @@ -3811,7 +4025,7 @@ fn __action14< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action15< +fn __action16< 'input, >( input: &'input str, @@ -3823,7 +4037,7 @@ fn __action15< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action16< +fn __action17< 'input, >( input: &'input str, @@ -3835,7 +4049,7 @@ fn __action16< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action17< +fn __action18< 'input, >( input: &'input str, @@ -3847,7 +4061,7 @@ fn __action17< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action18< +fn __action19< 'input, >( input: &'input str, @@ -3859,7 +4073,7 @@ fn __action18< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action19< +fn __action20< 'input, >( input: &'input str, @@ -3871,7 +4085,7 @@ fn __action19< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action20< +fn __action21< 'input, >( input: &'input str, @@ -3883,7 +4097,7 @@ fn __action20< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action21< +fn __action22< 'input, >( input: &'input str, @@ -3895,7 +4109,7 @@ fn __action21< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action22< +fn __action23< 'input, >( input: &'input str, @@ -3907,7 +4121,7 @@ fn __action22< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action23< +fn __action24< 'input, >( input: &'input str, @@ -3919,7 +4133,7 @@ fn __action23< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action24< +fn __action25< 'input, >( input: &'input str, @@ -3931,7 +4145,7 @@ fn __action24< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action25< +fn __action26< 'input, >( input: &'input str, @@ -3943,7 +4157,7 @@ fn __action25< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action26< +fn __action27< 'input, >( input: &'input str, @@ -3955,7 +4169,7 @@ fn __action26< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action27< +fn __action28< 'input, >( input: &'input str, @@ -3967,7 +4181,7 @@ fn __action27< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action28< +fn __action29< 'input, >( input: &'input str, @@ -3979,7 +4193,7 @@ fn __action28< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action29< +fn __action30< 'input, >( input: &'input str, @@ -3991,7 +4205,7 @@ fn __action29< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action30< +fn __action31< 'input, >( input: &'input str, @@ -4003,7 +4217,7 @@ fn __action30< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action31< +fn __action32< 'input, >( input: &'input str, @@ -4015,7 +4229,7 @@ fn __action31< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action32< +fn __action33< 'input, >( input: &'input str, @@ -4027,7 +4241,7 @@ fn __action32< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action33< +fn __action34< 'input, >( input: &'input str, @@ -4039,7 +4253,7 @@ fn __action33< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action34< +fn __action35< 'input, >( input: &'input str, @@ -4051,7 +4265,7 @@ fn __action34< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action35< +fn __action36< 'input, >( input: &'input str, @@ -4063,7 +4277,7 @@ fn __action35< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action36< +fn __action37< 'input, >( input: &'input str, @@ -4076,7 +4290,7 @@ fn __action36< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action37< +fn __action38< 'input, >( input: &'input str, @@ -4088,7 +4302,7 @@ fn __action37< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action38< +fn __action39< 'input, >( input: &'input str, @@ -4102,7 +4316,7 @@ fn __action38< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action39< +fn __action40< 'input, >( input: &'input str, @@ -4117,7 +4331,7 @@ fn __action39< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action40< +fn __action41< 'input, >( input: &'input str, @@ -4132,7 +4346,7 @@ fn __action40< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action41< +fn __action42< 'input, >( input: &'input str, @@ -4144,7 +4358,7 @@ fn __action41< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action42< +fn __action43< 'input, >( input: &'input str, @@ -4156,7 +4370,7 @@ fn __action42< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action43< +fn __action44< 'input, >( input: &'input str, @@ -4168,7 +4382,19 @@ fn __action43< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action44< +fn __action45< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, &'input str, usize), +) -> Expr<&'input str> +{ + Expr::Lit { val: Lit::Unit } +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action46< 'input, >( input: &'input str, @@ -4180,7 +4406,7 @@ fn __action44< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action45< +fn __action47< 'input, >( input: &'input str, @@ -4194,7 +4420,7 @@ fn __action45< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action46< +fn __action48< 'input, >( input: &'input str, @@ -4206,7 +4432,7 @@ fn __action46< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action47< +fn __action49< 'input, >( input: &'input str, @@ -4218,7 +4444,7 @@ fn __action47< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action48< +fn __action50< 'input, >( input: &'input str, @@ -4230,7 +4456,7 @@ fn __action48< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action49< +fn __action51< 'input, >( input: &'input str, @@ -4242,7 +4468,7 @@ fn __action49< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action50< +fn __action52< 'input, >( input: &'input str, @@ -4262,7 +4488,7 @@ fn __action50< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action51< +fn __action53< 'input, >( input: &'input str, @@ -4276,7 +4502,7 @@ fn __action51< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action52< +fn __action54< 'input, >( input: &'input str, @@ -4288,7 +4514,7 @@ fn __action52< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action53< +fn __action55< 'input, >( input: &'input str, @@ -4302,7 +4528,7 @@ fn __action53< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action54< +fn __action56< 'input, >( input: &'input str, @@ -4314,7 +4540,7 @@ fn __action54< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action55< +fn __action57< 'input, >( input: &'input str, @@ -4328,7 +4554,7 @@ fn __action55< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action56< +fn __action58< 'input, >( input: &'input str, @@ -4340,7 +4566,7 @@ fn __action56< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action57< +fn __action59< 'input, >( input: &'input str, @@ -4354,7 +4580,7 @@ fn __action57< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action58< +fn __action60< 'input, >( input: &'input str, @@ -4366,7 +4592,7 @@ fn __action58< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action59< +fn __action61< 'input, >( input: &'input str, @@ -4380,7 +4606,7 @@ fn __action59< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action60< +fn __action62< 'input, >( input: &'input str, @@ -4392,7 +4618,7 @@ fn __action60< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action61< +fn __action63< 'input, >( input: &'input str, @@ -4406,7 +4632,7 @@ fn __action61< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action62< +fn __action64< 'input, >( input: &'input str, @@ -4418,7 +4644,7 @@ fn __action62< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action63< +fn __action65< 'input, >( input: &'input str, @@ -4430,7 +4656,7 @@ fn __action63< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action64< +fn __action66< 'input, >( input: &'input str, @@ -4443,7 +4669,45 @@ fn __action64< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action65< +fn __action67< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, Type, usize), +) -> core::option::Option +{ + Some(__0) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action68< + 'input, +>( + input: &'input str, + __lookbehind: &usize, + __lookahead: &usize, +) -> core::option::Option +{ + None +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action69< + 'input, +>( + input: &'input str, + (_, _, _): (usize, &'input str, usize), + (_, __0, _): (usize, Type, usize), +) -> Type +{ + __0 +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action70< 'input, >( input: &'input str, @@ -4463,7 +4727,7 @@ fn __action65< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action66< +fn __action71< 'input, >( input: &'input str, @@ -4476,7 +4740,7 @@ fn __action66< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action67< +fn __action72< 'input, >( input: &'input str, @@ -4488,7 +4752,7 @@ fn __action67< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action68< +fn __action73< 'input, >( input: &'input str, @@ -4500,7 +4764,7 @@ fn __action68< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action69< +fn __action74< 'input, >( input: &'input str, @@ -4513,7 +4777,7 @@ fn __action69< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action70< +fn __action75< 'input, >( input: &'input str, @@ -4525,7 +4789,7 @@ fn __action70< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action71< +fn __action76< 'input, >( input: &'input str, @@ -4538,7 +4802,7 @@ fn __action71< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action72< +fn __action77< 'input, >( input: &'input str, @@ -4551,7 +4815,7 @@ fn __action72< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action73< +fn __action78< 'input, >( input: &'input str, @@ -4563,7 +4827,7 @@ fn __action73< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action74< +fn __action79< 'input, >( input: &'input str, @@ -4576,7 +4840,7 @@ fn __action74< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action75< +fn __action80< 'input, >( input: &'input str, @@ -4589,7 +4853,7 @@ fn __action75< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action76< +fn __action81< 'input, >( input: &'input str, @@ -4601,7 +4865,7 @@ fn __action76< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action77< +fn __action82< 'input, >( input: &'input str, @@ -4614,7 +4878,7 @@ fn __action77< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action78< +fn __action83< 'input, >( input: &'input str, @@ -4626,7 +4890,7 @@ fn __action78< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action79< +fn __action84< 'input, >( input: &'input str, @@ -4639,7 +4903,7 @@ fn __action79< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action80< +fn __action85< 'input, >( input: &'input str, @@ -4651,7 +4915,7 @@ fn __action80< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action81< +fn __action86< 'input, >( input: &'input str, @@ -4665,7 +4929,112 @@ fn __action81< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action82< +fn __action87< + 'input, +>( + input: &'input str, + __0: (usize, &'input str, usize), + __1: (usize, Type, usize), +) -> core::option::Option +{ + let __start0 = __0.0; + let __end0 = __1.2; + let __temp0 = __action69( + input, + __0, + __1, + ); + let __temp0 = (__start0, __temp0, __end0); + __action67( + input, + __temp0, + ) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action88< + 'input, +>( + input: &'input str, + __0: (usize, &'input str, usize), + __1: (usize, &'input str, usize), + __2: (usize, &'input str, usize), + __3: (usize, Vec<(&'input str, Type)>, usize), + __4: (usize, &'input str, usize), + __5: (usize, &'input str, usize), + __6: (usize, Type, usize), + __7: (usize, &'input str, usize), + __8: (usize, Expr<&'input str>, usize), + __9: (usize, &'input str, usize), +) -> Def<&'input str> +{ + let __start0 = __5.0; + let __end0 = __6.2; + let __temp0 = __action87( + input, + __5, + __6, + ); + let __temp0 = (__start0, __temp0, __end0); + __action3( + input, + __0, + __1, + __2, + __3, + __4, + __temp0, + __7, + __8, + __9, + ) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action89< + 'input, +>( + input: &'input str, + __0: (usize, &'input str, usize), + __1: (usize, &'input str, usize), + __2: (usize, &'input str, usize), + __3: (usize, Vec<(&'input str, Type)>, usize), + __4: (usize, &'input str, usize), + __5: (usize, &'input str, usize), + __6: (usize, Expr<&'input str>, usize), + __7: (usize, &'input str, usize), +) -> Def<&'input str> +{ + let __start0 = __4.2; + let __end0 = __5.0; + let __temp0 = __action68( + input, + &__start0, + &__end0, + ); + let __temp0 = (__start0, __temp0, __end0); + __action3( + input, + __0, + __1, + __2, + __3, + __4, + __temp0, + __5, + __6, + __7, + ) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action90< 'input, >( input: &'input str, @@ -4675,13 +5044,13 @@ fn __action82< { let __start0 = __0.0; let __end0 = __1.2; - let __temp0 = __action77( + let __temp0 = __action82( input, __0, __1, ); let __temp0 = (__start0, __temp0, __end0); - __action78( + __action83( input, __temp0, ) @@ -4690,7 +5059,7 @@ fn __action82< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action83< +fn __action91< 'input, >( input: &'input str, @@ -4701,13 +5070,13 @@ fn __action83< { let __start0 = __1.0; let __end0 = __2.2; - let __temp0 = __action77( + let __temp0 = __action82( input, __1, __2, ); let __temp0 = (__start0, __temp0, __end0); - __action79( + __action84( input, __0, __temp0, @@ -4717,7 +5086,7 @@ fn __action83< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action84< +fn __action92< 'input, >( input: &'input str, @@ -4726,13 +5095,13 @@ fn __action84< { let __start0 = __0.0; let __end0 = __0.0; - let __temp0 = __action75( + let __temp0 = __action80( input, &__start0, &__end0, ); let __temp0 = (__start0, __temp0, __end0); - __action50( + __action52( input, __temp0, __0, @@ -4742,7 +5111,7 @@ fn __action84< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action85< +fn __action93< 'input, >( input: &'input str, @@ -4752,12 +5121,12 @@ fn __action85< { let __start0 = __0.0; let __end0 = __0.2; - let __temp0 = __action76( + let __temp0 = __action81( input, __0, ); let __temp0 = (__start0, __temp0, __end0); - __action50( + __action52( input, __temp0, __1, @@ -4767,7 +5136,7 @@ fn __action85< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action86< +fn __action94< 'input, >( input: &'input str, @@ -4777,13 +5146,13 @@ fn __action86< { let __start0 = __0.0; let __end0 = __1.2; - let __temp0 = __action74( + let __temp0 = __action79( input, __0, __1, ); let __temp0 = (__start0, __temp0, __end0); - __action80( + __action85( input, __temp0, ) @@ -4792,7 +5161,7 @@ fn __action86< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action87< +fn __action95< 'input, >( input: &'input str, @@ -4803,13 +5172,13 @@ fn __action87< { let __start0 = __1.0; let __end0 = __2.2; - let __temp0 = __action74( + let __temp0 = __action79( input, __1, __2, ); let __temp0 = (__start0, __temp0, __end0); - __action81( + __action86( input, __0, __temp0, @@ -4819,7 +5188,7 @@ fn __action87< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action88< +fn __action96< 'input, >( input: &'input str, @@ -4828,13 +5197,13 @@ fn __action88< { let __start0 = __0.0; let __end0 = __0.0; - let __temp0 = __action72( + let __temp0 = __action77( input, &__start0, &__end0, ); let __temp0 = (__start0, __temp0, __end0); - __action65( + __action70( input, __temp0, __0, @@ -4844,7 +5213,7 @@ fn __action88< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action89< +fn __action97< 'input, >( input: &'input str, @@ -4854,12 +5223,12 @@ fn __action89< { let __start0 = __0.0; let __end0 = __0.2; - let __temp0 = __action73( + let __temp0 = __action78( input, __0, ); let __temp0 = (__start0, __temp0, __end0); - __action65( + __action70( input, __temp0, __1, @@ -4869,7 +5238,7 @@ fn __action89< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action90< +fn __action98< 'input, >( input: &'input str, @@ -4879,7 +5248,7 @@ fn __action90< { let __start0 = *__lookbehind; let __end0 = *__lookahead; - let __temp0 = __action66( + let __temp0 = __action71( input, &__start0, &__end0, @@ -4894,7 +5263,7 @@ fn __action90< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action91< +fn __action99< 'input, >( input: &'input str, @@ -4903,7 +5272,7 @@ fn __action91< { let __start0 = __0.0; let __end0 = __0.2; - let __temp0 = __action67( + let __temp0 = __action72( input, __0, ); @@ -4917,7 +5286,7 @@ fn __action91< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action92< +fn __action100< 'input, >( input: &'input str, @@ -4926,12 +5295,12 @@ fn __action92< { let __start0 = __0.0; let __end0 = __0.2; - let __temp0 = __action63( + let __temp0 = __action65( input, __0, ); let __temp0 = (__start0, __temp0, __end0); - __action84( + __action92( input, __temp0, ) @@ -4940,7 +5309,7 @@ fn __action92< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action93< +fn __action101< 'input, >( input: &'input str, @@ -4950,13 +5319,13 @@ fn __action93< { let __start0 = *__lookbehind; let __end0 = *__lookahead; - let __temp0 = __action64( + let __temp0 = __action66( input, &__start0, &__end0, ); let __temp0 = (__start0, __temp0, __end0); - __action84( + __action92( input, __temp0, ) @@ -4965,7 +5334,7 @@ fn __action93< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action94< +fn __action102< 'input, >( input: &'input str, @@ -4975,12 +5344,12 @@ fn __action94< { let __start0 = __1.0; let __end0 = __1.2; - let __temp0 = __action63( + let __temp0 = __action65( input, __1, ); let __temp0 = (__start0, __temp0, __end0); - __action85( + __action93( input, __0, __temp0, @@ -4990,7 +5359,7 @@ fn __action94< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action95< +fn __action103< 'input, >( input: &'input str, @@ -4999,13 +5368,13 @@ fn __action95< { let __start0 = __0.2; let __end0 = __0.2; - let __temp0 = __action64( + let __temp0 = __action66( input, &__start0, &__end0, ); let __temp0 = (__start0, __temp0, __end0); - __action85( + __action93( input, __0, __temp0, @@ -5015,7 +5384,7 @@ fn __action95< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action96< +fn __action104< 'input, >( input: &'input str, @@ -5025,12 +5394,12 @@ fn __action96< { let __start0 = __1.0; let __end0 = __1.2; - let __temp0 = __action63( + let __temp0 = __action65( input, __1, ); let __temp0 = (__start0, __temp0, __end0); - __action12( + __action13( input, __0, __temp0, @@ -5040,7 +5409,7 @@ fn __action96< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action97< +fn __action105< 'input, >( input: &'input str, @@ -5049,13 +5418,13 @@ fn __action97< { let __start0 = __0.2; let __end0 = __0.2; - let __temp0 = __action64( + let __temp0 = __action66( input, &__start0, &__end0, ); let __temp0 = (__start0, __temp0, __end0); - __action12( + __action13( input, __0, __temp0, @@ -5065,7 +5434,7 @@ fn __action97< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action98< +fn __action106< 'input, >( input: &'input str, @@ -5074,12 +5443,12 @@ fn __action98< { let __start0 = __0.0; let __end0 = __0.2; - let __temp0 = __action70( + let __temp0 = __action75( input, __0, ); let __temp0 = (__start0, __temp0, __end0); - __action88( + __action96( input, __temp0, ) @@ -5088,7 +5457,7 @@ fn __action98< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action99< +fn __action107< 'input, >( input: &'input str, @@ -5098,13 +5467,13 @@ fn __action99< { let __start0 = *__lookbehind; let __end0 = *__lookahead; - let __temp0 = __action71( + let __temp0 = __action76( input, &__start0, &__end0, ); let __temp0 = (__start0, __temp0, __end0); - __action88( + __action96( input, __temp0, ) @@ -5113,7 +5482,7 @@ fn __action99< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action100< +fn __action108< 'input, >( input: &'input str, @@ -5123,12 +5492,12 @@ fn __action100< { let __start0 = __1.0; let __end0 = __1.2; - let __temp0 = __action70( + let __temp0 = __action75( input, __1, ); let __temp0 = (__start0, __temp0, __end0); - __action89( + __action97( input, __0, __temp0, @@ -5138,7 +5507,7 @@ fn __action100< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action101< +fn __action109< 'input, >( input: &'input str, @@ -5147,13 +5516,13 @@ fn __action101< { let __start0 = __0.2; let __end0 = __0.2; - let __temp0 = __action71( + let __temp0 = __action76( input, &__start0, &__end0, ); let __temp0 = (__start0, __temp0, __end0); - __action89( + __action97( input, __0, __temp0, diff --git a/compiler/src/passes/parse/mod.rs b/compiler/src/passes/parse/mod.rs index 63647f8..d7f1f0d 100644 --- a/compiler/src/passes/parse/mod.rs +++ b/compiler/src/passes/parse/mod.rs @@ -61,7 +61,7 @@ pub enum Expr { bdy: Box>, }, Break { - e: Option>>, + bdy: Option>>, } } diff --git a/compiler/src/passes/type_check/check.rs b/compiler/src/passes/type_check/check.rs index d007a80..4c0b1f1 100644 --- a/compiler/src/passes/type_check/check.rs +++ b/compiler/src/passes/type_check/check.rs @@ -27,11 +27,50 @@ pub enum TypeError { ArgCountMismatch { expected: usize, got: usize }, #[error("The program doesn't have a main function.")] NoMain, + #[error("Found a break outside of a loop.")] + BreakOutsideLoop, +} + +struct Env<'a, 'p> { + scope: &'a mut PushMap<&'p str, Type>, + loop_type: &'a mut Option, + in_loop: bool, +} + +impl<'a, 'p> Env<'a, 'p> { + pub fn push(&mut self, k: &'p str, v: Type, sub: impl FnOnce(&mut Env<'_, 'p>) -> O) -> O { + self.scope.push(k, v, |scope| { + sub(&mut Env { + scope, + loop_type: self.loop_type, + in_loop: self.in_loop, + }) + }) + } + + pub fn push_iter( + &mut self, + iterator: impl Iterator, + sub: impl FnOnce(&mut Env<'_, 'p>) -> O, + ) -> O { + self.scope.push_iter(iterator, |scope| { + sub(&mut Env { + scope, + loop_type: self.loop_type, + in_loop: self.in_loop, + }) + }) + } } impl<'p> PrgParsed<'p> { pub fn type_check(self) -> Result, TypeError> { let mut scope = uncover_fns(&self)?; + let mut env = Env { + scope: &mut scope, + loop_type: &mut None, + in_loop: false, + }; let defs = self .defs @@ -42,9 +81,8 @@ impl<'p> PrgParsed<'p> { ref params, ref bdy, ref typ, - } => scope - .push_iter(params.iter().cloned(), |scope| { - expect_type(bdy, scope, typ.clone()) + } => env.push_iter(params.iter().cloned(), |env| { + expect_type(bdy, typ.clone(), env) }) .map(|_| (sym, def)), }) @@ -97,64 +135,62 @@ fn uncover_fns<'p>(program: &PrgParsed<'p>) -> Result, Ty fn type_check_expr<'p>( expr: &Expr<&'p str>, - scope: &mut PushMap<&'p str, Type>, + env: &mut Env<'_, 'p>, ) -> Result { match expr { - Expr::Lit { - val: Lit::Bool { .. }, - } => Ok(Type::Bool), - Expr::Lit { - val: Lit::Int { .. }, - } => Ok(Type::Int), - Expr::Var { sym } => scope.get(sym).cloned().ok_or(UndeclaredVar { + Expr::Lit { val} => match val { + Lit::Int { .. } => Ok(Type::Int), + Lit::Bool { .. } => Ok(Type::Bool), + Lit::Unit => Ok(Type::Unit), + } + Expr::Var { sym } => env.scope.get(sym).cloned().ok_or(UndeclaredVar { sym: (*sym).to_string(), }), Expr::Prim { op, args } => match (op, args.as_slice()) { (Op::Plus | Op::Minus | Op::Mul | Op::Mod | Op::Div, [e1, e2]) => { - expect_type(e1, scope, Type::Int)?; - expect_type(e2, scope, Type::Int)?; + expect_type(e1, Type::Int, env)?; + expect_type(e2, Type::Int, env)?; Ok(Type::Int) } (Op::Minus, [e1]) => { - expect_type(e1, scope, Type::Int)?; + expect_type(e1, Type::Int, env)?; Ok(Type::Int) } (Op::Read, []) => Ok(Type::Int), (Op::Print, [e1]) => { // todo: Eventually `Print` should become a function call, not an `Expr`. - // type_check_expr(e1, scope) - expect_type(e1, scope, Type::Int)?; + expect_type(e1, Type::Int, env)?; Ok(Type::Int) } (Op::GT | Op::GE | Op::LT | Op::LE, [e1, e2]) => { - expect_type(e1, scope, Type::Int)?; - expect_type(e2, scope, Type::Int)?; + expect_type(e1, Type::Int, env)?; + expect_type(e2, Type::Int, env)?; Ok(Type::Bool) } (Op::EQ | Op::NE, [e1, e2]) => { - expect_type_eq(e1, e2, scope)?; + expect_type_eq(e1, e2, env)?; Ok(Type::Bool) } (Op::Not, [e1]) => { - expect_type(e1, scope, Type::Bool)?; + expect_type(e1, Type::Bool, env)?; Ok(Type::Bool) } (Op::LAnd | Op::LOr | Op::Xor, [e1, e2]) => { - expect_type(e1, scope, Type::Bool)?; - expect_type(e2, scope, Type::Bool)?; + expect_type(e1, Type::Bool, env)?; + expect_type(e2, Type::Bool, env)?; Ok(Type::Bool) } _ => panic!("Found incorrect operator during type checking"), }, Expr::Let { sym, bnd, bdy } => { - let t = type_check_expr(bnd, scope)?; - scope.push(sym, t, |scope| type_check_expr(bdy, scope)) + let t = type_check_expr(bnd, env)?; + env.push(sym, t, |env| type_check_expr(bdy, env) ) } Expr::If { cnd, thn, els } => { - expect_type(cnd, scope, Type::Bool)?; - expect_type_eq(thn, els, scope) + expect_type(cnd, Type::Bool, env)?; + expect_type_eq(thn, els, env) } - Expr::Apply { fun, args } => match type_check_expr(fun, scope)? { + Expr::Apply { fun, args } => match type_check_expr(fun, env)? { Type::Fn { typ, args: expected_types, @@ -167,36 +203,63 @@ fn type_check_expr<'p>( } for (arg, arg_typ) in args.iter().zip(expected_types.iter()) { - expect_type(arg, scope, arg_typ.clone())?; + expect_type(arg, arg_typ.clone(), env)?; } Ok(*typ) } got => Err(TypeMismatchExpectFn { got }), }, - Expr::Loop { .. } => todo!(), - Expr::Break { .. } => todo!(), - Expr::Lit { val: Lit::Unit } => todo!(), + Expr::Loop { bdy } => { + let mut loop_type = None; + let mut env = Env { + scope: env.scope, + loop_type: &mut loop_type, + in_loop: true, + }; + type_check_expr(bdy, &mut env)?; + Ok(loop_type.unwrap_or(Type::Never)) + } + Expr::Break { bdy } => { + expect(env.in_loop, BreakOutsideLoop)?; + + let bdy_type = match bdy { + None => { + Type::Unit + }, + Some(bdy) => { + type_check_expr(bdy, env)? + }, + }; + + if let Some(loop_type) = env.loop_type { + expect(*loop_type == bdy_type, TypeMismatchEqual { t1: loop_type.clone(), t2: bdy_type.clone() })?; + } else { + *env.loop_type = Some(bdy_type); + } + + Ok(Type::Never) + }, } } fn expect_type_eq<'p>( e1: &Expr<&'p str>, e2: &Expr<&'p str>, - scope: &mut PushMap<&'p str, Type>, + env: &mut Env<'_, 'p>, ) -> Result { - let t1 = type_check_expr(e1, scope)?; - let t2 = type_check_expr(e2, scope)?; + let t1 = type_check_expr(e1, env)?; + let t2 = type_check_expr(e2, env)?; expect(t1 == t2, TypeMismatchEqual { t1: t1.clone(), t2 })?; Ok(t1) } fn expect_type<'p>( expr: &Expr<&'p str>, - scope: &mut PushMap<&'p str, Type>, expected: Type, + env: &mut Env<'_, 'p>, ) -> Result<(), TypeError> { - let t = type_check_expr(expr, scope)?; + let t = type_check_expr(expr, env)?; expect( t == expected, TypeMismatchExpect { diff --git a/compiler/src/passes/type_check/mod.rs b/compiler/src/passes/type_check/mod.rs index ff93692..9514226 100644 --- a/compiler/src/passes/type_check/mod.rs +++ b/compiler/src/passes/type_check/mod.rs @@ -11,6 +11,7 @@ pub enum Type { Int, Bool, Unit, + Never, Fn { typ: Box, args: Vec }, } @@ -20,6 +21,7 @@ impl Display for Type { Type::Int => write!(f, "Int"), Type::Bool => write!(f, "Bool"), Type::Unit => write!(f, "Unit"), + Type::Never => write!(f, "Never"), Type::Fn { typ, args } => write!(f, "fn({}) -> {}", args.iter().format(", "), typ), } } diff --git a/compiler/src/utils/push_map.rs b/compiler/src/utils/push_map.rs index 6d375e3..73bfa61 100644 --- a/compiler/src/utils/push_map.rs +++ b/compiler/src/utils/push_map.rs @@ -30,10 +30,10 @@ impl PushMap { self.0.get(k) } - pub fn push(&mut self, k: K, v: V, scope: impl FnOnce(&mut Self) -> O) -> O { + pub fn push(&mut self, k: K, v: V, sub: impl FnOnce(&mut Self) -> O) -> O { let old = self.0.insert(k.clone(), v); - let o = scope(self); + let o = sub(self); if let Some(old) = old { self.0.insert(k, old); @@ -61,13 +61,13 @@ impl PushMap { pub fn push_iter( &mut self, iterator: impl Iterator, - scope: impl FnOnce(&mut Self) -> O, + sub: impl FnOnce(&mut Self) -> O, ) -> O { let old = iterator .map(|(k, v)| (k.clone(), self.0.insert(k, v))) .collect::>(); - let o = scope(self); + let o = sub(self); for (k, old) in old { if let Some(old) = old { diff --git a/programs/fail/type_check/break_outside_loop.test b/programs/fail/type_check/break_outside_loop.test new file mode 100644 index 0000000..ea1dfdd --- /dev/null +++ b/programs/fail/type_check/break_outside_loop.test @@ -0,0 +1,4 @@ +### +fn main() -> Unit { + break +} \ No newline at end of file diff --git a/programs/good/loops/loop_in_loop.test b/programs/good/loops/loop_in_loop.test new file mode 100644 index 0000000..9e789d2 --- /dev/null +++ b/programs/good/loops/loop_in_loop.test @@ -0,0 +1,15 @@ +## +5 +# +fn main() -> Int { + loop { + let x = (loop { + break true + }); + if x { + break 5 + } else { + break 7 + } + } +} diff --git a/programs/good/loops/loop_never.test b/programs/good/loops/loop_never.test new file mode 100644 index 0000000..b86ae39 --- /dev/null +++ b/programs/good/loops/loop_never.test @@ -0,0 +1,10 @@ +## +unit +# +fn test() -> Never { + loop { 1 } +} + +fn main() -> Unit { + unit +} diff --git a/programs/good/loops/loop_void.test b/programs/good/loops/loop_unit.test similarity index 100% rename from programs/good/loops/loop_void.test rename to programs/good/loops/loop_unit.test From 9090962ec46957773e6aef1f710074c5a6a15a83 Mon Sep 17 00:00:00 2001 From: jonathan Date: Tue, 24 Oct 2023 23:27:05 +0200 Subject: [PATCH 04/27] Interpreter almost working --- compiler/src/interpreter/value.rs | 1 + compiler/src/passes/parse/interpreter.rs | 129 +++++++++++------- programs/good/loops/loop_never_if.test | 17 +++ .../good/loops/loop_num_shortcircuit.test | 8 ++ 4 files changed, 109 insertions(+), 46 deletions(-) create mode 100644 programs/good/loops/loop_never_if.test create mode 100644 programs/good/loops/loop_num_shortcircuit.test diff --git a/compiler/src/interpreter/value.rs b/compiler/src/interpreter/value.rs index 1591c98..29a4d82 100644 --- a/compiler/src/interpreter/value.rs +++ b/compiler/src/interpreter/value.rs @@ -68,6 +68,7 @@ impl FromStr for Lit { Ok(match s { "false" => Lit::Bool { val: false }, "true" => Lit::Bool { val: true }, + "unit" => Lit::Unit, s => Lit::Int { val: s.parse().map_err(|_| ())?, }, diff --git a/compiler/src/passes/parse/interpreter.rs b/compiler/src/passes/parse/interpreter.rs index ae787fa..992bd96 100644 --- a/compiler/src/passes/parse/interpreter.rs +++ b/compiler/src/passes/parse/interpreter.rs @@ -5,6 +5,33 @@ use crate::utils::push_map::PushMap; use std::fmt::Debug; use std::hash::Hash; +#[derive(Copy, Clone)] +pub enum ControlFlow { + Val(Val), + Break(Val), +} + +impl ControlFlow { + pub fn val(self) -> Val { + match self { + ControlFlow::Val(v) => v, + ControlFlow::Break(_) => panic!("Sterf"), + } + } +} + +macro_rules! b { + ($e: expr) => { + { + let e = $e; + match e { + ControlFlow::Break(_) => return e, + ControlFlow::Val(x) => x, + } + } + } +} + impl PrgGenericVar { pub fn interpret(&self, io: &mut impl IO) -> Val { let mut scope = PushMap::from_iter( @@ -25,7 +52,7 @@ impl PrgGenericVar { match &self.defs[&sym] { Def::Fn { params, bdy, .. } => scope.push_iter( params.iter().zip(args.iter()).map(|((k, _), v)| (*k, *v)), - |scope| self.interpret_expr(bdy, scope, io), + |scope| self.interpret_expr(bdy, scope, io).val(), ), } } @@ -35,123 +62,133 @@ impl PrgGenericVar { expr: &Expr, scope: &mut PushMap>, io: &mut impl IO, - ) -> Val { - match expr { + ) -> ControlFlow { + ControlFlow::Val(match expr { Expr::Lit { val } => (*val).into(), Expr::Var { sym } => scope[sym], Expr::Prim { op, args } => match (op, args.as_slice()) { (Op::Read, []) => io.read().into(), (Op::Print, [v]) => { - let val = self.interpret_expr(v, scope, io); + let val = b!(self.interpret_expr(v, scope, io)); io.print(Lit::Int { val: val.int() }); val } (Op::Plus, [e1, e2]) => { - let e1 = self.interpret_expr(e1, scope, io).int(); - let e2 = self.interpret_expr(e2, scope, io).int(); + let e1 = b!(self.interpret_expr(e1, scope, io)).int(); + let e2 = b!(self.interpret_expr(e2, scope, io)).int(); Val::Int { val: e1 + e2 } } (Op::Minus, [e1]) => { - let e1 = self.interpret_expr(e1, scope, io).int(); + let e1 = b!(self.interpret_expr(e1, scope, io)).int(); Val::Int { val: -e1 } } (Op::Minus, [e1, e2]) => { - let e1 = self.interpret_expr(e1, scope, io).int(); - let e2 = self.interpret_expr(e2, scope, io).int(); + let e1 = b!(self.interpret_expr(e1, scope, io)).int(); + let e2 = b!(self.interpret_expr(e2, scope, io)).int(); Val::Int { val: e1 - e2 } } (Op::Mul, [e1, e2]) => { - let e1 = self.interpret_expr(e1, scope, io).int(); - let e2 = self.interpret_expr(e2, scope, io).int(); + let e1 = b!(self.interpret_expr(e1, scope, io)).int(); + let e2 = b!(self.interpret_expr(e2, scope, io)).int(); Val::Int { val: e1 * e2 } } (Op::Div, [e1, e2]) => { - let e1 = self.interpret_expr(e1, scope, io).int(); - let e2 = self.interpret_expr(e2, scope, io).int(); + let e1 = b!(self.interpret_expr(e1, scope, io)).int(); + let e2 = b!(self.interpret_expr(e2, scope, io)).int(); Val::Int { val: e1 / e2 } } (Op::Mod, [e1, e2]) => { - let e1 = self.interpret_expr(e1, scope, io).int(); - let e2 = self.interpret_expr(e2, scope, io).int(); + let e1 = b!(self.interpret_expr(e1, scope, io)).int(); + let e2 = b!(self.interpret_expr(e2, scope, io)).int(); Val::Int { val: e1 % e2 } } (Op::GT, [e1, e2]) => { - let e1 = self.interpret_expr(e1, scope, io).int(); - let e2 = self.interpret_expr(e2, scope, io).int(); + let e1 = b!(self.interpret_expr(e1, scope, io)).int(); + let e2 = b!(self.interpret_expr(e2, scope, io)).int(); Val::Bool { val: e1 > e2 } } (Op::GE, [e1, e2]) => { - let e1 = self.interpret_expr(e1, scope, io).int(); - let e2 = self.interpret_expr(e2, scope, io).int(); + let e1 = b!(self.interpret_expr(e1, scope, io)).int(); + let e2 = b!(self.interpret_expr(e2, scope, io)).int(); Val::Bool { val: e1 >= e2 } } (Op::LT, [e1, e2]) => { - let e1 = self.interpret_expr(e1, scope, io).int(); - let e2 = self.interpret_expr(e2, scope, io).int(); + let e1 = b!(self.interpret_expr(e1, scope, io)).int(); + let e2 = b!(self.interpret_expr(e2, scope, io)).int(); Val::Bool { val: e1 < e2 } } (Op::LE, [e1, e2]) => { - let e1 = self.interpret_expr(e1, scope, io).int(); - let e2 = self.interpret_expr(e2, scope, io).int(); + let e1 = b!(self.interpret_expr(e1, scope, io)).int(); + let e2 = b!(self.interpret_expr(e2, scope, io)).int(); Val::Bool { val: e1 <= e2 } } (Op::EQ, [e1, e2]) => { - let e1 = self.interpret_expr(e1, scope, io); - let e2 = self.interpret_expr(e2, scope, io); + let e1 = b!(self.interpret_expr(e1, scope, io)); + let e2 = b!(self.interpret_expr(e2, scope, io)); Val::Bool { val: e1 == e2 } } (Op::NE, [e1, e2]) => { - let e1 = self.interpret_expr(e1, scope, io); - let e2 = self.interpret_expr(e2, scope, io); + let e1 = b!(self.interpret_expr(e1, scope, io)); + let e2 = b!(self.interpret_expr(e2, scope, io)); Val::Bool { val: e1 != e2 } } (Op::Not, [e1]) => { - let e1 = self.interpret_expr(e1, scope, io).bool(); + let e1 = b!(self.interpret_expr(e1, scope, io)).bool(); Val::Bool { val: !e1 } } (Op::LAnd, [e1, e2]) => { - let e1 = self.interpret_expr(e1, scope, io).bool(); + let e1 = b!(self.interpret_expr(e1, scope, io)).bool(); if !e1 { - return Val::Bool { val: false }; + return ControlFlow::Val(Val::Bool { val: false }); } - self.interpret_expr(e2, scope, io) + b!(self.interpret_expr(e2, scope, io)) } (Op::LOr, [e1, e2]) => { - let e1 = self.interpret_expr(e1, scope, io).bool(); + let e1 = b!(self.interpret_expr(e1, scope, io)).bool(); if e1 { - return Val::Bool { val: true }; + return ControlFlow::Val(Val::Bool { val: true }); } - self.interpret_expr(e2, scope, io) + b!(self.interpret_expr(e2, scope, io)) } (Op::Xor, [e1, e2]) => { - let e1 = self.interpret_expr(e1, scope, io).bool(); - let e2 = self.interpret_expr(e2, scope, io).bool(); + let e1 = b!(self.interpret_expr(e1, scope, io)).bool(); + let e2 = b!(self.interpret_expr(e2, scope, io)).bool(); Val::Bool { val: e1 ^ e2 } } _ => unreachable!(), }, Expr::Let { sym, bnd, bdy } => { - let bnd = self.interpret_expr(bnd, scope, io); - scope.push(*sym, bnd, |scope| self.interpret_expr(bdy, scope, io)) + let bnd = b!(self.interpret_expr(bnd, scope, io)); + b!(scope.push(*sym, bnd, |scope| self.interpret_expr(bdy, scope, io))) } Expr::If { cnd, thn, els } => { - if self.interpret_expr(cnd, scope, io).bool() { - self.interpret_expr(thn, scope, io) + if b!(self.interpret_expr(cnd, scope, io)).bool() { + b!(self.interpret_expr(thn, scope, io)) } else { - self.interpret_expr(els, scope, io) + b!(self.interpret_expr(els, scope, io)) } } Expr::Apply { fun, args } => { - let sym = self.interpret_expr(fun, scope, io).fun(); + let sym = b!(self.interpret_expr(fun, scope, io)).fun(); let args = args .iter() - .map(|arg| self.interpret_expr(arg, scope, io)) + .map(|arg| self.interpret_expr(arg, scope, io).val()) .collect(); self.interpret_fn(sym, args, scope, io) } - Expr::Loop { .. } => todo!(), - Expr::Break { .. } => todo!(), - } + Expr::Loop { bdy } => { + loop { + let x = self.interpret_expr(bdy, scope, io); + if let ControlFlow::Break(x) = x { + return ControlFlow::Val(x) + } + } + }, + Expr::Break { bdy } => return ControlFlow::Break(match bdy { + Some(bdy) => b!(self.interpret_expr(bdy, scope, io)), + None => Val::Unit, + }), + }) } } diff --git a/programs/good/loops/loop_never_if.test b/programs/good/loops/loop_never_if.test new file mode 100644 index 0000000..6ba9b6a --- /dev/null +++ b/programs/good/loops/loop_never_if.test @@ -0,0 +1,17 @@ +## +unit +# +fn test() -> Unit { + loop { + if false { + break + } else { + let x = (loop { 5 }); + unit + } + } +} + +fn main() -> Unit { + unit +} diff --git a/programs/good/loops/loop_num_shortcircuit.test b/programs/good/loops/loop_num_shortcircuit.test new file mode 100644 index 0000000..fac8134 --- /dev/null +++ b/programs/good/loops/loop_num_shortcircuit.test @@ -0,0 +1,8 @@ +## +5 +# +fn main() -> Int { + loop { + (break 5) + print(3) + } +} From 4ee270c10e8760e0f6d93b3ae24a119589b159b6 Mon Sep 17 00:00:00 2001 From: Vlamonster Date: Tue, 24 Oct 2023 23:53:28 +0200 Subject: [PATCH 05/27] Fix loop test. --- programs/good/loops/loop_num_shortcircuit.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/good/loops/loop_num_shortcircuit.test b/programs/good/loops/loop_num_shortcircuit.test index fac8134..7afc1a8 100644 --- a/programs/good/loops/loop_num_shortcircuit.test +++ b/programs/good/loops/loop_num_shortcircuit.test @@ -3,6 +3,6 @@ # fn main() -> Int { loop { - (break 5) + print(3) + (let x = (break 5); 2) + print(3) } } From 25d0a75442f5f7ec521a4aff59393482dc25423d Mon Sep 17 00:00:00 2001 From: Vlamonster Date: Wed, 25 Oct 2023 02:25:12 +0200 Subject: [PATCH 06/27] Use the `derive_more` for cleaner `Display` implementations. --- Cargo.lock | 1 + compiler/Cargo.toml | 1 + compiler/src/elf/mod.rs | 1 - compiler/src/interpreter/value.rs | 5 +- compiler/src/interpreter/x86var.rs | 2 +- compiler/src/language/mod.rs | 1 - compiler/src/language/x86var.rs | 54 +++++++++++++--- compiler/src/language/x86var_format.rs | 81 ------------------------ compiler/src/lib.rs | 4 +- compiler/src/main.rs | 4 +- compiler/src/passes/explicate_control.rs | 4 +- compiler/src/passes/parse/interpreter.rs | 34 +++++----- compiler/src/passes/parse/mod.rs | 8 +-- compiler/src/passes/parse/parse.rs | 4 +- compiler/src/passes/reveal_functions.rs | 2 +- compiler/src/passes/select/mod.rs | 2 +- compiler/src/passes/type_check/check.rs | 42 ++++++------ compiler/src/passes/type_check/mod.rs | 2 +- compiler/src/passes/uniquify.rs | 6 +- compiler/src/utils/split_test.rs | 2 +- 20 files changed, 109 insertions(+), 151 deletions(-) delete mode 100644 compiler/src/language/x86var_format.rs diff --git a/Cargo.lock b/Cargo.lock index 4287b42..88aa3a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -531,6 +531,7 @@ version = "0.1.0" dependencies = [ "bitflags 2.4.1", "clap", + "derive_more", "itertools", "lalrpop-util", "miette", diff --git a/compiler/Cargo.toml b/compiler/Cargo.toml index 13b7f6b..9a103d3 100644 --- a/compiler/Cargo.toml +++ b/compiler/Cargo.toml @@ -14,6 +14,7 @@ clap = { version = "4.4.6", features = ["derive"] } miette = { version = "5.10.0", features = ["fancy"] } zerocopy = {version = "0.7.11", features = ["derive"] } lalrpop-util = { version = "0.20", features = ["lexer", "unicode"] } +derive_more = "0.99.17" [dev-dependencies] test_each_file = "0.1.0" diff --git a/compiler/src/elf/mod.rs b/compiler/src/elf/mod.rs index 8be220f..12ca742 100644 --- a/compiler/src/elf/mod.rs +++ b/compiler/src/elf/mod.rs @@ -7,7 +7,6 @@ use std::io::Write; use std::mem::size_of; use zerocopy::AsBytes; -#[allow(clippy::module_inception)] mod header; mod program; mod section; diff --git a/compiler/src/interpreter/value.rs b/compiler/src/interpreter/value.rs index 29a4d82..7294221 100644 --- a/compiler/src/interpreter/value.rs +++ b/compiler/src/interpreter/value.rs @@ -16,12 +16,11 @@ impl From for Val { match value { Lit::Int { val } => Val::Int { val }, Lit::Bool { val } => Val::Bool { val }, - Lit::Unit => Val::Unit + Lit::Unit => Val::Unit, } } } - impl Val { pub fn int(self) -> i64 { match self { @@ -88,7 +87,7 @@ impl Display for Val { } } Val::Function { sym, .. } => write!(f, "pointer to `{sym}``"), - Val::Unit => write!(f, "unit") + Val::Unit => write!(f, "unit"), } } } diff --git a/compiler/src/interpreter/x86var.rs b/compiler/src/interpreter/x86var.rs index a5c8df8..f7a9545 100644 --- a/compiler/src/interpreter/x86var.rs +++ b/compiler/src/interpreter/x86var.rs @@ -1,8 +1,8 @@ use crate::interpreter::IO; -use crate::passes::parse::Lit; use crate::language::x86var::{ Block, Cnd, Instr, Reg, VarArg, X86Concluded, X86Selected, CALLEE_SAVED, CALLER_SAVED, }; +use crate::passes::parse::Lit; use crate::passes::uniquify::UniqueSym; use serde::{Deserialize, Serialize}; use std::collections::HashMap; diff --git a/compiler/src/language/mod.rs b/compiler/src/language/mod.rs index 932d31f..01eeaa5 100644 --- a/compiler/src/language/mod.rs +++ b/compiler/src/language/mod.rs @@ -2,4 +2,3 @@ pub mod alvar; pub mod cvar; pub mod rlvar; pub mod x86var; -pub mod x86var_format; diff --git a/compiler/src/language/x86var.rs b/compiler/src/language/x86var.rs index 95ff329..863c425 100644 --- a/compiler/src/language/x86var.rs +++ b/compiler/src/language/x86var.rs @@ -4,9 +4,12 @@ use crate::{ addq, andq, callq_direct, callq_indirect, cmpq, divq, jcc, jmp, load_lbl, movq, mulq, negq, notq, orq, popq, pushq, retq, setcc, subq, syscall, xorq, }; +use derive_more::Display; +use itertools::Itertools; use petgraph::graphmap::GraphMap; use petgraph::Undirected; use std::collections::{HashMap, HashSet}; +use std::fmt::Display; #[derive(Debug, PartialEq)] pub struct X86Concluded<'p> { @@ -31,7 +34,11 @@ pub struct X86Assigned<'p> { pub std: Std<'p>, } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Display)] +#[display( + fmt = "{}", + r#"blocks.iter().map(|(sym, block)| format!("{sym}:\n{block}")).format("\n")"# +)] pub struct X86Selected<'p> { pub blocks: HashMap, Block<'p, VarArg<'p>>>, pub entry: UniqueSym<'p>, @@ -64,8 +71,9 @@ pub struct X86Colored<'p> { pub type InterferenceGraph<'p> = GraphMap, (), Undirected>; -#[derive(Debug, PartialEq, Clone)] -pub struct Block<'p, A> { +#[derive(Debug, PartialEq, Clone, Display)] +#[display(fmt = "\t{}", r#"instrs.iter().format("\n\t")"#)] +pub struct Block<'p, A: Display> { pub instrs: Vec>, } @@ -74,7 +82,7 @@ pub struct LBlock<'p> { pub instrs: Vec<(Instr<'p, VarArg<'p>>, HashSet>)>, } -#[derive(Copy, Clone, Debug, PartialEq)] +#[derive(Copy, Clone, Debug, PartialEq, Display)] pub enum Cnd { Above, AboveOrEqual, @@ -96,43 +104,71 @@ pub enum Cnd { Sign, } -#[derive(Clone, Debug, PartialEq)] -pub enum Instr<'p, A> { +#[derive(Clone, Debug, PartialEq, Display)] +pub enum Instr<'p, A: Display> { + #[display(fmt = "addq\t{src}\t{dst}")] Addq { src: A, dst: A }, + #[display(fmt = "subq\t{src}\t{dst}")] Subq { src: A, dst: A }, + #[display(fmt = "divq\t{divisor}")] Divq { divisor: A }, + #[display(fmt = "mulq\t{src}")] Mulq { src: A }, + #[display(fmt = "negq\t{dst}")] Negq { dst: A }, + #[display(fmt = "movq\t{src}\t{dst}")] Movq { src: A, dst: A }, + #[display(fmt = "pushq\t{src}")] Pushq { src: A }, + #[display(fmt = "popq\t{dst}")] Popq { dst: A }, + #[display(fmt = "retq")] Retq, + #[display(fmt = "syscall\t// arity: {arity}")] Syscall { arity: usize }, + #[display(fmt = "cmpq\t{src}\t{dst}")] Cmpq { src: A, dst: A }, + #[display(fmt = "jmp\t{lbl}")] Jmp { lbl: UniqueSym<'p> }, + #[display(fmt = "jcc\t{cnd}\t{lbl}")] Jcc { lbl: UniqueSym<'p>, cnd: Cnd }, + #[display(fmt = "andq {src}\t{dst}")] Andq { src: A, dst: A }, + #[display(fmt = "orq {src}\t{dst}")] Orq { src: A, dst: A }, + #[display(fmt = "xorq\t{src}\t{dst}")] Xorq { src: A, dst: A }, + #[display(fmt = "notq\t{dst}")] Notq { dst: A }, + #[display(fmt = "setcc\t{cnd}")] Setcc { cnd: Cnd }, //TODO allow setting other byteregs + #[display(fmt = "loadlbl\t{sym}\t{dst}")] LoadLbl { sym: UniqueSym<'p>, dst: A }, + #[display(fmt = "call_direct\t{lbl}\t// arity: {arity}")] CallqDirect { lbl: UniqueSym<'p>, arity: usize }, + #[display(fmt = "call_indirect\t{src}\t// arity: {arity}")] CallqIndirect { src: A, arity: usize }, } -#[derive(Debug, PartialEq, Clone, Copy, Hash, Eq)] +#[derive(Debug, PartialEq, Clone, Copy, Hash, Eq, Display)] pub enum VarArg<'p> { + #[display(fmt = "${val}")] Imm { val: i64 }, + #[display(fmt = "%{reg}")] Reg { reg: Reg }, + #[display(fmt = "[%{reg} + ${off}]")] Deref { reg: Reg, off: i64 }, + #[display(fmt = "{sym}")] XVar { sym: UniqueSym<'p> }, } -#[derive(Debug, PartialEq, Copy, Clone, Hash, Eq)] +#[derive(Debug, PartialEq, Copy, Clone, Hash, Eq, Display)] pub enum Arg { + #[display(fmt = "${val}")] Imm { val: i64 }, + #[display(fmt = "%{reg}")] Reg { reg: Reg }, + #[display(fmt = "[%{reg} + ${off}]")] Deref { reg: Reg, off: i64 }, } @@ -187,7 +223,7 @@ pub const SYSCALL_REGS: [Reg; 7] = [ /// caller-saved: rax rcx rdx rsi rdi r8 r9 r10 r11 /// callee-saved: rsp rbp rbx r12 r13 r14 r15 /// arg-passing: rdi rsi rdx rcx r8 r9 -#[derive(Debug, PartialEq, Clone, Copy, Eq, Hash, Ord, PartialOrd)] +#[derive(Debug, PartialEq, Clone, Copy, Eq, Hash, Ord, PartialOrd, Display)] #[allow(clippy::upper_case_acronyms)] pub enum Reg { RSP, diff --git a/compiler/src/language/x86var_format.rs b/compiler/src/language/x86var_format.rs deleted file mode 100644 index d13e74f..0000000 --- a/compiler/src/language/x86var_format.rs +++ /dev/null @@ -1,81 +0,0 @@ -use crate::language::x86var::{Block, Cnd, Instr, Reg, VarArg, X86Selected}; -use crate::passes::uniquify::UniqueSym; -use std::fmt::{Display, Formatter}; - -impl Display for X86Selected<'_> { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - for (sym, block) in &self.blocks { - writeln!(f, "{sym}:")?; - write!(f, "{block}")?; - } - Ok(()) - } -} - -impl Display for Block<'_, A> { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - for instr in &self.instrs { - writeln!(f, "\t{instr}")?; - } - Ok(()) - } -} - -impl Display for Instr<'_, A> { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - match self { - Instr::Addq { src, dst } => write!(f, "addq\t{src}\t{dst}"), - Instr::Subq { src, dst } => write!(f, "subq\t{src}\t{dst}"), - Instr::Divq { divisor } => write!(f, "divq\t{divisor}"), - Instr::Mulq { src } => write!(f, "mulq\t{src}"), - Instr::Negq { dst } => write!(f, "negq\t{dst}"), - Instr::Movq { src, dst } => write!(f, "movq\t{src}\t{dst}"), - Instr::Pushq { src } => write!(f, "pushq\t{src}"), - Instr::Popq { dst } => write!(f, "popq\t{dst}"), - Instr::Retq => write!(f, "retq"), - Instr::Syscall { arity } => write!(f, "syscall\t// arity: {arity}"), - Instr::Cmpq { src, dst } => write!(f, "cmpq\t{src}\t{dst}"), - Instr::Jmp { lbl } => write!(f, "jmp\t{lbl}"), - Instr::Jcc { lbl, cnd } => write!(f, "jcc\t{cnd}\t{lbl}"), - Instr::Andq { src, dst } => write!(f, "andq {src}\t{dst}"), - Instr::Orq { src, dst } => write!(f, "orq {src}\t{dst}"), - Instr::Xorq { src, dst } => write!(f, "xorq\t{src}\t{dst}"), - Instr::Notq { dst } => write!(f, "notq\t{dst}"), - Instr::Setcc { cnd } => write!(f, "setcc\t{cnd}"), - Instr::LoadLbl { sym, dst } => write!(f, "loadlbl\t{sym}\t{dst}"), - Instr::CallqDirect { lbl, arity } => write!(f, "call_direct\t{lbl}\t// arity: {arity}"), - Instr::CallqIndirect { src, arity } => { - write!(f, "call_indirect\t{src}\t// arity: {arity}") - } - } - } -} - -impl Display for Cnd { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self) - } -} - -impl Display for Reg { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self) - } -} - -impl Display for UniqueSym<'_> { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - write!(f, "{}.{}", self.sym, self.id) - } -} - -impl Display for VarArg<'_> { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - match self { - VarArg::Imm { val } => write!(f, "${val}"), - VarArg::Reg { reg } => write!(f, "%{reg}"), - VarArg::Deref { reg, off } => write!(f, "[%{reg} + ${off}]"), - VarArg::XVar { sym } => write!(f, "'{sym}'"), - } - } -} diff --git a/compiler/src/lib.rs b/compiler/src/lib.rs index 3b9e51d..0bbc13d 100644 --- a/compiler/src/lib.rs +++ b/compiler/src/lib.rs @@ -1,7 +1,9 @@ +#![allow(clippy::module_inception)] + use crate::elf::ElfFile; +use crate::passes::parse::parse::parse_program; use std::fs::File; use std::path::Path; -use crate::passes::parse::parse::parse_program; pub mod elf; pub mod interpreter; diff --git a/compiler/src/main.rs b/compiler/src/main.rs index f15c56c..c7db803 100644 --- a/compiler/src/main.rs +++ b/compiler/src/main.rs @@ -1,13 +1,13 @@ use crate::MainError::IOResult; use clap::Parser; use compiler::compile; +use compiler::passes::parse::parse::PrettyParseError; +use compiler::passes::type_check::check::TypeError; use miette::Diagnostic; use std::io::Read; use std::path::Path; use std::{fs, io}; use thiserror::Error; -use compiler::passes::parse::parse::PrettyParseError; -use compiler::passes::type_check::check::TypeError; #[derive(Debug, Error, Diagnostic)] enum MainError { diff --git a/compiler/src/passes/explicate_control.rs b/compiler/src/passes/explicate_control.rs index 85f8e1d..c9d3ce1 100644 --- a/compiler/src/passes/explicate_control.rs +++ b/compiler/src/passes/explicate_control.rs @@ -247,7 +247,9 @@ fn explicate_pred<'p>( val: Lit::Int { .. }, }, } => unreachable!(), - AExpr::Atom { atm: Atom::Val { val: Lit::Unit } } => todo!() + AExpr::Atom { + atm: Atom::Val { val: Lit::Unit }, + } => todo!(), } } diff --git a/compiler/src/passes/parse/interpreter.rs b/compiler/src/passes/parse/interpreter.rs index 992bd96..184458e 100644 --- a/compiler/src/passes/parse/interpreter.rs +++ b/compiler/src/passes/parse/interpreter.rs @@ -21,15 +21,13 @@ impl ControlFlow { } macro_rules! b { - ($e: expr) => { - { - let e = $e; - match e { - ControlFlow::Break(_) => return e, - ControlFlow::Val(x) => x, - } + ($e: expr) => {{ + let e = $e; + match e { + ControlFlow::Break(_) => return e, + ControlFlow::Val(x) => x, } - } + }}; } impl PrgGenericVar { @@ -176,18 +174,18 @@ impl PrgGenericVar { .collect(); self.interpret_fn(sym, args, scope, io) } - Expr::Loop { bdy } => { - loop { - let x = self.interpret_expr(bdy, scope, io); - if let ControlFlow::Break(x) = x { - return ControlFlow::Val(x) - } + Expr::Loop { bdy } => loop { + let x = self.interpret_expr(bdy, scope, io); + if let ControlFlow::Break(x) = x { + return ControlFlow::Val(x); } }, - Expr::Break { bdy } => return ControlFlow::Break(match bdy { - Some(bdy) => b!(self.interpret_expr(bdy, scope, io)), - None => Val::Unit, - }), + Expr::Break { bdy } => { + return ControlFlow::Break(match bdy { + Some(bdy) => b!(self.interpret_expr(bdy, scope, io)), + None => Val::Unit, + }) + } }) } } diff --git a/compiler/src/passes/parse/mod.rs b/compiler/src/passes/parse/mod.rs index d7f1f0d..d80c9b1 100644 --- a/compiler/src/passes/parse/mod.rs +++ b/compiler/src/passes/parse/mod.rs @@ -4,8 +4,8 @@ mod grammar; pub mod interpreter; pub mod parse; -use std::collections::HashMap; use crate::passes::type_check::Type; +use std::collections::HashMap; use std::fmt::{Display, Formatter}; use std::hash::Hash; @@ -62,7 +62,7 @@ pub enum Expr { }, Break { bdy: Option>>, - } + }, } #[derive(Copy, Clone, Debug, PartialEq)] @@ -90,7 +90,7 @@ pub enum Op { pub enum Lit { Int { val: i64 }, Bool { val: bool }, - Unit + Unit, } impl Lit { @@ -120,7 +120,7 @@ impl Display for Lit { write!(f, "false") } } - Lit::Unit => write!(f, "unit") + Lit::Unit => write!(f, "unit"), } } } diff --git a/compiler/src/passes/parse/parse.rs b/compiler/src/passes/parse/parse.rs index 27f018b..63adc2a 100644 --- a/compiler/src/passes/parse/parse.rs +++ b/compiler/src/passes/parse/parse.rs @@ -1,7 +1,7 @@ -use miette::{Diagnostic, SourceSpan}; -use thiserror::Error; use crate::passes::parse::grammar::ProgramParser; use crate::passes::parse::PrgParsed; +use miette::{Diagnostic, SourceSpan}; +use thiserror::Error; #[derive(Error, Debug, Diagnostic)] #[error("Parse error!")] diff --git a/compiler/src/passes/reveal_functions.rs b/compiler/src/passes/reveal_functions.rs index faf1922..58be343 100644 --- a/compiler/src/passes/reveal_functions.rs +++ b/compiler/src/passes/reveal_functions.rs @@ -1,5 +1,5 @@ -use crate::passes::parse::{Def, Expr}; use crate::language::rlvar::{PrgRevealed, RDef, RExpr}; +use crate::passes::parse::{Def, Expr}; use crate::passes::uniquify::{PrgUniquified, UniqueSym}; use crate::utils::push_map::PushMap; diff --git a/compiler/src/passes/select/mod.rs b/compiler/src/passes/select/mod.rs index b0f0eb4..554c109 100644 --- a/compiler/src/passes/select/mod.rs +++ b/compiler/src/passes/select/mod.rs @@ -7,10 +7,10 @@ pub mod io; use crate::language::alvar::Atom; use crate::language::cvar::{CExpr, PrgExplicated, Tail}; -use crate::passes::parse::Op; use crate::language::x86var::{ Block, Cnd, Instr, VarArg, X86Selected, ARG_PASSING_REGS, CALLEE_SAVED_NO_STACK, }; +use crate::passes::parse::Op; use crate::passes::select::io::Std; use crate::passes::uniquify::{gen_sym, UniqueSym}; use crate::*; diff --git a/compiler/src/passes/type_check/check.rs b/compiler/src/passes/type_check/check.rs index 4c0b1f1..130afb5 100644 --- a/compiler/src/passes/type_check/check.rs +++ b/compiler/src/passes/type_check/check.rs @@ -1,12 +1,12 @@ use crate::passes::parse::{Def, Expr, Lit, Op, PrgParsed}; +use crate::passes::type_check::check::TypeError::*; +use crate::passes::type_check::PrgTypeChecked; +use crate::passes::type_check::*; use crate::utils::expect::expect; use crate::utils::push_map::PushMap; use miette::Diagnostic; use std::collections::{HashMap, HashSet}; use thiserror::Error; -use crate::passes::type_check::*; -use crate::passes::type_check::check::TypeError::*; -use crate::passes::type_check::PrgTypeChecked; #[derive(Debug, Error, Diagnostic)] #[diagnostic()] @@ -81,7 +81,8 @@ impl<'p> PrgParsed<'p> { ref params, ref bdy, ref typ, - } => env.push_iter(params.iter().cloned(), |env| { + } => env + .push_iter(params.iter().cloned(), |env| { expect_type(bdy, typ.clone(), env) }) .map(|_| (sym, def)), @@ -133,16 +134,13 @@ fn uncover_fns<'p>(program: &PrgParsed<'p>) -> Result, Ty Ok(PushMap::from(globals)) } -fn type_check_expr<'p>( - expr: &Expr<&'p str>, - env: &mut Env<'_, 'p>, -) -> Result { +fn type_check_expr<'p>(expr: &Expr<&'p str>, env: &mut Env<'_, 'p>) -> Result { match expr { - Expr::Lit { val} => match val { + Expr::Lit { val } => match val { Lit::Int { .. } => Ok(Type::Int), Lit::Bool { .. } => Ok(Type::Bool), Lit::Unit => Ok(Type::Unit), - } + }, Expr::Var { sym } => env.scope.get(sym).cloned().ok_or(UndeclaredVar { sym: (*sym).to_string(), }), @@ -172,7 +170,7 @@ fn type_check_expr<'p>( Ok(Type::Bool) } (Op::Not, [e1]) => { - expect_type(e1, Type::Bool, env)?; + expect_type(e1, Type::Bool, env)?; Ok(Type::Bool) } (Op::LAnd | Op::LOr | Op::Xor, [e1, e2]) => { @@ -184,7 +182,7 @@ fn type_check_expr<'p>( }, Expr::Let { sym, bnd, bdy } => { let t = type_check_expr(bnd, env)?; - env.push(sym, t, |env| type_check_expr(bdy, env) ) + env.push(sym, t, |env| type_check_expr(bdy, env)) } Expr::If { cnd, thn, els } => { expect_type(cnd, Type::Bool, env)?; @@ -224,22 +222,24 @@ fn type_check_expr<'p>( expect(env.in_loop, BreakOutsideLoop)?; let bdy_type = match bdy { - None => { - Type::Unit - }, - Some(bdy) => { - type_check_expr(bdy, env)? - }, + None => Type::Unit, + Some(bdy) => type_check_expr(bdy, env)?, }; if let Some(loop_type) = env.loop_type { - expect(*loop_type == bdy_type, TypeMismatchEqual { t1: loop_type.clone(), t2: bdy_type.clone() })?; + expect( + *loop_type == bdy_type, + TypeMismatchEqual { + t1: loop_type.clone(), + t2: bdy_type.clone(), + }, + )?; } else { *env.loop_type = Some(bdy_type); } Ok(Type::Never) - }, + } } } @@ -271,8 +271,8 @@ fn expect_type<'p>( #[cfg(test)] mod tests { - use test_each_file::test_each_file; use crate::passes::parse::parse::parse_program; + use test_each_file::test_each_file; fn check([test]: [&str; 1], should_fail: bool) { let mut test = test.split('#'); diff --git a/compiler/src/passes/type_check/mod.rs b/compiler/src/passes/type_check/mod.rs index 9514226..7bf3ae6 100644 --- a/compiler/src/passes/type_check/mod.rs +++ b/compiler/src/passes/type_check/mod.rs @@ -1,8 +1,8 @@ pub mod check; -use std::fmt::{Display, Formatter}; use crate::passes::parse::PrgGenericVar; use itertools::Itertools; +use std::fmt::{Display, Formatter}; pub type PrgTypeChecked<'p> = PrgGenericVar<&'p str>; diff --git a/compiler/src/passes/uniquify.rs b/compiler/src/passes/uniquify.rs index 12bf582..567e0d7 100644 --- a/compiler/src/passes/uniquify.rs +++ b/compiler/src/passes/uniquify.rs @@ -4,9 +4,10 @@ //! and after selecting instructions we will only have a list of X86 instructions left. use crate::passes::parse::{Def, Expr, PrgGenericVar}; +use crate::passes::type_check::PrgTypeChecked; use crate::utils::push_map::PushMap; +use derive_more::Display; use std::sync::atomic::{AtomicUsize, Ordering}; -use crate::passes::type_check::PrgTypeChecked; static COUNT: AtomicUsize = AtomicUsize::new(0); @@ -98,7 +99,8 @@ fn uniquify_expression<'p>( } } -#[derive(Copy, Clone, Eq, PartialEq, Debug, Hash, Ord, PartialOrd)] +#[derive(Copy, Clone, Eq, PartialEq, Debug, Hash, Ord, PartialOrd, Display)] +#[display(fmt = "{sym}.{id}")] pub struct UniqueSym<'p> { pub sym: &'p str, pub id: usize, diff --git a/compiler/src/utils/split_test.rs b/compiler/src/utils/split_test.rs index 63118cc..4603565 100644 --- a/compiler/src/utils/split_test.rs +++ b/compiler/src/utils/split_test.rs @@ -1,7 +1,7 @@ use crate::interpreter::value::Val; +use crate::passes::parse::parse::parse_program; use crate::passes::parse::{Lit, PrgParsed}; use std::hash::Hash; -use crate::passes::parse::parse::parse_program; pub fn split_test_raw(test: &str) -> (Vec, Vec, Lit, &str) { let mut test = test.split('#'); From 2929016c77138d8ebe281250450d6be17e3dc669 Mon Sep 17 00:00:00 2001 From: Vlamonster Date: Wed, 25 Oct 2023 02:47:23 +0200 Subject: [PATCH 07/27] Use the `derive_more` for cleaner `Display` implementations. --- compiler/src/interpreter/value.rs | 32 ++++++++---------------- compiler/src/passes/parse/interpreter.rs | 8 +++--- compiler/src/passes/parse/mod.rs | 23 ++++------------- compiler/src/passes/type_check/mod.rs | 21 ++++++---------- 4 files changed, 26 insertions(+), 58 deletions(-) diff --git a/compiler/src/interpreter/value.rs b/compiler/src/interpreter/value.rs index 7294221..eabe946 100644 --- a/compiler/src/interpreter/value.rs +++ b/compiler/src/interpreter/value.rs @@ -1,17 +1,22 @@ use crate::passes::parse::Lit; -use std::fmt::{Display, Formatter}; +use derive_more::Display; +use std::fmt::Display; use std::hash::Hash; use std::str::FromStr; -#[derive(Eq, PartialEq, Copy, Clone, Debug)] -pub enum Val { +#[derive(Eq, PartialEq, Copy, Clone, Debug, Display)] +pub enum Val { + #[display(fmt = "{val}")] Int { val: i64 }, + #[display(fmt = "{}", r#"if *val { "true" } else { "false" }"#)] Bool { val: bool }, + #[display(fmt = "unit")] Unit, + #[display(fmt = "fn pointer `{sym}`")] Function { sym: A }, } -impl From for Val { +impl From for Val { fn from(value: Lit) -> Self { match value { Lit::Int { val } => Val::Int { val }, @@ -21,7 +26,7 @@ impl From for Val { } } -impl Val { +impl Val { pub fn int(self) -> i64 { match self { Val::Int { val } => val, @@ -74,20 +79,3 @@ impl FromStr for Lit { }) } } - -impl Display for Val { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - match self { - Val::Int { val } => write!(f, "{val}"), - Val::Bool { val } => { - if *val { - write!(f, "true") - } else { - write!(f, "false") - } - } - Val::Function { sym, .. } => write!(f, "pointer to `{sym}``"), - Val::Unit => write!(f, "unit"), - } - } -} diff --git a/compiler/src/passes/parse/interpreter.rs b/compiler/src/passes/parse/interpreter.rs index 184458e..3c53bb4 100644 --- a/compiler/src/passes/parse/interpreter.rs +++ b/compiler/src/passes/parse/interpreter.rs @@ -2,16 +2,16 @@ use crate::interpreter::value::Val; use crate::interpreter::IO; use crate::passes::parse::{Def, Expr, Lit, Op, PrgGenericVar}; use crate::utils::push_map::PushMap; -use std::fmt::Debug; +use std::fmt::{Debug, Display}; use std::hash::Hash; #[derive(Copy, Clone)] -pub enum ControlFlow { +pub enum ControlFlow { Val(Val), Break(Val), } -impl ControlFlow { +impl ControlFlow { pub fn val(self) -> Val { match self { ControlFlow::Val(v) => v, @@ -30,7 +30,7 @@ macro_rules! b { }}; } -impl PrgGenericVar { +impl PrgGenericVar { pub fn interpret(&self, io: &mut impl IO) -> Val { let mut scope = PushMap::from_iter( self.defs diff --git a/compiler/src/passes/parse/mod.rs b/compiler/src/passes/parse/mod.rs index d80c9b1..4baf8e6 100644 --- a/compiler/src/passes/parse/mod.rs +++ b/compiler/src/passes/parse/mod.rs @@ -5,8 +5,8 @@ pub mod interpreter; pub mod parse; use crate::passes::type_check::Type; +use derive_more::Display; use std::collections::HashMap; -use std::fmt::{Display, Formatter}; use std::hash::Hash; #[derive(Debug, PartialEq)] @@ -86,10 +86,13 @@ pub enum Op { NE, } -#[derive(Copy, Clone, Debug, PartialEq)] +#[derive(Copy, Clone, Debug, PartialEq, Display)] pub enum Lit { + #[display(fmt = "{val}")] Int { val: i64 }, + #[display(fmt = "{}", r#"if *val { "true" } else { "false" }"#)] Bool { val: bool }, + #[display(fmt = "unit")] Unit, } @@ -108,19 +111,3 @@ impl Lit { } } } - -impl Display for Lit { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - match self { - Lit::Int { val } => write!(f, "{val}"), - Lit::Bool { val } => { - if *val { - write!(f, "true") - } else { - write!(f, "false") - } - } - Lit::Unit => write!(f, "unit"), - } - } -} diff --git a/compiler/src/passes/type_check/mod.rs b/compiler/src/passes/type_check/mod.rs index 7bf3ae6..7f30caf 100644 --- a/compiler/src/passes/type_check/mod.rs +++ b/compiler/src/passes/type_check/mod.rs @@ -1,28 +1,21 @@ pub mod check; use crate::passes::parse::PrgGenericVar; +use derive_more::Display; use itertools::Itertools; -use std::fmt::{Display, Formatter}; pub type PrgTypeChecked<'p> = PrgGenericVar<&'p str>; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Display)] pub enum Type { + #[display(fmt = "Int")] Int, + #[display(fmt = "Bool")] Bool, + #[display(fmt = "Unit")] Unit, + #[display(fmt = "Never")] Never, + #[display(fmt = "fn({}) -> {typ}", r#"args.iter().format(", ")"#)] Fn { typ: Box, args: Vec }, } - -impl Display for Type { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - match self { - Type::Int => write!(f, "Int"), - Type::Bool => write!(f, "Bool"), - Type::Unit => write!(f, "Unit"), - Type::Never => write!(f, "Never"), - Type::Fn { typ, args } => write!(f, "fn({}) -> {}", args.iter().format(", "), typ), - } - } -} From f53130bc98a5e8a1394da6c72a94317df46dfe81 Mon Sep 17 00:00:00 2001 From: Vlamonster Date: Wed, 25 Oct 2023 02:59:58 +0200 Subject: [PATCH 08/27] Use the `derive_more` for cleaner `Index` implementations. --- compiler/Cargo.toml | 2 +- compiler/src/utils/push_map.rs | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/compiler/Cargo.toml b/compiler/Cargo.toml index 9a103d3..f670c2e 100644 --- a/compiler/Cargo.toml +++ b/compiler/Cargo.toml @@ -12,7 +12,7 @@ itertools = "0.11.0" serde = { version = "1.0.189", features = ["derive"] } clap = { version = "4.4.6", features = ["derive"] } miette = { version = "5.10.0", features = ["fancy"] } -zerocopy = {version = "0.7.11", features = ["derive"] } +zerocopy = { version = "0.7.11", features = ["derive"] } lalrpop-util = { version = "0.20", features = ["lexer", "unicode"] } derive_more = "0.99.17" diff --git a/compiler/src/utils/push_map.rs b/compiler/src/utils/push_map.rs index 73bfa61..3f92d72 100644 --- a/compiler/src/utils/push_map.rs +++ b/compiler/src/utils/push_map.rs @@ -1,8 +1,10 @@ +use derive_more::Index; use std::collections::HashMap; use std::fmt::Debug; use std::hash::Hash; use std::ops::Index; +#[derive(Index)] pub struct PushMap(HashMap); impl Default for PushMap { @@ -80,15 +82,3 @@ impl PushMap { o } } - -impl Index<&K> for PushMap { - type Output = V; - - fn index(&self, index: &K) -> &Self::Output { - assert!( - self.0.contains_key(index), - "Expected to find {index:?} in push map." - ); - &self.0[index] - } -} From d26433664b23f651ce8739612f9fb5d9b8a2454f Mon Sep 17 00:00:00 2001 From: jonathan Date: Sat, 28 Oct 2023 16:55:34 +0200 Subject: [PATCH 09/27] Use functor_derive --- Cargo.lock | 21 ++++++++++ compiler/Cargo.toml | 1 + compiler/src/interpreter/x86var.rs | 3 +- compiler/src/language/x86var.rs | 63 +++--------------------------- 4 files changed, 30 insertions(+), 58 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 88aa3a0..4596956 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -532,6 +532,7 @@ dependencies = [ "bitflags 2.4.1", "clap", "derive_more", + "functor_derive", "itertools", "lalrpop-util", "miette", @@ -812,6 +813,26 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +[[package]] +name = "functor_derive" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e9314761e9d91c3a2283818f3ecc01f1b8136ec062bd0120126087395aa7309" +dependencies = [ + "functor_derive_lib", +] + +[[package]] +name = "functor_derive_lib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e2eb26e533f90d0887d9cdfbf59909d07e2c12abfa02c66d99e2447865ec069" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + [[package]] name = "funty" version = "2.0.0" diff --git a/compiler/Cargo.toml b/compiler/Cargo.toml index f670c2e..3849d0b 100644 --- a/compiler/Cargo.toml +++ b/compiler/Cargo.toml @@ -15,6 +15,7 @@ miette = { version = "5.10.0", features = ["fancy"] } zerocopy = { version = "0.7.11", features = ["derive"] } lalrpop-util = { version = "0.20", features = ["lexer", "unicode"] } derive_more = "0.99.17" +functor_derive = "0.2.2" [dev-dependencies] test_each_file = "0.1.0" diff --git a/compiler/src/interpreter/x86var.rs b/compiler/src/interpreter/x86var.rs index f7a9545..e9ce47a 100644 --- a/compiler/src/interpreter/x86var.rs +++ b/compiler/src/interpreter/x86var.rs @@ -6,6 +6,7 @@ use crate::passes::parse::Lit; use crate::passes::uniquify::UniqueSym; use serde::{Deserialize, Serialize}; use std::collections::HashMap; +use std::fmt::Debug; use std::mem; use zerocopy::AsBytes; @@ -61,7 +62,7 @@ impl<'p> X86Concluded<'p> { .blocks .clone() .into_iter() - .map(|(sym, block)| (sym, block.into())) + .map(|(sym, block)| (sym, block.fmap(Into::into))) .collect(), io, regs, diff --git a/compiler/src/language/x86var.rs b/compiler/src/language/x86var.rs index 863c425..679b306 100644 --- a/compiler/src/language/x86var.rs +++ b/compiler/src/language/x86var.rs @@ -1,10 +1,7 @@ use crate::passes::select::io::Std; use crate::passes::uniquify::UniqueSym; -use crate::{ - addq, andq, callq_direct, callq_indirect, cmpq, divq, jcc, jmp, load_lbl, movq, mulq, negq, - notq, orq, popq, pushq, retq, setcc, subq, syscall, xorq, -}; use derive_more::Display; +use functor_derive::Functor; use itertools::Itertools; use petgraph::graphmap::GraphMap; use petgraph::Undirected; @@ -71,7 +68,7 @@ pub struct X86Colored<'p> { pub type InterferenceGraph<'p> = GraphMap, (), Undirected>; -#[derive(Debug, PartialEq, Clone, Display)] +#[derive(Debug, PartialEq, Clone, Display, Functor)] #[display(fmt = "\t{}", r#"instrs.iter().format("\n\t")"#)] pub struct Block<'p, A: Display> { pub instrs: Vec>, @@ -104,7 +101,7 @@ pub enum Cnd { Sign, } -#[derive(Clone, Debug, PartialEq, Display)] +#[derive(Clone, Debug, PartialEq, Display, Functor)] pub enum Instr<'p, A: Display> { #[display(fmt = "addq\t{src}\t{dst}")] Addq { src: A, dst: A }, @@ -247,11 +244,7 @@ pub enum Reg { impl<'p> From> for X86Selected<'p> { fn from(value: X86Concluded<'p>) -> Self { X86Selected { - blocks: value - .blocks - .into_iter() - .map(|(n, b)| (n, b.into())) - .collect(), + blocks: value.blocks.fmap(|v| v.fmap(Into::into)), entry: value.entry, std: value.std, } @@ -261,11 +254,7 @@ impl<'p> From> for X86Selected<'p> { impl<'p> From> for X86Selected<'p> { fn from(value: X86Patched<'p>) -> Self { X86Selected { - blocks: value - .blocks - .into_iter() - .map(|(n, b)| (n, b.into())) - .collect(), + blocks: value.blocks.fmap(|v| v.fmap(Into::into)), entry: value.entry, std: value.std, } @@ -275,25 +264,13 @@ impl<'p> From> for X86Selected<'p> { impl<'p> From> for X86Selected<'p> { fn from(value: X86Assigned<'p>) -> Self { X86Selected { - blocks: value - .blocks - .into_iter() - .map(|(n, b)| (n, b.into())) - .collect(), + blocks: value.blocks.fmap(|v| v.fmap(Into::into)), entry: value.entry, std: value.std, } } } -impl<'p> From> for Block<'p, VarArg<'p>> { - fn from(value: Block<'p, Arg>) -> Self { - Block { - instrs: value.instrs.into_iter().map(From::from).collect(), - } - } -} - impl<'p> From> for Block<'p, VarArg<'p>> { fn from(value: LBlock<'p>) -> Self { Block { @@ -302,34 +279,6 @@ impl<'p> From> for Block<'p, VarArg<'p>> { } } -impl<'p> From> for Instr<'p, VarArg<'p>> { - fn from(value: Instr<'p, Arg>) -> Self { - match value { - Instr::Addq { src, dst } => addq!(src.into(), dst.into()), - Instr::Subq { src, dst } => subq!(src.into(), dst.into()), - Instr::Negq { dst } => negq!(dst.into()), - Instr::Movq { src, dst } => movq!(src.into(), dst.into()), - Instr::Pushq { src } => pushq!(src.into()), - Instr::Popq { dst } => popq!(dst.into()), - Instr::CallqDirect { lbl, arity } => callq_direct!(lbl, arity), - Instr::Retq => retq!(), - Instr::Jmp { lbl } => jmp!(lbl), - Instr::Syscall { arity } => syscall!(arity), - Instr::Divq { divisor } => divq!(divisor.into()), - Instr::Jcc { lbl, cnd } => jcc!(lbl, cnd), - Instr::Mulq { src } => mulq!(src.into()), - Instr::Cmpq { src, dst } => cmpq!(src.into(), dst.into()), - Instr::Andq { src, dst } => andq!(src.into(), dst.into()), - Instr::Orq { src, dst } => orq!(src.into(), dst.into()), - Instr::Xorq { src, dst } => xorq!(src.into(), dst.into()), - Instr::Notq { dst } => notq!(dst.into()), - Instr::Setcc { cnd } => setcc!(cnd), - Instr::LoadLbl { sym, dst } => load_lbl!(sym, dst.into()), - Instr::CallqIndirect { src, arity } => callq_indirect!(src.into(), arity), - } - } -} - impl<'p> From for VarArg<'p> { fn from(value: Arg) -> Self { match value { From fb8dd51905ad62811d64090a83e50298232633a1 Mon Sep 17 00:00:00 2001 From: jonathan Date: Sat, 28 Oct 2023 20:58:02 +0200 Subject: [PATCH 10/27] Uniquify --- compiler/src/interpreter/cvar.rs | 2 +- compiler/src/interpreter/x86var.rs | 2 +- compiler/src/language/alvar.rs | 3 +- compiler/src/language/cvar.rs | 2 +- compiler/src/language/rlvar.rs | 3 +- compiler/src/language/x86var.rs | 2 +- compiler/src/passes/assign_homes.rs | 4 +- compiler/src/passes/atomize.rs | 2 +- compiler/src/passes/coloring_interference.rs | 2 +- compiler/src/passes/conclude.rs | 2 +- compiler/src/passes/emit/mod.rs | 2 +- compiler/src/passes/explicate_control.rs | 2 +- compiler/src/passes/liveness_analysis.rs | 2 +- compiler/src/passes/patch_instructions.rs | 2 +- compiler/src/passes/reveal_functions.rs | 3 +- compiler/src/passes/select/io.rs | 2 +- compiler/src/passes/select/mod.rs | 4 +- compiler/src/passes/uniquify/mod.rs | 25 ++++++++ .../src/passes/{ => uniquify}/uniquify.rs | 57 +++---------------- compiler/src/utils/gen_sym.rs | 18 ++++++ compiler/src/utils/mod.rs | 1 + programs/good/loops/loop_never_if.test | 11 ++-- 22 files changed, 79 insertions(+), 74 deletions(-) create mode 100644 compiler/src/passes/uniquify/mod.rs rename compiler/src/passes/{ => uniquify}/uniquify.rs (61%) create mode 100644 compiler/src/utils/gen_sym.rs diff --git a/compiler/src/interpreter/cvar.rs b/compiler/src/interpreter/cvar.rs index 5fb4510..53ac477 100644 --- a/compiler/src/interpreter/cvar.rs +++ b/compiler/src/interpreter/cvar.rs @@ -3,7 +3,7 @@ use crate::interpreter::IO; use crate::language::alvar::Atom; use crate::language::cvar::{CExpr, PrgExplicated, Tail}; use crate::passes::parse::{Lit, Op}; -use crate::passes::uniquify::UniqueSym; +use crate::utils::gen_sym::UniqueSym; use crate::utils::push_map::PushMap; impl<'p> PrgExplicated<'p> { diff --git a/compiler/src/interpreter/x86var.rs b/compiler/src/interpreter/x86var.rs index e9ce47a..5f6df92 100644 --- a/compiler/src/interpreter/x86var.rs +++ b/compiler/src/interpreter/x86var.rs @@ -3,7 +3,7 @@ use crate::language::x86var::{ Block, Cnd, Instr, Reg, VarArg, X86Concluded, X86Selected, CALLEE_SAVED, CALLER_SAVED, }; use crate::passes::parse::Lit; -use crate::passes::uniquify::UniqueSym; +use crate::utils::gen_sym::UniqueSym; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::fmt::Debug; diff --git a/compiler/src/language/alvar.rs b/compiler/src/language/alvar.rs index c088d18..085a627 100644 --- a/compiler/src/language/alvar.rs +++ b/compiler/src/language/alvar.rs @@ -1,6 +1,7 @@ use crate::passes::parse::{Def, Expr, Lit, Op}; use crate::passes::type_check::Type; -use crate::passes::uniquify::{PrgUniquified, UniqueSym}; +use crate::passes::uniquify::PrgUniquified; +use crate::utils::gen_sym::UniqueSym; use std::collections::HashMap; #[derive(Debug, PartialEq)] diff --git a/compiler/src/language/cvar.rs b/compiler/src/language/cvar.rs index e108552..d5b695d 100644 --- a/compiler/src/language/cvar.rs +++ b/compiler/src/language/cvar.rs @@ -1,6 +1,6 @@ use crate::language::alvar::Atom; use crate::passes::parse::Op; -use crate::passes::uniquify::UniqueSym; +use crate::utils::gen_sym::UniqueSym; use std::collections::HashMap; #[derive(Debug, PartialEq)] diff --git a/compiler/src/language/rlvar.rs b/compiler/src/language/rlvar.rs index a582a3d..c9c055e 100644 --- a/compiler/src/language/rlvar.rs +++ b/compiler/src/language/rlvar.rs @@ -1,6 +1,7 @@ use crate::passes::parse::{Def, Expr, Lit, Op}; use crate::passes::type_check::Type; -use crate::passes::uniquify::{PrgUniquified, UniqueSym}; +use crate::passes::uniquify::PrgUniquified; +use crate::utils::gen_sym::UniqueSym; use std::collections::HashMap; #[derive(Debug, PartialEq)] diff --git a/compiler/src/language/x86var.rs b/compiler/src/language/x86var.rs index 679b306..6c493db 100644 --- a/compiler/src/language/x86var.rs +++ b/compiler/src/language/x86var.rs @@ -1,5 +1,5 @@ use crate::passes::select::io::Std; -use crate::passes::uniquify::UniqueSym; +use crate::utils::gen_sym::UniqueSym; use derive_more::Display; use functor_derive::Functor; use itertools::Itertools; diff --git a/compiler/src/passes/assign_homes.rs b/compiler/src/passes/assign_homes.rs index 8c3b2c2..b7490cf 100644 --- a/compiler/src/passes/assign_homes.rs +++ b/compiler/src/passes/assign_homes.rs @@ -3,7 +3,7 @@ //! This pass is responsible for assigning all the program variables to locations on the stack. use crate::language::x86var::{Arg, Block, Instr, VarArg, X86Assigned, X86Colored}; -use crate::passes::uniquify::UniqueSym; +use crate::utils::gen_sym::UniqueSym; use crate::{ addq, andq, callq_direct, callq_indirect, cmpq, divq, jcc, jmp, load_lbl, movq, mulq, negq, notq, orq, popq, pushq, retq, setcc, subq, syscall, xorq, @@ -79,7 +79,7 @@ fn assign_instr<'p>( mod tests { use crate::interpreter::TestIO; use crate::language::x86var::X86Selected; - use crate::passes::uniquify::gen_sym; + use crate::utils::gen_sym::gen_sym; use crate::utils::split_test::split_test; use crate::{block, callq_direct, movq, reg}; use test_each_file::test_each_file; diff --git a/compiler/src/passes/atomize.rs b/compiler/src/passes/atomize.rs index 261a7ab..45ed981 100644 --- a/compiler/src/passes/atomize.rs +++ b/compiler/src/passes/atomize.rs @@ -8,7 +8,7 @@ use crate::language::alvar::{ADef, AExpr, Atom, PrgAtomized}; use crate::language::rlvar::{PrgRevealed, RDef, RExpr}; -use crate::passes::uniquify::{gen_sym, UniqueSym}; +use crate::utils::gen_sym::{gen_sym, UniqueSym}; impl<'p> PrgRevealed<'p> { /// See module-level documentation. diff --git a/compiler/src/passes/coloring_interference.rs b/compiler/src/passes/coloring_interference.rs index 4a38aac..f3e74a4 100644 --- a/compiler/src/passes/coloring_interference.rs +++ b/compiler/src/passes/coloring_interference.rs @@ -1,5 +1,5 @@ use crate::language::x86var::{Arg, InterferenceGraph, LArg, Reg, X86Colored, X86WithInterference}; -use crate::passes::uniquify::UniqueSym; +use crate::utils::gen_sym::UniqueSym; use itertools::Itertools; use std::collections::{HashMap, HashSet}; diff --git a/compiler/src/passes/conclude.rs b/compiler/src/passes/conclude.rs index 69cc5df..4d804a3 100644 --- a/compiler/src/passes/conclude.rs +++ b/compiler/src/passes/conclude.rs @@ -4,7 +4,7 @@ //! Note that we will refer to the body of the `PX86Program` program as the 'core' block. use crate::language::x86var::{X86Concluded, X86Patched}; -use crate::passes::uniquify::gen_sym; +use crate::utils::gen_sym::gen_sym; use crate::{addq, block, callq_direct, imm, movq, popq, pushq, reg, subq}; impl<'p> X86Patched<'p> { diff --git a/compiler/src/passes/emit/mod.rs b/compiler/src/passes/emit/mod.rs index 9657b74..3583fe9 100644 --- a/compiler/src/passes/emit/mod.rs +++ b/compiler/src/passes/emit/mod.rs @@ -16,7 +16,7 @@ use crate::passes::emit::mul_div::{encode_muldiv_instr, MulDivOpInfo}; use crate::passes::emit::push_pop::{encode_push_pop, POPQ_INFO, PUSHQ_INFO}; use crate::passes::emit::special::encode_setcc; use crate::passes::emit::unary::{encode_unary_instr, CALLQ_INDIRECT_INFO, NEGQ_INFO}; -use crate::passes::uniquify::UniqueSym; +use crate::utils::gen_sym::UniqueSym; use std::collections::HashMap; impl<'p> X86Concluded<'p> { diff --git a/compiler/src/passes/explicate_control.rs b/compiler/src/passes/explicate_control.rs index c9d3ce1..8d118a6 100644 --- a/compiler/src/passes/explicate_control.rs +++ b/compiler/src/passes/explicate_control.rs @@ -7,7 +7,7 @@ use crate::language::alvar::ADef; use crate::language::alvar::{AExpr, Atom, PrgAtomized}; use crate::language::cvar::{CExpr, PrgExplicated, Tail}; use crate::passes::parse::{Lit, Op}; -use crate::passes::uniquify::{gen_sym, UniqueSym}; +use crate::utils::gen_sym::{gen_sym, UniqueSym}; use std::collections::HashMap; impl<'p> PrgAtomized<'p> { diff --git a/compiler/src/passes/liveness_analysis.rs b/compiler/src/passes/liveness_analysis.rs index 3ed53a7..1e63db1 100644 --- a/compiler/src/passes/liveness_analysis.rs +++ b/compiler/src/passes/liveness_analysis.rs @@ -2,7 +2,7 @@ use crate::language::x86var::{ Block, Instr, LArg, LBlock, LX86VarProgram, Reg, VarArg, X86Selected, ARG_PASSING_REGS, CALLER_SAVED, SYSCALL_REGS, }; -use crate::passes::uniquify::UniqueSym; +use crate::utils::gen_sym::UniqueSym; use std::collections::{HashMap, HashSet}; diff --git a/compiler/src/passes/patch_instructions.rs b/compiler/src/passes/patch_instructions.rs index 24e93ce..c08f627 100644 --- a/compiler/src/passes/patch_instructions.rs +++ b/compiler/src/passes/patch_instructions.rs @@ -51,7 +51,7 @@ fn patch_args<'p>(src: Arg, dst: Arg, op: fn(Arg, Arg) -> Instr<'p, Arg>) -> Vec mod tests { use crate::interpreter::TestIO; use crate::language::x86var::X86Selected; - use crate::passes::uniquify::gen_sym; + use crate::utils::gen_sym::gen_sym; use crate::utils::split_test::split_test; use crate::{block, callq_direct, movq, reg}; use test_each_file::test_each_file; diff --git a/compiler/src/passes/reveal_functions.rs b/compiler/src/passes/reveal_functions.rs index 58be343..668e7d7 100644 --- a/compiler/src/passes/reveal_functions.rs +++ b/compiler/src/passes/reveal_functions.rs @@ -1,6 +1,7 @@ use crate::language::rlvar::{PrgRevealed, RDef, RExpr}; use crate::passes::parse::{Def, Expr}; -use crate::passes::uniquify::{PrgUniquified, UniqueSym}; +use crate::passes::uniquify::PrgUniquified; +use crate::utils::gen_sym::UniqueSym; use crate::utils::push_map::PushMap; impl<'p> PrgUniquified<'p> { diff --git a/compiler/src/passes/select/io.rs b/compiler/src/passes/select/io.rs index 587a724..72af130 100644 --- a/compiler/src/passes/select/io.rs +++ b/compiler/src/passes/select/io.rs @@ -1,6 +1,6 @@ use crate::language::x86var::Reg; use crate::language::x86var::{Block, Cnd, VarArg}; -use crate::passes::uniquify::{gen_sym, UniqueSym}; +use crate::utils::gen_sym::{gen_sym, UniqueSym}; use crate::{ addq, block, cmpq, deref, divq, imm, jcc, jmp, movq, mulq, negq, popq, pushq, reg, retq, subq, syscall, diff --git a/compiler/src/passes/select/mod.rs b/compiler/src/passes/select/mod.rs index 554c109..49cb678 100644 --- a/compiler/src/passes/select/mod.rs +++ b/compiler/src/passes/select/mod.rs @@ -12,7 +12,7 @@ use crate::language::x86var::{ }; use crate::passes::parse::Op; use crate::passes::select::io::Std; -use crate::passes::uniquify::{gen_sym, UniqueSym}; +use crate::utils::gen_sym::{gen_sym, UniqueSym}; use crate::*; use std::collections::HashMap; @@ -200,7 +200,7 @@ fn select_cmp(op: Op) -> Cnd { #[cfg(test)] mod tests { use crate::interpreter::TestIO; - use crate::passes::uniquify::gen_sym; + use crate::utils::gen_sym::gen_sym; use crate::utils::split_test::split_test; use crate::{block, callq_direct, movq, reg}; use test_each_file::test_each_file; diff --git a/compiler/src/passes/uniquify/mod.rs b/compiler/src/passes/uniquify/mod.rs new file mode 100644 index 0000000..fb2e512 --- /dev/null +++ b/compiler/src/passes/uniquify/mod.rs @@ -0,0 +1,25 @@ +pub mod uniquify; + +use crate::passes::parse::PrgGenericVar; +use crate::utils::gen_sym::UniqueSym; + +pub type PrgUniquified<'p> = PrgGenericVar>; + +#[cfg(test)] +mod tests { + use crate::interpreter::TestIO; + use crate::utils::split_test::split_test; + use test_each_file::test_each_file; + + fn unique([test]: [&str; 1]) { + let (input, expected_output, expected_return, program) = split_test(test); + let uniquified_program = program.type_check().unwrap().uniquify(); + let mut io = TestIO::new(input); + let result = uniquified_program.interpret(&mut io); + + assert_eq!(result, expected_return.into(), "Incorrect program result."); + assert_eq!(io.outputs(), &expected_output, "Incorrect program output."); + } + + test_each_file! { for ["test"] in "./programs/good" as uniquify => unique } +} diff --git a/compiler/src/passes/uniquify.rs b/compiler/src/passes/uniquify/uniquify.rs similarity index 61% rename from compiler/src/passes/uniquify.rs rename to compiler/src/passes/uniquify/uniquify.rs index 567e0d7..45e3b21 100644 --- a/compiler/src/passes/uniquify.rs +++ b/compiler/src/passes/uniquify/uniquify.rs @@ -1,18 +1,10 @@ -//! This pass deals with the shadowing of variables by renaming every variable to a unique name. -//! The names need to be globally unique, not just in their scope. -//! This is useful because in later passes we will be changing the structure of the program, -//! and after selecting instructions we will only have a list of X86 instructions left. - -use crate::passes::parse::{Def, Expr, PrgGenericVar}; +use crate::passes::parse::{Def, Expr}; use crate::passes::type_check::PrgTypeChecked; +use crate::passes::uniquify::PrgUniquified; +use crate::utils::gen_sym::{gen_sym, UniqueSym}; use crate::utils::push_map::PushMap; -use derive_more::Display; -use std::sync::atomic::{AtomicUsize, Ordering}; - -static COUNT: AtomicUsize = AtomicUsize::new(0); impl<'p> PrgTypeChecked<'p> { - /// See module-level documentation. pub fn uniquify(self) -> PrgUniquified<'p> { let mut scope = PushMap::from_iter(self.defs.iter().map(|(&sym, _)| (sym, gen_sym(sym)))); @@ -94,42 +86,11 @@ fn uniquify_expression<'p>( .map(|arg| uniquify_expression(arg, scope)) .collect(), }, - Expr::Loop { .. } => todo!(), - Expr::Break { .. } => todo!(), - } -} - -#[derive(Copy, Clone, Eq, PartialEq, Debug, Hash, Ord, PartialOrd, Display)] -#[display(fmt = "{sym}.{id}")] -pub struct UniqueSym<'p> { - pub sym: &'p str, - pub id: usize, -} - -pub fn gen_sym(sym: &str) -> UniqueSym<'_> { - UniqueSym { - sym, - id: COUNT.fetch_add(1, Ordering::Relaxed), - } -} - -#[cfg(test)] -mod tests { - use crate::interpreter::TestIO; - use crate::utils::split_test::split_test; - use test_each_file::test_each_file; - - fn unique([test]: [&str; 1]) { - let (input, expected_output, expected_return, program) = split_test(test); - let uniquified_program = program.type_check().unwrap().uniquify(); - let mut io = TestIO::new(input); - let result = uniquified_program.interpret(&mut io); - - assert_eq!(result, expected_return.into(), "Incorrect program result."); - assert_eq!(io.outputs(), &expected_output, "Incorrect program output."); + Expr::Loop { bdy } => Expr::Loop { + bdy: Box::new(uniquify_expression(*bdy, scope)), + }, + Expr::Break { bdy } => Expr::Break { + bdy: bdy.map(|bdy| Box::new(uniquify_expression(*bdy, scope))), + }, } - - test_each_file! { for ["test"] in "./programs/good" as uniquify => unique } } - -pub type PrgUniquified<'p> = PrgGenericVar>; diff --git a/compiler/src/utils/gen_sym.rs b/compiler/src/utils/gen_sym.rs new file mode 100644 index 0000000..bc8a792 --- /dev/null +++ b/compiler/src/utils/gen_sym.rs @@ -0,0 +1,18 @@ +use derive_more::Display; +use std::sync::atomic::{AtomicUsize, Ordering}; + +static COUNT: AtomicUsize = AtomicUsize::new(0); + +#[derive(Copy, Clone, Eq, PartialEq, Debug, Hash, Ord, PartialOrd, Display)] +#[display(fmt = "{sym}.{id}")] +pub struct UniqueSym<'p> { + pub sym: &'p str, + pub id: usize, +} + +pub fn gen_sym(sym: &str) -> UniqueSym<'_> { + UniqueSym { + sym, + id: COUNT.fetch_add(1, Ordering::SeqCst), + } +} diff --git a/compiler/src/utils/mod.rs b/compiler/src/utils/mod.rs index 3282714..0bb1351 100644 --- a/compiler/src/utils/mod.rs +++ b/compiler/src/utils/mod.rs @@ -1,4 +1,5 @@ #![allow(unused)] pub mod expect; +pub mod gen_sym; pub mod push_map; pub mod split_test; diff --git a/programs/good/loops/loop_never_if.test b/programs/good/loops/loop_never_if.test index 6ba9b6a..f977ebe 100644 --- a/programs/good/loops/loop_never_if.test +++ b/programs/good/loops/loop_never_if.test @@ -1,17 +1,14 @@ ## unit # -fn test() -> Unit { +fn main() -> Unit { loop { - if false { - break + if true { + let x = (break); + unit } else { let x = (loop { 5 }); unit } } } - -fn main() -> Unit { - unit -} From 8b960876bb6402fe4ad7488e9d1c9a5fb1b37ed5 Mon Sep 17 00:00:00 2001 From: jonathan Date: Sat, 28 Oct 2023 21:16:18 +0200 Subject: [PATCH 11/27] Reveal start --- compiler/src/interpreter/cvar.rs | 2 +- compiler/src/language/cvar.rs | 2 +- compiler/src/language/mod.rs | 2 - compiler/src/passes/{ => atomize}/atomize.rs | 40 ++++++++----------- .../alvar.rs => passes/atomize/mod.rs} | 22 ++++------ compiler/src/passes/explicate_control.rs | 11 +++-- compiler/src/passes/parse/grammar.lalrpop | 4 +- compiler/src/passes/parse/grammar.rs | 40 +++++++++---------- compiler/src/passes/parse/mod.rs | 8 ++-- .../reveal_functions/mod.rs} | 7 +++- .../reveal_functions.rs | 2 +- compiler/src/passes/select/mod.rs | 2 +- compiler/src/passes/uniquify/uniquify.rs | 4 +- 13 files changed, 65 insertions(+), 81 deletions(-) rename compiler/src/passes/{ => atomize}/atomize.rs (76%) rename compiler/src/{language/alvar.rs => passes/atomize/mod.rs} (87%) rename compiler/src/{language/rlvar.rs => passes/reveal_functions/mod.rs} (95%) rename compiler/src/passes/{ => reveal_functions}/reveal_functions.rs (98%) diff --git a/compiler/src/interpreter/cvar.rs b/compiler/src/interpreter/cvar.rs index 53ac477..ba8f728 100644 --- a/compiler/src/interpreter/cvar.rs +++ b/compiler/src/interpreter/cvar.rs @@ -1,7 +1,7 @@ use crate::interpreter::value::Val; use crate::interpreter::IO; -use crate::language::alvar::Atom; use crate::language::cvar::{CExpr, PrgExplicated, Tail}; +use crate::passes::atomize::Atom; use crate::passes::parse::{Lit, Op}; use crate::utils::gen_sym::UniqueSym; use crate::utils::push_map::PushMap; diff --git a/compiler/src/language/cvar.rs b/compiler/src/language/cvar.rs index d5b695d..5d58432 100644 --- a/compiler/src/language/cvar.rs +++ b/compiler/src/language/cvar.rs @@ -1,7 +1,7 @@ -use crate::language::alvar::Atom; use crate::passes::parse::Op; use crate::utils::gen_sym::UniqueSym; use std::collections::HashMap; +use crate::passes::atomize::Atom; #[derive(Debug, PartialEq)] pub struct PrgExplicated<'p> { diff --git a/compiler/src/language/mod.rs b/compiler/src/language/mod.rs index 01eeaa5..086a5b4 100644 --- a/compiler/src/language/mod.rs +++ b/compiler/src/language/mod.rs @@ -1,4 +1,2 @@ -pub mod alvar; pub mod cvar; -pub mod rlvar; pub mod x86var; diff --git a/compiler/src/passes/atomize.rs b/compiler/src/passes/atomize/atomize.rs similarity index 76% rename from compiler/src/passes/atomize.rs rename to compiler/src/passes/atomize/atomize.rs index 45ed981..901d316 100644 --- a/compiler/src/passes/atomize.rs +++ b/compiler/src/passes/atomize/atomize.rs @@ -1,17 +1,9 @@ -//! This pass compiles `ULVarProgram`s into `ALVarProgram` in which the arguments of operations are atomic expressions. -//! -//! This is accomplished by introducing new temporary variables, assigning -//! the complex operand to those new variables, and then using them in place -//! of the complex operand. -//! -//! We consider `Int`s and `Var`s atomic. - -use crate::language::alvar::{ADef, AExpr, Atom, PrgAtomized}; -use crate::language::rlvar::{PrgRevealed, RDef, RExpr}; +use crate::passes::atomize::{AExpr, Atom, PrgAtomized}; +use crate::passes::parse::Def; +use crate::passes::reveal_functions::{PrgRevealed, RDef, RExpr}; use crate::utils::gen_sym::{gen_sym, UniqueSym}; impl<'p> PrgRevealed<'p> { - /// See module-level documentation. pub fn atomize(self) -> PrgAtomized<'p> { PrgAtomized { defs: self @@ -24,11 +16,11 @@ impl<'p> PrgRevealed<'p> { params, typ, bdy, - } => ADef::Fn { + } => Def::Fn { sym, params, typ, - bdy: rco_expr(bdy), + bdy: atomize_expr(bdy), }, }; (sym, def) @@ -39,7 +31,7 @@ impl<'p> PrgRevealed<'p> { } } -fn rco_expr(expr: RExpr) -> AExpr { +fn atomize_expr(expr: RExpr) -> AExpr { match expr { RExpr::Lit { val } => AExpr::Atom { atm: Atom::Val { val }, @@ -48,7 +40,7 @@ fn rco_expr(expr: RExpr) -> AExpr { atm: Atom::Var { sym }, }, RExpr::Prim { op, args } => { - let (args, extras): (Vec<_>, Vec<_>) = args.into_iter().map(rco_atom).unzip(); + let (args, extras): (Vec<_>, Vec<_>) = args.into_iter().map(atomize_atom).unzip(); extras .into_iter() @@ -61,18 +53,18 @@ fn rco_expr(expr: RExpr) -> AExpr { } RExpr::Let { sym, bnd, bdy } => AExpr::Let { sym, - bnd: Box::new(rco_expr(*bnd)), - bdy: Box::new(rco_expr(*bdy)), + bnd: Box::new(atomize_expr(*bnd)), + bdy: Box::new(atomize_expr(*bdy)), }, RExpr::If { cnd, thn, els } => AExpr::If { - cnd: Box::new(rco_expr(*cnd)), - thn: Box::new(rco_expr(*thn)), - els: Box::new(rco_expr(*els)), + cnd: Box::new(atomize_expr(*cnd)), + thn: Box::new(atomize_expr(*thn)), + els: Box::new(atomize_expr(*els)), }, RExpr::Apply { fun, args } => { - let (args, extras): (Vec<_>, Vec<_>) = args.into_iter().map(rco_atom).unzip(); + let (args, extras): (Vec<_>, Vec<_>) = args.into_iter().map(atomize_atom).unzip(); - let (fun, fun_expr) = rco_atom(*fun); + let (fun, fun_expr) = atomize_atom(*fun); fun_expr .into_iter() @@ -102,7 +94,7 @@ fn rco_expr(expr: RExpr) -> AExpr { } } -fn rco_atom(expr: RExpr) -> (Atom, Option<(UniqueSym, AExpr)>) { +fn atomize_atom(expr: RExpr) -> (Atom, Option<(UniqueSym, AExpr)>) { match expr { RExpr::Lit { val } => (Atom::Val { val }, None), RExpr::Var { sym } => (Atom::Var { sym }, None), @@ -112,7 +104,7 @@ fn rco_atom(expr: RExpr) -> (Atom, Option<(UniqueSym, AExpr)>) { | RExpr::Apply { .. } | RExpr::FunRef { .. } => { let tmp = gen_sym("tmp"); - (Atom::Var { sym: tmp }, Some((tmp, rco_expr(expr)))) + (Atom::Var { sym: tmp }, Some((tmp, atomize_expr(expr)))) } } } diff --git a/compiler/src/language/alvar.rs b/compiler/src/passes/atomize/mod.rs similarity index 87% rename from compiler/src/language/alvar.rs rename to compiler/src/passes/atomize/mod.rs index 085a627..71419a6 100644 --- a/compiler/src/language/alvar.rs +++ b/compiler/src/passes/atomize/mod.rs @@ -1,25 +1,16 @@ +pub mod atomize; + use crate::passes::parse::{Def, Expr, Lit, Op}; -use crate::passes::type_check::Type; use crate::passes::uniquify::PrgUniquified; use crate::utils::gen_sym::UniqueSym; use std::collections::HashMap; #[derive(Debug, PartialEq)] pub struct PrgAtomized<'p> { - pub defs: HashMap, ADef<'p>>, + pub defs: HashMap, Def, AExpr<'p>>>, pub entry: UniqueSym<'p>, } -#[derive(Debug, PartialEq)] -pub enum ADef<'p> { - Fn { - sym: UniqueSym<'p>, - params: Vec<(UniqueSym<'p>, Type)>, - typ: Type, - bdy: AExpr<'p>, - }, -} - #[derive(Debug, PartialEq)] pub enum AExpr<'p> { Atom { @@ -67,10 +58,11 @@ impl<'p> From> for PrgUniquified<'p> { } } -impl<'p> From> for Def> { - fn from(value: ADef<'p>) -> Self { +// TODO functor time +impl<'p> From, AExpr<'p>>> for Def, Expr>> { + fn from(value: Def, AExpr<'p>>) -> Self { match value { - ADef::Fn { + Def::Fn { sym, params, typ, diff --git a/compiler/src/passes/explicate_control.rs b/compiler/src/passes/explicate_control.rs index 8d118a6..74068fc 100644 --- a/compiler/src/passes/explicate_control.rs +++ b/compiler/src/passes/explicate_control.rs @@ -3,12 +3,11 @@ //! This pass makes the order of execution explicit in their syntax. //! This is achieved by flattening the nested expressions into a sequence of statements. -use crate::language::alvar::ADef; -use crate::language::alvar::{AExpr, Atom, PrgAtomized}; use crate::language::cvar::{CExpr, PrgExplicated, Tail}; -use crate::passes::parse::{Lit, Op}; +use crate::passes::parse::{Def, Lit, Op}; use crate::utils::gen_sym::{gen_sym, UniqueSym}; use std::collections::HashMap; +use crate::passes::atomize::{AExpr, Atom, PrgAtomized}; impl<'p> PrgAtomized<'p> { /// See module-level documentation. @@ -18,7 +17,7 @@ impl<'p> PrgAtomized<'p> { .defs .iter() .map(|(fn_sym, def)| match def { - ADef::Fn { params, .. } => (*fn_sym, params.iter().map(|(sym, _)| *sym).collect()), + Def::Fn { params, .. } => (*fn_sym, params.iter().map(|(sym, _)| *sym).collect()), }) .collect(); @@ -34,9 +33,9 @@ impl<'p> PrgAtomized<'p> { } } -fn explicate_def<'p>(def: ADef<'p>, blocks: &mut HashMap, Tail<'p>>) { +fn explicate_def<'p>(def: Def, AExpr<'p>>, blocks: &mut HashMap, Tail<'p>>) { match def { - ADef::Fn { sym, bdy, .. } => { + Def::Fn { sym, bdy, .. } => { let tail = explicate_tail(bdy, blocks); blocks.insert(sym, tail); } diff --git a/compiler/src/passes/parse/grammar.lalrpop b/compiler/src/passes/parse/grammar.lalrpop index ab9e70e..ce2f831 100644 --- a/compiler/src/passes/parse/grammar.lalrpop +++ b/compiler/src/passes/parse/grammar.lalrpop @@ -73,9 +73,9 @@ pub Program: PrgParsed<'input> = { => PrgParsed{ defs, entry: "main" } } -Def: Def<&'input str> = Fn; +Def: Def<&'input str, Expr<&'input str>> = Fn; -Fn: Def<&'input str> = { +Fn: Def<&'input str, Expr<&'input str>> = { "fn" "(" > ")" " )?> "{" "}" => Def::Fn { sym, params, typ: typ.unwrap_or(Type::Unit), bdy } } diff --git a/compiler/src/passes/parse/grammar.rs b/compiler/src/passes/parse/grammar.rs index ec1a238..b268e06 100644 --- a/compiler/src/passes/parse/grammar.rs +++ b/compiler/src/passes/parse/grammar.rs @@ -1,5 +1,5 @@ // auto-generated: "lalrpop 0.20.1" -// sha3: 64c166fbc73816d41147ecc4223f3fc5110879e198b167ca6ced0e0af6d31919 +// sha3: e3be941400b2b2d077a1b55d8b5fca46e77420fd6308940cf885f36782760a51 use std::str::FromStr; use crate::passes::parse::*; use crate::passes::parse::PrgParsed; @@ -40,8 +40,8 @@ mod __parse__Program { Variant8(bool), Variant9(Vec>), Variant10(Vec<(&'input str, Type)>), - Variant11(Def<&'input str>), - Variant12(alloc::vec::Vec>), + Variant11(Def<&'input str, Expr<&'input str>>), + Variant12(alloc::vec::Vec>>), Variant13(core::option::Option>), Variant14(i64), Variant15(core::option::Option<(&'input str, Type)>), @@ -1861,7 +1861,7 @@ mod __parse__Program { 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, Def<&'input str>, usize) + ) -> (usize, Def<&'input str, Expr<&'input str>>, usize) { match __symbols.pop() { Some((__l, __Symbol::Variant11(__v), __r)) => (__l, __v, __r), @@ -1949,7 +1949,7 @@ mod __parse__Program { 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, alloc::vec::Vec>, usize) + ) -> (usize, alloc::vec::Vec>>, usize) { match __symbols.pop() { Some((__l, __Symbol::Variant12(__v), __r)) => (__l, __v, __r), @@ -3822,7 +3822,7 @@ fn __action1< 'input, >( input: &'input str, - (_, defs, _): (usize, alloc::vec::Vec>, usize), + (_, defs, _): (usize, alloc::vec::Vec>>, usize), ) -> PrgParsed<'input> { PrgParsed{ defs, entry: "main" } @@ -3834,8 +3834,8 @@ fn __action2< 'input, >( input: &'input str, - (_, __0, _): (usize, Def<&'input str>, usize), -) -> Def<&'input str> + (_, __0, _): (usize, Def<&'input str, Expr<&'input str>>, usize), +) -> Def<&'input str, Expr<&'input str>> { __0 } @@ -3855,7 +3855,7 @@ fn __action3< (_, _, _): (usize, &'input str, usize), (_, bdy, _): (usize, Expr<&'input str>, usize), (_, _, _): (usize, &'input str, usize), -) -> Def<&'input str> +) -> Def<&'input str, Expr<&'input str>> { Def::Fn { sym, params, typ: typ.unwrap_or(Type::Unit), bdy } } @@ -4733,7 +4733,7 @@ fn __action71< input: &'input str, __lookbehind: &usize, __lookahead: &usize, -) -> alloc::vec::Vec> +) -> alloc::vec::Vec>> { alloc::vec![] } @@ -4744,8 +4744,8 @@ fn __action72< 'input, >( input: &'input str, - (_, v, _): (usize, alloc::vec::Vec>, usize), -) -> alloc::vec::Vec> + (_, v, _): (usize, alloc::vec::Vec>>, usize), +) -> alloc::vec::Vec>> { v } @@ -4756,8 +4756,8 @@ fn __action73< 'input, >( input: &'input str, - (_, __0, _): (usize, Def<&'input str>, usize), -) -> alloc::vec::Vec> + (_, __0, _): (usize, Def<&'input str, Expr<&'input str>>, usize), +) -> alloc::vec::Vec>> { alloc::vec![__0] } @@ -4768,9 +4768,9 @@ fn __action74< 'input, >( input: &'input str, - (_, v, _): (usize, alloc::vec::Vec>, usize), - (_, e, _): (usize, Def<&'input str>, usize), -) -> alloc::vec::Vec> + (_, v, _): (usize, alloc::vec::Vec>>, usize), + (_, e, _): (usize, Def<&'input str, Expr<&'input str>>, usize), +) -> alloc::vec::Vec>> { { let mut v = v; v.push(e); v } } @@ -4968,7 +4968,7 @@ fn __action88< __7: (usize, &'input str, usize), __8: (usize, Expr<&'input str>, usize), __9: (usize, &'input str, usize), -) -> Def<&'input str> +) -> Def<&'input str, Expr<&'input str>> { let __start0 = __5.0; let __end0 = __6.2; @@ -5007,7 +5007,7 @@ fn __action89< __5: (usize, &'input str, usize), __6: (usize, Expr<&'input str>, usize), __7: (usize, &'input str, usize), -) -> Def<&'input str> +) -> Def<&'input str, Expr<&'input str>> { let __start0 = __4.2; let __end0 = __5.0; @@ -5267,7 +5267,7 @@ fn __action99< 'input, >( input: &'input str, - __0: (usize, alloc::vec::Vec>, usize), + __0: (usize, alloc::vec::Vec>>, usize), ) -> PrgParsed<'input> { let __start0 = __0.0; diff --git a/compiler/src/passes/parse/mod.rs b/compiler/src/passes/parse/mod.rs index 4baf8e6..87a37ab 100644 --- a/compiler/src/passes/parse/mod.rs +++ b/compiler/src/passes/parse/mod.rs @@ -11,23 +11,23 @@ use std::hash::Hash; #[derive(Debug, PartialEq)] pub struct PrgParsed<'p> { - pub defs: Vec>, + pub defs: Vec>>, pub entry: &'p str, } #[derive(Debug, PartialEq)] pub struct PrgGenericVar { - pub defs: HashMap>, + pub defs: HashMap>>, pub entry: A, } #[derive(Debug, PartialEq)] -pub enum Def { +pub enum Def { Fn { sym: A, params: Vec<(A, Type)>, typ: Type, - bdy: Expr, + bdy: B, }, } diff --git a/compiler/src/language/rlvar.rs b/compiler/src/passes/reveal_functions/mod.rs similarity index 95% rename from compiler/src/language/rlvar.rs rename to compiler/src/passes/reveal_functions/mod.rs index c9c055e..1533baa 100644 --- a/compiler/src/language/rlvar.rs +++ b/compiler/src/passes/reveal_functions/mod.rs @@ -1,8 +1,10 @@ +pub mod reveal_functions; + +use std::collections::HashMap; use crate::passes::parse::{Def, Expr, Lit, Op}; use crate::passes::type_check::Type; use crate::passes::uniquify::PrgUniquified; use crate::utils::gen_sym::UniqueSym; -use std::collections::HashMap; #[derive(Debug, PartialEq)] pub struct PrgRevealed<'p> { @@ -64,7 +66,8 @@ impl<'p> From> for PrgUniquified<'p> { } } -impl<'p> From> for Def> { +//TODO also functor time? +impl<'p> From> for Def, Expr>> { fn from(value: RDef<'p>) -> Self { match value { RDef::Fn { diff --git a/compiler/src/passes/reveal_functions.rs b/compiler/src/passes/reveal_functions/reveal_functions.rs similarity index 98% rename from compiler/src/passes/reveal_functions.rs rename to compiler/src/passes/reveal_functions/reveal_functions.rs index 668e7d7..8213f79 100644 --- a/compiler/src/passes/reveal_functions.rs +++ b/compiler/src/passes/reveal_functions/reveal_functions.rs @@ -1,5 +1,5 @@ -use crate::language::rlvar::{PrgRevealed, RDef, RExpr}; use crate::passes::parse::{Def, Expr}; +use crate::passes::reveal_functions::{PrgRevealed, RDef, RExpr}; use crate::passes::uniquify::PrgUniquified; use crate::utils::gen_sym::UniqueSym; use crate::utils::push_map::PushMap; diff --git a/compiler/src/passes/select/mod.rs b/compiler/src/passes/select/mod.rs index 49cb678..7797b88 100644 --- a/compiler/src/passes/select/mod.rs +++ b/compiler/src/passes/select/mod.rs @@ -5,7 +5,6 @@ pub mod io; -use crate::language::alvar::Atom; use crate::language::cvar::{CExpr, PrgExplicated, Tail}; use crate::language::x86var::{ Block, Cnd, Instr, VarArg, X86Selected, ARG_PASSING_REGS, CALLEE_SAVED_NO_STACK, @@ -15,6 +14,7 @@ use crate::passes::select::io::Std; use crate::utils::gen_sym::{gen_sym, UniqueSym}; use crate::*; use std::collections::HashMap; +use crate::passes::atomize::Atom; impl<'p> PrgExplicated<'p> { /// See module-level documentation. diff --git a/compiler/src/passes/uniquify/uniquify.rs b/compiler/src/passes/uniquify/uniquify.rs index 45e3b21..e6a55c1 100644 --- a/compiler/src/passes/uniquify/uniquify.rs +++ b/compiler/src/passes/uniquify/uniquify.rs @@ -20,9 +20,9 @@ impl<'p> PrgTypeChecked<'p> { } fn uniquify_def<'p>( - def: Def<&'p str>, + def: Def<&'p str, Expr<&'p str>>, scope: &mut PushMap<&'p str, UniqueSym<'p>>, -) -> Def> { +) -> Def, Expr>> { match def { Def::Fn { sym, From c4881b30d952551dbd5935601f16ec7b0cda1eaa Mon Sep 17 00:00:00 2001 From: jonathan Date: Sat, 28 Oct 2023 21:24:16 +0200 Subject: [PATCH 12/27] Functions have been revealed --- compiler/src/passes/atomize/atomize.rs | 5 +++++ compiler/src/passes/reveal_functions/mod.rs | 9 +++++++++ .../src/passes/reveal_functions/reveal_functions.rs | 12 ++++++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/compiler/src/passes/atomize/atomize.rs b/compiler/src/passes/atomize/atomize.rs index 901d316..fe9b70e 100644 --- a/compiler/src/passes/atomize/atomize.rs +++ b/compiler/src/passes/atomize/atomize.rs @@ -91,6 +91,8 @@ fn atomize_expr(expr: RExpr) -> AExpr { }), } } + RExpr::Loop { .. } => todo!(), + RExpr::Break { .. } => todo!(), } } @@ -106,6 +108,9 @@ fn atomize_atom(expr: RExpr) -> (Atom, Option<(UniqueSym, AExpr)>) { let tmp = gen_sym("tmp"); (Atom::Var { sym: tmp }, Some((tmp, atomize_expr(expr)))) } + + RExpr::Loop { .. } => todo!(), + RExpr::Break { .. } => todo!(), } } diff --git a/compiler/src/passes/reveal_functions/mod.rs b/compiler/src/passes/reveal_functions/mod.rs index 1533baa..80571e2 100644 --- a/compiler/src/passes/reveal_functions/mod.rs +++ b/compiler/src/passes/reveal_functions/mod.rs @@ -51,6 +51,12 @@ pub enum RExpr<'p> { fun: Box>, args: Vec>, }, + Loop { + bdy: Box>, + }, + Break { + bdy: Option>>, + }, } impl<'p> From> for PrgUniquified<'p> { @@ -108,6 +114,9 @@ impl<'p> From> for Expr> { args: args.into_iter().map(Into::into).collect(), }, RExpr::Var { sym } | RExpr::FunRef { sym } => Expr::Var { sym }, + + RExpr::Loop { bdy } => Expr::Loop { bdy: Box::new((*bdy).into()) }, + RExpr::Break { bdy } => Expr::Break { bdy: bdy.map(|bdy| Box::new((*bdy).into())) }, } } } diff --git a/compiler/src/passes/reveal_functions/reveal_functions.rs b/compiler/src/passes/reveal_functions/reveal_functions.rs index 8213f79..0706b7f 100644 --- a/compiler/src/passes/reveal_functions/reveal_functions.rs +++ b/compiler/src/passes/reveal_functions/reveal_functions.rs @@ -72,8 +72,16 @@ fn reveal_expr<'p>(expr: Expr>, scope: &mut PushMap, .map(|arg| reveal_expr(arg, scope)) .collect(), }, - Expr::Loop { .. } => todo!(), - Expr::Break { .. } => todo!(), + Expr::Loop { bdy } => { + RExpr::Loop { + bdy: Box::new(reveal_expr(*bdy, scope)) + } + }, + Expr::Break { bdy } => { + RExpr::Break { + bdy: bdy.map(|bdy| Box::new(reveal_expr(*bdy, scope))) + } + }, } } From c6c043ef1ad5156a15751e3fd77adc2fc2c56199 Mon Sep 17 00:00:00 2001 From: jonathan Date: Sat, 28 Oct 2023 21:45:26 +0200 Subject: [PATCH 13/27] Atomized --- compiler/src/language/cvar.rs | 2 +- compiler/src/passes/atomize/atomize.rs | 28 +++++++++++++++------ compiler/src/passes/atomize/mod.rs | 12 +++++++-- compiler/src/passes/explicate_control.rs | 6 +++++ compiler/src/passes/reveal_functions/mod.rs | 1 - 5 files changed, 37 insertions(+), 12 deletions(-) diff --git a/compiler/src/language/cvar.rs b/compiler/src/language/cvar.rs index 5d58432..3082051 100644 --- a/compiler/src/language/cvar.rs +++ b/compiler/src/language/cvar.rs @@ -40,7 +40,7 @@ pub enum CExpr<'p> { args: Vec>, }, Apply { - fun: Box>, + fun: Atom<'p>, args: Vec>, }, FunRef { diff --git a/compiler/src/passes/atomize/atomize.rs b/compiler/src/passes/atomize/atomize.rs index fe9b70e..05ca03f 100644 --- a/compiler/src/passes/atomize/atomize.rs +++ b/compiler/src/passes/atomize/atomize.rs @@ -1,5 +1,5 @@ use crate::passes::atomize::{AExpr, Atom, PrgAtomized}; -use crate::passes::parse::Def; +use crate::passes::parse::{Def, Lit}; use crate::passes::reveal_functions::{PrgRevealed, RDef, RExpr}; use crate::utils::gen_sym::{gen_sym, UniqueSym}; @@ -71,7 +71,7 @@ fn atomize_expr(expr: RExpr) -> AExpr { .chain(extras.into_iter().flatten()) .rfold( AExpr::Apply { - fun: Box::new(fun), + fun, args, }, |bdy, (sym, bnd)| AExpr::Let { @@ -91,8 +91,21 @@ fn atomize_expr(expr: RExpr) -> AExpr { }), } } - RExpr::Loop { .. } => todo!(), - RExpr::Break { .. } => todo!(), + RExpr::Loop { bdy } => AExpr::Loop { bdy: Box::new(atomize_expr(*bdy))}, + RExpr::Break { bdy } => { + let (atm, extras) = match bdy { + Some(bdy) => atomize_atom(*bdy), + None => return AExpr::Break { bdy: Atom::Val { val: Lit::Unit }}, + }; + + extras + .into_iter() + .rfold(AExpr::Break { bdy: atm}, |bdy, (sym, bnd)| AExpr::Let { + sym, + bnd: Box::new(bnd), + bdy: Box::new(bdy), + }) + }, } } @@ -104,13 +117,12 @@ fn atomize_atom(expr: RExpr) -> (Atom, Option<(UniqueSym, AExpr)>) { | RExpr::Let { .. } | RExpr::If { .. } | RExpr::Apply { .. } - | RExpr::FunRef { .. } => { + | RExpr::FunRef { .. } + | RExpr::Loop { .. } + | RExpr::Break { .. } => { let tmp = gen_sym("tmp"); (Atom::Var { sym: tmp }, Some((tmp, atomize_expr(expr)))) } - - RExpr::Loop { .. } => todo!(), - RExpr::Break { .. } => todo!(), } } diff --git a/compiler/src/passes/atomize/mod.rs b/compiler/src/passes/atomize/mod.rs index 71419a6..bf086ea 100644 --- a/compiler/src/passes/atomize/mod.rs +++ b/compiler/src/passes/atomize/mod.rs @@ -31,12 +31,18 @@ pub enum AExpr<'p> { els: Box>, }, Apply { - fun: Box>, + fun: Atom<'p>, args: Vec>, }, FunRef { sym: UniqueSym<'p>, }, + Loop { + bdy: Box>, + }, + Break { + bdy: Atom<'p>, + }, } #[derive(Debug, PartialEq, Copy, Clone)] @@ -96,10 +102,12 @@ impl<'p> From> for Expr> { els: Box::new((*els).into()), }, AExpr::Apply { fun, args } => Expr::Apply { - fun: Box::new((*fun).into()), + fun: Box::new(fun.into()), args: args.into_iter().map(Into::into).collect(), }, AExpr::FunRef { sym } => Expr::Var { sym }, + AExpr::Loop { bdy } => Expr::Loop { bdy: Box::new((*bdy).into()) }, + AExpr::Break { bdy } => Expr::Break { bdy: Some(Box::new(bdy.into())) }, } } } diff --git a/compiler/src/passes/explicate_control.rs b/compiler/src/passes/explicate_control.rs index 74068fc..a67ea07 100644 --- a/compiler/src/passes/explicate_control.rs +++ b/compiler/src/passes/explicate_control.rs @@ -65,6 +65,8 @@ fn explicate_tail<'p>(expr: AExpr<'p>, blocks: &mut HashMap, Tail< AExpr::FunRef { sym } => Tail::Return { expr: CExpr::FunRef { sym }, }, + AExpr::Loop { .. } => todo!(), + AExpr::Break { .. } => todo!(), } } @@ -120,6 +122,8 @@ fn explicate_assign<'p>( blocks, ) } + AExpr::Loop { .. } => todo!(), + AExpr::Break { .. } => todo!(), } } @@ -249,6 +253,8 @@ fn explicate_pred<'p>( AExpr::Atom { atm: Atom::Val { val: Lit::Unit }, } => todo!(), + AExpr::Loop { .. } => todo!(), + AExpr::Break { .. } => todo!(), } } diff --git a/compiler/src/passes/reveal_functions/mod.rs b/compiler/src/passes/reveal_functions/mod.rs index 80571e2..affc265 100644 --- a/compiler/src/passes/reveal_functions/mod.rs +++ b/compiler/src/passes/reveal_functions/mod.rs @@ -114,7 +114,6 @@ impl<'p> From> for Expr> { args: args.into_iter().map(Into::into).collect(), }, RExpr::Var { sym } | RExpr::FunRef { sym } => Expr::Var { sym }, - RExpr::Loop { bdy } => Expr::Loop { bdy: Box::new((*bdy).into()) }, RExpr::Break { bdy } => Expr::Break { bdy: bdy.map(|bdy| Box::new((*bdy).into())) }, } From 36039f7594f01057dde553b9bb7fb6ea045e6c09 Mon Sep 17 00:00:00 2001 From: jonathan Date: Sat, 28 Oct 2023 23:08:11 +0200 Subject: [PATCH 14/27] Refactoooor grammaaar --- compiler/src/interpreter/mod.rs | 1 - compiler/src/language/mod.rs | 2 +- compiler/src/passes/atomize/mod.rs | 1 + .../explicate.rs} | 14 +- .../cvar.rs => passes/explicate/interpret.rs} | 3 +- .../cvar.rs => passes/explicate/mod.rs} | 7 +- compiler/src/passes/mod.rs | 2 +- compiler/src/passes/parse/grammar.lalrpop | 15 +- compiler/src/passes/parse/grammar.rs | 2791 ++++++++++------- compiler/src/passes/parse/interpreter.rs | 4 +- compiler/src/passes/parse/mod.rs | 22 + compiler/src/passes/reveal_functions/mod.rs | 1 + .../reveal_functions/reveal_functions.rs | 4 +- compiler/src/passes/select/mod.rs | 4 +- compiler/src/passes/type_check/check.rs | 4 +- compiler/src/passes/uniquify/uniquify.rs | 5 +- programs/good/mutability/let_semicolon.test | 6 + programs/good/mutability/let_set.test | 8 + programs/good/mutability/loop.test | 13 + programs/good/mutability/possibly_set.test | 13 + programs/good/mutability/read.test | 10 + programs/good/mutability/semicolon.test | 6 + programs/good/mutability/semicolons.test | 8 + 23 files changed, 1844 insertions(+), 1100 deletions(-) rename compiler/src/passes/{explicate_control.rs => explicate/explicate.rs} (95%) rename compiler/src/{interpreter/cvar.rs => passes/explicate/interpret.rs} (99%) rename compiler/src/{language/cvar.rs => passes/explicate/mod.rs} (96%) create mode 100644 programs/good/mutability/let_semicolon.test create mode 100644 programs/good/mutability/let_set.test create mode 100644 programs/good/mutability/loop.test create mode 100644 programs/good/mutability/possibly_set.test create mode 100644 programs/good/mutability/read.test create mode 100644 programs/good/mutability/semicolon.test create mode 100644 programs/good/mutability/semicolons.test diff --git a/compiler/src/interpreter/mod.rs b/compiler/src/interpreter/mod.rs index 8377ee1..14cd45c 100644 --- a/compiler/src/interpreter/mod.rs +++ b/compiler/src/interpreter/mod.rs @@ -1,4 +1,3 @@ -pub mod cvar; pub mod value; pub mod x86var; diff --git a/compiler/src/language/mod.rs b/compiler/src/language/mod.rs index 086a5b4..6faa557 100644 --- a/compiler/src/language/mod.rs +++ b/compiler/src/language/mod.rs @@ -1,2 +1,2 @@ -pub mod cvar; + pub mod x86var; diff --git a/compiler/src/passes/atomize/mod.rs b/compiler/src/passes/atomize/mod.rs index bf086ea..3894afc 100644 --- a/compiler/src/passes/atomize/mod.rs +++ b/compiler/src/passes/atomize/mod.rs @@ -93,6 +93,7 @@ impl<'p> From> for Expr> { }, AExpr::Let { sym, bnd, bdy } => Expr::Let { sym, + mutable: true, bnd: Box::new((*bnd).into()), bdy: Box::new((*bdy).into()), }, diff --git a/compiler/src/passes/explicate_control.rs b/compiler/src/passes/explicate/explicate.rs similarity index 95% rename from compiler/src/passes/explicate_control.rs rename to compiler/src/passes/explicate/explicate.rs index a67ea07..dcc74c7 100644 --- a/compiler/src/passes/explicate_control.rs +++ b/compiler/src/passes/explicate/explicate.rs @@ -1,16 +1,10 @@ -//! This pass compiles `ALVarProgram`s into `CLVarProgram`. -//! -//! This pass makes the order of execution explicit in their syntax. -//! This is achieved by flattening the nested expressions into a sequence of statements. - -use crate::language::cvar::{CExpr, PrgExplicated, Tail}; use crate::passes::parse::{Def, Lit, Op}; use crate::utils::gen_sym::{gen_sym, UniqueSym}; use std::collections::HashMap; use crate::passes::atomize::{AExpr, Atom, PrgAtomized}; +use crate::passes::explicate::{CExpr, PrgExplicated, Tail}; impl<'p> PrgAtomized<'p> { - /// See module-level documentation. pub fn explicate(self) -> PrgExplicated<'p> { let mut blocks = HashMap::new(); let fn_params = self @@ -42,6 +36,8 @@ fn explicate_def<'p>(def: Def, AExpr<'p>>, blocks: &mut HashMap 100 { let x = break 100; unit } else { unit } + fn explicate_tail<'p>(expr: AExpr<'p>, blocks: &mut HashMap, Tail<'p>>) -> Tail<'p> { match expr { AExpr::Atom { atm } => Tail::Return { @@ -65,11 +61,13 @@ fn explicate_tail<'p>(expr: AExpr<'p>, blocks: &mut HashMap, Tail< AExpr::FunRef { sym } => Tail::Return { expr: CExpr::FunRef { sym }, }, - AExpr::Loop { .. } => todo!(), + AExpr::Loop { bdy } => todo!(), AExpr::Break { .. } => todo!(), } } +// def explicate_effect(expr: Expr, cnt: Tail, blocks: HashMap[String, Tail]) : Tail = expr match { + fn explicate_assign<'p>( sym: UniqueSym<'p>, bnd: AExpr<'p>, diff --git a/compiler/src/interpreter/cvar.rs b/compiler/src/passes/explicate/interpret.rs similarity index 99% rename from compiler/src/interpreter/cvar.rs rename to compiler/src/passes/explicate/interpret.rs index ba8f728..a3f80b7 100644 --- a/compiler/src/interpreter/cvar.rs +++ b/compiler/src/passes/explicate/interpret.rs @@ -1,7 +1,8 @@ + use crate::interpreter::value::Val; use crate::interpreter::IO; -use crate::language::cvar::{CExpr, PrgExplicated, Tail}; use crate::passes::atomize::Atom; +use crate::passes::explicate::{CExpr, PrgExplicated, Tail}; use crate::passes::parse::{Lit, Op}; use crate::utils::gen_sym::UniqueSym; use crate::utils::push_map::PushMap; diff --git a/compiler/src/language/cvar.rs b/compiler/src/passes/explicate/mod.rs similarity index 96% rename from compiler/src/language/cvar.rs rename to compiler/src/passes/explicate/mod.rs index 3082051..2b04c8e 100644 --- a/compiler/src/language/cvar.rs +++ b/compiler/src/passes/explicate/mod.rs @@ -1,7 +1,10 @@ -use crate::passes::parse::Op; -use crate::utils::gen_sym::UniqueSym; +pub mod explicate; +pub mod interpret; + use std::collections::HashMap; use crate::passes::atomize::Atom; +use crate::passes::parse::Op; +use crate::utils::gen_sym::UniqueSym; #[derive(Debug, PartialEq)] pub struct PrgExplicated<'p> { diff --git a/compiler/src/passes/mod.rs b/compiler/src/passes/mod.rs index 5456be5..6726eaa 100644 --- a/compiler/src/passes/mod.rs +++ b/compiler/src/passes/mod.rs @@ -4,7 +4,6 @@ pub mod coloring_interference; pub mod compute_interference; pub mod conclude; pub mod emit; -pub mod explicate_control; pub mod liveness_analysis; pub mod parse; pub mod patch_instructions; @@ -12,3 +11,4 @@ pub mod reveal_functions; pub mod select; pub mod type_check; pub mod uniquify; +pub mod explicate; diff --git a/compiler/src/passes/parse/grammar.lalrpop b/compiler/src/passes/parse/grammar.lalrpop index ce2f831..7ff77e5 100644 --- a/compiler/src/passes/parse/grammar.lalrpop +++ b/compiler/src/passes/parse/grammar.lalrpop @@ -13,6 +13,7 @@ match { "else", "loop", "break", + "mut", // Structural tokens "(", @@ -96,10 +97,18 @@ BinaryOps: Expr<&'input str> = { Expr = ExprStmt; ExprStmt: Expr<&'input str> = { - "let" "=" ";" => Expr::Let { sym, bnd: Box::new(bnd), bdy: Box::new(bdy) }, + "let" "=" ";" => Expr::Let { sym, mutable: mutable.is_some(), bnd: Box::new(bnd), bdy: Box::new(Expr::Lit { val: Lit::Unit }) }, + "let" "=" ";" => Expr::Let { sym, mutable: mutable.is_some(), bnd: Box::new(bnd), bdy: Box::new(bdy) }, + ";" => Expr::Seq { stmt: Box::new(stmt), cnt: Box::new(Expr::Lit { val: Lit::Unit }) }, + ";" => Expr::Seq { stmt: Box::new(stmt), cnt: Box::new(cnt) }, + ExprInStmt, +} + +ExprInStmt: Expr<&'input str> = { + "=" => Expr::Assign { sym, bnd: Box::new(bnd), bdy: Box::new(Expr::Lit { val: Lit::Unit }) }, "if" "{" "}" "else" "{" "}" => Expr::If { cnd: Box::new(cnd), thn: Box::new(thn), els: Box::new(els) }, - "loop" "{" "}" => Expr::Loop { bdy: Box::new(bdy) }, - "break" => Expr::Break { bdy: bdy.map(Box::new) }, + "loop" "{" "}" => Expr::Loop { bdy: Box::new(bdy) }, + "break" => Expr::Break { bdy: bdy.map(Box::new) }, ExprLogicalOr, } diff --git a/compiler/src/passes/parse/grammar.rs b/compiler/src/passes/parse/grammar.rs index b268e06..ca6d2ed 100644 --- a/compiler/src/passes/parse/grammar.rs +++ b/compiler/src/passes/parse/grammar.rs @@ -1,5 +1,5 @@ // auto-generated: "lalrpop 0.20.1" -// sha3: e3be941400b2b2d077a1b55d8b5fca46e77420fd6308940cf885f36782760a51 +// sha3: 54bd82964252811feec0ac4adfd2ad0a957764d825ac9afe9d3e0d6aad26080b use std::str::FromStr; use crate::passes::parse::*; use crate::passes::parse::PrgParsed; @@ -30,281 +30,306 @@ mod __parse__Program { pub(crate) enum __Symbol<'input> { Variant0(&'input str), - Variant1(Type), - Variant2(core::option::Option), - Variant3(Expr<&'input str>), - Variant4(alloc::vec::Vec>), - Variant5((&'input str, Type)), - Variant6(alloc::vec::Vec<(&'input str, Type)>), - Variant7(Op), - Variant8(bool), - Variant9(Vec>), - Variant10(Vec<(&'input str, Type)>), - Variant11(Def<&'input str, Expr<&'input str>>), - Variant12(alloc::vec::Vec>>), - Variant13(core::option::Option>), - Variant14(i64), - Variant15(core::option::Option<(&'input str, Type)>), - Variant16(PrgParsed<'input>), - } - const __ACTION: &[i8] = &[ + Variant1(core::option::Option<&'input str>), + Variant2(Type), + Variant3(core::option::Option), + Variant4(Expr<&'input str>), + Variant5(alloc::vec::Vec>), + Variant6((&'input str, Type)), + Variant7(alloc::vec::Vec<(&'input str, Type)>), + Variant8(Op), + Variant9(bool), + Variant10(Vec>), + Variant11(Vec<(&'input str, Type)>), + Variant12(Def<&'input str, Expr<&'input str>>), + Variant13(alloc::vec::Vec>>), + Variant14(core::option::Option>), + Variant15(i64), + Variant16(core::option::Option<(&'input str, Type)>), + Variant17(PrgParsed<'input>), + } + const __ACTION: &[i16] = &[ // State 0 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 1 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 2 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 3 - 0, 0, 0, 0, 0, -35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, + 0, 0, 0, 0, 0, -37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, // State 4 - 0, 0, 0, 0, 0, -37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, + 0, 0, 0, 0, 0, -39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, // State 5 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 55, 56, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 6 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 55, 56, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 7 - 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 70, 0, 18, 19, 71, 72, 73, 74, 75, 0, 0, 0, 76, 40, + 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, // State 8 - 0, -52, 0, -52, 0, -52, 0, 77, -52, 78, 0, 0, 0, -52, -52, -52, 0, -52, -52, -52, 0, 0, 0, 0, -52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -52, -52, -52, 0, 0, + 0, -54, 0, -54, 0, -54, 0, 83, -54, 84, 0, 0, 0, -54, -54, -54, 0, -54, -54, -54, 0, 0, 0, 0, -54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -54, -54, -54, 0, 0, // State 9 - 0, 79, 0, -62, 0, -62, 0, 0, -62, 0, 0, 0, 0, -62, 80, 81, 0, 82, 83, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -62, -62, -62, 0, 0, + 0, 85, 0, -64, 0, -64, 0, 0, -64, 0, 0, 0, 0, -64, 86, 87, 0, 88, 89, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -64, -64, -64, 0, 0, // State 10 - 0, 0, 0, 85, 0, -63, 0, 0, -63, 0, 0, 0, 0, -63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -63, -63, -63, 0, 0, + 0, 0, 0, 91, 0, -71, 0, 0, -71, 0, 0, 0, 0, -71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -71, -71, -71, 0, 0, // State 11 - 0, 0, 0, 0, 0, -64, 0, 0, -64, 0, 0, 0, 0, -64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -64, 86, -64, 0, 0, + 0, 0, 0, 0, 0, -72, 0, 0, -72, 0, 0, 0, 0, -72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -72, 92, -72, 0, 0, // State 12 - 0, -65, 87, -65, 0, -65, 88, -65, -65, -65, 0, 89, 0, -65, -65, -65, 0, -65, -65, -65, 0, 0, 0, 0, -65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -65, -65, -65, 0, 0, + 0, -75, 93, -75, 0, -75, 94, -75, -75, -75, 0, 95, 0, -75, -75, -75, 0, -75, -75, -75, 0, 0, 0, 0, -75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -75, -75, -75, 0, 0, // State 13 - 0, -74, 0, -74, 0, -74, 0, 0, -74, 0, 0, 0, 0, -74, -74, -74, 0, -74, -74, -74, 0, 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -74, -74, -74, 0, 0, + 0, -85, 0, -85, 0, -85, 0, 0, -85, 0, 0, 0, 0, -85, -85, -85, 0, -85, -85, -85, 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -85, -85, -85, 0, 0, // State 14 - 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 72, 73, 74, 75, 0, 0, 0, 76, 40, + 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, // State 15 - 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 70, 0, 18, 19, 71, 72, 73, 74, 75, 0, 0, 0, 76, 40, + 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, // State 16 - 68, 0, 0, 0, 16, -70, 0, 0, -70, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 70, 0, 18, 19, 71, 72, 73, 74, 75, 0, 0, -70, 76, 40, + 74, 0, 0, 0, 16, -69, 0, 0, -69, 75, 0, 0, 0, -69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, -69, 82, 45, // State 17 - 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 72, 73, 74, 75, 0, 0, 0, 76, 40, + 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, // State 18 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 45, // State 19 - 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 70, 0, 18, 19, 71, 72, 73, 74, 75, 0, 0, 0, 76, 40, + 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, // State 20 - 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 72, 73, 74, 75, 0, 0, 0, 76, 40, + 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, // State 21 - 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 72, 73, 74, 75, 0, 0, 0, 76, 40, + 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, // State 22 - 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 72, 73, 74, 75, 0, 0, 0, 76, 40, + 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, // State 23 - 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 72, 73, 74, 75, 0, 0, 0, 76, 40, + 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, // State 24 - 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 72, 73, 74, 75, 0, 0, 0, 76, 40, + 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, // State 25 - 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 72, 73, 74, 75, 0, 0, 0, 76, 40, + 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, // State 26 - 68, 0, 0, 0, 16, -31, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 70, 0, 18, 19, 71, 72, 73, 74, 75, 0, 0, 0, 76, 40, + 74, 0, 0, 0, 16, -33, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, // State 27 - 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 70, 0, 18, 19, 71, 72, 73, 74, 75, 0, 0, 0, 76, 40, + 74, 0, 0, 0, 16, -80, 0, 0, -80, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, -80, 82, 45, // State 28 - 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 70, 0, 18, 19, 71, 72, 73, 74, 75, 0, 0, 0, 76, 40, + 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, // State 29 - 68, 0, 0, 0, 16, -33, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 70, 0, 18, 19, 71, 72, 73, 74, 75, 0, 0, 0, 76, 40, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, // State 30 - 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 70, 0, 18, 19, 71, 72, 73, 74, 75, 0, 0, 0, 76, 40, + 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, // State 31 - 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 72, 73, 74, 75, 0, 0, 0, 76, 40, + 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, // State 32 - 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 70, 0, 18, 19, 71, 72, 73, 74, 75, 0, 0, 0, 76, 40, + 74, 0, 0, 0, 16, -35, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, // State 33 - 68, 0, 0, 0, 16, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 70, 0, 18, 19, 71, 72, 73, 74, 75, 0, 0, 0, 76, 40, + 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, // State 34 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, // State 35 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, // State 36 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 74, 0, 0, 0, 16, -77, 0, 0, -77, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, -77, 82, 45, // State 37 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 74, 0, 0, 0, 16, -76, 0, 0, -76, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, -76, 82, 45, // State 38 - 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, // State 39 - 0, -77, -77, -77, -77, -77, -77, -77, -77, -77, 0, -77, -77, -77, -77, -77, -77, -77, -77, -77, 0, 0, 0, 0, -77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -77, -77, -77, 0, 0, + 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 40 - 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 41 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 42 - 0, 0, 0, 0, 0, -34, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 43 - 0, 0, 0, 0, 0, -36, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 44 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, + 0, -88, -88, -88, -88, -88, -88, -88, -88, -88, 0, -88, -88, -88, -88, -88, -88, -88, -88, -88, 0, 0, 0, 0, -88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -88, -88, -88, 0, 0, // State 45 - 0, 0, 0, 0, 0, -12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 46 - 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -13, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 47 - 0, 0, 0, 0, 0, -84, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -36, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 48 - 0, 0, 0, 0, 0, -90, 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, 0, 0, -90, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -38, 0, 0, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 49 - 0, 0, 0, 0, 0, -89, 0, 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, 0, 0, 0, -89, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, // State 50 - 0, 0, 0, 0, 0, -92, 0, 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, 0, 0, -92, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, // State 51 - 0, 0, 0, 0, 0, -91, 0, 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, 0, 0, 0, -91, 0, 0, 0, 0, + 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, // State 52 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -95, 0, 0, -95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 53 - 0, -54, -54, -54, -54, -54, -54, -54, -54, -54, 0, -54, 0, -54, -54, -54, 0, -54, -54, -54, 0, 0, 0, 0, -54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -54, -54, -54, 0, 0, + 0, 0, 0, 0, 0, -101, 0, 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, 0, 0, 0, 0, -101, 0, 0, 0, 0, // State 54 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91, 0, 0, + 0, 0, 0, 0, 0, -100, 0, 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, 0, 0, 0, -100, 0, 0, 0, 0, // State 55 - 0, -27, 0, -27, 0, -27, 0, 0, -27, 0, 0, 0, 0, -27, -27, -27, 0, -27, -27, -27, 0, 0, 0, 0, -27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -27, -27, -27, 0, 0, + 0, 0, 0, 0, 0, -103, 0, 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, 0, 0, 0, 0, -103, 0, 0, 0, 0, // State 56 - 0, -61, -61, -61, 27, -61, -61, -61, -61, -61, 0, -61, 0, -61, -61, -61, 0, -61, -61, -61, 0, 0, 0, 0, -61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -61, -61, -61, 0, 0, + 0, 0, 0, 0, 0, -102, 0, 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, 0, 0, 0, 0, 0, -102, 0, 0, 0, 0, // State 57 - 0, -73, -73, -73, 0, -73, -73, -73, -73, -73, 0, -73, 0, -73, -73, -73, 0, -73, -73, -73, 0, 0, 0, 0, -73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -73, -73, -73, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, // State 58 - 0, 0, 0, -21, 0, -21, 0, 0, -21, 0, 0, 0, 0, -21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -21, -21, -21, 0, 0, + 0, -56, -56, -56, -56, -56, -56, -56, -56, -56, 0, -56, 0, -56, -56, -56, 0, -56, -56, -56, 0, 0, 0, 0, -56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -56, -56, -56, 0, 0, // State 59 - 0, 0, 0, 0, 0, -23, 0, 0, -23, 0, 0, 0, 0, -23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -23, -23, -23, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 0, 0, // State 60 - 0, 0, 0, 0, 0, -71, 0, 0, -71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -71, 0, 0, + 0, -29, 0, -29, 0, -29, 0, 0, -29, 0, 0, 0, 0, -29, -29, -29, 0, -29, -29, -29, 0, 0, 0, 0, -29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -29, -29, -29, 0, 0, // State 61 - 0, -17, 0, -17, 0, -17, 0, -17, -17, -17, 0, 0, 0, -17, -17, -17, 0, -17, -17, -17, 0, 0, 0, 0, -17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -17, -17, -17, 0, 0, + 0, -63, -63, -63, 27, -63, -63, -63, -63, -63, 0, -63, 0, -63, -63, -63, 0, -63, -63, -63, 0, 0, 0, 0, -63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -63, -63, -63, 0, 0, // State 62 - 0, 0, 0, 0, 0, -49, 0, 0, -49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -49, 0, 0, + 0, -84, -84, -84, 0, -84, -84, -84, -84, -84, 0, -84, 0, -84, -84, -84, 0, -84, -84, -84, 0, 0, 0, 0, -84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -84, -84, -84, 0, 0, // State 63 - 0, -25, -25, -25, 0, -25, -25, -25, -25, -25, 0, -25, 0, -25, -25, -25, 0, -25, -25, -25, 0, 0, 0, 0, -25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -25, -25, -25, 0, 0, + 0, 0, 0, -23, 0, -23, 0, 0, -23, 0, 0, 0, 0, -23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -23, -23, -23, 0, 0, // State 64 - 0, -19, 0, -19, 0, -19, 0, 0, -19, 0, 0, 0, 0, -19, -19, -19, 0, -19, -19, -19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -19, -19, -19, 0, 0, + 0, 0, 0, 0, 0, -82, 0, 0, -82, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -82, 0, 0, // State 65 - 0, -56, -56, -56, -56, -56, -56, -56, -56, -56, 0, -56, 0, -56, -56, -56, 0, -56, -56, -56, 0, 0, 0, 0, -56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -56, -56, -56, 0, 0, + 0, 0, 0, 0, 0, -25, 0, 0, -25, 0, 0, 0, 0, -25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -25, -25, -25, 0, 0, // State 66 - 0, -53, -53, -53, -53, -53, -53, -53, -53, -53, 0, -53, 0, -53, -53, -53, 0, -53, -53, -53, 0, 0, 0, 0, -53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -53, -53, -53, 0, 0, + 0, 0, 0, 0, 0, -70, 0, 0, -70, 0, 0, 0, 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, -70, 0, 0, // State 67 - -94, 0, 0, 0, -94, 0, 0, 0, 0, -94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -94, 0, 0, 0, 0, -94, -94, -94, -94, 0, 0, 0, -94, -94, + 0, -19, 0, -19, 0, -19, 0, -19, -19, -19, 0, 0, 0, -19, -19, -19, 0, -19, -19, -19, 0, 0, 0, 0, -19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -19, -19, -19, 0, 0, // State 68 - -93, 0, 0, 0, -93, 0, 0, 0, 0, -93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -93, 0, 0, 0, 0, -93, -93, -93, -93, 0, 0, 0, -93, -93, + 0, 0, 0, 0, 0, -51, 0, 0, -51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -51, 0, 0, // State 69 - 0, -29, -29, -29, -29, -29, -29, -29, -29, -29, 0, -29, 0, -29, -29, -29, 0, -29, -29, -29, 0, 0, 0, 0, -29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -29, -29, -29, 0, 0, + 0, -27, -27, -27, 0, -27, -27, -27, -27, -27, 0, -27, 0, -27, -27, -27, 0, -27, -27, -27, 0, 0, 0, 0, -27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -27, -27, -27, 0, 0, // State 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, 0, 0, 0, 28, 0, 0, 0, 0, + 0, -21, 0, -21, 0, -21, 0, 0, -21, 0, 0, 0, 0, -21, -21, -21, 0, -21, -21, -21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -21, -21, -21, 0, 0, // State 71 - 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -58, -58, -58, -58, -58, -58, -58, -58, -58, 0, -58, 0, -58, -58, -58, 29, -58, -58, -58, 0, 0, 0, 0, -58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -58, -58, 0, 0, // State 72 - 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -55, -55, -55, -55, -55, -55, -55, -55, -55, 0, -55, 0, -55, -55, -55, 0, -55, -55, -55, 0, 0, 0, 0, -55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -55, -55, -55, 0, 0, // State 73 - 0, -28, -28, -28, -28, -28, -28, -28, -28, -28, 0, -28, 0, -28, -28, -28, 0, -28, -28, -28, 0, 0, 0, 0, -28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -28, -28, -28, 0, 0, + -105, 0, 0, 0, -105, 0, 0, 0, 0, -105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -105, 0, 0, 0, 0, 0, -105, -105, -105, -105, 0, 0, 0, -105, -105, // State 74 - 0, -55, -55, -55, -55, -55, -55, -55, -55, -55, 0, -55, 0, -55, -55, -55, 0, -55, -55, -55, 0, 0, 0, 0, -55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -55, -55, -55, 0, 0, + -104, 0, 0, 0, -104, 0, 0, 0, 0, -104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -104, 0, 0, 0, 0, 0, -104, -104, -104, -104, 0, 0, 0, -104, -104, // State 75 - 0, -83, -83, -83, -83, -83, -83, -83, -83, -83, 0, -83, 0, -83, -83, -83, 0, -83, -83, -83, 0, 0, 0, 0, -83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -83, -83, -83, 0, 0, + 0, -31, -31, -31, -31, -31, -31, -31, -31, -31, 0, -31, 0, -31, -31, -31, 0, -31, -31, -31, 0, 0, 0, 0, -31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -31, -31, -31, 0, 0, // State 76 - -14, 0, 0, 0, -14, 0, 0, 0, 0, -14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, 0, 0, 0, 0, -14, -14, -14, -14, 0, 0, 0, -14, -14, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, // State 77 - -15, 0, 0, 0, -15, 0, 0, 0, 0, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, 0, 0, 0, 0, -15, -15, -15, -15, 0, 0, 0, -15, -15, + 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 78 - -39, 0, 0, 0, -39, 0, 0, 0, 0, -39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -39, 0, 0, 0, 0, -39, -39, -39, -39, 0, 0, 0, -39, -39, + 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 79 - -42, 0, 0, 0, -42, 0, 0, 0, 0, -42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -42, 0, 0, 0, 0, -42, -42, -42, -42, 0, 0, 0, -42, -42, + 0, -30, -30, -30, -30, -30, -30, -30, -30, -30, 0, -30, 0, -30, -30, -30, 0, -30, -30, -30, 0, 0, 0, 0, -30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -30, -30, -30, 0, 0, // State 80 - -43, 0, 0, 0, -43, 0, 0, 0, 0, -43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -43, 0, 0, 0, 0, -43, -43, -43, -43, 0, 0, 0, -43, -43, + 0, -57, -57, -57, -57, -57, -57, -57, -57, -57, 0, -57, 0, -57, -57, -57, 0, -57, -57, -57, 0, 0, 0, 0, -57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -57, -57, -57, 0, 0, // State 81 - -38, 0, 0, 0, -38, 0, 0, 0, 0, -38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -38, 0, 0, 0, 0, -38, -38, -38, -38, 0, 0, 0, -38, -38, + 0, -94, -94, -94, -94, -94, -94, -94, -94, -94, 0, -94, 0, -94, -94, -94, 0, -94, -94, -94, 0, 0, 0, 0, -94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -94, -94, -94, 0, 0, // State 82 - -40, 0, 0, 0, -40, 0, 0, 0, 0, -40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -40, 0, 0, 0, 0, -40, -40, -40, -40, 0, 0, 0, -40, -40, + -16, 0, 0, 0, -16, 0, 0, 0, 0, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16, 0, 0, 0, 0, 0, -16, -16, -16, -16, 0, 0, 0, -16, -16, // State 83 - -41, 0, 0, 0, -41, 0, 0, 0, 0, -41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -41, 0, 0, 0, 0, -41, -41, -41, -41, 0, 0, 0, -41, -41, + -17, 0, 0, 0, -17, 0, 0, 0, 0, -17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -17, 0, 0, 0, 0, 0, -17, -17, -17, -17, 0, 0, 0, -17, -17, // State 84 - -78, 0, 0, 0, -78, 0, 0, 0, 0, -78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -78, 0, 0, 0, 0, -78, -78, -78, -78, 0, 0, 0, -78, -78, + -41, 0, 0, 0, -41, 0, 0, 0, 0, -41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -41, 0, 0, 0, 0, 0, -41, -41, -41, -41, 0, 0, 0, -41, -41, // State 85 - -79, 0, 0, 0, -79, 0, 0, 0, 0, -79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -79, 0, 0, 0, 0, -79, -79, -79, -79, 0, 0, 0, -79, -79, + -44, 0, 0, 0, -44, 0, 0, 0, 0, -44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -44, 0, 0, 0, 0, 0, -44, -44, -44, -44, 0, 0, 0, -44, -44, // State 86 - -82, 0, 0, 0, -82, 0, 0, 0, 0, -82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -82, 0, 0, 0, 0, -82, -82, -82, -82, 0, 0, 0, -82, -82, + -45, 0, 0, 0, -45, 0, 0, 0, 0, -45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -45, 0, 0, 0, 0, 0, -45, -45, -45, -45, 0, 0, 0, -45, -45, // State 87 - -80, 0, 0, 0, -80, 0, 0, 0, 0, -80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -80, 0, 0, 0, 0, -80, -80, -80, -80, 0, 0, 0, -80, -80, + -40, 0, 0, 0, -40, 0, 0, 0, 0, -40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -40, 0, 0, 0, 0, 0, -40, -40, -40, -40, 0, 0, 0, -40, -40, // State 88 - -81, 0, 0, 0, -81, 0, 0, 0, 0, -81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -81, 0, 0, 0, 0, -81, -81, -81, -81, 0, 0, 0, -81, -81, + -42, 0, 0, 0, -42, 0, 0, 0, 0, -42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -42, 0, 0, 0, 0, 0, -42, -42, -42, -42, 0, 0, 0, -42, -42, // State 89 - -95, 0, 0, 0, -95, 0, 0, 0, 0, -95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -95, 0, 0, 0, 0, -95, -95, -95, -95, 0, 0, 0, -95, -95, + -43, 0, 0, 0, -43, 0, 0, 0, 0, -43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -43, 0, 0, 0, 0, 0, -43, -43, -43, -43, 0, 0, 0, -43, -43, // State 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, -76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -89, 0, 0, 0, -89, 0, 0, 0, 0, -89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -89, 0, 0, 0, 0, 0, -89, -89, -89, -89, 0, 0, 0, -89, -89, // State 91 - 0, -72, -72, -72, 0, -72, -72, -72, -72, -72, 0, -72, 0, -72, -72, -72, 0, -72, -72, -72, 0, 0, 0, 0, -72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -72, -72, -72, 0, 0, + -90, 0, 0, 0, -90, 0, 0, 0, 0, -90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -90, 0, 0, 0, 0, 0, -90, -90, -90, -90, 0, 0, 0, -90, -90, // State 92 - 0, 0, 0, 0, 0, 107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -93, 0, 0, 0, -93, 0, 0, 0, 0, -93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -93, 0, 0, 0, 0, 0, -93, -93, -93, -93, 0, 0, 0, -93, -93, // State 93 - 0, 0, 0, 0, 0, -69, 0, 0, -69, 0, 0, 0, 0, 0, 0, 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, 0, + -91, 0, 0, 0, -91, 0, 0, 0, 0, -91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -91, 0, 0, 0, 0, 0, -91, -91, -91, -91, 0, 0, 0, -91, -91, // State 94 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, + -92, 0, 0, 0, -92, 0, 0, 0, 0, -92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -92, 0, 0, 0, 0, 0, -92, -92, -92, -92, 0, 0, 0, -92, -92, // State 95 - 0, 0, 0, 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, + -106, 0, 0, 0, -106, 0, 0, 0, 0, -106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -106, 0, 0, 0, 0, 0, -106, -106, -106, -106, 0, 0, 0, -106, -106, // State 96 - 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, 0, 0, + 0, -83, -83, -83, 0, -83, -83, -83, -83, -83, 0, -83, 0, -83, -83, -83, 0, -83, -83, -83, 0, 0, 0, 0, -83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -83, -83, -83, 0, 0, // State 98 - 0, -16, 0, -16, 0, -16, 0, -16, -16, -16, 0, 0, 0, -16, -16, -16, 0, -16, -16, -16, 0, 0, 0, 0, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16, -16, -16, 0, 0, + 0, -58, -58, -58, -58, -58, -58, -58, -58, -58, 0, -58, 0, -58, -58, -58, 0, -58, -58, -58, 0, 0, 0, 0, -58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -58, -58, -58, 0, 0, // State 99 - 0, -18, 0, -18, 0, -18, 0, 0, -18, 0, 0, 0, 0, -18, -18, -18, 0, -18, -18, -18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -18, -18, -18, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 100 - 0, 0, 0, -20, 0, -20, 0, 0, -20, 0, 0, 0, 0, -20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -20, -20, -20, 0, 0, + 0, 0, 0, 0, 0, -68, 0, 0, -68, 0, 0, 0, 0, -68, 0, 0, 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, 0, // State 101 - 0, 0, 0, 0, 0, -22, 0, 0, -22, 0, 0, 0, 0, -22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -22, -22, -22, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, // State 102 - 0, -24, -24, -24, 0, -24, -24, -24, -24, -24, 0, -24, 0, -24, -24, -24, 0, -24, -24, -24, 0, 0, 0, 0, -24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -24, -24, -24, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 103 - 0, -26, 0, -26, 0, -26, 0, 0, -26, 0, 0, 0, 0, -26, -26, -26, 0, -26, -26, -26, 0, 0, 0, 0, -26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -26, -26, -26, 0, 0, + 0, 0, 0, 0, 0, 120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 104 - 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121, 0, 0, // State 105 - 0, 0, 0, 0, 0, -30, 0, 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -18, 0, -18, 0, -18, 0, -18, -18, -18, 0, 0, 0, -18, -18, -18, 0, -18, -18, -18, 0, 0, 0, 0, -18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -18, -18, -18, 0, 0, // State 106 - 0, -57, -57, -57, -57, -57, -57, -57, -57, -57, 0, -57, 0, -57, -57, -57, 0, -57, -57, -57, 0, 0, 0, 0, -57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -57, -57, -57, 0, 0, + 0, -20, 0, -20, 0, -20, 0, 0, -20, 0, 0, 0, 0, -20, -20, -20, 0, -20, -20, -20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -20, -20, -20, 0, 0, // State 107 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 117, 0, 0, + 0, 0, 0, -22, 0, -22, 0, 0, -22, 0, 0, 0, 0, -22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -22, -22, -22, 0, 0, // State 108 - 0, 0, 0, 0, 0, 118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -24, 0, 0, -24, 0, 0, 0, 0, -24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -24, -24, -24, 0, 0, // State 109 - 0, -58, -58, -58, 0, -58, -58, -58, -58, -58, 0, -58, 0, -58, -58, -58, 0, -58, -58, -58, 0, 0, 0, 0, -58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -58, -58, -58, 0, 0, + 0, -26, -26, -26, 0, -26, -26, -26, -26, -26, 0, -26, 0, -26, -26, -26, 0, -26, -26, -26, 0, 0, 0, 0, -26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -26, -26, -26, 0, 0, // State 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, 0, 0, 0, -75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -28, 0, -28, 0, -28, 0, 0, -28, 0, 0, 0, 0, -28, -28, -28, 0, -28, -28, -28, 0, 0, 0, 0, -28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -28, -28, -28, 0, 0, // State 111 - 0, 0, 0, 0, 0, -32, 0, 0, 119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 112 - 0, -60, -60, -60, 0, -60, -60, -60, -60, -60, 0, -60, 0, -60, -60, -60, 0, -60, -60, -60, 0, 0, 0, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -60, -60, -60, 0, 0, + 0, 0, 0, 0, 0, -32, 0, 0, 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 113 - -7, 0, 0, 0, -7, -7, 0, 0, 0, -7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -7, 0, -7, 0, -7, -7, -7, -7, -7, -7, -7, 0, 0, 0, -7, -7, + 0, 0, 0, 0, 0, -81, 0, 0, -81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -81, 0, 0, // State 114 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 0, 0, + 0, 0, 0, 0, 0, -65, 0, 0, -65, 0, 0, 0, 0, -65, 0, 0, 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, 0, // State 115 - 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -59, -59, -59, -59, -59, -59, -59, -59, -59, 0, -59, 0, -59, -59, -59, 0, -59, -59, -59, 0, 0, 0, 0, -59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -59, -59, -59, 0, 0, // State 116 - 0, 0, 0, 0, 0, -68, 0, 0, -68, 0, 0, 0, 0, 0, 0, 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, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 117 - 0, -59, -59, -59, 0, -59, -59, -59, -59, -59, 0, -59, 0, -59, -59, -59, 0, -59, -59, -59, 0, 0, 0, 0, -59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -59, -59, -59, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 0, 0, // State 118 - -8, 0, 0, 0, -8, -8, 0, 0, 0, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -8, 0, -8, 0, -8, -8, -8, -8, -8, -8, -8, 0, 0, 0, -8, -8, + 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 119 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -60, -60, -60, 0, -60, -60, -60, -60, -60, 0, -60, 0, -60, -60, -60, 0, -60, -60, -60, 0, 0, 0, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -60, -60, -60, 0, 0, // State 120 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 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, // State 121 - 0, 0, 0, 0, 0, -66, 0, 0, -66, 0, 0, 0, 0, 0, 0, 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, 0, + 0, 0, 0, 0, 0, -34, 0, 0, 129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 122 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 0, 0, + 0, -62, -62, -62, 0, -62, -62, -62, -62, -62, 0, -62, 0, -62, -62, -62, 0, -62, -62, -62, 0, 0, 0, 0, -62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -62, -62, -62, 0, 0, // State 123 - 0, 0, 0, 0, 0, -67, 0, 0, -67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -67, 0, 0, + -9, 0, 0, 0, -9, -9, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -9, 0, -9, 0, -9, -9, -9, 0, -9, -9, -9, -9, 0, 0, 0, -9, -9, + // State 124 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 130, 0, 0, + // State 125 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // State 126 + 0, 0, 0, 0, 0, -67, 0, 0, -67, 0, 0, 0, 0, -67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -67, 0, 0, + // State 127 + 0, -61, -61, -61, 0, -61, -61, -61, -61, -61, 0, -61, 0, -61, -61, -61, 0, -61, -61, -61, 0, 0, 0, 0, -61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -61, -61, -61, 0, 0, + // State 128 + -10, 0, 0, 0, -10, -10, 0, 0, 0, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10, 0, -10, 0, -10, -10, -10, 0, -10, -10, -10, -10, 0, 0, 0, -10, -10, + // State 129 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // State 130 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // State 131 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, + // State 132 + 0, 0, 0, 0, 0, -79, 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, 0, 0, 0, 0, 0, 0, 0, -79, 0, 0, + // State 133 + 0, 0, 0, 0, 0, -78, 0, 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, 0, 0, 0, 0, 0, 0, 0, -78, 0, 0, + // State 134 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, + // State 135 + 0, 0, 0, 0, 0, -66, 0, 0, -66, 0, 0, 0, 0, -66, 0, 0, 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, 0, ]; - fn __action(state: i8, integer: usize) -> i8 { - __ACTION[(state as usize) * 41 + integer] + fn __action(state: i16, integer: usize) -> i16 { + __ACTION[(state as usize) * 42 + integer] } - const __EOF_ACTION: &[i8] = &[ + const __EOF_ACTION: &[i16] = &[ // State 0 - -87, + -98, // State 1 - -88, + -99, // State 2 0, // State 3 @@ -370,23 +395,23 @@ mod __parse__Program { // State 33 0, // State 34 - -47, + 0, // State 35 - -44, + 0, // State 36 - -96, + 0, // State 37 - -48, + 0, // State 38 0, // State 39 - 0, + -49, // State 40 - 0, + -46, // State 41 - 0, + -107, // State 42 - 0, + -50, // State 43 0, // State 44 @@ -482,7 +507,7 @@ mod __parse__Program { // State 89 0, // State 90 - -76, + 0, // State 91 0, // State 92 @@ -494,7 +519,7 @@ mod __parse__Program { // State 95 0, // State 96 - 0, + -87, // State 97 0, // State 98 @@ -522,7 +547,7 @@ mod __parse__Program { // State 109 0, // State 110 - -75, + 0, // State 111 0, // State 112 @@ -542,104 +567,135 @@ mod __parse__Program { // State 119 0, // State 120 - 0, + -86, // State 121 0, // State 122 0, // State 123 0, + // State 124 + 0, + // State 125 + 0, + // State 126 + 0, + // State 127 + 0, + // State 128 + 0, + // State 129 + 0, + // State 130 + 0, + // State 131 + 0, + // State 132 + 0, + // State 133 + 0, + // State 134 + 0, + // State 135 + 0, ]; - fn __goto(state: i8, nt: usize) -> i8 { + fn __goto(state: i16, nt: usize) -> i16 { match nt { - 4 => 29, - 7 => 4, - 8 => 20, - 9 => 8, - 10 => 9, - 11 => 10, - 12 => 11, - 13 => 12, - 14 => 13, - 15 => 53, - 16 => 104, - 17 => 40, - 18 => 21, - 19 => match state { - 1 => 37, - _ => 34, - }, - 21 => 1, - 22 => match state { - 15 => 92, - 16 => 93, - 19 => 97, - 26 => 105, - 28 => 108, - 29 => 111, - 30 => 114, - 33 => 122, - _ => 54, - }, - 24 => match state { - 25 => 103, - _ => 55, + 5 => 32, + 8 => 4, + 9 => 20, + 10 => 8, + 11 => 9, + 12 => 10, + 13 => 11, + 14 => 12, + 15 => 13, + 16 => 58, + 17 => 111, + 18 => 45, + 19 => 21, + 20 => match state { + 1 => 42, + _ => 39, }, - 25 => 56, - 26 => 57, - 27 => match state { - 22 => 100, - _ => 58, - }, - 28 => match state { - 23 => 101, + 22 => 1, + 23 => match state { + 15 => 99, + 19 => 104, + 26 => 112, + 30 => 117, + 31 => 118, + 32 => 121, + 33 => 124, + 38 => 134, _ => 59, }, - 29 => match state { - 17 => 94, - 31 => 115, + 25 => match state { + 25 => 110, _ => 60, }, + 26 => 61, + 27 => 62, + 28 => match state { + 22 => 107, + _ => 63, + }, + 29 => 64, 30 => match state { - 20 => 98, - _ => 61, + 23 => 108, + _ => 65, }, 31 => match state { - 27 => 107, - 32 => 121, - _ => 62, - }, - 32 => match state { - 14 => 91, - 24 => 102, - _ => 63, + 16 => 100, + 17 => 101, + 28 => 114, + 34 => 125, + 35 => 130, + _ => 66, }, 33 => match state { - 21 => 99, - _ => 64, + 20 => 105, + _ => 67, + }, + 34 => match state { + 27 => 113, + 36 => 132, + 37 => 133, + _ => 68, }, - 34 => 35, 35 => match state { - 2 => 38, - 3..=4 => 41, - 18 => 95, - _ => 65, + 14 => 97, + 24 => 109, + _ => 69, }, - 36 => 22, - 37 => 23, - 38 => 24, - 39 => 66, - 40 => match state { - 4 => 43, - _ => 42, + 36 => match state { + 21 => 106, + _ => 70, }, - 42 => 36, + 37 => 40, + 38 => match state { + 2 => 43, + 3..=4 => 46, + 14 | 16..=17 | 20..=25 | 28 | 34..=35 => 98, + 18 => 102, + 29 => 116, + _ => 71, + }, + 39 => 22, + 40 => 23, + 41 => 24, + 42 => 72, 43 => match state { - 6 => 52, + 4 => 48, _ => 47, }, - 44 => 14, - 45 => 25, + 45 => 41, + 46 => match state { + 6 => 57, + _ => 52, + }, + 47 => 14, + 48 => 25, _ => 0, } } @@ -676,6 +732,7 @@ mod __parse__Program { r###""if""###, r###""let""###, r###""loop""###, + r###""mut""###, r###""print""###, r###""read""###, r###""true""###, @@ -686,7 +743,7 @@ mod __parse__Program { r###"r#"[0-9]+"#"###, r###"r#"[_a-zA-Z][_a-zA-Z0-9]*"#"###, ]; - fn __expected_tokens(__state: i8) -> alloc::vec::Vec { + fn __expected_tokens(__state: i16) -> alloc::vec::Vec { __TERMINAL.iter().enumerate().filter_map(|(index, terminal)| { let next_state = __action(__state, index); if next_state == 0 { @@ -699,7 +756,7 @@ mod __parse__Program { fn __expected_tokens_from_states< 'input, >( - __states: &[i8], + __states: &[i16], _: core::marker::PhantomData<(&'input ())>, ) -> alloc::vec::Vec { @@ -726,9 +783,9 @@ mod __parse__Program { type TokenIndex = usize; type Symbol = __Symbol<'input>; type Success = PrgParsed<'input>; - type StateIndex = i8; - type Action = i8; - type ReduceIndex = i8; + type StateIndex = i16; + type Action = i16; + type ReduceIndex = i16; type NonterminalIndex = usize; #[inline] @@ -747,22 +804,22 @@ mod __parse__Program { } #[inline] - fn action(&self, state: i8, integer: usize) -> i8 { + fn action(&self, state: i16, integer: usize) -> i16 { __action(state, integer) } #[inline] - fn error_action(&self, state: i8) -> i8 { - __action(state, 41 - 1) + fn error_action(&self, state: i16) -> i16 { + __action(state, 42 - 1) } #[inline] - fn eof_action(&self, state: i8) -> i8 { + fn eof_action(&self, state: i16) -> i16 { __EOF_ACTION[state as usize] } #[inline] - fn goto(&self, state: i8, nt: usize) -> i8 { + fn goto(&self, state: i16, nt: usize) -> i16 { __goto(state, nt) } @@ -770,11 +827,11 @@ mod __parse__Program { __token_to_symbol(token_index, token, core::marker::PhantomData::<(&())>) } - fn expected_tokens(&self, state: i8) -> alloc::vec::Vec { + fn expected_tokens(&self, state: i16) -> alloc::vec::Vec { __expected_tokens(state) } - fn expected_tokens_from_states(&self, states: &[i8]) -> alloc::vec::Vec { + fn expected_tokens_from_states(&self, states: &[i16]) -> alloc::vec::Vec { __expected_tokens_from_states(states, core::marker::PhantomData::<(&())>) } @@ -793,9 +850,9 @@ mod __parse__Program { fn reduce( &mut self, - action: i8, + action: i16, start_location: Option<&Self::Location>, - states: &mut alloc::vec::Vec, + states: &mut alloc::vec::Vec, symbols: &mut alloc::vec::Vec<__state_machine::SymbolTriple>, ) -> Option<__state_machine::ParseResult> { __reduce( @@ -808,7 +865,7 @@ mod __parse__Program { ) } - fn simulate_reduce(&self, action: i8) -> __state_machine::SimulatedReduce { + fn simulate_reduce(&self, action: i16) -> __state_machine::SimulatedReduce { __simulate_reduce(action, core::marker::PhantomData::<(&())>) } } @@ -859,8 +916,9 @@ mod __parse__Program { Token(39, _) if true => Some(36), Token(40, _) if true => Some(37), Token(41, _) if true => Some(38), - Token(0, _) if true => Some(39), - Token(1, _) if true => Some(40), + Token(42, _) if true => Some(39), + Token(0, _) if true => Some(40), + Token(1, _) if true => Some(41), _ => None, } } @@ -873,8 +931,8 @@ mod __parse__Program { ) -> __Symbol<'input> { #[allow(clippy::manual_range_patterns)]match __token_index { - 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 => match __token { - Token(3, __tok0) | Token(4, __tok0) | Token(5, __tok0) | Token(6, __tok0) | Token(7, __tok0) | Token(8, __tok0) | Token(9, __tok0) | Token(10, __tok0) | Token(11, __tok0) | Token(12, __tok0) | Token(13, __tok0) | Token(14, __tok0) | Token(15, __tok0) | Token(16, __tok0) | Token(17, __tok0) | Token(18, __tok0) | Token(19, __tok0) | Token(20, __tok0) | Token(21, __tok0) | Token(22, __tok0) | Token(23, __tok0) | Token(24, __tok0) | Token(25, __tok0) | Token(26, __tok0) | Token(27, __tok0) | Token(28, __tok0) | Token(29, __tok0) | Token(30, __tok0) | Token(31, __tok0) | Token(32, __tok0) | Token(33, __tok0) | Token(34, __tok0) | Token(35, __tok0) | Token(36, __tok0) | Token(37, __tok0) | Token(38, __tok0) | Token(39, __tok0) | Token(40, __tok0) | Token(41, __tok0) | Token(0, __tok0) | Token(1, __tok0) if true => __Symbol::Variant0(__tok0), + 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 => match __token { + Token(3, __tok0) | Token(4, __tok0) | Token(5, __tok0) | Token(6, __tok0) | Token(7, __tok0) | Token(8, __tok0) | Token(9, __tok0) | Token(10, __tok0) | Token(11, __tok0) | Token(12, __tok0) | Token(13, __tok0) | Token(14, __tok0) | Token(15, __tok0) | Token(16, __tok0) | Token(17, __tok0) | Token(18, __tok0) | Token(19, __tok0) | Token(20, __tok0) | Token(21, __tok0) | Token(22, __tok0) | Token(23, __tok0) | Token(24, __tok0) | Token(25, __tok0) | Token(26, __tok0) | Token(27, __tok0) | Token(28, __tok0) | Token(29, __tok0) | Token(30, __tok0) | Token(31, __tok0) | Token(32, __tok0) | Token(33, __tok0) | Token(34, __tok0) | Token(35, __tok0) | Token(36, __tok0) | Token(37, __tok0) | Token(38, __tok0) | Token(39, __tok0) | Token(40, __tok0) | Token(41, __tok0) | Token(42, __tok0) | Token(0, __tok0) | Token(1, __tok0) if true => __Symbol::Variant0(__tok0), _ => unreachable!(), }, _ => unreachable!(), @@ -883,26 +941,26 @@ mod __parse__Program { fn __simulate_reduce< 'input, >( - __reduce_index: i8, + __reduce_index: i16, _: core::marker::PhantomData<(&'input ())>, ) -> __state_machine::SimulatedReduce<__StateMachine<'input>> { match __reduce_index { 0 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, + states_to_pop: 1, nonterminal_produced: 0, } } 1 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 1, + states_to_pop: 0, + nonterminal_produced: 0, } } 2 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, + states_to_pop: 2, nonterminal_produced: 1, } } @@ -915,24 +973,24 @@ mod __parse__Program { 4 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 0, - nonterminal_produced: 3, + nonterminal_produced: 2, } } 5 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 2, nonterminal_produced: 3, } } 6 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, + states_to_pop: 0, nonterminal_produced: 4, } } 7 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, + states_to_pop: 1, nonterminal_produced: 4, } } @@ -944,43 +1002,43 @@ mod __parse__Program { } 9 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 6, + states_to_pop: 3, + nonterminal_produced: 5, } } 10 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 2, nonterminal_produced: 6, } } 11 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, + states_to_pop: 0, nonterminal_produced: 7, } } 12 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, + states_to_pop: 1, nonterminal_produced: 7, } } 13 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 2, nonterminal_produced: 8, } } 14 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 3, nonterminal_produced: 8, } } 15 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, + states_to_pop: 1, nonterminal_produced: 9, } } @@ -1052,7 +1110,7 @@ mod __parse__Program { } 27 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 3, nonterminal_produced: 15, } } @@ -1070,49 +1128,49 @@ mod __parse__Program { } 30 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, + states_to_pop: 1, nonterminal_produced: 16, } } 31 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 16, + states_to_pop: 1, + nonterminal_produced: 17, } } 32 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 16, + states_to_pop: 0, + nonterminal_produced: 17, } } 33 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 2, nonterminal_produced: 17, } } 34 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, + states_to_pop: 1, nonterminal_produced: 17, } } 35 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 17, + states_to_pop: 1, + nonterminal_produced: 18, } } 36 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 17, + states_to_pop: 0, + nonterminal_produced: 18, } } 37 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 2, nonterminal_produced: 18, } } @@ -1125,25 +1183,25 @@ mod __parse__Program { 39 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 18, + nonterminal_produced: 19, } } 40 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 18, + nonterminal_produced: 19, } } 41 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 18, + nonterminal_produced: 19, } } 42 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 18, + nonterminal_produced: 19, } } 43 => { @@ -1154,8 +1212,8 @@ mod __parse__Program { } 44 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 20, + states_to_pop: 1, + nonterminal_produced: 19, } } 45 => { @@ -1166,13 +1224,13 @@ mod __parse__Program { } 46 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 0, nonterminal_produced: 21, } } 47 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, + states_to_pop: 1, nonterminal_produced: 21, } } @@ -1184,13 +1242,13 @@ mod __parse__Program { } 49 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 23, + states_to_pop: 2, + nonterminal_produced: 22, } } 50 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, + states_to_pop: 1, nonterminal_produced: 23, } } @@ -1202,8 +1260,8 @@ mod __parse__Program { } 52 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 25, + states_to_pop: 0, + nonterminal_produced: 24, } } 53 => { @@ -1215,109 +1273,109 @@ mod __parse__Program { 54 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 25, + nonterminal_produced: 26, } } 55 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 25, + nonterminal_produced: 26, } } 56 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 25, + states_to_pop: 1, + nonterminal_produced: 26, } } 57 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, + states_to_pop: 1, nonterminal_produced: 26, } } 58 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, + states_to_pop: 3, nonterminal_produced: 26, } } 59 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 26, + states_to_pop: 3, + nonterminal_produced: 27, } } 60 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 26, + states_to_pop: 4, + nonterminal_produced: 27, } } 61 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 4, nonterminal_produced: 27, } } 62 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 28, + nonterminal_produced: 27, } } 63 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 29, + nonterminal_produced: 28, } } 64 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 30, + states_to_pop: 3, + nonterminal_produced: 29, } } 65 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 6, - nonterminal_produced: 31, + states_to_pop: 9, + nonterminal_produced: 29, } } 66 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 9, - nonterminal_produced: 31, + states_to_pop: 4, + nonterminal_produced: 29, } } 67 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 4, - nonterminal_produced: 31, + states_to_pop: 2, + nonterminal_produced: 29, } } 68 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 31, + states_to_pop: 1, + nonterminal_produced: 29, } } 69 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 31, + nonterminal_produced: 29, } } 70 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 31, + nonterminal_produced: 30, } } 71 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 2, - nonterminal_produced: 32, + states_to_pop: 1, + nonterminal_produced: 31, } } 72 => { @@ -1328,143 +1386,209 @@ mod __parse__Program { } 73 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 33, + states_to_pop: 0, + nonterminal_produced: 32, } } 74 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 10, - nonterminal_produced: 34, + states_to_pop: 1, + nonterminal_produced: 33, } } 75 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 8, + states_to_pop: 6, nonterminal_produced: 34, } } 76 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 35, + states_to_pop: 5, + nonterminal_produced: 34, } } 77 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 36, + states_to_pop: 7, + nonterminal_produced: 34, } } 78 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 37, + states_to_pop: 6, + nonterminal_produced: 34, } } 79 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 38, + states_to_pop: 2, + nonterminal_produced: 34, } } 80 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 38, + states_to_pop: 3, + nonterminal_produced: 34, } } 81 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 38, + nonterminal_produced: 34, } } 82 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 39, + states_to_pop: 2, + nonterminal_produced: 35, } } 83 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, - nonterminal_produced: 40, + states_to_pop: 1, + nonterminal_produced: 35, } } 84 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 41, + nonterminal_produced: 36, } } 85 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 41, + states_to_pop: 10, + nonterminal_produced: 37, } } 86 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, - nonterminal_produced: 42, + states_to_pop: 8, + nonterminal_produced: 37, } } 87 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 42, + nonterminal_produced: 38, } } 88 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 43, + nonterminal_produced: 39, } } 89 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 43, + nonterminal_produced: 40, } } 90 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 43, + nonterminal_produced: 41, } } 91 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 43, + nonterminal_produced: 41, } } 92 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 44, + nonterminal_produced: 41, } } 93 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 44, + nonterminal_produced: 42, } } 94 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 3, + nonterminal_produced: 43, + } + } + 95 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 45, + nonterminal_produced: 44, } } - 95 => __state_machine::SimulatedReduce::Accept, - _ => panic!("invalid reduction index {}", __reduce_index) - } - } - pub struct ProgramParser { - builder: __lalrpop_util::lexer::MatcherBuilder, - _priv: (), + 96 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 0, + nonterminal_produced: 44, + } + } + 97 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 0, + nonterminal_produced: 45, + } + } + 98 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 45, + } + } + 99 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 46, + } + } + 100 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 46, + } + } + 101 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 46, + } + } + 102 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 46, + } + } + 103 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 47, + } + } + 104 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 47, + } + } + 105 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 48, + } + } + 106 => __state_machine::SimulatedReduce::Accept, + _ => panic!("invalid reduction index {}", __reduce_index) + } + } + pub struct ProgramParser { + builder: __lalrpop_util::lexer::MatcherBuilder, + _priv: (), } impl Default for ProgramParser { fn default() -> Self { Self::new() } } @@ -1498,8 +1622,8 @@ mod __parse__Program { fn __accepts< 'input, >( - __error_state: Option, - __states: &[i8], + __error_state: Option, + __states: &[i16], __opt_integer: Option, _: core::marker::PhantomData<(&'input ())>, ) -> bool @@ -1532,9 +1656,9 @@ mod __parse__Program { 'input, >( input: &'input str, - __action: i8, + __action: i16, __lookahead_start: Option<&usize>, - __states: &mut alloc::vec::Vec, + __states: &mut alloc::vec::Vec, __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, _: core::marker::PhantomData<(&'input ())>, ) -> Option,__lalrpop_util::ParseError, &'static str>>> @@ -1826,8 +1950,41 @@ mod __parse__Program { __reduce94(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) } 95 => { + __reduce95(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 96 => { + __reduce96(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 97 => { + __reduce97(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 98 => { + __reduce98(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 99 => { + __reduce99(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 100 => { + __reduce100(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 101 => { + __reduce101(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 102 => { + __reduce102(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 103 => { + __reduce103(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 104 => { + __reduce104(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 105 => { + __reduce105(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 106 => { // __Program = Program => ActionFn(0); - let __sym0 = __pop_Variant16(__symbols); + let __sym0 = __pop_Variant17(__symbols); let __start = __sym0.0; let __end = __sym0.2; let __nt = super::__action0::<>(input, __sym0); @@ -1846,179 +2003,190 @@ mod __parse__Program { fn __symbol_type_mismatch() -> ! { panic!("symbol type mismatch") } - fn __pop_Variant5< + fn __pop_Variant6< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, (&'input str, Type), 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_Variant11< + fn __pop_Variant12< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, Def<&'input str, Expr<&'input str>>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant11(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant12(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant3< + fn __pop_Variant4< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, Expr<&'input str>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant3(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant4(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant7< + fn __pop_Variant8< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, Op, 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_Variant16< + fn __pop_Variant17< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, PrgParsed<'input>, 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_Variant1< + fn __pop_Variant2< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, Type, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant1(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant2(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant10< + fn __pop_Variant11< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, Vec<(&'input str, Type)>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant10(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant11(__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, 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() } } - fn __pop_Variant6< + fn __pop_Variant7< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, alloc::vec::Vec<(&'input str, Type)>, 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_Variant12< + fn __pop_Variant13< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, alloc::vec::Vec>>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant12(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant13(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant4< + fn __pop_Variant5< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, alloc::vec::Vec>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant4(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant5(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant8< + fn __pop_Variant9< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, bool, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant8(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant9(__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, core::option::Option<(&'input str, Type)>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant15(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant16(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant13< + fn __pop_Variant14< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, core::option::Option>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant13(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant14(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant2< + fn __pop_Variant3< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, core::option::Option, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant2(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant3(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant14< + fn __pop_Variant1< + 'input, + >( + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> + ) -> (usize, core::option::Option<&'input str>, usize) + { + match __symbols.pop() { + Some((__l, __Symbol::Variant1(__v), __r)) => (__l, __v, __r), + _ => __symbol_type_mismatch() + } + } + fn __pop_Variant15< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> ) -> (usize, i64, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant14(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant15(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } @@ -2042,15 +2210,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ("->" ) = "->", Type => ActionFn(69); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant1(__symbols); + // "mut"? = "mut" => ActionFn(72); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action69::<>(input, __sym0, __sym1); + let __end = __sym0.2; + let __nt = super::__action72::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (2, 0) + (1, 0) } fn __reduce1< 'input, @@ -2061,15 +2227,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ("->" )? = "->", Type => ActionFn(87); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant1(__symbols); - let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action87::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant2(__nt), __end)); - (2, 1) + // "mut"? = => ActionFn(73); + let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); + let __end = __start; + let __nt = super::__action73::<>(input, &__start, &__end); + __symbols.push((__start, __Symbol::Variant1(__nt), __end)); + (0, 0) } fn __reduce2< 'input, @@ -2080,12 +2243,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ("->" )? = => ActionFn(68); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); - let __end = __start; - let __nt = super::__action68::<>(input, &__start, &__end); + // ("->" ) = "->", Type => ActionFn(76); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant2(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0; + let __end = __sym1.2; + let __nt = super::__action76::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant2(__nt), __end)); - (0, 1) + (2, 1) } fn __reduce3< 'input, @@ -2096,13 +2262,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",") = Expr, "," => ActionFn(82); + // ("->" )? = "->", Type => ActionFn(100); assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant3(__symbols); + let __sym1 = __pop_Variant2(__symbols); + let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym1.2; - let __nt = super::__action82::<>(input, __sym0, __sym1); + let __nt = super::__action100::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant3(__nt), __end)); (2, 2) } @@ -2115,12 +2281,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")* = => ActionFn(80); + // ("->" )? = => ActionFn(75); let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); let __end = __start; - let __nt = super::__action80::<>(input, &__start, &__end); - __symbols.push((__start, __Symbol::Variant4(__nt), __end)); - (0, 3) + let __nt = super::__action75::<>(input, &__start, &__end); + __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + (0, 2) } fn __reduce5< 'input, @@ -2131,13 +2297,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")* = ( ",")+ => ActionFn(81); + // ( ",") = Expr, "," => ActionFn(91); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action81::<>(input, __sym0); + let __end = __sym1.2; + let __nt = super::__action91::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant4(__nt), __end)); - (1, 3) + (2, 3) } fn __reduce6< 'input, @@ -2148,15 +2316,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")+ = Expr, "," => ActionFn(90); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant3(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action90::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant4(__nt), __end)); - (2, 4) + // ( ",")* = => ActionFn(89); + let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); + let __end = __start; + let __nt = super::__action89::<>(input, &__start, &__end); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (0, 4) } fn __reduce7< 'input, @@ -2167,16 +2332,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")+ = ( ",")+, Expr, "," => ActionFn(91); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant3(__symbols); - let __sym0 = __pop_Variant4(__symbols); + // ( ",")* = ( ",")+ => ActionFn(90); + let __sym0 = __pop_Variant5(__symbols); let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action91::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant4(__nt), __end)); - (3, 4) + let __end = __sym0.2; + let __nt = super::__action90::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (1, 4) } fn __reduce8< 'input, @@ -2187,13 +2349,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",") = Param, "," => ActionFn(79); + // ( ",")+ = Expr, "," => ActionFn(103); assert!(__symbols.len() >= 2); let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant5(__symbols); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym1.2; - let __nt = super::__action79::<>(input, __sym0, __sym1); + let __nt = super::__action103::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant5(__nt), __end)); (2, 5) } @@ -2206,12 +2368,16 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")* = => ActionFn(77); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); - let __end = __start; - let __nt = super::__action77::<>(input, &__start, &__end); - __symbols.push((__start, __Symbol::Variant6(__nt), __end)); - (0, 6) + // ( ",")+ = ( ",")+, Expr, "," => ActionFn(104); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant4(__symbols); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0; + let __end = __sym2.2; + let __nt = super::__action104::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant5(__nt), __end)); + (3, 5) } fn __reduce10< 'input, @@ -2222,13 +2388,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")* = ( ",")+ => ActionFn(78); + // ( ",") = Param, "," => ActionFn(86); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action78::<>(input, __sym0); + let __end = __sym1.2; + let __nt = super::__action86::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant6(__nt), __end)); - (1, 6) + (2, 6) } fn __reduce11< 'input, @@ -2239,15 +2407,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")+ = Param, "," => ActionFn(94); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant5(__symbols); - let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action94::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant6(__nt), __end)); - (2, 7) + // ( ",")* = => ActionFn(84); + let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); + let __end = __start; + let __nt = super::__action84::<>(input, &__start, &__end); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (0, 7) } fn __reduce12< 'input, @@ -2258,16 +2423,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")+ = ( ",")+, Param, "," => ActionFn(95); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant5(__symbols); - let __sym0 = __pop_Variant6(__symbols); + // ( ",")* = ( ",")+ => ActionFn(85); + let __sym0 = __pop_Variant7(__symbols); let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action95::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant6(__nt), __end)); - (3, 7) + let __end = __sym0.2; + let __nt = super::__action85::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + (1, 7) } fn __reduce13< 'input, @@ -2278,13 +2440,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // AdditiveOp = "+" => ActionFn(30); - let __sym0 = __pop_Variant0(__symbols); + // ( ",")+ = Param, "," => ActionFn(107); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action30::<>(input, __sym0); + let __end = __sym1.2; + let __nt = super::__action107::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant7(__nt), __end)); - (1, 8) + (2, 8) } fn __reduce14< 'input, @@ -2295,13 +2459,16 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // AdditiveOp = "-" => ActionFn(31); - let __sym0 = __pop_Variant0(__symbols); + // ( ",")+ = ( ",")+, Param, "," => ActionFn(108); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant6(__symbols); + let __sym0 = __pop_Variant7(__symbols); let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action31::<>(input, __sym0); + let __end = __sym2.2; + let __nt = super::__action108::<>(input, __sym0, __sym1, __sym2); __symbols.push((__start, __Symbol::Variant7(__nt), __end)); - (1, 8) + (3, 8) } fn __reduce15< 'input, @@ -2312,16 +2479,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = BinaryOps, AdditiveOp, ExprMultiplicative => ActionFn(55); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant3(__symbols); - let __sym1 = __pop_Variant7(__symbols); - let __sym0 = __pop_Variant3(__symbols); + // AdditiveOp = "+" => ActionFn(35); + let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action55::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (3, 9) + let __end = __sym0.2; + let __nt = super::__action35::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (1, 9) } fn __reduce16< 'input, @@ -2332,12 +2496,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = ExprMultiplicative => ActionFn(56); - let __sym0 = __pop_Variant3(__symbols); + // AdditiveOp = "-" => ActionFn(36); + let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action56::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + let __nt = super::__action36::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); (1, 9) } fn __reduce17< @@ -2349,15 +2513,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = BinaryOps, ComparativeOp, ExprXor => ActionFn(59); + // BinaryOps = BinaryOps, AdditiveOp, ExprMultiplicative => ActionFn(60); assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant3(__symbols); - let __sym1 = __pop_Variant7(__symbols); - let __sym0 = __pop_Variant3(__symbols); + let __sym2 = __pop_Variant4(__symbols); + let __sym1 = __pop_Variant8(__symbols); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action59::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + let __nt = super::__action60::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); (3, 10) } fn __reduce18< @@ -2369,12 +2533,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = ExprXor => ActionFn(60); - let __sym0 = __pop_Variant3(__symbols); + // BinaryOps = ExprMultiplicative => ActionFn(61); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action60::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + let __nt = super::__action61::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); (1, 10) } fn __reduce19< @@ -2386,15 +2550,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = BinaryOps, LogicalAndOp, ExprComparative => ActionFn(61); + // BinaryOps = BinaryOps, ComparativeOp, ExprXor => ActionFn(64); assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant3(__symbols); - let __sym1 = __pop_Variant7(__symbols); - let __sym0 = __pop_Variant3(__symbols); + let __sym2 = __pop_Variant4(__symbols); + let __sym1 = __pop_Variant8(__symbols); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action61::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + let __nt = super::__action64::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); (3, 11) } fn __reduce20< @@ -2406,12 +2570,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = ExprComparative => ActionFn(62); - let __sym0 = __pop_Variant3(__symbols); + // BinaryOps = ExprXor => ActionFn(65); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action62::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + let __nt = super::__action65::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); (1, 11) } fn __reduce21< @@ -2423,15 +2587,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = BinaryOps, LogicalOrOp, ExprLogicalAnd => ActionFn(63); + // BinaryOps = BinaryOps, LogicalAndOp, ExprComparative => ActionFn(66); assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant3(__symbols); - let __sym1 = __pop_Variant7(__symbols); - let __sym0 = __pop_Variant3(__symbols); + let __sym2 = __pop_Variant4(__symbols); + let __sym1 = __pop_Variant8(__symbols); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action63::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + let __nt = super::__action66::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); (3, 12) } fn __reduce22< @@ -2443,12 +2607,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = ExprLogicalAnd => ActionFn(64); - let __sym0 = __pop_Variant3(__symbols); + // BinaryOps = ExprComparative => ActionFn(67); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action64::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + let __nt = super::__action67::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); (1, 12) } fn __reduce23< @@ -2460,15 +2624,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = BinaryOps, MultiplicativeOp, ExprUnary => ActionFn(53); + // BinaryOps = BinaryOps, LogicalOrOp, ExprLogicalAnd => ActionFn(68); assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant3(__symbols); - let __sym1 = __pop_Variant7(__symbols); - let __sym0 = __pop_Variant3(__symbols); + let __sym2 = __pop_Variant4(__symbols); + let __sym1 = __pop_Variant8(__symbols); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action53::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + let __nt = super::__action68::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); (3, 13) } fn __reduce24< @@ -2480,12 +2644,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = ExprUnary => ActionFn(54); - let __sym0 = __pop_Variant3(__symbols); + // BinaryOps = ExprLogicalAnd => ActionFn(69); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action54::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + let __nt = super::__action69::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); (1, 13) } fn __reduce25< @@ -2497,15 +2661,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = BinaryOps, XorOp, ExprAdditive => ActionFn(57); + // BinaryOps = BinaryOps, MultiplicativeOp, ExprUnary => ActionFn(58); assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant3(__symbols); - let __sym1 = __pop_Variant7(__symbols); - let __sym0 = __pop_Variant3(__symbols); + let __sym2 = __pop_Variant4(__symbols); + let __sym1 = __pop_Variant8(__symbols); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action57::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + let __nt = super::__action58::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); (3, 14) } fn __reduce26< @@ -2517,12 +2681,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // BinaryOps = ExprAdditive => ActionFn(58); - let __sym0 = __pop_Variant3(__symbols); + // BinaryOps = ExprUnary => ActionFn(59); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action58::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + let __nt = super::__action59::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); (1, 14) } fn __reduce27< @@ -2534,13 +2698,16 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Bool = "true" => ActionFn(50); - let __sym0 = __pop_Variant0(__symbols); + // BinaryOps = BinaryOps, XorOp, ExprAdditive => ActionFn(62); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant4(__symbols); + let __sym1 = __pop_Variant8(__symbols); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action50::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); - (1, 15) + let __end = __sym2.2; + let __nt = super::__action62::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (3, 15) } fn __reduce28< 'input, @@ -2551,12 +2718,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Bool = "false" => ActionFn(51); - let __sym0 = __pop_Variant0(__symbols); + // BinaryOps = ExprAdditive => ActionFn(63); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action51::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + let __nt = super::__action63::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); (1, 15) } fn __reduce29< @@ -2568,11 +2735,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = Expr => ActionFn(100); - let __sym0 = __pop_Variant3(__symbols); + // Bool = "true" => ActionFn(55); + let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action100::<>(input, __sym0); + let __nt = super::__action55::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant9(__nt), __end)); (1, 16) } @@ -2585,12 +2752,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = => ActionFn(101); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); - let __end = __start; - let __nt = super::__action101::<>(input, &__start, &__end); + // Bool = "false" => ActionFn(56); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0; + let __end = __sym0.2; + let __nt = super::__action56::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant9(__nt), __end)); - (0, 16) + (1, 16) } fn __reduce31< 'input, @@ -2601,15 +2769,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = ( ",")+, Expr => ActionFn(102); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant3(__symbols); + // Comma = Expr => ActionFn(113); let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action102::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant9(__nt), __end)); - (2, 16) + let __end = __sym0.2; + let __nt = super::__action113::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant10(__nt), __end)); + (1, 17) } fn __reduce32< 'input, @@ -2620,13 +2786,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = ( ",")+ => ActionFn(103); - let __sym0 = __pop_Variant4(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action103::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant9(__nt), __end)); - (1, 16) + // Comma = => ActionFn(114); + let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); + let __end = __start; + let __nt = super::__action114::<>(input, &__start, &__end); + __symbols.push((__start, __Symbol::Variant10(__nt), __end)); + (0, 17) } fn __reduce33< 'input, @@ -2637,13 +2802,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = Param => ActionFn(106); + // Comma = ( ",")+, Expr => ActionFn(115); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant4(__symbols); let __sym0 = __pop_Variant5(__symbols); let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action106::<>(input, __sym0); + let __end = __sym1.2; + let __nt = super::__action115::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant10(__nt), __end)); - (1, 17) + (2, 17) } fn __reduce34< 'input, @@ -2654,12 +2821,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = => ActionFn(107); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); - let __end = __start; - let __nt = super::__action107::<>(input, &__start, &__end); + // Comma = ( ",")+ => ActionFn(116); + let __sym0 = __pop_Variant5(__symbols); + let __start = __sym0.0; + let __end = __sym0.2; + let __nt = super::__action116::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant10(__nt), __end)); - (0, 17) + (1, 17) } fn __reduce35< 'input, @@ -2670,15 +2838,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = ( ",")+, Param => ActionFn(108); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant5(__symbols); + // Comma = Param => ActionFn(119); let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action108::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant10(__nt), __end)); - (2, 17) + let __end = __sym0.2; + let __nt = super::__action119::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant11(__nt), __end)); + (1, 18) } fn __reduce36< 'input, @@ -2689,13 +2855,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = ( ",")+ => ActionFn(109); - let __sym0 = __pop_Variant6(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action109::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant10(__nt), __end)); - (1, 17) + // Comma = => ActionFn(120); + let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); + let __end = __start; + let __nt = super::__action120::<>(input, &__start, &__end); + __symbols.push((__start, __Symbol::Variant11(__nt), __end)); + (0, 18) } fn __reduce37< 'input, @@ -2706,13 +2871,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ComparativeOp = "==" => ActionFn(23); - let __sym0 = __pop_Variant0(__symbols); + // Comma = ( ",")+, Param => ActionFn(121); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant6(__symbols); + let __sym0 = __pop_Variant7(__symbols); let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action23::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant7(__nt), __end)); - (1, 18) + let __end = __sym1.2; + let __nt = super::__action121::<>(input, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant11(__nt), __end)); + (2, 18) } fn __reduce38< 'input, @@ -2723,12 +2890,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ComparativeOp = "!=" => ActionFn(24); - let __sym0 = __pop_Variant0(__symbols); + // Comma = ( ",")+ => ActionFn(122); + let __sym0 = __pop_Variant7(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action24::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant7(__nt), __end)); + let __nt = super::__action122::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant11(__nt), __end)); (1, 18) } fn __reduce39< @@ -2740,13 +2907,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ComparativeOp = ">" => ActionFn(25); + // ComparativeOp = "==" => ActionFn(28); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action25::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant7(__nt), __end)); - (1, 18) + let __nt = super::__action28::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (1, 19) } fn __reduce40< 'input, @@ -2757,13 +2924,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ComparativeOp = ">=" => ActionFn(26); + // ComparativeOp = "!=" => ActionFn(29); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action26::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant7(__nt), __end)); - (1, 18) + let __nt = super::__action29::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (1, 19) } fn __reduce41< 'input, @@ -2774,13 +2941,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ComparativeOp = "<" => ActionFn(27); + // ComparativeOp = ">" => ActionFn(30); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action27::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant7(__nt), __end)); - (1, 18) + let __nt = super::__action30::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (1, 19) } fn __reduce42< 'input, @@ -2791,13 +2958,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ComparativeOp = "<=" => ActionFn(28); + // ComparativeOp = ">=" => ActionFn(31); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action28::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant7(__nt), __end)); - (1, 18) + let __nt = super::__action31::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (1, 19) } fn __reduce43< 'input, @@ -2808,12 +2975,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Def = Fn => ActionFn(2); - let __sym0 = __pop_Variant11(__symbols); + // ComparativeOp = "<" => ActionFn(32); + let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action2::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); + let __nt = super::__action32::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); (1, 19) } fn __reduce44< @@ -2825,12 +2992,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Def* = => ActionFn(71); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); - let __end = __start; - let __nt = super::__action71::<>(input, &__start, &__end); - __symbols.push((__start, __Symbol::Variant12(__nt), __end)); - (0, 20) + // ComparativeOp = "<=" => ActionFn(33); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0; + let __end = __sym0.2; + let __nt = super::__action33::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (1, 19) } fn __reduce45< 'input, @@ -2841,11 +3009,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Def* = Def+ => ActionFn(72); + // Def = Fn => ActionFn(2); let __sym0 = __pop_Variant12(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action72::<>(input, __sym0); + let __nt = super::__action2::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant12(__nt), __end)); (1, 20) } @@ -2858,13 +3026,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Def+ = Def => ActionFn(73); - let __sym0 = __pop_Variant11(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action73::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant12(__nt), __end)); - (1, 21) + // Def* = => ActionFn(78); + let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); + let __end = __start; + let __nt = super::__action78::<>(input, &__start, &__end); + __symbols.push((__start, __Symbol::Variant13(__nt), __end)); + (0, 21) } fn __reduce47< 'input, @@ -2875,15 +3042,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Def+ = Def+, Def => ActionFn(74); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant11(__symbols); - let __sym0 = __pop_Variant12(__symbols); + // Def* = Def+ => ActionFn(79); + let __sym0 = __pop_Variant13(__symbols); let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action74::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant12(__nt), __end)); - (2, 21) + let __end = __sym0.2; + let __nt = super::__action79::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant13(__nt), __end)); + (1, 21) } fn __reduce48< 'input, @@ -2894,12 +3059,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Expr = ExprStmt => ActionFn(9); - let __sym0 = __pop_Variant3(__symbols); + // Def+ = Def => ActionFn(80); + let __sym0 = __pop_Variant12(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action9::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + let __nt = super::__action80::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant13(__nt), __end)); (1, 22) } fn __reduce49< @@ -2911,13 +3076,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Expr? = Expr => ActionFn(65); - let __sym0 = __pop_Variant3(__symbols); + // Def+ = Def+, Def => ActionFn(81); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant12(__symbols); + let __sym0 = __pop_Variant13(__symbols); let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action65::<>(input, __sym0); + let __end = __sym1.2; + let __nt = super::__action81::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (1, 23) + (2, 22) } fn __reduce50< 'input, @@ -2928,12 +3095,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Expr? = => ActionFn(66); - let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); - let __end = __start; - let __nt = super::__action66::<>(input, &__start, &__end); - __symbols.push((__start, __Symbol::Variant13(__nt), __end)); - (0, 23) + // Expr = ExprStmt => ActionFn(9); + let __sym0 = __pop_Variant4(__symbols); + let __start = __sym0.0; + let __end = __sym0.2; + let __nt = super::__action9::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 23) } fn __reduce51< 'input, @@ -2944,12 +3112,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprAdditive = BinaryOps => ActionFn(19); - let __sym0 = __pop_Variant3(__symbols); + // Expr? = Expr => ActionFn(87); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action19::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + let __nt = super::__action87::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant14(__nt), __end)); (1, 24) } fn __reduce52< @@ -2961,13 +3129,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprAtom = Num => ActionFn(43); - let __sym0 = __pop_Variant14(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action43::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (1, 25) + // Expr? = => ActionFn(88); + let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); + let __end = __start; + let __nt = super::__action88::<>(input, &__start, &__end); + __symbols.push((__start, __Symbol::Variant14(__nt), __end)); + (0, 24) } fn __reduce53< 'input, @@ -2978,12 +3145,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprAtom = Bool => ActionFn(44); - let __sym0 = __pop_Variant8(__symbols); + // ExprAdditive = BinaryOps => ActionFn(24); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action44::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + let __nt = super::__action24::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); (1, 25) } fn __reduce54< @@ -2995,13 +3162,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprAtom = "unit" => ActionFn(45); - let __sym0 = __pop_Variant0(__symbols); + // ExprAtom = Num => ActionFn(48); + let __sym0 = __pop_Variant15(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action45::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (1, 25) + let __nt = super::__action48::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 26) } fn __reduce55< 'input, @@ -3012,13 +3179,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprAtom = Ident => ActionFn(46); - let __sym0 = __pop_Variant0(__symbols); + // ExprAtom = Bool => ActionFn(49); + let __sym0 = __pop_Variant9(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action46::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (1, 25) + let __nt = super::__action49::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 26) } fn __reduce56< 'input, @@ -3029,16 +3196,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprAtom = "(", Expr, ")" => ActionFn(47); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant3(__symbols); + // ExprAtom = "unit" => ActionFn(50); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action47::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (3, 25) + let __end = __sym0.2; + let __nt = super::__action50::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 26) } fn __reduce57< 'input, @@ -3049,16 +3213,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprCall = "read", "(", ")" => ActionFn(39); - assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); + // ExprAtom = Ident => ActionFn(51); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; - let __end = __sym2.2; - let __nt = super::__action39::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (3, 26) + let __end = __sym0.2; + let __nt = super::__action51::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 26) } fn __reduce58< 'input, @@ -3069,17 +3230,16 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprCall = "print", "(", Expr, ")" => ActionFn(40); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant3(__symbols); - let __sym1 = __pop_Variant0(__symbols); + // ExprAtom = "(", Expr, ")" => ActionFn(52); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant4(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action40::<>(input, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (4, 26) + let __end = __sym2.2; + let __nt = super::__action52::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (3, 26) } fn __reduce59< 'input, @@ -3090,17 +3250,16 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprCall = ExprAtom, "(", Comma, ")" => ActionFn(41); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant9(__symbols); + // ExprCall = "read", "(", ")" => ActionFn(44); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant0(__symbols); let __sym1 = __pop_Variant0(__symbols); - let __sym0 = __pop_Variant3(__symbols); + let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action41::<>(input, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (4, 26) + let __end = __sym2.2; + let __nt = super::__action44::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (3, 27) } fn __reduce60< 'input, @@ -3111,13 +3270,17 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprCall = ExprAtom => ActionFn(42); - let __sym0 = __pop_Variant3(__symbols); + // ExprCall = "print", "(", Expr, ")" => ActionFn(45); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant4(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action42::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (1, 26) + let __end = __sym3.2; + let __nt = super::__action45::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (4, 27) } fn __reduce61< 'input, @@ -3128,13 +3291,17 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprComparative = BinaryOps => ActionFn(17); - let __sym0 = __pop_Variant3(__symbols); + // ExprCall = ExprAtom, "(", Comma, ")" => ActionFn(46); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant10(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action17::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (1, 27) + let __end = __sym3.2; + let __nt = super::__action46::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (4, 27) } fn __reduce62< 'input, @@ -3145,13 +3312,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprLogicalAnd = BinaryOps => ActionFn(16); - let __sym0 = __pop_Variant3(__symbols); + // ExprCall = ExprAtom => ActionFn(47); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action16::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (1, 28) + let __nt = super::__action47::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 27) } fn __reduce63< 'input, @@ -3162,13 +3329,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprLogicalOr = BinaryOps => ActionFn(15); - let __sym0 = __pop_Variant3(__symbols); + // ExprComparative = BinaryOps => ActionFn(22); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action15::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (1, 29) + let __nt = super::__action22::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 28) } fn __reduce64< 'input, @@ -3179,13 +3346,16 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprMultiplicative = BinaryOps => ActionFn(20); - let __sym0 = __pop_Variant3(__symbols); + // ExprInStmt = Ident, "=", ExprLogicalOr => ActionFn(15); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant4(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action20::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (1, 30) + let __end = __sym2.2; + let __nt = super::__action15::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (3, 29) } fn __reduce65< 'input, @@ -3196,19 +3366,22 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprStmt = "let", Ident, "=", ExprLogicalOr, ";", ExprStmt => ActionFn(10); - assert!(__symbols.len() >= 6); - let __sym5 = __pop_Variant3(__symbols); + // ExprInStmt = "if", ExprLogicalOr, "{", Expr, "}", "else", "{", Expr, "}" => ActionFn(16); + assert!(__symbols.len() >= 9); + let __sym8 = __pop_Variant0(__symbols); + let __sym7 = __pop_Variant4(__symbols); + let __sym6 = __pop_Variant0(__symbols); + let __sym5 = __pop_Variant0(__symbols); let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant3(__symbols); + let __sym3 = __pop_Variant4(__symbols); let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant4(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; - let __end = __sym5.2; - let __nt = super::__action10::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (6, 31) + let __end = __sym8.2; + let __nt = super::__action16::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (9, 29) } fn __reduce66< 'input, @@ -3219,22 +3392,17 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprStmt = "if", ExprLogicalOr, "{", Expr, "}", "else", "{", Expr, "}" => ActionFn(11); - assert!(__symbols.len() >= 9); - let __sym8 = __pop_Variant0(__symbols); - let __sym7 = __pop_Variant3(__symbols); - let __sym6 = __pop_Variant0(__symbols); - let __sym5 = __pop_Variant0(__symbols); - let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant3(__symbols); - let __sym2 = __pop_Variant0(__symbols); - let __sym1 = __pop_Variant3(__symbols); + // ExprInStmt = "loop", "{", Expr, "}" => ActionFn(17); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant4(__symbols); + let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; - let __end = __sym8.2; - let __nt = super::__action11::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (9, 31) + let __end = __sym3.2; + let __nt = super::__action17::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (4, 29) } fn __reduce67< 'input, @@ -3245,17 +3413,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprStmt = "loop", "{", ExprStmt, "}" => ActionFn(12); - assert!(__symbols.len() >= 4); - let __sym3 = __pop_Variant0(__symbols); - let __sym2 = __pop_Variant3(__symbols); - let __sym1 = __pop_Variant0(__symbols); + // ExprInStmt = "break", ExprLogicalOr => ActionFn(117); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant4(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; - let __end = __sym3.2; - let __nt = super::__action12::<>(input, __sym0, __sym1, __sym2, __sym3); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (4, 31) + let __end = __sym1.2; + let __nt = super::__action117::<>(input, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (2, 29) } fn __reduce68< 'input, @@ -3266,15 +3432,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprStmt = "break", Expr => ActionFn(104); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant3(__symbols); + // ExprInStmt = "break" => ActionFn(118); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action104::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (2, 31) + let __end = __sym0.2; + let __nt = super::__action118::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 29) } fn __reduce69< 'input, @@ -3285,13 +3449,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprStmt = "break" => ActionFn(105); - let __sym0 = __pop_Variant0(__symbols); + // ExprInStmt = ExprLogicalOr => ActionFn(19); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action105::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (1, 31) + let __nt = super::__action19::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 29) } fn __reduce70< 'input, @@ -3302,13 +3466,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprStmt = ExprLogicalOr => ActionFn(14); - let __sym0 = __pop_Variant3(__symbols); + // ExprLogicalAnd = BinaryOps => ActionFn(21); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action14::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (1, 31) + let __nt = super::__action21::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 30) } fn __reduce71< 'input, @@ -3319,15 +3483,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprUnary = UnaryOp, ExprUnary => ActionFn(37); - assert!(__symbols.len() >= 2); - let __sym1 = __pop_Variant3(__symbols); - let __sym0 = __pop_Variant7(__symbols); + // ExprLogicalOr = BinaryOps => ActionFn(20); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; - let __end = __sym1.2; - let __nt = super::__action37::<>(input, __sym0, __sym1); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); - (2, 32) + let __end = __sym0.2; + let __nt = super::__action20::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 31) } fn __reduce72< 'input, @@ -3338,12 +3500,12 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprUnary = ExprCall => ActionFn(38); - let __sym0 = __pop_Variant3(__symbols); + // ExprLogicalOr? = ExprLogicalOr => ActionFn(70); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action38::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + let __nt = super::__action70::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant14(__nt), __end)); (1, 32) } fn __reduce73< @@ -3355,15 +3517,54 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprXor = BinaryOps => ActionFn(18); - let __sym0 = __pop_Variant3(__symbols); + // ExprLogicalOr? = => ActionFn(71); + let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); + let __end = __start; + let __nt = super::__action71::<>(input, &__start, &__end); + __symbols.push((__start, __Symbol::Variant14(__nt), __end)); + (0, 32) + } + fn __reduce74< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ExprMultiplicative = BinaryOps => ActionFn(25); + let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action18::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant3(__nt), __end)); + let __nt = super::__action25::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); (1, 33) } - fn __reduce74< + fn __reduce75< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ExprStmt = "let", "mut", Ident, "=", ExprLogicalOr, ";" => ActionFn(96); + assert!(__symbols.len() >= 6); + let __sym5 = __pop_Variant0(__symbols); + let __sym4 = __pop_Variant4(__symbols); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0; + let __end = __sym5.2; + let __nt = super::__action96::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (6, 34) + } + fn __reduce76< 'input, >( input: &'input str, @@ -3372,25 +3573,203 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Fn = "fn", Ident, "(", Comma, ")", "->", Type, "{", Expr, "}" => ActionFn(88); + // ExprStmt = "let", Ident, "=", ExprLogicalOr, ";" => ActionFn(97); + assert!(__symbols.len() >= 5); + let __sym4 = __pop_Variant0(__symbols); + let __sym3 = __pop_Variant4(__symbols); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0; + let __end = __sym4.2; + let __nt = super::__action97::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (5, 34) + } + fn __reduce77< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ExprStmt = "let", "mut", Ident, "=", ExprLogicalOr, ";", ExprStmt => ActionFn(98); + assert!(__symbols.len() >= 7); + let __sym6 = __pop_Variant4(__symbols); + let __sym5 = __pop_Variant0(__symbols); + let __sym4 = __pop_Variant4(__symbols); + let __sym3 = __pop_Variant0(__symbols); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0; + let __end = __sym6.2; + let __nt = super::__action98::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (7, 34) + } + fn __reduce78< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ExprStmt = "let", Ident, "=", ExprLogicalOr, ";", ExprStmt => ActionFn(99); + assert!(__symbols.len() >= 6); + let __sym5 = __pop_Variant4(__symbols); + let __sym4 = __pop_Variant0(__symbols); + let __sym3 = __pop_Variant4(__symbols); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0; + let __end = __sym5.2; + let __nt = super::__action99::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (6, 34) + } + fn __reduce79< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ExprStmt = ExprInStmt, ";" => ActionFn(12); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant4(__symbols); + let __start = __sym0.0; + let __end = __sym1.2; + let __nt = super::__action12::<>(input, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (2, 34) + } + fn __reduce80< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ExprStmt = ExprInStmt, ";", ExprStmt => ActionFn(13); + assert!(__symbols.len() >= 3); + let __sym2 = __pop_Variant4(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant4(__symbols); + let __start = __sym0.0; + let __end = __sym2.2; + let __nt = super::__action13::<>(input, __sym0, __sym1, __sym2); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (3, 34) + } + fn __reduce81< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ExprStmt = ExprInStmt => ActionFn(14); + let __sym0 = __pop_Variant4(__symbols); + let __start = __sym0.0; + let __end = __sym0.2; + let __nt = super::__action14::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 34) + } + fn __reduce82< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ExprUnary = UnaryOp, ExprUnary => ActionFn(42); + assert!(__symbols.len() >= 2); + let __sym1 = __pop_Variant4(__symbols); + let __sym0 = __pop_Variant8(__symbols); + let __start = __sym0.0; + let __end = __sym1.2; + let __nt = super::__action42::<>(input, __sym0, __sym1); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (2, 35) + } + fn __reduce83< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ExprUnary = ExprCall => ActionFn(43); + let __sym0 = __pop_Variant4(__symbols); + let __start = __sym0.0; + let __end = __sym0.2; + let __nt = super::__action43::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 35) + } + fn __reduce84< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // ExprXor = BinaryOps => ActionFn(23); + let __sym0 = __pop_Variant4(__symbols); + let __start = __sym0.0; + let __end = __sym0.2; + let __nt = super::__action23::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant4(__nt), __end)); + (1, 36) + } + fn __reduce85< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Fn = "fn", Ident, "(", Comma, ")", "->", Type, "{", Expr, "}" => ActionFn(101); assert!(__symbols.len() >= 10); let __sym9 = __pop_Variant0(__symbols); - let __sym8 = __pop_Variant3(__symbols); + let __sym8 = __pop_Variant4(__symbols); let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant1(__symbols); + let __sym6 = __pop_Variant2(__symbols); let __sym5 = __pop_Variant0(__symbols); let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant10(__symbols); + let __sym3 = __pop_Variant11(__symbols); let __sym2 = __pop_Variant0(__symbols); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym9.2; - let __nt = super::__action88::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8, __sym9); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (10, 34) + let __nt = super::__action101::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8, __sym9); + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + (10, 37) } - fn __reduce75< + fn __reduce86< 'input, >( input: &'input str, @@ -3399,23 +3778,23 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Fn = "fn", Ident, "(", Comma, ")", "{", Expr, "}" => ActionFn(89); + // Fn = "fn", Ident, "(", Comma, ")", "{", Expr, "}" => ActionFn(102); assert!(__symbols.len() >= 8); let __sym7 = __pop_Variant0(__symbols); - let __sym6 = __pop_Variant3(__symbols); + let __sym6 = __pop_Variant4(__symbols); let __sym5 = __pop_Variant0(__symbols); let __sym4 = __pop_Variant0(__symbols); - let __sym3 = __pop_Variant10(__symbols); + let __sym3 = __pop_Variant11(__symbols); let __sym2 = __pop_Variant0(__symbols); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym7.2; - let __nt = super::__action89::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7); - __symbols.push((__start, __Symbol::Variant11(__nt), __end)); - (8, 34) + let __nt = super::__action102::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7); + __symbols.push((__start, __Symbol::Variant12(__nt), __end)); + (8, 37) } - fn __reduce76< + fn __reduce87< 'input, >( input: &'input str, @@ -3424,15 +3803,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Ident = r#"[_a-zA-Z][_a-zA-Z0-9]*"# => ActionFn(48); + // Ident = r#"[_a-zA-Z][_a-zA-Z0-9]*"# => ActionFn(53); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action48::<>(input, __sym0); + let __nt = super::__action53::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant0(__nt), __end)); - (1, 35) + (1, 38) } - fn __reduce77< + fn __reduce88< 'input, >( input: &'input str, @@ -3441,15 +3820,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // LogicalAndOp = "&&" => ActionFn(22); + // LogicalAndOp = "&&" => ActionFn(27); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action22::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant7(__nt), __end)); - (1, 36) + let __nt = super::__action27::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (1, 39) } - fn __reduce78< + fn __reduce89< 'input, >( input: &'input str, @@ -3458,15 +3837,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // LogicalOrOp = "||" => ActionFn(21); + // LogicalOrOp = "||" => ActionFn(26); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action21::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant7(__nt), __end)); - (1, 37) + let __nt = super::__action26::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (1, 40) } - fn __reduce79< + fn __reduce90< 'input, >( input: &'input str, @@ -3475,15 +3854,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // MultiplicativeOp = "*" => ActionFn(32); + // MultiplicativeOp = "*" => ActionFn(37); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action32::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant7(__nt), __end)); - (1, 38) + let __nt = super::__action37::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (1, 41) } - fn __reduce80< + fn __reduce91< 'input, >( input: &'input str, @@ -3492,15 +3871,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // MultiplicativeOp = "/" => ActionFn(33); + // MultiplicativeOp = "/" => ActionFn(38); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action33::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant7(__nt), __end)); - (1, 38) + let __nt = super::__action38::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (1, 41) } - fn __reduce81< + fn __reduce92< 'input, >( input: &'input str, @@ -3509,15 +3888,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // MultiplicativeOp = "%" => ActionFn(34); + // MultiplicativeOp = "%" => ActionFn(39); let __sym0 = __pop_Variant0(__symbols); - let __start = __sym0.0; - let __end = __sym0.2; - let __nt = super::__action34::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant7(__nt), __end)); - (1, 38) + let __start = __sym0.0; + let __end = __sym0.2; + let __nt = super::__action39::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (1, 41) } - fn __reduce82< + fn __reduce93< 'input, >( input: &'input str, @@ -3526,15 +3905,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Num = r#"[0-9]+"# => ActionFn(49); + // Num = r#"[0-9]+"# => ActionFn(54); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action49::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant14(__nt), __end)); - (1, 39) + let __nt = super::__action54::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant15(__nt), __end)); + (1, 42) } - fn __reduce83< + fn __reduce94< 'input, >( input: &'input str, @@ -3545,16 +3924,16 @@ mod __parse__Program { { // Param = Ident, ":", Type => ActionFn(4); assert!(__symbols.len() >= 3); - let __sym2 = __pop_Variant1(__symbols); + let __sym2 = __pop_Variant2(__symbols); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym2.2; let __nt = super::__action4::<>(input, __sym0, __sym1, __sym2); - __symbols.push((__start, __Symbol::Variant5(__nt), __end)); - (3, 40) + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (3, 43) } - fn __reduce84< + fn __reduce95< 'input, >( input: &'input str, @@ -3563,15 +3942,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Param? = Param => ActionFn(75); - let __sym0 = __pop_Variant5(__symbols); + // Param? = Param => ActionFn(82); + let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action75::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (1, 41) + let __nt = super::__action82::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant16(__nt), __end)); + (1, 44) } - fn __reduce85< + fn __reduce96< 'input, >( input: &'input str, @@ -3580,14 +3959,14 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Param? = => ActionFn(76); + // Param? = => ActionFn(83); let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); let __end = __start; - let __nt = super::__action76::<>(input, &__start, &__end); - __symbols.push((__start, __Symbol::Variant15(__nt), __end)); - (0, 41) + let __nt = super::__action83::<>(input, &__start, &__end); + __symbols.push((__start, __Symbol::Variant16(__nt), __end)); + (0, 44) } - fn __reduce86< + fn __reduce97< 'input, >( input: &'input str, @@ -3596,14 +3975,14 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Program = => ActionFn(98); + // Program = => ActionFn(111); let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); let __end = __start; - let __nt = super::__action98::<>(input, &__start, &__end); - __symbols.push((__start, __Symbol::Variant16(__nt), __end)); - (0, 42) + let __nt = super::__action111::<>(input, &__start, &__end); + __symbols.push((__start, __Symbol::Variant17(__nt), __end)); + (0, 45) } - fn __reduce87< + fn __reduce98< 'input, >( input: &'input str, @@ -3612,15 +3991,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Program = Def+ => ActionFn(99); - let __sym0 = __pop_Variant12(__symbols); + // Program = Def+ => ActionFn(112); + let __sym0 = __pop_Variant13(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action99::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant16(__nt), __end)); - (1, 42) + let __nt = super::__action112::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant17(__nt), __end)); + (1, 45) } - fn __reduce88< + fn __reduce99< 'input, >( input: &'input str, @@ -3634,10 +4013,10 @@ mod __parse__Program { let __start = __sym0.0; let __end = __sym0.2; let __nt = super::__action5::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (1, 43) + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + (1, 46) } - fn __reduce89< + fn __reduce100< 'input, >( input: &'input str, @@ -3651,10 +4030,10 @@ mod __parse__Program { let __start = __sym0.0; let __end = __sym0.2; let __nt = super::__action6::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (1, 43) + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + (1, 46) } - fn __reduce90< + fn __reduce101< 'input, >( input: &'input str, @@ -3668,10 +4047,10 @@ mod __parse__Program { let __start = __sym0.0; let __end = __sym0.2; let __nt = super::__action7::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (1, 43) + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + (1, 46) } - fn __reduce91< + fn __reduce102< 'input, >( input: &'input str, @@ -3685,10 +4064,10 @@ mod __parse__Program { let __start = __sym0.0; let __end = __sym0.2; let __nt = super::__action8::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant1(__nt), __end)); - (1, 43) + __symbols.push((__start, __Symbol::Variant2(__nt), __end)); + (1, 46) } - fn __reduce92< + fn __reduce103< 'input, >( input: &'input str, @@ -3697,15 +4076,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // UnaryOp = "-" => ActionFn(35); + // UnaryOp = "-" => ActionFn(40); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action35::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant7(__nt), __end)); - (1, 44) + let __nt = super::__action40::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (1, 47) } - fn __reduce93< + fn __reduce104< 'input, >( input: &'input str, @@ -3714,15 +4093,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // UnaryOp = "!" => ActionFn(36); + // UnaryOp = "!" => ActionFn(41); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action36::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant7(__nt), __end)); - (1, 44) + let __nt = super::__action41::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (1, 47) } - fn __reduce94< + fn __reduce105< 'input, >( input: &'input str, @@ -3731,13 +4110,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // XorOp = "^" => ActionFn(29); + // XorOp = "^" => ActionFn(34); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action29::<>(input, __sym0); - __symbols.push((__start, __Symbol::Variant7(__nt), __end)); - (1, 45) + let __nt = super::__action34::<>(input, __sym0); + __symbols.push((__start, __Symbol::Variant8(__nt), __end)); + (1, 48) } } pub use self::__parse__Program::ProgramParser; @@ -3791,6 +4170,7 @@ mod __intern_token { ("(?:if)", false), ("(?:let)", false), ("(?:loop)", false), + ("(?:mut)", false), ("(?:print)", false), ("(?:read)", false), ("(?:true)", false), @@ -3941,20 +4321,91 @@ fn __action10< >( input: &'input str, (_, _, _): (usize, &'input str, usize), + (_, mutable, _): (usize, core::option::Option<&'input str>, usize), (_, sym, _): (usize, &'input str, usize), (_, _, _): (usize, &'input str, usize), (_, bnd, _): (usize, Expr<&'input str>, usize), (_, _, _): (usize, &'input str, usize), - (_, bdy, _): (usize, Expr<&'input str>, usize), ) -> Expr<&'input str> { - Expr::Let { sym, bnd: Box::new(bnd), bdy: Box::new(bdy) } + Expr::Let { sym, mutable: mutable.is_some(), bnd: Box::new(bnd), bdy: Box::new(Expr::Lit { val: Lit::Unit }) } } #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] fn __action11< 'input, +>( + input: &'input str, + (_, _, _): (usize, &'input str, usize), + (_, mutable, _): (usize, core::option::Option<&'input str>, usize), + (_, sym, _): (usize, &'input str, usize), + (_, _, _): (usize, &'input str, usize), + (_, bnd, _): (usize, Expr<&'input str>, usize), + (_, _, _): (usize, &'input str, usize), + (_, bdy, _): (usize, Expr<&'input str>, usize), +) -> Expr<&'input str> +{ + Expr::Let { sym, mutable: mutable.is_some(), bnd: Box::new(bnd), bdy: Box::new(bdy) } +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action12< + 'input, +>( + input: &'input str, + (_, stmt, _): (usize, Expr<&'input str>, usize), + (_, _, _): (usize, &'input str, usize), +) -> Expr<&'input str> +{ + Expr::Seq { stmt: Box::new(stmt), cnt: Box::new(Expr::Lit { val: Lit::Unit }) } +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action13< + 'input, +>( + input: &'input str, + (_, stmt, _): (usize, Expr<&'input str>, usize), + (_, _, _): (usize, &'input str, usize), + (_, cnt, _): (usize, Expr<&'input str>, usize), +) -> Expr<&'input str> +{ + Expr::Seq { stmt: Box::new(stmt), cnt: Box::new(cnt) } +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action14< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, Expr<&'input str>, usize), +) -> Expr<&'input str> +{ + __0 +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action15< + 'input, +>( + input: &'input str, + (_, sym, _): (usize, &'input str, usize), + (_, _, _): (usize, &'input str, usize), + (_, bnd, _): (usize, Expr<&'input str>, usize), +) -> Expr<&'input str> +{ + Expr::Assign { sym, bnd: Box::new(bnd), bdy: Box::new(Expr::Lit { val: Lit::Unit }) } +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action16< + 'input, >( input: &'input str, (_, _, _): (usize, &'input str, usize), @@ -3973,7 +4424,7 @@ fn __action11< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action12< +fn __action17< 'input, >( input: &'input str, @@ -3988,7 +4439,7 @@ fn __action12< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action13< +fn __action18< 'input, >( input: &'input str, @@ -4001,7 +4452,7 @@ fn __action13< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action14< +fn __action19< 'input, >( input: &'input str, @@ -4013,7 +4464,7 @@ fn __action14< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action15< +fn __action20< 'input, >( input: &'input str, @@ -4025,7 +4476,7 @@ fn __action15< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action16< +fn __action21< 'input, >( input: &'input str, @@ -4037,7 +4488,7 @@ fn __action16< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action17< +fn __action22< 'input, >( input: &'input str, @@ -4049,7 +4500,7 @@ fn __action17< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action18< +fn __action23< 'input, >( input: &'input str, @@ -4061,7 +4512,7 @@ fn __action18< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action19< +fn __action24< 'input, >( input: &'input str, @@ -4073,7 +4524,7 @@ fn __action19< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action20< +fn __action25< 'input, >( input: &'input str, @@ -4085,7 +4536,7 @@ fn __action20< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action21< +fn __action26< 'input, >( input: &'input str, @@ -4097,7 +4548,7 @@ fn __action21< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action22< +fn __action27< 'input, >( input: &'input str, @@ -4109,7 +4560,7 @@ fn __action22< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action23< +fn __action28< 'input, >( input: &'input str, @@ -4121,7 +4572,7 @@ fn __action23< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action24< +fn __action29< 'input, >( input: &'input str, @@ -4133,7 +4584,7 @@ fn __action24< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action25< +fn __action30< 'input, >( input: &'input str, @@ -4145,7 +4596,7 @@ fn __action25< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action26< +fn __action31< 'input, >( input: &'input str, @@ -4157,7 +4608,7 @@ fn __action26< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action27< +fn __action32< 'input, >( input: &'input str, @@ -4169,7 +4620,7 @@ fn __action27< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action28< +fn __action33< 'input, >( input: &'input str, @@ -4181,7 +4632,7 @@ fn __action28< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action29< +fn __action34< 'input, >( input: &'input str, @@ -4193,7 +4644,7 @@ fn __action29< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action30< +fn __action35< 'input, >( input: &'input str, @@ -4205,7 +4656,7 @@ fn __action30< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action31< +fn __action36< 'input, >( input: &'input str, @@ -4217,7 +4668,7 @@ fn __action31< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action32< +fn __action37< 'input, >( input: &'input str, @@ -4229,7 +4680,7 @@ fn __action32< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action33< +fn __action38< 'input, >( input: &'input str, @@ -4241,7 +4692,7 @@ fn __action33< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action34< +fn __action39< 'input, >( input: &'input str, @@ -4253,7 +4704,7 @@ fn __action34< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action35< +fn __action40< 'input, >( input: &'input str, @@ -4265,7 +4716,7 @@ fn __action35< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action36< +fn __action41< 'input, >( input: &'input str, @@ -4277,7 +4728,7 @@ fn __action36< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action37< +fn __action42< 'input, >( input: &'input str, @@ -4290,7 +4741,7 @@ fn __action37< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action38< +fn __action43< 'input, >( input: &'input str, @@ -4302,7 +4753,7 @@ fn __action38< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action39< +fn __action44< 'input, >( input: &'input str, @@ -4316,7 +4767,7 @@ fn __action39< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action40< +fn __action45< 'input, >( input: &'input str, @@ -4331,7 +4782,7 @@ fn __action40< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action41< +fn __action46< 'input, >( input: &'input str, @@ -4346,7 +4797,7 @@ fn __action41< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action42< +fn __action47< 'input, >( input: &'input str, @@ -4358,7 +4809,7 @@ fn __action42< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action43< +fn __action48< 'input, >( input: &'input str, @@ -4370,7 +4821,7 @@ fn __action43< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action44< +fn __action49< 'input, >( input: &'input str, @@ -4382,7 +4833,7 @@ fn __action44< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action45< +fn __action50< 'input, >( input: &'input str, @@ -4394,7 +4845,7 @@ fn __action45< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action46< +fn __action51< 'input, >( input: &'input str, @@ -4406,7 +4857,7 @@ fn __action46< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action47< +fn __action52< 'input, >( input: &'input str, @@ -4420,7 +4871,7 @@ fn __action47< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action48< +fn __action53< 'input, >( input: &'input str, @@ -4432,7 +4883,7 @@ fn __action48< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action49< +fn __action54< 'input, >( input: &'input str, @@ -4444,7 +4895,7 @@ fn __action49< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action50< +fn __action55< 'input, >( input: &'input str, @@ -4456,7 +4907,7 @@ fn __action50< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action51< +fn __action56< 'input, >( input: &'input str, @@ -4468,7 +4919,7 @@ fn __action51< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action52< +fn __action57< 'input, >( input: &'input str, @@ -4488,7 +4939,7 @@ fn __action52< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action53< +fn __action58< 'input, >( input: &'input str, @@ -4502,7 +4953,7 @@ fn __action53< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action54< +fn __action59< 'input, >( input: &'input str, @@ -4514,7 +4965,7 @@ fn __action54< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action55< +fn __action60< 'input, >( input: &'input str, @@ -4528,7 +4979,7 @@ fn __action55< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action56< +fn __action61< 'input, >( input: &'input str, @@ -4540,7 +4991,7 @@ fn __action56< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action57< +fn __action62< 'input, >( input: &'input str, @@ -4554,7 +5005,7 @@ fn __action57< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action58< +fn __action63< 'input, >( input: &'input str, @@ -4566,7 +5017,7 @@ fn __action58< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action59< +fn __action64< 'input, >( input: &'input str, @@ -4580,7 +5031,7 @@ fn __action59< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action60< +fn __action65< 'input, >( input: &'input str, @@ -4592,7 +5043,7 @@ fn __action60< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action61< +fn __action66< 'input, >( input: &'input str, @@ -4606,7 +5057,7 @@ fn __action61< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action62< +fn __action67< 'input, >( input: &'input str, @@ -4618,7 +5069,7 @@ fn __action62< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action63< +fn __action68< 'input, >( input: &'input str, @@ -4632,44 +5083,69 @@ fn __action63< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action64< +fn __action69< 'input, >( input: &'input str, (_, __0, _): (usize, Expr<&'input str>, usize), ) -> Expr<&'input str> { - __0 + __0 +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action70< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, Expr<&'input str>, usize), +) -> core::option::Option> +{ + Some(__0) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action71< + 'input, +>( + input: &'input str, + __lookbehind: &usize, + __lookahead: &usize, +) -> core::option::Option> +{ + None } #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action65< +fn __action72< 'input, >( input: &'input str, - (_, __0, _): (usize, Expr<&'input str>, usize), -) -> core::option::Option> + (_, __0, _): (usize, &'input str, usize), +) -> core::option::Option<&'input str> { Some(__0) } #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action66< +fn __action73< 'input, >( input: &'input str, __lookbehind: &usize, __lookahead: &usize, -) -> core::option::Option> +) -> core::option::Option<&'input str> { None } #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action67< +fn __action74< 'input, >( input: &'input str, @@ -4681,7 +5157,7 @@ fn __action67< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action68< +fn __action75< 'input, >( input: &'input str, @@ -4694,7 +5170,7 @@ fn __action68< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action69< +fn __action76< 'input, >( input: &'input str, @@ -4707,7 +5183,7 @@ fn __action69< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action70< +fn __action77< 'input, >( input: &'input str, @@ -4727,7 +5203,7 @@ fn __action70< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action71< +fn __action78< 'input, >( input: &'input str, @@ -4740,7 +5216,7 @@ fn __action71< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action72< +fn __action79< 'input, >( input: &'input str, @@ -4752,7 +5228,7 @@ fn __action72< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action73< +fn __action80< 'input, >( input: &'input str, @@ -4764,7 +5240,7 @@ fn __action73< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action74< +fn __action81< 'input, >( input: &'input str, @@ -4777,7 +5253,7 @@ fn __action74< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action75< +fn __action82< 'input, >( input: &'input str, @@ -4789,7 +5265,7 @@ fn __action75< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action76< +fn __action83< 'input, >( input: &'input str, @@ -4802,7 +5278,7 @@ fn __action76< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action77< +fn __action84< 'input, >( input: &'input str, @@ -4815,7 +5291,7 @@ fn __action77< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action78< +fn __action85< 'input, >( input: &'input str, @@ -4827,7 +5303,7 @@ fn __action78< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action79< +fn __action86< 'input, >( input: &'input str, @@ -4840,7 +5316,32 @@ fn __action79< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action80< +fn __action87< + 'input, +>( + input: &'input str, + (_, __0, _): (usize, Expr<&'input str>, usize), +) -> core::option::Option> +{ + Some(__0) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action88< + 'input, +>( + input: &'input str, + __lookbehind: &usize, + __lookahead: &usize, +) -> core::option::Option> +{ + None +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] +fn __action89< 'input, >( input: &'input str, @@ -4853,7 +5354,7 @@ fn __action80< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action81< +fn __action90< 'input, >( input: &'input str, @@ -4865,7 +5366,7 @@ fn __action81< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action82< +fn __action91< 'input, >( input: &'input str, @@ -4878,7 +5379,7 @@ fn __action82< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action83< +fn __action92< 'input, >( input: &'input str, @@ -4890,7 +5391,7 @@ fn __action83< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action84< +fn __action93< 'input, >( input: &'input str, @@ -4903,7 +5404,7 @@ fn __action84< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action85< +fn __action94< 'input, >( input: &'input str, @@ -4915,7 +5416,7 @@ fn __action85< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action86< +fn __action95< 'input, >( input: &'input str, @@ -4929,7 +5430,143 @@ fn __action86< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action87< +fn __action96< + 'input, +>( + input: &'input str, + __0: (usize, &'input str, usize), + __1: (usize, &'input str, usize), + __2: (usize, &'input str, usize), + __3: (usize, &'input str, usize), + __4: (usize, Expr<&'input str>, usize), + __5: (usize, &'input str, usize), +) -> Expr<&'input str> +{ + let __start0 = __1.0; + let __end0 = __1.2; + let __temp0 = __action72( + input, + __1, + ); + let __temp0 = (__start0, __temp0, __end0); + __action10( + input, + __0, + __temp0, + __2, + __3, + __4, + __5, + ) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action97< + 'input, +>( + input: &'input str, + __0: (usize, &'input str, usize), + __1: (usize, &'input str, usize), + __2: (usize, &'input str, usize), + __3: (usize, Expr<&'input str>, usize), + __4: (usize, &'input str, usize), +) -> Expr<&'input str> +{ + let __start0 = __0.2; + let __end0 = __1.0; + let __temp0 = __action73( + input, + &__start0, + &__end0, + ); + let __temp0 = (__start0, __temp0, __end0); + __action10( + input, + __0, + __temp0, + __1, + __2, + __3, + __4, + ) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action98< + 'input, +>( + input: &'input str, + __0: (usize, &'input str, usize), + __1: (usize, &'input str, usize), + __2: (usize, &'input str, usize), + __3: (usize, &'input str, usize), + __4: (usize, Expr<&'input str>, usize), + __5: (usize, &'input str, usize), + __6: (usize, Expr<&'input str>, usize), +) -> Expr<&'input str> +{ + let __start0 = __1.0; + let __end0 = __1.2; + let __temp0 = __action72( + input, + __1, + ); + let __temp0 = (__start0, __temp0, __end0); + __action11( + input, + __0, + __temp0, + __2, + __3, + __4, + __5, + __6, + ) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action99< + 'input, +>( + input: &'input str, + __0: (usize, &'input str, usize), + __1: (usize, &'input str, usize), + __2: (usize, &'input str, usize), + __3: (usize, Expr<&'input str>, usize), + __4: (usize, &'input str, usize), + __5: (usize, Expr<&'input str>, usize), +) -> Expr<&'input str> +{ + let __start0 = __0.2; + let __end0 = __1.0; + let __temp0 = __action73( + input, + &__start0, + &__end0, + ); + let __temp0 = (__start0, __temp0, __end0); + __action11( + input, + __0, + __temp0, + __1, + __2, + __3, + __4, + __5, + ) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action100< 'input, >( input: &'input str, @@ -4939,13 +5576,13 @@ fn __action87< { let __start0 = __0.0; let __end0 = __1.2; - let __temp0 = __action69( + let __temp0 = __action76( input, __0, __1, ); let __temp0 = (__start0, __temp0, __end0); - __action67( + __action74( input, __temp0, ) @@ -4954,7 +5591,7 @@ fn __action87< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action88< +fn __action101< 'input, >( input: &'input str, @@ -4972,7 +5609,7 @@ fn __action88< { let __start0 = __5.0; let __end0 = __6.2; - let __temp0 = __action87( + let __temp0 = __action100( input, __5, __6, @@ -4995,7 +5632,7 @@ fn __action88< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action89< +fn __action102< 'input, >( input: &'input str, @@ -5011,7 +5648,7 @@ fn __action89< { let __start0 = __4.2; let __end0 = __5.0; - let __temp0 = __action68( + let __temp0 = __action75( input, &__start0, &__end0, @@ -5034,7 +5671,7 @@ fn __action89< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action90< +fn __action103< 'input, >( input: &'input str, @@ -5044,13 +5681,13 @@ fn __action90< { let __start0 = __0.0; let __end0 = __1.2; - let __temp0 = __action82( + let __temp0 = __action91( input, __0, __1, ); let __temp0 = (__start0, __temp0, __end0); - __action83( + __action92( input, __temp0, ) @@ -5059,7 +5696,7 @@ fn __action90< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action91< +fn __action104< 'input, >( input: &'input str, @@ -5070,13 +5707,13 @@ fn __action91< { let __start0 = __1.0; let __end0 = __2.2; - let __temp0 = __action82( + let __temp0 = __action91( input, __1, __2, ); let __temp0 = (__start0, __temp0, __end0); - __action84( + __action93( input, __0, __temp0, @@ -5086,7 +5723,7 @@ fn __action91< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action92< +fn __action105< 'input, >( input: &'input str, @@ -5095,13 +5732,13 @@ fn __action92< { let __start0 = __0.0; let __end0 = __0.0; - let __temp0 = __action80( + let __temp0 = __action89( input, &__start0, &__end0, ); let __temp0 = (__start0, __temp0, __end0); - __action52( + __action57( input, __temp0, __0, @@ -5111,7 +5748,7 @@ fn __action92< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action93< +fn __action106< 'input, >( input: &'input str, @@ -5121,12 +5758,12 @@ fn __action93< { let __start0 = __0.0; let __end0 = __0.2; - let __temp0 = __action81( + let __temp0 = __action90( input, __0, ); let __temp0 = (__start0, __temp0, __end0); - __action52( + __action57( input, __temp0, __1, @@ -5136,7 +5773,7 @@ fn __action93< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action94< +fn __action107< 'input, >( input: &'input str, @@ -5146,13 +5783,13 @@ fn __action94< { let __start0 = __0.0; let __end0 = __1.2; - let __temp0 = __action79( + let __temp0 = __action86( input, __0, __1, ); let __temp0 = (__start0, __temp0, __end0); - __action85( + __action94( input, __temp0, ) @@ -5161,7 +5798,7 @@ fn __action94< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action95< +fn __action108< 'input, >( input: &'input str, @@ -5172,13 +5809,13 @@ fn __action95< { let __start0 = __1.0; let __end0 = __2.2; - let __temp0 = __action79( + let __temp0 = __action86( input, __1, __2, ); let __temp0 = (__start0, __temp0, __end0); - __action86( + __action95( input, __0, __temp0, @@ -5188,7 +5825,7 @@ fn __action95< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action96< +fn __action109< 'input, >( input: &'input str, @@ -5197,13 +5834,13 @@ fn __action96< { let __start0 = __0.0; let __end0 = __0.0; - let __temp0 = __action77( + let __temp0 = __action84( input, &__start0, &__end0, ); let __temp0 = (__start0, __temp0, __end0); - __action70( + __action77( input, __temp0, __0, @@ -5213,7 +5850,7 @@ fn __action96< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action97< +fn __action110< 'input, >( input: &'input str, @@ -5223,12 +5860,12 @@ fn __action97< { let __start0 = __0.0; let __end0 = __0.2; - let __temp0 = __action78( + let __temp0 = __action85( input, __0, ); let __temp0 = (__start0, __temp0, __end0); - __action70( + __action77( input, __temp0, __1, @@ -5238,7 +5875,7 @@ fn __action97< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action98< +fn __action111< 'input, >( input: &'input str, @@ -5248,7 +5885,7 @@ fn __action98< { let __start0 = *__lookbehind; let __end0 = *__lookahead; - let __temp0 = __action71( + let __temp0 = __action78( input, &__start0, &__end0, @@ -5263,7 +5900,7 @@ fn __action98< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action99< +fn __action112< 'input, >( input: &'input str, @@ -5272,7 +5909,7 @@ fn __action99< { let __start0 = __0.0; let __end0 = __0.2; - let __temp0 = __action72( + let __temp0 = __action79( input, __0, ); @@ -5286,7 +5923,7 @@ fn __action99< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action100< +fn __action113< 'input, >( input: &'input str, @@ -5295,12 +5932,12 @@ fn __action100< { let __start0 = __0.0; let __end0 = __0.2; - let __temp0 = __action65( + let __temp0 = __action87( input, __0, ); let __temp0 = (__start0, __temp0, __end0); - __action92( + __action105( input, __temp0, ) @@ -5309,7 +5946,7 @@ fn __action100< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action101< +fn __action114< 'input, >( input: &'input str, @@ -5319,13 +5956,13 @@ fn __action101< { let __start0 = *__lookbehind; let __end0 = *__lookahead; - let __temp0 = __action66( + let __temp0 = __action88( input, &__start0, &__end0, ); let __temp0 = (__start0, __temp0, __end0); - __action92( + __action105( input, __temp0, ) @@ -5334,7 +5971,7 @@ fn __action101< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action102< +fn __action115< 'input, >( input: &'input str, @@ -5344,12 +5981,12 @@ fn __action102< { let __start0 = __1.0; let __end0 = __1.2; - let __temp0 = __action65( + let __temp0 = __action87( input, __1, ); let __temp0 = (__start0, __temp0, __end0); - __action93( + __action106( input, __0, __temp0, @@ -5359,7 +5996,7 @@ fn __action102< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action103< +fn __action116< 'input, >( input: &'input str, @@ -5368,13 +6005,13 @@ fn __action103< { let __start0 = __0.2; let __end0 = __0.2; - let __temp0 = __action66( + let __temp0 = __action88( input, &__start0, &__end0, ); let __temp0 = (__start0, __temp0, __end0); - __action93( + __action106( input, __0, __temp0, @@ -5384,7 +6021,7 @@ fn __action103< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action104< +fn __action117< 'input, >( input: &'input str, @@ -5394,12 +6031,12 @@ fn __action104< { let __start0 = __1.0; let __end0 = __1.2; - let __temp0 = __action65( + let __temp0 = __action70( input, __1, ); let __temp0 = (__start0, __temp0, __end0); - __action13( + __action18( input, __0, __temp0, @@ -5409,7 +6046,7 @@ fn __action104< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action105< +fn __action118< 'input, >( input: &'input str, @@ -5418,13 +6055,13 @@ fn __action105< { let __start0 = __0.2; let __end0 = __0.2; - let __temp0 = __action66( + let __temp0 = __action71( input, &__start0, &__end0, ); let __temp0 = (__start0, __temp0, __end0); - __action13( + __action18( input, __0, __temp0, @@ -5434,7 +6071,7 @@ fn __action105< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action106< +fn __action119< 'input, >( input: &'input str, @@ -5443,12 +6080,12 @@ fn __action106< { let __start0 = __0.0; let __end0 = __0.2; - let __temp0 = __action75( + let __temp0 = __action82( input, __0, ); let __temp0 = (__start0, __temp0, __end0); - __action96( + __action109( input, __temp0, ) @@ -5457,7 +6094,7 @@ fn __action106< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action107< +fn __action120< 'input, >( input: &'input str, @@ -5467,13 +6104,13 @@ fn __action107< { let __start0 = *__lookbehind; let __end0 = *__lookahead; - let __temp0 = __action76( + let __temp0 = __action83( input, &__start0, &__end0, ); let __temp0 = (__start0, __temp0, __end0); - __action96( + __action109( input, __temp0, ) @@ -5482,7 +6119,7 @@ fn __action107< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action108< +fn __action121< 'input, >( input: &'input str, @@ -5492,12 +6129,12 @@ fn __action108< { let __start0 = __1.0; let __end0 = __1.2; - let __temp0 = __action75( + let __temp0 = __action82( input, __1, ); let __temp0 = (__start0, __temp0, __end0); - __action97( + __action110( input, __0, __temp0, @@ -5507,7 +6144,7 @@ fn __action108< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action109< +fn __action122< 'input, >( input: &'input str, @@ -5516,13 +6153,13 @@ fn __action109< { let __start0 = __0.2; let __end0 = __0.2; - let __temp0 = __action76( + let __temp0 = __action83( input, &__start0, &__end0, ); let __temp0 = (__start0, __temp0, __end0); - __action97( + __action110( input, __0, __temp0, diff --git a/compiler/src/passes/parse/interpreter.rs b/compiler/src/passes/parse/interpreter.rs index 3c53bb4..5fade39 100644 --- a/compiler/src/passes/parse/interpreter.rs +++ b/compiler/src/passes/parse/interpreter.rs @@ -155,7 +155,7 @@ impl PrgGenericVar { } _ => unreachable!(), }, - Expr::Let { sym, bnd, bdy } => { + Expr::Let { sym, mutable, bnd, bdy } => { let bnd = b!(self.interpret_expr(bnd, scope, io)); b!(scope.push(*sym, bnd, |scope| self.interpret_expr(bdy, scope, io))) } @@ -186,6 +186,8 @@ impl PrgGenericVar { None => Val::Unit, }) } + Expr::Seq { .. } => todo!(), + Expr::Assign { .. } => todo!(), }) } } diff --git a/compiler/src/passes/parse/mod.rs b/compiler/src/passes/parse/mod.rs index 87a37ab..40f19bd 100644 --- a/compiler/src/passes/parse/mod.rs +++ b/compiler/src/passes/parse/mod.rs @@ -45,6 +45,7 @@ pub enum Expr { }, Let { sym: A, + mutable: bool, bnd: Box>, bdy: Box>, }, @@ -63,6 +64,15 @@ pub enum Expr { Break { bdy: Option>>, }, + Seq { + stmt: Box>, + cnt: Box>, + }, + Assign { + sym: A, + bnd: Box>, + bdy: Box>, + }, } #[derive(Copy, Clone, Debug, PartialEq)] @@ -111,3 +121,15 @@ impl Lit { } } } + +#[cfg(test)] +mod tests { + use crate::utils::split_test::split_test; + use test_each_file::test_each_file; + + fn parse([test]: [&str; 1]) { + split_test(test); + } + + test_each_file! { for ["test"] in "./programs/good" as parse => parse } +} diff --git a/compiler/src/passes/reveal_functions/mod.rs b/compiler/src/passes/reveal_functions/mod.rs index affc265..26f68ea 100644 --- a/compiler/src/passes/reveal_functions/mod.rs +++ b/compiler/src/passes/reveal_functions/mod.rs @@ -101,6 +101,7 @@ impl<'p> From> for Expr> { }, RExpr::Let { sym, bnd, bdy } => Expr::Let { sym, + mutable: true, bnd: Box::new((*bnd).into()), bdy: Box::new((*bdy).into()), }, diff --git a/compiler/src/passes/reveal_functions/reveal_functions.rs b/compiler/src/passes/reveal_functions/reveal_functions.rs index 0706b7f..190bb6c 100644 --- a/compiler/src/passes/reveal_functions/reveal_functions.rs +++ b/compiler/src/passes/reveal_functions/reveal_functions.rs @@ -52,7 +52,7 @@ fn reveal_expr<'p>(expr: Expr>, scope: &mut PushMap, .map(|arg| reveal_expr(arg, scope)) .collect(), }, - Expr::Let { sym, bnd, bdy } => { + Expr::Let { sym, mutable, bnd, bdy } => { let bnd = Box::new(reveal_expr(*bnd, scope)); scope.remove(sym, |scope| RExpr::Let { sym, @@ -82,6 +82,8 @@ fn reveal_expr<'p>(expr: Expr>, scope: &mut PushMap, bdy: bdy.map(|bdy| Box::new(reveal_expr(*bdy, scope))) } }, + Expr::Seq { .. } => todo!(), + Expr::Assign { .. } => todo!(), } } diff --git a/compiler/src/passes/select/mod.rs b/compiler/src/passes/select/mod.rs index 7797b88..6db42cb 100644 --- a/compiler/src/passes/select/mod.rs +++ b/compiler/src/passes/select/mod.rs @@ -5,9 +5,8 @@ pub mod io; -use crate::language::cvar::{CExpr, PrgExplicated, Tail}; use crate::language::x86var::{ - Block, Cnd, Instr, VarArg, X86Selected, ARG_PASSING_REGS, CALLEE_SAVED_NO_STACK, + ARG_PASSING_REGS, Block, CALLEE_SAVED_NO_STACK, Cnd, Instr, VarArg, X86Selected, }; use crate::passes::parse::Op; use crate::passes::select::io::Std; @@ -15,6 +14,7 @@ use crate::utils::gen_sym::{gen_sym, UniqueSym}; use crate::*; use std::collections::HashMap; use crate::passes::atomize::Atom; +use crate::passes::explicate::{CExpr, PrgExplicated, Tail}; impl<'p> PrgExplicated<'p> { /// See module-level documentation. diff --git a/compiler/src/passes/type_check/check.rs b/compiler/src/passes/type_check/check.rs index 130afb5..2641976 100644 --- a/compiler/src/passes/type_check/check.rs +++ b/compiler/src/passes/type_check/check.rs @@ -180,7 +180,7 @@ fn type_check_expr<'p>(expr: &Expr<&'p str>, env: &mut Env<'_, 'p>) -> Result panic!("Found incorrect operator during type checking"), }, - Expr::Let { sym, bnd, bdy } => { + Expr::Let { sym, mutable, bnd, bdy } => { let t = type_check_expr(bnd, env)?; env.push(sym, t, |env| type_check_expr(bdy, env)) } @@ -240,6 +240,8 @@ fn type_check_expr<'p>(expr: &Expr<&'p str>, env: &mut Env<'_, 'p>) -> Result todo!(), + Expr::Assign { .. } => todo!(), } } diff --git a/compiler/src/passes/uniquify/uniquify.rs b/compiler/src/passes/uniquify/uniquify.rs index e6a55c1..1bcaff4 100644 --- a/compiler/src/passes/uniquify/uniquify.rs +++ b/compiler/src/passes/uniquify/uniquify.rs @@ -63,13 +63,14 @@ fn uniquify_expression<'p>( .map(|arg| uniquify_expression(arg, scope)) .collect(), }, - Expr::Let { sym, bnd, bdy } => { + Expr::Let { sym, mutable, bnd, bdy } => { let unique_bnd = uniquify_expression(*bnd, scope); let unique_sym = gen_sym(sym); let unique_bdy = scope.push(sym, unique_sym, |scope| uniquify_expression(*bdy, scope)); Expr::Let { sym: unique_sym, + mutable, bnd: Box::new(unique_bnd), bdy: Box::new(unique_bdy), } @@ -92,5 +93,7 @@ fn uniquify_expression<'p>( Expr::Break { bdy } => Expr::Break { bdy: bdy.map(|bdy| Box::new(uniquify_expression(*bdy, scope))), }, + Expr::Seq { .. } => todo!(), + Expr::Assign { .. } => todo!(), } } diff --git a/programs/good/mutability/let_semicolon.test b/programs/good/mutability/let_semicolon.test new file mode 100644 index 0000000..7f3d592 --- /dev/null +++ b/programs/good/mutability/let_semicolon.test @@ -0,0 +1,6 @@ +## +unit +# +fn main() -> Unit { + let x = 5; +} diff --git a/programs/good/mutability/let_set.test b/programs/good/mutability/let_set.test new file mode 100644 index 0000000..8f803f6 --- /dev/null +++ b/programs/good/mutability/let_set.test @@ -0,0 +1,8 @@ +## +6 +# +fn main() -> Int { + let mut x = 5; + x = 6; + x +} diff --git a/programs/good/mutability/loop.test b/programs/good/mutability/loop.test new file mode 100644 index 0000000..b3ea57a --- /dev/null +++ b/programs/good/mutability/loop.test @@ -0,0 +1,13 @@ +## +42 +# +fn main() -> Int { + let mut x = 1; + loop { + if x < 42 { + x = x + 1; + } else { + break x; + } + } +} diff --git a/programs/good/mutability/possibly_set.test b/programs/good/mutability/possibly_set.test new file mode 100644 index 0000000..3a2f82a --- /dev/null +++ b/programs/good/mutability/possibly_set.test @@ -0,0 +1,13 @@ +45 +## +42 +# +fn main() -> Int { + let mut x = read(); + if x > 42 { + x = 42; + } else { + unit + }; + x +} diff --git a/programs/good/mutability/read.test b/programs/good/mutability/read.test new file mode 100644 index 0000000..c3f0196 --- /dev/null +++ b/programs/good/mutability/read.test @@ -0,0 +1,10 @@ +## +unit +# +fn test() -> Unit { + unit; +} + +fn main() -> Unit { + test(); +} diff --git a/programs/good/mutability/semicolon.test b/programs/good/mutability/semicolon.test new file mode 100644 index 0000000..a6b6b22 --- /dev/null +++ b/programs/good/mutability/semicolon.test @@ -0,0 +1,6 @@ +## +unit +# +fn main() -> Unit { + 5; +} diff --git a/programs/good/mutability/semicolons.test b/programs/good/mutability/semicolons.test new file mode 100644 index 0000000..a28d813 --- /dev/null +++ b/programs/good/mutability/semicolons.test @@ -0,0 +1,8 @@ +## +unit +# +fn main() -> Unit { + 5; + 6; + 7; +} From eb662217e1e9859cb80303a0e0794dd40d7dcb8d Mon Sep 17 00:00:00 2001 From: jonathan Date: Sat, 28 Oct 2023 23:08:26 +0200 Subject: [PATCH 15/27] Fmt --- compiler/src/language/mod.rs | 1 - compiler/src/passes/atomize/atomize.rs | 32 +++++++++---------- compiler/src/passes/atomize/mod.rs | 8 +++-- compiler/src/passes/explicate/explicate.rs | 9 ++++-- compiler/src/passes/explicate/interpret.rs | 1 - compiler/src/passes/explicate/mod.rs | 20 +++--------- compiler/src/passes/mod.rs | 2 +- compiler/src/passes/parse/interpreter.rs | 7 +++- compiler/src/passes/reveal_functions/mod.rs | 10 ++++-- .../reveal_functions/reveal_functions.rs | 19 +++++------ compiler/src/passes/select/mod.rs | 6 ++-- compiler/src/passes/type_check/check.rs | 7 +++- compiler/src/passes/uniquify/uniquify.rs | 7 +++- 13 files changed, 72 insertions(+), 57 deletions(-) diff --git a/compiler/src/language/mod.rs b/compiler/src/language/mod.rs index 6faa557..a87fa85 100644 --- a/compiler/src/language/mod.rs +++ b/compiler/src/language/mod.rs @@ -1,2 +1 @@ - pub mod x86var; diff --git a/compiler/src/passes/atomize/atomize.rs b/compiler/src/passes/atomize/atomize.rs index 05ca03f..c0cd2f9 100644 --- a/compiler/src/passes/atomize/atomize.rs +++ b/compiler/src/passes/atomize/atomize.rs @@ -69,17 +69,11 @@ fn atomize_expr(expr: RExpr) -> AExpr { fun_expr .into_iter() .chain(extras.into_iter().flatten()) - .rfold( - AExpr::Apply { - fun, - args, - }, - |bdy, (sym, bnd)| AExpr::Let { - sym, - bnd: Box::new(bnd), - bdy: Box::new(bdy), - }, - ) + .rfold(AExpr::Apply { fun, args }, |bdy, (sym, bnd)| AExpr::Let { + sym, + bnd: Box::new(bnd), + bdy: Box::new(bdy), + }) } RExpr::FunRef { sym } => { let tmp = gen_sym("tmp"); @@ -91,21 +85,27 @@ fn atomize_expr(expr: RExpr) -> AExpr { }), } } - RExpr::Loop { bdy } => AExpr::Loop { bdy: Box::new(atomize_expr(*bdy))}, + RExpr::Loop { bdy } => AExpr::Loop { + bdy: Box::new(atomize_expr(*bdy)), + }, RExpr::Break { bdy } => { let (atm, extras) = match bdy { Some(bdy) => atomize_atom(*bdy), - None => return AExpr::Break { bdy: Atom::Val { val: Lit::Unit }}, + None => { + return AExpr::Break { + bdy: Atom::Val { val: Lit::Unit }, + } + } }; extras .into_iter() - .rfold(AExpr::Break { bdy: atm}, |bdy, (sym, bnd)| AExpr::Let { + .rfold(AExpr::Break { bdy: atm }, |bdy, (sym, bnd)| AExpr::Let { sym, bnd: Box::new(bnd), bdy: Box::new(bdy), }) - }, + } } } @@ -119,7 +119,7 @@ fn atomize_atom(expr: RExpr) -> (Atom, Option<(UniqueSym, AExpr)>) { | RExpr::Apply { .. } | RExpr::FunRef { .. } | RExpr::Loop { .. } - | RExpr::Break { .. } => { + | RExpr::Break { .. } => { let tmp = gen_sym("tmp"); (Atom::Var { sym: tmp }, Some((tmp, atomize_expr(expr)))) } diff --git a/compiler/src/passes/atomize/mod.rs b/compiler/src/passes/atomize/mod.rs index 3894afc..57a400c 100644 --- a/compiler/src/passes/atomize/mod.rs +++ b/compiler/src/passes/atomize/mod.rs @@ -107,8 +107,12 @@ impl<'p> From> for Expr> { args: args.into_iter().map(Into::into).collect(), }, AExpr::FunRef { sym } => Expr::Var { sym }, - AExpr::Loop { bdy } => Expr::Loop { bdy: Box::new((*bdy).into()) }, - AExpr::Break { bdy } => Expr::Break { bdy: Some(Box::new(bdy.into())) }, + AExpr::Loop { bdy } => Expr::Loop { + bdy: Box::new((*bdy).into()), + }, + AExpr::Break { bdy } => Expr::Break { + bdy: Some(Box::new(bdy.into())), + }, } } } diff --git a/compiler/src/passes/explicate/explicate.rs b/compiler/src/passes/explicate/explicate.rs index dcc74c7..ad9e6dd 100644 --- a/compiler/src/passes/explicate/explicate.rs +++ b/compiler/src/passes/explicate/explicate.rs @@ -1,8 +1,8 @@ +use crate::passes::atomize::{AExpr, Atom, PrgAtomized}; +use crate::passes::explicate::{CExpr, PrgExplicated, Tail}; use crate::passes::parse::{Def, Lit, Op}; use crate::utils::gen_sym::{gen_sym, UniqueSym}; use std::collections::HashMap; -use crate::passes::atomize::{AExpr, Atom, PrgAtomized}; -use crate::passes::explicate::{CExpr, PrgExplicated, Tail}; impl<'p> PrgAtomized<'p> { pub fn explicate(self) -> PrgExplicated<'p> { @@ -27,7 +27,10 @@ impl<'p> PrgAtomized<'p> { } } -fn explicate_def<'p>(def: Def, AExpr<'p>>, blocks: &mut HashMap, Tail<'p>>) { +fn explicate_def<'p>( + def: Def, AExpr<'p>>, + blocks: &mut HashMap, Tail<'p>>, +) { match def { Def::Fn { sym, bdy, .. } => { let tail = explicate_tail(bdy, blocks); diff --git a/compiler/src/passes/explicate/interpret.rs b/compiler/src/passes/explicate/interpret.rs index a3f80b7..aee545a 100644 --- a/compiler/src/passes/explicate/interpret.rs +++ b/compiler/src/passes/explicate/interpret.rs @@ -1,4 +1,3 @@ - use crate::interpreter::value::Val; use crate::interpreter::IO; use crate::passes::atomize::Atom; diff --git a/compiler/src/passes/explicate/mod.rs b/compiler/src/passes/explicate/mod.rs index 2b04c8e..6238d1c 100644 --- a/compiler/src/passes/explicate/mod.rs +++ b/compiler/src/passes/explicate/mod.rs @@ -1,10 +1,10 @@ pub mod explicate; pub mod interpret; -use std::collections::HashMap; use crate::passes::atomize::Atom; use crate::passes::parse::Op; use crate::utils::gen_sym::UniqueSym; +use std::collections::HashMap; #[derive(Debug, PartialEq)] pub struct PrgExplicated<'p> { @@ -35,18 +35,8 @@ pub enum Tail<'p> { #[derive(Clone, Debug, PartialEq)] pub enum CExpr<'p> { - Atom { - atm: Atom<'p>, - }, - Prim { - op: Op, - args: Vec>, - }, - Apply { - fun: Atom<'p>, - args: Vec>, - }, - FunRef { - sym: UniqueSym<'p>, - }, + Atom { atm: Atom<'p> }, + Prim { op: Op, args: Vec> }, + Apply { fun: Atom<'p>, args: Vec> }, + FunRef { sym: UniqueSym<'p> }, } diff --git a/compiler/src/passes/mod.rs b/compiler/src/passes/mod.rs index 6726eaa..89af6c4 100644 --- a/compiler/src/passes/mod.rs +++ b/compiler/src/passes/mod.rs @@ -4,6 +4,7 @@ pub mod coloring_interference; pub mod compute_interference; pub mod conclude; pub mod emit; +pub mod explicate; pub mod liveness_analysis; pub mod parse; pub mod patch_instructions; @@ -11,4 +12,3 @@ pub mod reveal_functions; pub mod select; pub mod type_check; pub mod uniquify; -pub mod explicate; diff --git a/compiler/src/passes/parse/interpreter.rs b/compiler/src/passes/parse/interpreter.rs index 5fade39..5cac39e 100644 --- a/compiler/src/passes/parse/interpreter.rs +++ b/compiler/src/passes/parse/interpreter.rs @@ -155,7 +155,12 @@ impl PrgGenericVar { } _ => unreachable!(), }, - Expr::Let { sym, mutable, bnd, bdy } => { + Expr::Let { + sym, + mutable, + bnd, + bdy, + } => { let bnd = b!(self.interpret_expr(bnd, scope, io)); b!(scope.push(*sym, bnd, |scope| self.interpret_expr(bdy, scope, io))) } diff --git a/compiler/src/passes/reveal_functions/mod.rs b/compiler/src/passes/reveal_functions/mod.rs index 26f68ea..46f1d91 100644 --- a/compiler/src/passes/reveal_functions/mod.rs +++ b/compiler/src/passes/reveal_functions/mod.rs @@ -1,10 +1,10 @@ pub mod reveal_functions; -use std::collections::HashMap; use crate::passes::parse::{Def, Expr, Lit, Op}; use crate::passes::type_check::Type; use crate::passes::uniquify::PrgUniquified; use crate::utils::gen_sym::UniqueSym; +use std::collections::HashMap; #[derive(Debug, PartialEq)] pub struct PrgRevealed<'p> { @@ -115,8 +115,12 @@ impl<'p> From> for Expr> { args: args.into_iter().map(Into::into).collect(), }, RExpr::Var { sym } | RExpr::FunRef { sym } => Expr::Var { sym }, - RExpr::Loop { bdy } => Expr::Loop { bdy: Box::new((*bdy).into()) }, - RExpr::Break { bdy } => Expr::Break { bdy: bdy.map(|bdy| Box::new((*bdy).into())) }, + RExpr::Loop { bdy } => Expr::Loop { + bdy: Box::new((*bdy).into()), + }, + RExpr::Break { bdy } => Expr::Break { + bdy: bdy.map(|bdy| Box::new((*bdy).into())), + }, } } } diff --git a/compiler/src/passes/reveal_functions/reveal_functions.rs b/compiler/src/passes/reveal_functions/reveal_functions.rs index 190bb6c..887ee01 100644 --- a/compiler/src/passes/reveal_functions/reveal_functions.rs +++ b/compiler/src/passes/reveal_functions/reveal_functions.rs @@ -52,7 +52,12 @@ fn reveal_expr<'p>(expr: Expr>, scope: &mut PushMap, .map(|arg| reveal_expr(arg, scope)) .collect(), }, - Expr::Let { sym, mutable, bnd, bdy } => { + Expr::Let { + sym, + mutable, + bnd, + bdy, + } => { let bnd = Box::new(reveal_expr(*bnd, scope)); scope.remove(sym, |scope| RExpr::Let { sym, @@ -72,15 +77,11 @@ fn reveal_expr<'p>(expr: Expr>, scope: &mut PushMap, .map(|arg| reveal_expr(arg, scope)) .collect(), }, - Expr::Loop { bdy } => { - RExpr::Loop { - bdy: Box::new(reveal_expr(*bdy, scope)) - } + Expr::Loop { bdy } => RExpr::Loop { + bdy: Box::new(reveal_expr(*bdy, scope)), }, - Expr::Break { bdy } => { - RExpr::Break { - bdy: bdy.map(|bdy| Box::new(reveal_expr(*bdy, scope))) - } + Expr::Break { bdy } => RExpr::Break { + bdy: bdy.map(|bdy| Box::new(reveal_expr(*bdy, scope))), }, Expr::Seq { .. } => todo!(), Expr::Assign { .. } => todo!(), diff --git a/compiler/src/passes/select/mod.rs b/compiler/src/passes/select/mod.rs index 6db42cb..acdca92 100644 --- a/compiler/src/passes/select/mod.rs +++ b/compiler/src/passes/select/mod.rs @@ -6,15 +6,15 @@ pub mod io; use crate::language::x86var::{ - ARG_PASSING_REGS, Block, CALLEE_SAVED_NO_STACK, Cnd, Instr, VarArg, X86Selected, + Block, Cnd, Instr, VarArg, X86Selected, ARG_PASSING_REGS, CALLEE_SAVED_NO_STACK, }; +use crate::passes::atomize::Atom; +use crate::passes::explicate::{CExpr, PrgExplicated, Tail}; use crate::passes::parse::Op; use crate::passes::select::io::Std; use crate::utils::gen_sym::{gen_sym, UniqueSym}; use crate::*; use std::collections::HashMap; -use crate::passes::atomize::Atom; -use crate::passes::explicate::{CExpr, PrgExplicated, Tail}; impl<'p> PrgExplicated<'p> { /// See module-level documentation. diff --git a/compiler/src/passes/type_check/check.rs b/compiler/src/passes/type_check/check.rs index 2641976..bd49a64 100644 --- a/compiler/src/passes/type_check/check.rs +++ b/compiler/src/passes/type_check/check.rs @@ -180,7 +180,12 @@ fn type_check_expr<'p>(expr: &Expr<&'p str>, env: &mut Env<'_, 'p>) -> Result panic!("Found incorrect operator during type checking"), }, - Expr::Let { sym, mutable, bnd, bdy } => { + Expr::Let { + sym, + mutable, + bnd, + bdy, + } => { let t = type_check_expr(bnd, env)?; env.push(sym, t, |env| type_check_expr(bdy, env)) } diff --git a/compiler/src/passes/uniquify/uniquify.rs b/compiler/src/passes/uniquify/uniquify.rs index 1bcaff4..9a4c139 100644 --- a/compiler/src/passes/uniquify/uniquify.rs +++ b/compiler/src/passes/uniquify/uniquify.rs @@ -63,7 +63,12 @@ fn uniquify_expression<'p>( .map(|arg| uniquify_expression(arg, scope)) .collect(), }, - Expr::Let { sym, mutable, bnd, bdy } => { + Expr::Let { + sym, + mutable, + bnd, + bdy, + } => { let unique_bnd = uniquify_expression(*bnd, scope); let unique_sym = gen_sym(sym); let unique_bdy = scope.push(sym, unique_sym, |scope| uniquify_expression(*bdy, scope)); From 08d19a070a64cd9fff5f758177bb194dfc9f0951 Mon Sep 17 00:00:00 2001 From: jonathan Date: Sat, 28 Oct 2023 23:09:50 +0200 Subject: [PATCH 16/27] Fix test name --- programs/good/mutability/{loop.test => loop_to_42.test} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename programs/good/mutability/{loop.test => loop_to_42.test} (100%) diff --git a/programs/good/mutability/loop.test b/programs/good/mutability/loop_to_42.test similarity index 100% rename from programs/good/mutability/loop.test rename to programs/good/mutability/loop_to_42.test From e441671df020d40492aa45385cf181eb43bbd71f Mon Sep 17 00:00:00 2001 From: jonathan Date: Sun, 29 Oct 2023 15:19:16 +0100 Subject: [PATCH 17/27] Type checking --- compiler/src/passes/atomize/atomize.rs | 4 +- compiler/src/passes/explicate/explicate.rs | 2 +- compiler/src/passes/parse/grammar.lalrpop | 5 +- compiler/src/passes/parse/grammar.rs | 859 ++++++++++-------- compiler/src/passes/parse/interpreter.rs | 15 +- compiler/src/passes/parse/mod.rs | 10 +- compiler/src/passes/reveal_functions/mod.rs | 18 +- .../reveal_functions/reveal_functions.rs | 4 +- compiler/src/passes/type_check/check.rs | 40 +- compiler/src/passes/uniquify/uniquify.rs | 7 +- compiler/src/utils/push_map.rs | 2 +- programs/fail/type_check/mut_var.test | 11 + programs/good/mutability/mut_var.test | 11 + 13 files changed, 566 insertions(+), 422 deletions(-) create mode 100644 programs/fail/type_check/mut_var.test create mode 100644 programs/good/mutability/mut_var.test diff --git a/compiler/src/passes/atomize/atomize.rs b/compiler/src/passes/atomize/atomize.rs index c0cd2f9..41df24d 100644 --- a/compiler/src/passes/atomize/atomize.rs +++ b/compiler/src/passes/atomize/atomize.rs @@ -1,6 +1,6 @@ use crate::passes::atomize::{AExpr, Atom, PrgAtomized}; use crate::passes::parse::{Def, Lit}; -use crate::passes::reveal_functions::{PrgRevealed, RDef, RExpr}; +use crate::passes::reveal_functions::{PrgRevealed, RExpr}; use crate::utils::gen_sym::{gen_sym, UniqueSym}; impl<'p> PrgRevealed<'p> { @@ -11,7 +11,7 @@ impl<'p> PrgRevealed<'p> { .into_iter() .map(|(sym, def)| { let def = match def { - RDef::Fn { + Def::Fn { sym, params, typ, diff --git a/compiler/src/passes/explicate/explicate.rs b/compiler/src/passes/explicate/explicate.rs index ad9e6dd..90714e5 100644 --- a/compiler/src/passes/explicate/explicate.rs +++ b/compiler/src/passes/explicate/explicate.rs @@ -11,7 +11,7 @@ impl<'p> PrgAtomized<'p> { .defs .iter() .map(|(fn_sym, def)| match def { - Def::Fn { params, .. } => (*fn_sym, params.iter().map(|(sym, _)| *sym).collect()), + Def::Fn { params, .. } => (*fn_sym, params.iter().map(|param| param.sym).collect()), }) .collect(); diff --git a/compiler/src/passes/parse/grammar.lalrpop b/compiler/src/passes/parse/grammar.lalrpop index 7ff77e5..2c4f9c8 100644 --- a/compiler/src/passes/parse/grammar.lalrpop +++ b/compiler/src/passes/parse/grammar.lalrpop @@ -80,7 +80,7 @@ Fn: Def<&'input str, Expr<&'input str>> = { "fn" "(" > ")" " )?> "{" "}" => Def::Fn { sym, params, typ: typ.unwrap_or(Type::Unit), bdy } } -Param = ":" ; +Param: Param<&'input str> = ":" => Param { mutable: mutable.is_some(), sym, typ }; Type: Type = { "Int" => Type::Int, @@ -97,6 +97,7 @@ BinaryOps: Expr<&'input str> = { Expr = ExprStmt; ExprStmt: Expr<&'input str> = { + //TODO yeet this? "let" "=" ";" => Expr::Let { sym, mutable: mutable.is_some(), bnd: Box::new(bnd), bdy: Box::new(Expr::Lit { val: Lit::Unit }) }, "let" "=" ";" => Expr::Let { sym, mutable: mutable.is_some(), bnd: Box::new(bnd), bdy: Box::new(bdy) }, ";" => Expr::Seq { stmt: Box::new(stmt), cnt: Box::new(Expr::Lit { val: Lit::Unit }) }, @@ -105,7 +106,7 @@ ExprStmt: Expr<&'input str> = { } ExprInStmt: Expr<&'input str> = { - "=" => Expr::Assign { sym, bnd: Box::new(bnd), bdy: Box::new(Expr::Lit { val: Lit::Unit }) }, + "=" => Expr::Assign { sym, bnd: Box::new(bnd) }, "if" "{" "}" "else" "{" "}" => Expr::If { cnd: Box::new(cnd), thn: Box::new(thn), els: Box::new(els) }, "loop" "{" "}" => Expr::Loop { bdy: Box::new(bdy) }, "break" => Expr::Break { bdy: bdy.map(Box::new) }, diff --git a/compiler/src/passes/parse/grammar.rs b/compiler/src/passes/parse/grammar.rs index ca6d2ed..bb747d9 100644 --- a/compiler/src/passes/parse/grammar.rs +++ b/compiler/src/passes/parse/grammar.rs @@ -1,5 +1,5 @@ // auto-generated: "lalrpop 0.20.1" -// sha3: 54bd82964252811feec0ac4adfd2ad0a957764d825ac9afe9d3e0d6aad26080b +// sha3: 3c4c7923c83c86d09168a0850717bb0210feb6858f8417dbaea3c25718b22de5 use std::str::FromStr; use crate::passes::parse::*; use crate::passes::parse::PrgParsed; @@ -35,17 +35,17 @@ mod __parse__Program { Variant3(core::option::Option), Variant4(Expr<&'input str>), Variant5(alloc::vec::Vec>), - Variant6((&'input str, Type)), - Variant7(alloc::vec::Vec<(&'input str, Type)>), + Variant6(Param<&'input str>), + Variant7(alloc::vec::Vec>), Variant8(Op), Variant9(bool), Variant10(Vec>), - Variant11(Vec<(&'input str, Type)>), + Variant11(Vec>), Variant12(Def<&'input str, Expr<&'input str>>), Variant13(alloc::vec::Vec>>), Variant14(core::option::Option>), Variant15(i64), - Variant16(core::option::Option<(&'input str, Type)>), + Variant16(core::option::Option>), Variant17(PrgParsed<'input>), } const __ACTION: &[i16] = &[ @@ -54,272 +54,280 @@ mod __parse__Program { // State 1 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 2 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 3 - 0, 0, 0, 0, 0, -37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, + 0, 0, 0, 0, 0, -37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 47, // State 4 - 0, 0, 0, 0, 0, -39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, + 0, 0, 0, 0, 0, -39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 47, // State 5 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 55, 56, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, // State 6 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 55, 56, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 58, 59, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 7 - 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 58, 59, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 8 - 0, -54, 0, -54, 0, -54, 0, 83, -54, 84, 0, 0, 0, -54, -54, -54, 0, -54, -54, -54, 0, 0, 0, 0, -54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -54, -54, -54, 0, 0, + 77, 0, 0, 0, 18, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 79, 0, 20, 21, 80, 0, 81, 82, 83, 84, 0, 0, 0, 85, 47, // State 9 - 0, 85, 0, -64, 0, -64, 0, 0, -64, 0, 0, 0, 0, -64, 86, 87, 0, 88, 89, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -64, -64, -64, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 58, 59, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 10 - 0, 0, 0, 91, 0, -71, 0, 0, -71, 0, 0, 0, 0, -71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -71, -71, -71, 0, 0, + 0, -54, 0, -54, 0, -54, 0, 87, -54, 88, 0, 0, 0, -54, -54, -54, 0, -54, -54, -54, 0, 0, 0, 0, -54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -54, -54, -54, 0, 0, // State 11 - 0, 0, 0, 0, 0, -72, 0, 0, -72, 0, 0, 0, 0, -72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -72, 92, -72, 0, 0, + 0, 89, 0, -64, 0, -64, 0, 0, -64, 0, 0, 0, 0, -64, 90, 91, 0, 92, 93, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -64, -64, -64, 0, 0, // State 12 - 0, -75, 93, -75, 0, -75, 94, -75, -75, -75, 0, 95, 0, -75, -75, -75, 0, -75, -75, -75, 0, 0, 0, 0, -75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -75, -75, -75, 0, 0, + 0, 0, 0, 95, 0, -71, 0, 0, -71, 0, 0, 0, 0, -71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -71, -71, -71, 0, 0, // State 13 - 0, -85, 0, -85, 0, -85, 0, 0, -85, 0, 0, 0, 0, -85, -85, -85, 0, -85, -85, -85, 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -85, -85, -85, 0, 0, + 0, 0, 0, 0, 0, -72, 0, 0, -72, 0, 0, 0, 0, -72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -72, 96, -72, 0, 0, // State 14 - 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, + 0, -75, 97, -75, 0, -75, 98, -75, -75, -75, 0, 99, 0, -75, -75, -75, 0, -75, -75, -75, 0, 0, 0, 0, -75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -75, -75, -75, 0, 0, // State 15 - 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, + 0, -85, 0, -85, 0, -85, 0, 0, -85, 0, 0, 0, 0, -85, -85, -85, 0, -85, -85, -85, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -85, -85, -85, 0, 0, // State 16 - 74, 0, 0, 0, 16, -69, 0, 0, -69, 75, 0, 0, 0, -69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, -69, 82, 45, + 77, 0, 0, 0, 18, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, 0, 0, 0, 81, 82, 83, 84, 0, 0, 0, 85, 47, // State 17 - 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, + 77, 0, 0, 0, 18, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 79, 0, 20, 21, 80, 0, 81, 82, 83, 84, 0, 0, 0, 85, 47, // State 18 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 45, + 77, 0, 0, 0, 18, -69, 0, 0, -69, 78, 0, 0, 0, -69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, 0, 0, 0, 81, 82, 83, 84, 0, 0, -69, 85, 47, // State 19 - 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, + 77, 0, 0, 0, 18, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, 0, 0, 0, 81, 82, 83, 84, 0, 0, 0, 85, 47, // State 20 - 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 47, // State 21 - 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, + 77, 0, 0, 0, 18, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 79, 0, 20, 21, 80, 0, 81, 82, 83, 84, 0, 0, 0, 85, 47, // State 22 - 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, + 77, 0, 0, 0, 18, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, 0, 0, 0, 81, 82, 83, 84, 0, 0, 0, 85, 47, // State 23 - 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, + 77, 0, 0, 0, 18, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, 0, 0, 0, 81, 82, 83, 84, 0, 0, 0, 85, 47, // State 24 - 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, + 77, 0, 0, 0, 18, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, 0, 0, 0, 81, 82, 83, 84, 0, 0, 0, 85, 47, // State 25 - 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, + 77, 0, 0, 0, 18, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, 0, 0, 0, 81, 82, 83, 84, 0, 0, 0, 85, 47, // State 26 - 74, 0, 0, 0, 16, -33, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, + 77, 0, 0, 0, 18, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, 0, 0, 0, 81, 82, 83, 84, 0, 0, 0, 85, 47, // State 27 - 74, 0, 0, 0, 16, -80, 0, 0, -80, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, -80, 82, 45, + 77, 0, 0, 0, 18, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, 0, 0, 0, 81, 82, 83, 84, 0, 0, 0, 85, 47, // State 28 - 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, + 77, 0, 0, 0, 18, -33, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 79, 0, 20, 21, 80, 0, 81, 82, 83, 84, 0, 0, 0, 85, 47, // State 29 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, + 77, 0, 0, 0, 18, -80, 0, 0, -80, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 79, 0, 20, 21, 80, 0, 81, 82, 83, 84, 0, 0, -80, 85, 47, // State 30 - 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, + 77, 0, 0, 0, 18, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, 0, 0, 0, 81, 82, 83, 84, 0, 0, 0, 85, 47, // State 31 - 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, // State 32 - 74, 0, 0, 0, 16, -35, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, + 77, 0, 0, 0, 18, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 79, 0, 20, 21, 80, 0, 81, 82, 83, 84, 0, 0, 0, 85, 47, // State 33 - 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, + 77, 0, 0, 0, 18, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 79, 0, 20, 21, 80, 0, 81, 82, 83, 84, 0, 0, 0, 85, 47, // State 34 - 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, + 77, 0, 0, 0, 18, -35, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 79, 0, 20, 21, 80, 0, 81, 82, 83, 84, 0, 0, 0, 85, 47, // State 35 - 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, + 77, 0, 0, 0, 18, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 79, 0, 20, 21, 80, 0, 81, 82, 83, 84, 0, 0, 0, 85, 47, // State 36 - 74, 0, 0, 0, 16, -77, 0, 0, -77, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, -77, 82, 45, + 77, 0, 0, 0, 18, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, 0, 0, 0, 81, 82, 83, 84, 0, 0, 0, 85, 47, // State 37 - 74, 0, 0, 0, 16, -76, 0, 0, -76, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, -76, 82, 45, + 77, 0, 0, 0, 18, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, 0, 0, 0, 81, 82, 83, 84, 0, 0, 0, 85, 47, // State 38 - 74, 0, 0, 0, 16, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 76, 0, 18, 19, 77, 0, 78, 79, 80, 81, 0, 0, 0, 82, 45, + 77, 0, 0, 0, 18, -77, 0, 0, -77, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 79, 0, 20, 21, 80, 0, 81, 82, 83, 84, 0, 0, -77, 85, 47, // State 39 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 77, 0, 0, 0, 18, -76, 0, 0, -76, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 79, 0, 20, 21, 80, 0, 81, 82, 83, 84, 0, 0, -76, 85, 47, // State 40 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 77, 0, 0, 0, 18, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 79, 0, 20, 21, 80, 0, 81, 82, 83, 84, 0, 0, 0, 85, 47, // State 41 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 42 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 43 - 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 44 - 0, -88, -88, -88, -88, -88, -88, -88, -88, -88, 0, -88, -88, -88, -88, -88, -88, -88, -88, -88, 0, 0, 0, 0, -88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -88, -88, -88, 0, 0, + 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 45 - 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 46 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -88, -88, -88, -88, -88, -88, -88, -88, -88, 0, -88, -88, -88, -88, -88, -88, -88, -88, -88, 0, 0, 0, 0, -88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -88, -88, -88, 0, 0, // State 47 - 0, 0, 0, 0, 0, -36, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 48 - 0, 0, 0, 0, 0, -38, 0, 0, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 49 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -36, 0, 0, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 50 - 0, 0, 0, 0, 0, -14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, + 0, 0, 0, 0, 0, -38, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 51 - 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, // State 52 - 0, 0, 0, 0, 0, -95, 0, 0, -95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 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, 0, 0, 0, 0, 0, 0, 0, -14, // State 53 - 0, 0, 0, 0, 0, -101, 0, 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, 0, 0, 0, 0, -101, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, // State 54 - 0, 0, 0, 0, 0, -100, 0, 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, 0, 0, 0, -100, 0, 0, 0, 0, + 0, 0, 0, 0, 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, 0, 0, 0, -15, 0, 0, 0, 0, 0, 0, 0, 0, -15, // State 55 - 0, 0, 0, 0, 0, -103, 0, 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, 0, 0, 0, 0, -103, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -96, 0, 0, -96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 56 0, 0, 0, 0, 0, -102, 0, 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, 0, 0, 0, 0, 0, -102, 0, 0, 0, 0, // State 57 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -101, 0, 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, 0, 0, 0, 0, -101, 0, 0, 0, 0, // State 58 - 0, -56, -56, -56, -56, -56, -56, -56, -56, -56, 0, -56, 0, -56, -56, -56, 0, -56, -56, -56, 0, 0, 0, 0, -56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -56, -56, -56, 0, 0, + 0, 0, 0, 0, 0, -104, 0, 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, 0, 0, 0, 0, -104, 0, 0, 0, 0, // State 59 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 0, 0, + 0, 0, 0, 0, 0, -103, 0, 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, 0, 0, 0, 0, -103, 0, 0, 0, 0, // State 60 - 0, -29, 0, -29, 0, -29, 0, 0, -29, 0, 0, 0, 0, -29, -29, -29, 0, -29, -29, -29, 0, 0, 0, 0, -29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -29, -29, -29, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, // State 61 - 0, -63, -63, -63, 27, -63, -63, -63, -63, -63, 0, -63, 0, -63, -63, -63, 0, -63, -63, -63, 0, 0, 0, 0, -63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -63, -63, -63, 0, 0, + 0, -56, -56, -56, -56, -56, -56, -56, -56, -56, 0, -56, 0, -56, -56, -56, 0, -56, -56, -56, 0, 0, 0, 0, -56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -56, -56, -56, 0, 0, // State 62 - 0, -84, -84, -84, 0, -84, -84, -84, -84, -84, 0, -84, 0, -84, -84, -84, 0, -84, -84, -84, 0, 0, 0, 0, -84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -84, -84, -84, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 0, 0, // State 63 - 0, 0, 0, -23, 0, -23, 0, 0, -23, 0, 0, 0, 0, -23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -23, -23, -23, 0, 0, + 0, -29, 0, -29, 0, -29, 0, 0, -29, 0, 0, 0, 0, -29, -29, -29, 0, -29, -29, -29, 0, 0, 0, 0, -29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -29, -29, -29, 0, 0, // State 64 - 0, 0, 0, 0, 0, -82, 0, 0, -82, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -82, 0, 0, + 0, -63, -63, -63, 29, -63, -63, -63, -63, -63, 0, -63, 0, -63, -63, -63, 0, -63, -63, -63, 0, 0, 0, 0, -63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -63, -63, -63, 0, 0, // State 65 - 0, 0, 0, 0, 0, -25, 0, 0, -25, 0, 0, 0, 0, -25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -25, -25, -25, 0, 0, + 0, -84, -84, -84, 0, -84, -84, -84, -84, -84, 0, -84, 0, -84, -84, -84, 0, -84, -84, -84, 0, 0, 0, 0, -84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -84, -84, -84, 0, 0, // State 66 - 0, 0, 0, 0, 0, -70, 0, 0, -70, 0, 0, 0, 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, -70, 0, 0, + 0, 0, 0, -23, 0, -23, 0, 0, -23, 0, 0, 0, 0, -23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -23, -23, -23, 0, 0, // State 67 - 0, -19, 0, -19, 0, -19, 0, -19, -19, -19, 0, 0, 0, -19, -19, -19, 0, -19, -19, -19, 0, 0, 0, 0, -19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -19, -19, -19, 0, 0, + 0, 0, 0, 0, 0, -82, 0, 0, -82, 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, 0, -82, 0, 0, // State 68 - 0, 0, 0, 0, 0, -51, 0, 0, -51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -51, 0, 0, + 0, 0, 0, 0, 0, -25, 0, 0, -25, 0, 0, 0, 0, -25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -25, -25, -25, 0, 0, // State 69 - 0, -27, -27, -27, 0, -27, -27, -27, -27, -27, 0, -27, 0, -27, -27, -27, 0, -27, -27, -27, 0, 0, 0, 0, -27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -27, -27, -27, 0, 0, + 0, 0, 0, 0, 0, -70, 0, 0, -70, 0, 0, 0, 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, -70, 0, 0, // State 70 - 0, -21, 0, -21, 0, -21, 0, 0, -21, 0, 0, 0, 0, -21, -21, -21, 0, -21, -21, -21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -21, -21, -21, 0, 0, + 0, -19, 0, -19, 0, -19, 0, -19, -19, -19, 0, 0, 0, -19, -19, -19, 0, -19, -19, -19, 0, 0, 0, 0, -19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -19, -19, -19, 0, 0, // State 71 - 0, -58, -58, -58, -58, -58, -58, -58, -58, -58, 0, -58, 0, -58, -58, -58, 29, -58, -58, -58, 0, 0, 0, 0, -58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -58, -58, 0, 0, + 0, 0, 0, 0, 0, -51, 0, 0, -51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -51, 0, 0, // State 72 - 0, -55, -55, -55, -55, -55, -55, -55, -55, -55, 0, -55, 0, -55, -55, -55, 0, -55, -55, -55, 0, 0, 0, 0, -55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -55, -55, -55, 0, 0, + 0, -27, -27, -27, 0, -27, -27, -27, -27, -27, 0, -27, 0, -27, -27, -27, 0, -27, -27, -27, 0, 0, 0, 0, -27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -27, -27, -27, 0, 0, // State 73 - -105, 0, 0, 0, -105, 0, 0, 0, 0, -105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -105, 0, 0, 0, 0, 0, -105, -105, -105, -105, 0, 0, 0, -105, -105, + 0, -21, 0, -21, 0, -21, 0, 0, -21, 0, 0, 0, 0, -21, -21, -21, 0, -21, -21, -21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -21, -21, -21, 0, 0, // State 74 - -104, 0, 0, 0, -104, 0, 0, 0, 0, -104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -104, 0, 0, 0, 0, 0, -104, -104, -104, -104, 0, 0, 0, -104, -104, + 0, -58, -58, -58, -58, -58, -58, -58, -58, -58, 0, -58, 0, -58, -58, -58, 31, -58, -58, -58, 0, 0, 0, 0, -58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -58, -58, 0, 0, // State 75 - 0, -31, -31, -31, -31, -31, -31, -31, -31, -31, 0, -31, 0, -31, -31, -31, 0, -31, -31, -31, 0, 0, 0, 0, -31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -31, -31, -31, 0, 0, + 0, -55, -55, -55, -55, -55, -55, -55, -55, -55, 0, -55, 0, -55, -55, -55, 0, -55, -55, -55, 0, 0, 0, 0, -55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -55, -55, -55, 0, 0, // State 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, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, + -106, 0, 0, 0, -106, 0, 0, 0, 0, -106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -106, 0, 0, 0, 0, 0, -106, -106, -106, -106, 0, 0, 0, -106, -106, // State 77 - 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -105, 0, 0, 0, -105, 0, 0, 0, 0, -105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -105, 0, 0, 0, 0, 0, -105, -105, -105, -105, 0, 0, 0, -105, -105, // State 78 - 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -31, -31, -31, -31, -31, -31, -31, -31, -31, 0, -31, 0, -31, -31, -31, 0, -31, -31, -31, 0, 0, 0, 0, -31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -31, -31, -31, 0, 0, // State 79 - 0, -30, -30, -30, -30, -30, -30, -30, -30, -30, 0, -30, 0, -30, -30, -30, 0, -30, -30, -30, 0, 0, 0, 0, -30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -30, -30, -30, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, // State 80 - 0, -57, -57, -57, -57, -57, -57, -57, -57, -57, 0, -57, 0, -57, -57, -57, 0, -57, -57, -57, 0, 0, 0, 0, -57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -57, -57, -57, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 81 - 0, -94, -94, -94, -94, -94, -94, -94, -94, -94, 0, -94, 0, -94, -94, -94, 0, -94, -94, -94, 0, 0, 0, 0, -94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -94, -94, -94, 0, 0, + 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 82 - -16, 0, 0, 0, -16, 0, 0, 0, 0, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16, 0, 0, 0, 0, 0, -16, -16, -16, -16, 0, 0, 0, -16, -16, + 0, -30, -30, -30, -30, -30, -30, -30, -30, -30, 0, -30, 0, -30, -30, -30, 0, -30, -30, -30, 0, 0, 0, 0, -30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -30, -30, -30, 0, 0, // State 83 - -17, 0, 0, 0, -17, 0, 0, 0, 0, -17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -17, 0, 0, 0, 0, 0, -17, -17, -17, -17, 0, 0, 0, -17, -17, + 0, -57, -57, -57, -57, -57, -57, -57, -57, -57, 0, -57, 0, -57, -57, -57, 0, -57, -57, -57, 0, 0, 0, 0, -57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -57, -57, -57, 0, 0, // State 84 - -41, 0, 0, 0, -41, 0, 0, 0, 0, -41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -41, 0, 0, 0, 0, 0, -41, -41, -41, -41, 0, 0, 0, -41, -41, + 0, -94, -94, -94, -94, -94, -94, -94, -94, -94, 0, -94, 0, -94, -94, -94, 0, -94, -94, -94, 0, 0, 0, 0, -94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -94, -94, -94, 0, 0, // State 85 - -44, 0, 0, 0, -44, 0, 0, 0, 0, -44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -44, 0, 0, 0, 0, 0, -44, -44, -44, -44, 0, 0, 0, -44, -44, + 0, 0, 0, 0, 0, -95, 0, 0, -95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 86 - -45, 0, 0, 0, -45, 0, 0, 0, 0, -45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -45, 0, 0, 0, 0, 0, -45, -45, -45, -45, 0, 0, 0, -45, -45, + -16, 0, 0, 0, -16, 0, 0, 0, 0, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16, 0, 0, 0, 0, 0, -16, -16, -16, -16, 0, 0, 0, -16, -16, // State 87 - -40, 0, 0, 0, -40, 0, 0, 0, 0, -40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -40, 0, 0, 0, 0, 0, -40, -40, -40, -40, 0, 0, 0, -40, -40, + -17, 0, 0, 0, -17, 0, 0, 0, 0, -17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -17, 0, 0, 0, 0, 0, -17, -17, -17, -17, 0, 0, 0, -17, -17, // State 88 - -42, 0, 0, 0, -42, 0, 0, 0, 0, -42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -42, 0, 0, 0, 0, 0, -42, -42, -42, -42, 0, 0, 0, -42, -42, + -41, 0, 0, 0, -41, 0, 0, 0, 0, -41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -41, 0, 0, 0, 0, 0, -41, -41, -41, -41, 0, 0, 0, -41, -41, // State 89 - -43, 0, 0, 0, -43, 0, 0, 0, 0, -43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -43, 0, 0, 0, 0, 0, -43, -43, -43, -43, 0, 0, 0, -43, -43, + -44, 0, 0, 0, -44, 0, 0, 0, 0, -44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -44, 0, 0, 0, 0, 0, -44, -44, -44, -44, 0, 0, 0, -44, -44, // State 90 - -89, 0, 0, 0, -89, 0, 0, 0, 0, -89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -89, 0, 0, 0, 0, 0, -89, -89, -89, -89, 0, 0, 0, -89, -89, + -45, 0, 0, 0, -45, 0, 0, 0, 0, -45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -45, 0, 0, 0, 0, 0, -45, -45, -45, -45, 0, 0, 0, -45, -45, // State 91 - -90, 0, 0, 0, -90, 0, 0, 0, 0, -90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -90, 0, 0, 0, 0, 0, -90, -90, -90, -90, 0, 0, 0, -90, -90, + -40, 0, 0, 0, -40, 0, 0, 0, 0, -40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -40, 0, 0, 0, 0, 0, -40, -40, -40, -40, 0, 0, 0, -40, -40, // State 92 - -93, 0, 0, 0, -93, 0, 0, 0, 0, -93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -93, 0, 0, 0, 0, 0, -93, -93, -93, -93, 0, 0, 0, -93, -93, + -42, 0, 0, 0, -42, 0, 0, 0, 0, -42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -42, 0, 0, 0, 0, 0, -42, -42, -42, -42, 0, 0, 0, -42, -42, // State 93 - -91, 0, 0, 0, -91, 0, 0, 0, 0, -91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -91, 0, 0, 0, 0, 0, -91, -91, -91, -91, 0, 0, 0, -91, -91, + -43, 0, 0, 0, -43, 0, 0, 0, 0, -43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -43, 0, 0, 0, 0, 0, -43, -43, -43, -43, 0, 0, 0, -43, -43, // State 94 - -92, 0, 0, 0, -92, 0, 0, 0, 0, -92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -92, 0, 0, 0, 0, 0, -92, -92, -92, -92, 0, 0, 0, -92, -92, + -89, 0, 0, 0, -89, 0, 0, 0, 0, -89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -89, 0, 0, 0, 0, 0, -89, -89, -89, -89, 0, 0, 0, -89, -89, // State 95 - -106, 0, 0, 0, -106, 0, 0, 0, 0, -106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -106, 0, 0, 0, 0, 0, -106, -106, -106, -106, 0, 0, 0, -106, -106, + -90, 0, 0, 0, -90, 0, 0, 0, 0, -90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -90, 0, 0, 0, 0, 0, -90, -90, -90, -90, 0, 0, 0, -90, -90, // State 96 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -93, 0, 0, 0, -93, 0, 0, 0, 0, -93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -93, 0, 0, 0, 0, 0, -93, -93, -93, -93, 0, 0, 0, -93, -93, // State 97 - 0, -83, -83, -83, 0, -83, -83, -83, -83, -83, 0, -83, 0, -83, -83, -83, 0, -83, -83, -83, 0, 0, 0, 0, -83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -83, -83, -83, 0, 0, + -91, 0, 0, 0, -91, 0, 0, 0, 0, -91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -91, 0, 0, 0, 0, 0, -91, -91, -91, -91, 0, 0, 0, -91, -91, // State 98 - 0, -58, -58, -58, -58, -58, -58, -58, -58, -58, 0, -58, 0, -58, -58, -58, 0, -58, -58, -58, 0, 0, 0, 0, -58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -58, -58, -58, 0, 0, + -92, 0, 0, 0, -92, 0, 0, 0, 0, -92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -92, 0, 0, 0, 0, 0, -92, -92, -92, -92, 0, 0, 0, -92, -92, // State 99 - 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -107, 0, 0, 0, -107, 0, 0, 0, 0, -107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -107, 0, 0, 0, 0, 0, -107, -107, -107, -107, 0, 0, 0, -107, -107, // State 100 - 0, 0, 0, 0, 0, -68, 0, 0, -68, 0, 0, 0, 0, -68, 0, 0, 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, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, + 0, -83, -83, -83, 0, -83, -83, -83, -83, -83, 0, -83, 0, -83, -83, -83, 0, -83, -83, -83, 0, 0, 0, 0, -83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -83, -83, -83, 0, 0, // State 102 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -58, -58, -58, -58, -58, -58, -58, -58, -58, 0, -58, 0, -58, -58, -58, 0, -58, -58, -58, 0, 0, 0, 0, -58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -58, -58, -58, 0, 0, // State 103 0, 0, 0, 0, 0, 120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121, 0, 0, + 0, 0, 0, 0, 0, -68, 0, 0, -68, 0, 0, 0, 0, -68, 0, 0, 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, 0, // State 105 - 0, -18, 0, -18, 0, -18, 0, -18, -18, -18, 0, 0, 0, -18, -18, -18, 0, -18, -18, -18, 0, 0, 0, 0, -18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -18, -18, -18, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, // State 106 - 0, -20, 0, -20, 0, -20, 0, 0, -20, 0, 0, 0, 0, -20, -20, -20, 0, -20, -20, -20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -20, -20, -20, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 107 - 0, 0, 0, -22, 0, -22, 0, 0, -22, 0, 0, 0, 0, -22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -22, -22, -22, 0, 0, + 0, 0, 0, 0, 0, 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 108 - 0, 0, 0, 0, 0, -24, 0, 0, -24, 0, 0, 0, 0, -24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -24, -24, -24, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 125, 0, 0, // State 109 - 0, -26, -26, -26, 0, -26, -26, -26, -26, -26, 0, -26, 0, -26, -26, -26, 0, -26, -26, -26, 0, 0, 0, 0, -26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -26, -26, -26, 0, 0, + 0, -18, 0, -18, 0, -18, 0, -18, -18, -18, 0, 0, 0, -18, -18, -18, 0, -18, -18, -18, 0, 0, 0, 0, -18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -18, -18, -18, 0, 0, // State 110 - 0, -28, 0, -28, 0, -28, 0, 0, -28, 0, 0, 0, 0, -28, -28, -28, 0, -28, -28, -28, 0, 0, 0, 0, -28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -28, -28, -28, 0, 0, + 0, -20, 0, -20, 0, -20, 0, 0, -20, 0, 0, 0, 0, -20, -20, -20, 0, -20, -20, -20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -20, -20, -20, 0, 0, // State 111 - 0, 0, 0, 0, 0, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, -22, 0, -22, 0, 0, -22, 0, 0, 0, 0, -22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -22, -22, -22, 0, 0, // State 112 - 0, 0, 0, 0, 0, -32, 0, 0, 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -24, 0, 0, -24, 0, 0, 0, 0, -24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -24, -24, -24, 0, 0, // State 113 - 0, 0, 0, 0, 0, -81, 0, 0, -81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -81, 0, 0, + 0, -26, -26, -26, 0, -26, -26, -26, -26, -26, 0, -26, 0, -26, -26, -26, 0, -26, -26, -26, 0, 0, 0, 0, -26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -26, -26, -26, 0, 0, // State 114 - 0, 0, 0, 0, 0, -65, 0, 0, -65, 0, 0, 0, 0, -65, 0, 0, 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, 0, + 0, -28, 0, -28, 0, -28, 0, 0, -28, 0, 0, 0, 0, -28, -28, -28, 0, -28, -28, -28, 0, 0, 0, 0, -28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -28, -28, -28, 0, 0, // State 115 - 0, -59, -59, -59, -59, -59, -59, -59, -59, -59, 0, -59, 0, -59, -59, -59, 0, -59, -59, -59, 0, 0, 0, 0, -59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -59, -59, -59, 0, 0, + 0, 0, 0, 0, 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 116 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -32, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 117 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 0, 0, + 0, 0, 0, 0, 0, -81, 0, 0, -81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -81, 0, 0, // State 118 - 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, -65, 0, 0, 0, 0, -65, 0, 0, 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, 0, // State 119 - 0, -60, -60, -60, 0, -60, -60, -60, -60, -60, 0, -60, 0, -60, -60, -60, 0, -60, -60, -60, 0, 0, 0, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -60, -60, -60, 0, 0, + 0, -59, -59, -59, -59, -59, -59, -59, -59, -59, 0, -59, 0, -59, -59, -59, 0, -59, -59, -59, 0, 0, 0, 0, -59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -59, -59, -59, 0, 0, // State 120 - 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 121 - 0, 0, 0, 0, 0, -34, 0, 0, 129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 131, 0, 0, // State 122 - 0, -62, -62, -62, 0, -62, -62, -62, -62, -62, 0, -62, 0, -62, -62, -62, 0, -62, -62, -62, 0, 0, 0, 0, -62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -62, -62, -62, 0, 0, + 0, 0, 0, 0, 0, 132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 123 - -9, 0, 0, 0, -9, -9, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -9, 0, -9, 0, -9, -9, -9, 0, -9, -9, -9, -9, 0, 0, 0, -9, -9, + 0, -60, -60, -60, 0, -60, -60, -60, -60, -60, 0, -60, 0, -60, -60, -60, 0, -60, -60, -60, 0, 0, 0, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -60, -60, -60, 0, 0, // State 124 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 130, 0, 0, + 0, 0, 0, 0, 0, 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, // State 125 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -34, 0, 0, 133, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 126 - 0, 0, 0, 0, 0, -67, 0, 0, -67, 0, 0, 0, 0, -67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -67, 0, 0, + 0, -62, -62, -62, 0, -62, -62, -62, -62, -62, 0, -62, 0, -62, -62, -62, 0, -62, -62, -62, 0, 0, 0, 0, -62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -62, -62, -62, 0, 0, // State 127 - 0, -61, -61, -61, 0, -61, -61, -61, -61, -61, 0, -61, 0, -61, -61, -61, 0, -61, -61, -61, 0, 0, 0, 0, -61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -61, -61, -61, 0, 0, + -9, 0, 0, 0, -9, -9, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -9, 0, -9, 0, -9, -9, -9, 0, -9, -9, -9, -9, 0, 0, 0, -9, -9, // State 128 - -10, 0, 0, 0, -10, -10, 0, 0, 0, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10, 0, -10, 0, -10, -10, -10, 0, -10, -10, -10, -10, 0, 0, 0, -10, -10, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 0, 0, // State 129 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 132, 0, 0, 0, 0, 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, 0, 0, 0, 0, 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 130 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -67, 0, 0, -67, 0, 0, 0, 0, -67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -67, 0, 0, // State 131 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, + 0, -61, -61, -61, 0, -61, -61, -61, -61, -61, 0, -61, 0, -61, -61, -61, 0, -61, -61, -61, 0, 0, 0, 0, -61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -61, -61, -61, 0, 0, // State 132 - 0, 0, 0, 0, 0, -79, 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, 0, 0, 0, 0, 0, 0, 0, -79, 0, 0, + -10, 0, 0, 0, -10, -10, 0, 0, 0, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10, 0, -10, 0, -10, -10, -10, 0, -10, -10, -10, -10, 0, 0, 0, -10, -10, // State 133 - 0, 0, 0, 0, 0, -78, 0, 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, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 134 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // State 135 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, + // State 136 + 0, 0, 0, 0, 0, -79, 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, 0, 0, 0, 0, 0, 0, 0, -79, 0, 0, + // State 137 + 0, 0, 0, 0, 0, -78, 0, 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, 0, 0, 0, 0, 0, 0, 0, -78, 0, 0, + // State 138 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 140, 0, 0, + // State 139 0, 0, 0, 0, 0, -66, 0, 0, -66, 0, 0, 0, 0, -66, 0, 0, 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, 0, ]; fn __action(state: i16, integer: usize) -> i16 { @@ -327,9 +335,9 @@ mod __parse__Program { } const __EOF_ACTION: &[i16] = &[ // State 0 - -98, - // State 1 -99, + // State 1 + -100, // State 2 0, // State 3 @@ -405,17 +413,17 @@ mod __parse__Program { // State 38 0, // State 39 - -49, + 0, // State 40 - -46, + 0, // State 41 - -107, + -49, // State 42 - -50, + -46, // State 43 - 0, + -108, // State 44 - 0, + -50, // State 45 0, // State 46 @@ -519,7 +527,7 @@ mod __parse__Program { // State 95 0, // State 96 - -87, + 0, // State 97 0, // State 98 @@ -527,7 +535,7 @@ mod __parse__Program { // State 99 0, // State 100 - 0, + -87, // State 101 0, // State 102 @@ -567,7 +575,7 @@ mod __parse__Program { // State 119 0, // State 120 - -86, + 0, // State 121 0, // State 122 @@ -575,7 +583,7 @@ mod __parse__Program { // State 123 0, // State 124 - 0, + -86, // State 125 0, // State 126 @@ -598,104 +606,114 @@ mod __parse__Program { 0, // State 135 0, + // State 136 + 0, + // State 137 + 0, + // State 138 + 0, + // State 139 + 0, ]; fn __goto(state: i16, nt: usize) -> i16 { match nt { - 5 => 32, + 5 => 34, 8 => 4, - 9 => 20, - 10 => 8, - 11 => 9, - 12 => 10, - 13 => 11, - 14 => 12, - 15 => 13, - 16 => 58, - 17 => 111, - 18 => 45, - 19 => 21, + 9 => 22, + 10 => 10, + 11 => 11, + 12 => 12, + 13 => 13, + 14 => 14, + 15 => 15, + 16 => 61, + 17 => 115, + 18 => 47, + 19 => 23, 20 => match state { - 1 => 42, - _ => 39, + 1 => 44, + _ => 41, }, 22 => 1, 23 => match state { - 15 => 99, - 19 => 104, - 26 => 112, - 30 => 117, - 31 => 118, + 17 => 103, + 21 => 108, + 28 => 116, 32 => 121, - 33 => 124, - 38 => 134, - _ => 59, + 33 => 122, + 34 => 125, + 35 => 128, + 40 => 138, + _ => 62, }, 25 => match state { - 25 => 110, - _ => 60, + 27 => 114, + _ => 63, }, - 26 => 61, - 27 => 62, + 26 => 64, + 27 => 65, 28 => match state { - 22 => 107, - _ => 63, + 24 => 111, + _ => 66, }, - 29 => 64, + 29 => 67, 30 => match state { - 23 => 108, - _ => 65, + 25 => 112, + _ => 68, }, 31 => match state { - 16 => 100, - 17 => 101, - 28 => 114, - 34 => 125, - 35 => 130, - _ => 66, + 18 => 104, + 19 => 105, + 30 => 118, + 36 => 129, + 37 => 134, + _ => 69, }, 33 => match state { - 20 => 105, - _ => 67, + 22 => 109, + _ => 70, }, 34 => match state { - 27 => 113, - 36 => 132, - 37 => 133, - _ => 68, + 29 => 117, + 38 => 136, + 39 => 137, + _ => 71, }, 35 => match state { - 14 => 97, - 24 => 109, - _ => 69, + 16 => 101, + 26 => 113, + _ => 72, }, 36 => match state { - 21 => 106, - _ => 70, + 23 => 110, + _ => 73, }, - 37 => 40, + 37 => 42, 38 => match state { - 2 => 43, - 3..=4 => 46, - 14 | 16..=17 | 20..=25 | 28 | 34..=35 => 98, - 18 => 102, - 29 => 116, - _ => 71, + 2 => 45, + 3..=4 => 48, + 5 => 53, + 16 | 18..=19 | 22..=27 | 30 | 36..=37 => 102, + 20 => 106, + 31 => 120, + _ => 74, }, - 39 => 22, - 40 => 23, - 41 => 24, - 42 => 72, + 39 => 24, + 40 => 25, + 41 => 26, + 42 => 75, 43 => match state { - 4 => 48, - _ => 47, + 4 => 50, + _ => 49, }, - 45 => 41, + 45 => 43, 46 => match state { - 6 => 57, - _ => 52, + 7 => 60, + 9 => 85, + _ => 55, }, - 47 => 14, - 48 => 25, + 47 => 16, + 48 => 27, _ => 0, } } @@ -1512,38 +1530,38 @@ mod __parse__Program { } 94 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 3, + states_to_pop: 4, nonterminal_produced: 43, } } 95 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, - nonterminal_produced: 44, + states_to_pop: 3, + nonterminal_produced: 43, } } 96 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 0, + states_to_pop: 1, nonterminal_produced: 44, } } 97 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 0, - nonterminal_produced: 45, + nonterminal_produced: 44, } } 98 => { __state_machine::SimulatedReduce::Reduce { - states_to_pop: 1, + states_to_pop: 0, nonterminal_produced: 45, } } 99 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 46, + nonterminal_produced: 45, } } 100 => { @@ -1567,7 +1585,7 @@ mod __parse__Program { 103 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, - nonterminal_produced: 47, + nonterminal_produced: 46, } } 104 => { @@ -1577,12 +1595,18 @@ mod __parse__Program { } } 105 => { + __state_machine::SimulatedReduce::Reduce { + states_to_pop: 1, + nonterminal_produced: 47, + } + } + 106 => { __state_machine::SimulatedReduce::Reduce { states_to_pop: 1, nonterminal_produced: 48, } } - 106 => __state_machine::SimulatedReduce::Accept, + 107 => __state_machine::SimulatedReduce::Accept, _ => panic!("invalid reduction index {}", __reduce_index) } } @@ -1983,6 +2007,9 @@ mod __parse__Program { __reduce105(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) } 106 => { + __reduce106(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&())>) + } + 107 => { // __Program = Program => ActionFn(0); let __sym0 = __pop_Variant17(__symbols); let __start = __sym0.0; @@ -2003,17 +2030,6 @@ mod __parse__Program { fn __symbol_type_mismatch() -> ! { panic!("symbol type mismatch") } - fn __pop_Variant6< - 'input, - >( - __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, (&'input str, Type), usize) - { - match __symbols.pop() { - Some((__l, __Symbol::Variant6(__v), __r)) => (__l, __v, __r), - _ => __symbol_type_mismatch() - } - } fn __pop_Variant12< 'input, >( @@ -2047,36 +2063,36 @@ mod __parse__Program { _ => __symbol_type_mismatch() } } - fn __pop_Variant17< + fn __pop_Variant6< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, PrgParsed<'input>, usize) + ) -> (usize, Param<&'input str>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant17(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant6(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant2< + fn __pop_Variant17< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, Type, usize) + ) -> (usize, PrgParsed<'input>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant2(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant17(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant11< + fn __pop_Variant2< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, Vec<(&'input str, Type)>, usize) + ) -> (usize, Type, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant11(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant2(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } @@ -2091,14 +2107,14 @@ mod __parse__Program { _ => __symbol_type_mismatch() } } - fn __pop_Variant7< + fn __pop_Variant11< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, alloc::vec::Vec<(&'input str, Type)>, usize) + ) -> (usize, Vec>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant7(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant11(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } @@ -2124,25 +2140,25 @@ mod __parse__Program { _ => __symbol_type_mismatch() } } - fn __pop_Variant9< + fn __pop_Variant7< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, bool, usize) + ) -> (usize, alloc::vec::Vec>, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant9(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant7(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } - fn __pop_Variant16< + fn __pop_Variant9< 'input, >( __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)> - ) -> (usize, core::option::Option<(&'input str, Type)>, usize) + ) -> (usize, bool, usize) { match __symbols.pop() { - Some((__l, __Symbol::Variant16(__v), __r)) => (__l, __v, __r), + Some((__l, __Symbol::Variant9(__v), __r)) => (__l, __v, __r), _ => __symbol_type_mismatch() } } @@ -2157,6 +2173,17 @@ mod __parse__Program { _ => __symbol_type_mismatch() } } + fn __pop_Variant16< + '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), + _ => __symbol_type_mismatch() + } + } fn __pop_Variant3< 'input, >( @@ -2262,13 +2289,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ("->" )? = "->", Type => ActionFn(100); + // ("->" )? = "->", Type => ActionFn(102); assert!(__symbols.len() >= 2); let __sym1 = __pop_Variant2(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym1.2; - let __nt = super::__action100::<>(input, __sym0, __sym1); + let __nt = super::__action102::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant3(__nt), __end)); (2, 2) } @@ -2349,13 +2376,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")+ = Expr, "," => ActionFn(103); + // ( ",")+ = Expr, "," => ActionFn(105); assert!(__symbols.len() >= 2); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym1.2; - let __nt = super::__action103::<>(input, __sym0, __sym1); + let __nt = super::__action105::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant5(__nt), __end)); (2, 5) } @@ -2368,14 +2395,14 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")+ = ( ",")+, Expr, "," => ActionFn(104); + // ( ",")+ = ( ",")+, Expr, "," => ActionFn(106); assert!(__symbols.len() >= 3); let __sym2 = __pop_Variant0(__symbols); let __sym1 = __pop_Variant4(__symbols); let __sym0 = __pop_Variant5(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action104::<>(input, __sym0, __sym1, __sym2); + let __nt = super::__action106::<>(input, __sym0, __sym1, __sym2); __symbols.push((__start, __Symbol::Variant5(__nt), __end)); (3, 5) } @@ -2440,13 +2467,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")+ = Param, "," => ActionFn(107); + // ( ",")+ = Param, "," => ActionFn(109); assert!(__symbols.len() >= 2); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0; let __end = __sym1.2; - let __nt = super::__action107::<>(input, __sym0, __sym1); + let __nt = super::__action109::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant7(__nt), __end)); (2, 8) } @@ -2459,14 +2486,14 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ( ",")+ = ( ",")+, Param, "," => ActionFn(108); + // ( ",")+ = ( ",")+, Param, "," => ActionFn(110); assert!(__symbols.len() >= 3); let __sym2 = __pop_Variant0(__symbols); let __sym1 = __pop_Variant6(__symbols); let __sym0 = __pop_Variant7(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action108::<>(input, __sym0, __sym1, __sym2); + let __nt = super::__action110::<>(input, __sym0, __sym1, __sym2); __symbols.push((__start, __Symbol::Variant7(__nt), __end)); (3, 8) } @@ -2769,11 +2796,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = Expr => ActionFn(113); + // Comma = Expr => ActionFn(115); let __sym0 = __pop_Variant4(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action113::<>(input, __sym0); + let __nt = super::__action115::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant10(__nt), __end)); (1, 17) } @@ -2786,10 +2813,10 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = => ActionFn(114); + // Comma = => ActionFn(116); let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); let __end = __start; - let __nt = super::__action114::<>(input, &__start, &__end); + let __nt = super::__action116::<>(input, &__start, &__end); __symbols.push((__start, __Symbol::Variant10(__nt), __end)); (0, 17) } @@ -2802,13 +2829,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = ( ",")+, Expr => ActionFn(115); + // Comma = ( ",")+, Expr => ActionFn(117); assert!(__symbols.len() >= 2); let __sym1 = __pop_Variant4(__symbols); let __sym0 = __pop_Variant5(__symbols); let __start = __sym0.0; let __end = __sym1.2; - let __nt = super::__action115::<>(input, __sym0, __sym1); + let __nt = super::__action117::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant10(__nt), __end)); (2, 17) } @@ -2821,11 +2848,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = ( ",")+ => ActionFn(116); + // Comma = ( ",")+ => ActionFn(118); let __sym0 = __pop_Variant5(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action116::<>(input, __sym0); + let __nt = super::__action118::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant10(__nt), __end)); (1, 17) } @@ -2838,11 +2865,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = Param => ActionFn(119); + // Comma = Param => ActionFn(121); let __sym0 = __pop_Variant6(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action119::<>(input, __sym0); + let __nt = super::__action121::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant11(__nt), __end)); (1, 18) } @@ -2855,10 +2882,10 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = => ActionFn(120); + // Comma = => ActionFn(122); let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); let __end = __start; - let __nt = super::__action120::<>(input, &__start, &__end); + let __nt = super::__action122::<>(input, &__start, &__end); __symbols.push((__start, __Symbol::Variant11(__nt), __end)); (0, 18) } @@ -2871,13 +2898,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = ( ",")+, Param => ActionFn(121); + // Comma = ( ",")+, Param => ActionFn(123); assert!(__symbols.len() >= 2); let __sym1 = __pop_Variant6(__symbols); let __sym0 = __pop_Variant7(__symbols); let __start = __sym0.0; let __end = __sym1.2; - let __nt = super::__action121::<>(input, __sym0, __sym1); + let __nt = super::__action123::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant11(__nt), __end)); (2, 18) } @@ -2890,11 +2917,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Comma = ( ",")+ => ActionFn(122); + // Comma = ( ",")+ => ActionFn(124); let __sym0 = __pop_Variant7(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action122::<>(input, __sym0); + let __nt = super::__action124::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant11(__nt), __end)); (1, 18) } @@ -3413,13 +3440,13 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprInStmt = "break", ExprLogicalOr => ActionFn(117); + // ExprInStmt = "break", ExprLogicalOr => ActionFn(119); assert!(__symbols.len() >= 2); let __sym1 = __pop_Variant4(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym1.2; - let __nt = super::__action117::<>(input, __sym0, __sym1); + let __nt = super::__action119::<>(input, __sym0, __sym1); __symbols.push((__start, __Symbol::Variant4(__nt), __end)); (2, 29) } @@ -3432,11 +3459,11 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // ExprInStmt = "break" => ActionFn(118); + // ExprInStmt = "break" => ActionFn(120); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action118::<>(input, __sym0); + let __nt = super::__action120::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant4(__nt), __end)); (1, 29) } @@ -3751,7 +3778,7 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Fn = "fn", Ident, "(", Comma, ")", "->", Type, "{", Expr, "}" => ActionFn(101); + // Fn = "fn", Ident, "(", Comma, ")", "->", Type, "{", Expr, "}" => ActionFn(103); assert!(__symbols.len() >= 10); let __sym9 = __pop_Variant0(__symbols); let __sym8 = __pop_Variant4(__symbols); @@ -3765,7 +3792,7 @@ mod __parse__Program { let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym9.2; - let __nt = super::__action101::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8, __sym9); + let __nt = super::__action103::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8, __sym9); __symbols.push((__start, __Symbol::Variant12(__nt), __end)); (10, 37) } @@ -3778,7 +3805,7 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Fn = "fn", Ident, "(", Comma, ")", "{", Expr, "}" => ActionFn(102); + // Fn = "fn", Ident, "(", Comma, ")", "{", Expr, "}" => ActionFn(104); assert!(__symbols.len() >= 8); let __sym7 = __pop_Variant0(__symbols); let __sym6 = __pop_Variant4(__symbols); @@ -3790,7 +3817,7 @@ mod __parse__Program { let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym7.2; - let __nt = super::__action102::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7); + let __nt = super::__action104::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7); __symbols.push((__start, __Symbol::Variant12(__nt), __end)); (8, 37) } @@ -3922,18 +3949,39 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Param = Ident, ":", Type => ActionFn(4); + // Param = "mut", Ident, ":", Type => ActionFn(100); + assert!(__symbols.len() >= 4); + let __sym3 = __pop_Variant2(__symbols); + let __sym2 = __pop_Variant0(__symbols); + let __sym1 = __pop_Variant0(__symbols); + let __sym0 = __pop_Variant0(__symbols); + let __start = __sym0.0; + let __end = __sym3.2; + let __nt = super::__action100::<>(input, __sym0, __sym1, __sym2, __sym3); + __symbols.push((__start, __Symbol::Variant6(__nt), __end)); + (4, 43) + } + fn __reduce95< + 'input, + >( + input: &'input str, + __lookahead_start: Option<&usize>, + __symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>, + _: core::marker::PhantomData<(&'input ())>, + ) -> (usize, usize) + { + // Param = Ident, ":", Type => ActionFn(101); assert!(__symbols.len() >= 3); let __sym2 = __pop_Variant2(__symbols); let __sym1 = __pop_Variant0(__symbols); let __sym0 = __pop_Variant0(__symbols); let __start = __sym0.0; let __end = __sym2.2; - let __nt = super::__action4::<>(input, __sym0, __sym1, __sym2); + let __nt = super::__action101::<>(input, __sym0, __sym1, __sym2); __symbols.push((__start, __Symbol::Variant6(__nt), __end)); (3, 43) } - fn __reduce95< + fn __reduce96< 'input, >( input: &'input str, @@ -3950,7 +3998,7 @@ mod __parse__Program { __symbols.push((__start, __Symbol::Variant16(__nt), __end)); (1, 44) } - fn __reduce96< + fn __reduce97< 'input, >( input: &'input str, @@ -3966,7 +4014,7 @@ mod __parse__Program { __symbols.push((__start, __Symbol::Variant16(__nt), __end)); (0, 44) } - fn __reduce97< + fn __reduce98< 'input, >( input: &'input str, @@ -3975,14 +4023,14 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Program = => ActionFn(111); + // Program = => ActionFn(113); let __start = __lookahead_start.cloned().or_else(|| __symbols.last().map(|s| s.2)).unwrap_or_default(); let __end = __start; - let __nt = super::__action111::<>(input, &__start, &__end); + let __nt = super::__action113::<>(input, &__start, &__end); __symbols.push((__start, __Symbol::Variant17(__nt), __end)); (0, 45) } - fn __reduce98< + fn __reduce99< 'input, >( input: &'input str, @@ -3991,15 +4039,15 @@ mod __parse__Program { _: core::marker::PhantomData<(&'input ())>, ) -> (usize, usize) { - // Program = Def+ => ActionFn(112); + // Program = Def+ => ActionFn(114); let __sym0 = __pop_Variant13(__symbols); let __start = __sym0.0; let __end = __sym0.2; - let __nt = super::__action112::<>(input, __sym0); + let __nt = super::__action114::<>(input, __sym0); __symbols.push((__start, __Symbol::Variant17(__nt), __end)); (1, 45) } - fn __reduce99< + fn __reduce100< 'input, >( input: &'input str, @@ -4016,7 +4064,7 @@ mod __parse__Program { __symbols.push((__start, __Symbol::Variant2(__nt), __end)); (1, 46) } - fn __reduce100< + fn __reduce101< 'input, >( input: &'input str, @@ -4033,7 +4081,7 @@ mod __parse__Program { __symbols.push((__start, __Symbol::Variant2(__nt), __end)); (1, 46) } - fn __reduce101< + fn __reduce102< 'input, >( input: &'input str, @@ -4050,7 +4098,7 @@ mod __parse__Program { __symbols.push((__start, __Symbol::Variant2(__nt), __end)); (1, 46) } - fn __reduce102< + fn __reduce103< 'input, >( input: &'input str, @@ -4067,7 +4115,7 @@ mod __parse__Program { __symbols.push((__start, __Symbol::Variant2(__nt), __end)); (1, 46) } - fn __reduce103< + fn __reduce104< 'input, >( input: &'input str, @@ -4084,7 +4132,7 @@ mod __parse__Program { __symbols.push((__start, __Symbol::Variant8(__nt), __end)); (1, 47) } - fn __reduce104< + fn __reduce105< 'input, >( input: &'input str, @@ -4101,7 +4149,7 @@ mod __parse__Program { __symbols.push((__start, __Symbol::Variant8(__nt), __end)); (1, 47) } - fn __reduce105< + fn __reduce106< 'input, >( input: &'input str, @@ -4229,7 +4277,7 @@ fn __action3< (_, _, _): (usize, &'input str, usize), (_, sym, _): (usize, &'input str, usize), (_, _, _): (usize, &'input str, usize), - (_, params, _): (usize, Vec<(&'input str, Type)>, usize), + (_, params, _): (usize, Vec>, usize), (_, _, _): (usize, &'input str, usize), (_, typ, _): (usize, core::option::Option, usize), (_, _, _): (usize, &'input str, usize), @@ -4246,12 +4294,13 @@ fn __action4< 'input, >( input: &'input str, - (_, __0, _): (usize, &'input str, usize), + (_, mutable, _): (usize, core::option::Option<&'input str>, usize), + (_, sym, _): (usize, &'input str, usize), (_, _, _): (usize, &'input str, usize), - (_, __1, _): (usize, Type, usize), -) -> (&'input str, Type) + (_, typ, _): (usize, Type, usize), +) -> Param<&'input str> { - (__0, __1) + Param { mutable: mutable.is_some(), sym, typ } } #[allow(unused_variables)] @@ -4399,7 +4448,7 @@ fn __action15< (_, bnd, _): (usize, Expr<&'input str>, usize), ) -> Expr<&'input str> { - Expr::Assign { sym, bnd: Box::new(bnd), bdy: Box::new(Expr::Lit { val: Lit::Unit }) } + Expr::Assign { sym, bnd: Box::new(bnd) } } #[allow(unused_variables)] @@ -5187,9 +5236,9 @@ fn __action77< 'input, >( input: &'input str, - (_, v, _): (usize, alloc::vec::Vec<(&'input str, Type)>, usize), - (_, e, _): (usize, core::option::Option<(&'input str, Type)>, usize), -) -> Vec<(&'input str, Type)> + (_, v, _): (usize, alloc::vec::Vec>, usize), + (_, e, _): (usize, core::option::Option>, usize), +) -> Vec> { match e { None=> v, @@ -5257,8 +5306,8 @@ fn __action82< 'input, >( input: &'input str, - (_, __0, _): (usize, (&'input str, Type), usize), -) -> core::option::Option<(&'input str, Type)> + (_, __0, _): (usize, Param<&'input str>, usize), +) -> core::option::Option> { Some(__0) } @@ -5271,7 +5320,7 @@ fn __action83< input: &'input str, __lookbehind: &usize, __lookahead: &usize, -) -> core::option::Option<(&'input str, Type)> +) -> core::option::Option> { None } @@ -5284,7 +5333,7 @@ fn __action84< input: &'input str, __lookbehind: &usize, __lookahead: &usize, -) -> alloc::vec::Vec<(&'input str, Type)> +) -> alloc::vec::Vec> { alloc::vec![] } @@ -5295,8 +5344,8 @@ fn __action85< 'input, >( input: &'input str, - (_, v, _): (usize, alloc::vec::Vec<(&'input str, Type)>, usize), -) -> alloc::vec::Vec<(&'input str, Type)> + (_, v, _): (usize, alloc::vec::Vec>, usize), +) -> alloc::vec::Vec> { v } @@ -5307,9 +5356,9 @@ fn __action86< 'input, >( input: &'input str, - (_, __0, _): (usize, (&'input str, Type), usize), + (_, __0, _): (usize, Param<&'input str>, usize), (_, _, _): (usize, &'input str, usize), -) -> (&'input str, Type) +) -> Param<&'input str> { __0 } @@ -5408,8 +5457,8 @@ fn __action94< 'input, >( input: &'input str, - (_, __0, _): (usize, (&'input str, Type), usize), -) -> alloc::vec::Vec<(&'input str, Type)> + (_, __0, _): (usize, Param<&'input str>, usize), +) -> alloc::vec::Vec> { alloc::vec![__0] } @@ -5420,9 +5469,9 @@ fn __action95< 'input, >( input: &'input str, - (_, v, _): (usize, alloc::vec::Vec<(&'input str, Type)>, usize), - (_, e, _): (usize, (&'input str, Type), usize), -) -> alloc::vec::Vec<(&'input str, Type)> + (_, v, _): (usize, alloc::vec::Vec>, usize), + (_, e, _): (usize, Param<&'input str>, usize), +) -> alloc::vec::Vec> { { let mut v = v; v.push(e); v } } @@ -5568,6 +5617,64 @@ fn __action99< clippy::just_underscores_and_digits)] fn __action100< 'input, +>( + input: &'input str, + __0: (usize, &'input str, usize), + __1: (usize, &'input str, usize), + __2: (usize, &'input str, usize), + __3: (usize, Type, usize), +) -> Param<&'input str> +{ + let __start0 = __0.0; + let __end0 = __0.2; + let __temp0 = __action72( + input, + __0, + ); + let __temp0 = (__start0, __temp0, __end0); + __action4( + input, + __temp0, + __1, + __2, + __3, + ) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action101< + 'input, +>( + input: &'input str, + __0: (usize, &'input str, usize), + __1: (usize, &'input str, usize), + __2: (usize, Type, usize), +) -> Param<&'input str> +{ + let __start0 = __0.0; + let __end0 = __0.0; + let __temp0 = __action73( + input, + &__start0, + &__end0, + ); + let __temp0 = (__start0, __temp0, __end0); + __action4( + input, + __temp0, + __0, + __1, + __2, + ) +} + +#[allow(unused_variables)] +#[allow(clippy::too_many_arguments, clippy::needless_lifetimes, + clippy::just_underscores_and_digits)] +fn __action102< + 'input, >( input: &'input str, __0: (usize, &'input str, usize), @@ -5591,14 +5698,14 @@ fn __action100< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action101< +fn __action103< 'input, >( input: &'input str, __0: (usize, &'input str, usize), __1: (usize, &'input str, usize), __2: (usize, &'input str, usize), - __3: (usize, Vec<(&'input str, Type)>, usize), + __3: (usize, Vec>, usize), __4: (usize, &'input str, usize), __5: (usize, &'input str, usize), __6: (usize, Type, usize), @@ -5609,7 +5716,7 @@ fn __action101< { let __start0 = __5.0; let __end0 = __6.2; - let __temp0 = __action100( + let __temp0 = __action102( input, __5, __6, @@ -5632,14 +5739,14 @@ fn __action101< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action102< +fn __action104< 'input, >( input: &'input str, __0: (usize, &'input str, usize), __1: (usize, &'input str, usize), __2: (usize, &'input str, usize), - __3: (usize, Vec<(&'input str, Type)>, usize), + __3: (usize, Vec>, usize), __4: (usize, &'input str, usize), __5: (usize, &'input str, usize), __6: (usize, Expr<&'input str>, usize), @@ -5671,7 +5778,7 @@ fn __action102< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action103< +fn __action105< 'input, >( input: &'input str, @@ -5696,7 +5803,7 @@ fn __action103< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action104< +fn __action106< 'input, >( input: &'input str, @@ -5723,7 +5830,7 @@ fn __action104< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action105< +fn __action107< 'input, >( input: &'input str, @@ -5748,7 +5855,7 @@ fn __action105< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action106< +fn __action108< 'input, >( input: &'input str, @@ -5773,13 +5880,13 @@ fn __action106< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action107< +fn __action109< 'input, >( input: &'input str, - __0: (usize, (&'input str, Type), usize), + __0: (usize, Param<&'input str>, usize), __1: (usize, &'input str, usize), -) -> alloc::vec::Vec<(&'input str, Type)> +) -> alloc::vec::Vec> { let __start0 = __0.0; let __end0 = __1.2; @@ -5798,14 +5905,14 @@ fn __action107< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action108< +fn __action110< 'input, >( input: &'input str, - __0: (usize, alloc::vec::Vec<(&'input str, Type)>, usize), - __1: (usize, (&'input str, Type), usize), + __0: (usize, alloc::vec::Vec>, usize), + __1: (usize, Param<&'input str>, usize), __2: (usize, &'input str, usize), -) -> alloc::vec::Vec<(&'input str, Type)> +) -> alloc::vec::Vec> { let __start0 = __1.0; let __end0 = __2.2; @@ -5825,12 +5932,12 @@ fn __action108< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action109< +fn __action111< 'input, >( input: &'input str, - __0: (usize, core::option::Option<(&'input str, Type)>, usize), -) -> Vec<(&'input str, Type)> + __0: (usize, core::option::Option>, usize), +) -> Vec> { let __start0 = __0.0; let __end0 = __0.0; @@ -5850,13 +5957,13 @@ fn __action109< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action110< +fn __action112< 'input, >( input: &'input str, - __0: (usize, alloc::vec::Vec<(&'input str, Type)>, usize), - __1: (usize, core::option::Option<(&'input str, Type)>, usize), -) -> Vec<(&'input str, Type)> + __0: (usize, alloc::vec::Vec>, usize), + __1: (usize, core::option::Option>, usize), +) -> Vec> { let __start0 = __0.0; let __end0 = __0.2; @@ -5875,7 +5982,7 @@ fn __action110< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action111< +fn __action113< 'input, >( input: &'input str, @@ -5900,7 +6007,7 @@ fn __action111< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action112< +fn __action114< 'input, >( input: &'input str, @@ -5923,7 +6030,7 @@ fn __action112< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action113< +fn __action115< 'input, >( input: &'input str, @@ -5937,7 +6044,7 @@ fn __action113< __0, ); let __temp0 = (__start0, __temp0, __end0); - __action105( + __action107( input, __temp0, ) @@ -5946,7 +6053,7 @@ fn __action113< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action114< +fn __action116< 'input, >( input: &'input str, @@ -5962,7 +6069,7 @@ fn __action114< &__end0, ); let __temp0 = (__start0, __temp0, __end0); - __action105( + __action107( input, __temp0, ) @@ -5971,7 +6078,7 @@ fn __action114< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action115< +fn __action117< 'input, >( input: &'input str, @@ -5986,7 +6093,7 @@ fn __action115< __1, ); let __temp0 = (__start0, __temp0, __end0); - __action106( + __action108( input, __0, __temp0, @@ -5996,7 +6103,7 @@ fn __action115< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action116< +fn __action118< 'input, >( input: &'input str, @@ -6011,7 +6118,7 @@ fn __action116< &__end0, ); let __temp0 = (__start0, __temp0, __end0); - __action106( + __action108( input, __0, __temp0, @@ -6021,7 +6128,7 @@ fn __action116< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action117< +fn __action119< 'input, >( input: &'input str, @@ -6046,7 +6153,7 @@ fn __action117< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action118< +fn __action120< 'input, >( input: &'input str, @@ -6071,12 +6178,12 @@ fn __action118< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action119< +fn __action121< 'input, >( input: &'input str, - __0: (usize, (&'input str, Type), usize), -) -> Vec<(&'input str, Type)> + __0: (usize, Param<&'input str>, usize), +) -> Vec> { let __start0 = __0.0; let __end0 = __0.2; @@ -6085,7 +6192,7 @@ fn __action119< __0, ); let __temp0 = (__start0, __temp0, __end0); - __action109( + __action111( input, __temp0, ) @@ -6094,13 +6201,13 @@ fn __action119< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action120< +fn __action122< 'input, >( input: &'input str, __lookbehind: &usize, __lookahead: &usize, -) -> Vec<(&'input str, Type)> +) -> Vec> { let __start0 = *__lookbehind; let __end0 = *__lookahead; @@ -6110,7 +6217,7 @@ fn __action120< &__end0, ); let __temp0 = (__start0, __temp0, __end0); - __action109( + __action111( input, __temp0, ) @@ -6119,13 +6226,13 @@ fn __action120< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action121< +fn __action123< 'input, >( input: &'input str, - __0: (usize, alloc::vec::Vec<(&'input str, Type)>, usize), - __1: (usize, (&'input str, Type), usize), -) -> Vec<(&'input str, Type)> + __0: (usize, alloc::vec::Vec>, usize), + __1: (usize, Param<&'input str>, usize), +) -> Vec> { let __start0 = __1.0; let __end0 = __1.2; @@ -6134,7 +6241,7 @@ fn __action121< __1, ); let __temp0 = (__start0, __temp0, __end0); - __action110( + __action112( input, __0, __temp0, @@ -6144,12 +6251,12 @@ fn __action121< #[allow(unused_variables)] #[allow(clippy::too_many_arguments, clippy::needless_lifetimes, clippy::just_underscores_and_digits)] -fn __action122< +fn __action124< 'input, >( input: &'input str, - __0: (usize, alloc::vec::Vec<(&'input str, Type)>, usize), -) -> Vec<(&'input str, Type)> + __0: (usize, alloc::vec::Vec>, usize), +) -> Vec> { let __start0 = __0.2; let __end0 = __0.2; @@ -6159,7 +6266,7 @@ fn __action122< &__end0, ); let __temp0 = (__start0, __temp0, __end0); - __action110( + __action112( input, __0, __temp0, diff --git a/compiler/src/passes/parse/interpreter.rs b/compiler/src/passes/parse/interpreter.rs index 5cac39e..0aa9388 100644 --- a/compiler/src/passes/parse/interpreter.rs +++ b/compiler/src/passes/parse/interpreter.rs @@ -49,7 +49,7 @@ impl PrgGenericVar { ) -> Val { match &self.defs[&sym] { Def::Fn { params, bdy, .. } => scope.push_iter( - params.iter().zip(args.iter()).map(|((k, _), v)| (*k, *v)), + params.iter().zip(args.iter()).map(|(param, v)| (param.sym, *v)), |scope| self.interpret_expr(bdy, scope, io).val(), ), } @@ -157,9 +157,9 @@ impl PrgGenericVar { }, Expr::Let { sym, - mutable, bnd, bdy, + .. } => { let bnd = b!(self.interpret_expr(bnd, scope, io)); b!(scope.push(*sym, bnd, |scope| self.interpret_expr(bdy, scope, io))) @@ -191,8 +191,15 @@ impl PrgGenericVar { None => Val::Unit, }) } - Expr::Seq { .. } => todo!(), - Expr::Assign { .. } => todo!(), + Expr::Seq { stmt, cnt } => { + b!(self.interpret_expr(stmt, scope, io)); + b!(self.interpret_expr(cnt, scope, io)) + }, + Expr::Assign { sym, bnd } => { + let bnd = b!(self.interpret_expr(bnd, scope, io)); + scope.0.insert(*sym, bnd); + Val::Unit + }, }) } } diff --git a/compiler/src/passes/parse/mod.rs b/compiler/src/passes/parse/mod.rs index 40f19bd..043ae4b 100644 --- a/compiler/src/passes/parse/mod.rs +++ b/compiler/src/passes/parse/mod.rs @@ -25,12 +25,19 @@ pub struct PrgGenericVar { pub enum Def { Fn { sym: A, - params: Vec<(A, Type)>, + params: Vec>, typ: Type, bdy: B, }, } +#[derive(Debug, PartialEq)] +pub struct Param { + pub sym: A, + pub typ: Type, + pub mutable: bool, +} + #[derive(Debug, PartialEq)] pub enum Expr { Lit { @@ -71,7 +78,6 @@ pub enum Expr { Assign { sym: A, bnd: Box>, - bdy: Box>, }, } diff --git a/compiler/src/passes/reveal_functions/mod.rs b/compiler/src/passes/reveal_functions/mod.rs index 46f1d91..3e6c2a2 100644 --- a/compiler/src/passes/reveal_functions/mod.rs +++ b/compiler/src/passes/reveal_functions/mod.rs @@ -8,20 +8,10 @@ use std::collections::HashMap; #[derive(Debug, PartialEq)] pub struct PrgRevealed<'p> { - pub defs: HashMap, RDef<'p>>, + pub defs: HashMap, Def, RExpr<'p>>>, pub entry: UniqueSym<'p>, } -#[derive(Debug, PartialEq)] -pub enum RDef<'p> { - Fn { - sym: UniqueSym<'p>, - params: Vec<(UniqueSym<'p>, Type)>, - typ: Type, - bdy: RExpr<'p>, - }, -} - #[derive(Debug, PartialEq)] pub enum RExpr<'p> { Lit { @@ -73,10 +63,10 @@ impl<'p> From> for PrgUniquified<'p> { } //TODO also functor time? -impl<'p> From> for Def, Expr>> { - fn from(value: RDef<'p>) -> Self { +impl<'p> From, RExpr<'p>>> for Def, Expr>> { + fn from(value: Def, RExpr<'p>>) -> Self { match value { - RDef::Fn { + Def::Fn { sym, params, typ, diff --git a/compiler/src/passes/reveal_functions/reveal_functions.rs b/compiler/src/passes/reveal_functions/reveal_functions.rs index 887ee01..1fee88b 100644 --- a/compiler/src/passes/reveal_functions/reveal_functions.rs +++ b/compiler/src/passes/reveal_functions/reveal_functions.rs @@ -1,5 +1,5 @@ use crate::passes::parse::{Def, Expr}; -use crate::passes::reveal_functions::{PrgRevealed, RDef, RExpr}; +use crate::passes::reveal_functions::{PrgRevealed, RExpr}; use crate::passes::uniquify::PrgUniquified; use crate::utils::gen_sym::UniqueSym; use crate::utils::push_map::PushMap; @@ -19,7 +19,7 @@ impl<'p> PrgUniquified<'p> { params, typ, bdy, - } => RDef::Fn { + } => Def::Fn { sym, params, typ, diff --git a/compiler/src/passes/type_check/check.rs b/compiler/src/passes/type_check/check.rs index bd49a64..1e8e79c 100644 --- a/compiler/src/passes/type_check/check.rs +++ b/compiler/src/passes/type_check/check.rs @@ -1,4 +1,4 @@ -use crate::passes::parse::{Def, Expr, Lit, Op, PrgParsed}; +use crate::passes::parse::{Def, Expr, Lit, Op, Param, PrgParsed}; use crate::passes::type_check::check::TypeError::*; use crate::passes::type_check::PrgTypeChecked; use crate::passes::type_check::*; @@ -29,16 +29,18 @@ pub enum TypeError { NoMain, #[error("Found a break outside of a loop.")] BreakOutsideLoop, + #[error("Tried to modify immutable variable 'var'")] + ModifyImmutable { sym: String }, } struct Env<'a, 'p> { - scope: &'a mut PushMap<&'p str, Type>, + scope: &'a mut PushMap<&'p str, (bool, Type)>, loop_type: &'a mut Option, in_loop: bool, } impl<'a, 'p> Env<'a, 'p> { - pub fn push(&mut self, k: &'p str, v: Type, sub: impl FnOnce(&mut Env<'_, 'p>) -> O) -> O { + pub fn push(&mut self, k: &'p str, v: (bool, Type), sub: impl FnOnce(&mut Env<'_, 'p>) -> O) -> O { self.scope.push(k, v, |scope| { sub(&mut Env { scope, @@ -50,7 +52,7 @@ impl<'a, 'p> Env<'a, 'p> { pub fn push_iter( &mut self, - iterator: impl Iterator, + iterator: impl Iterator, sub: impl FnOnce(&mut Env<'_, 'p>) -> O, ) -> O { self.scope.push_iter(iterator, |scope| { @@ -82,7 +84,7 @@ impl<'p> PrgParsed<'p> { ref bdy, ref typ, } => env - .push_iter(params.iter().cloned(), |env| { + .push_iter(params.iter().map(|p| (p.sym, (p.mutable, p.typ.clone()))), |env| { expect_type(bdy, typ.clone(), env) }) .map(|_| (sym, def)), @@ -98,7 +100,7 @@ impl<'p> PrgParsed<'p> { } } -fn uncover_fns<'p>(program: &PrgParsed<'p>) -> Result, TypeError> { +fn uncover_fns<'p>(program: &PrgParsed<'p>) -> Result, TypeError> { let mut globals = HashMap::new(); for def in &program.defs { @@ -111,10 +113,10 @@ fn uncover_fns<'p>(program: &PrgParsed<'p>) -> Result, Ty } => { let signature = Type::Fn { typ: Box::new(typ.clone()), - args: args.iter().map(|(_, t)| t.clone()).collect(), + args: args.iter().map(|param| param.typ.clone()).collect(), }; expect( - globals.insert(*sym, signature).is_none(), + globals.insert(*sym, (false, signature)).is_none(), DuplicateFunction { sym: sym.to_string(), }, @@ -122,7 +124,7 @@ fn uncover_fns<'p>(program: &PrgParsed<'p>) -> Result, Ty let mut arg_syms = HashSet::new(); expect( - args.iter().all(|(sym, _)| arg_syms.insert(sym)), + args.iter().all(|param| arg_syms.insert(param.sym)), DuplicateArg { sym: sym.to_string(), }, @@ -141,8 +143,8 @@ fn type_check_expr<'p>(expr: &Expr<&'p str>, env: &mut Env<'_, 'p>) -> Result Ok(Type::Bool), Lit::Unit => Ok(Type::Unit), }, - Expr::Var { sym } => env.scope.get(sym).cloned().ok_or(UndeclaredVar { - sym: (*sym).to_string(), + Expr::Var { sym } => env.scope.get(sym).map(|(_, t)| t).cloned().ok_or(UndeclaredVar { + sym: sym.to_string(), }), Expr::Prim { op, args } => match (op, args.as_slice()) { (Op::Plus | Op::Minus | Op::Mul | Op::Mod | Op::Div, [e1, e2]) => { @@ -187,7 +189,7 @@ fn type_check_expr<'p>(expr: &Expr<&'p str>, env: &mut Env<'_, 'p>) -> Result { let t = type_check_expr(bnd, env)?; - env.push(sym, t, |env| type_check_expr(bdy, env)) + env.push(sym, (*mutable, t), |env| type_check_expr(bdy, env)) } Expr::If { cnd, thn, els } => { expect_type(cnd, Type::Bool, env)?; @@ -245,8 +247,18 @@ fn type_check_expr<'p>(expr: &Expr<&'p str>, env: &mut Env<'_, 'p>) -> Result todo!(), - Expr::Assign { .. } => todo!(), + Expr::Seq { stmt, cnt } => { + type_check_expr(stmt, env)?; + type_check_expr(cnt, env) + }, + Expr::Assign { sym, bnd } => { + let (mutable, typ) = env.scope.get(sym).cloned().ok_or(UndeclaredVar { + sym: sym.to_string(), + })?; + expect(mutable, ModifyImmutable { sym: sym.to_string() })?; + expect_type(bnd, typ, env)?; + Ok(Type::Unit) + }, } } diff --git a/compiler/src/passes/uniquify/uniquify.rs b/compiler/src/passes/uniquify/uniquify.rs index 9a4c139..0e11704 100644 --- a/compiler/src/passes/uniquify/uniquify.rs +++ b/compiler/src/passes/uniquify/uniquify.rs @@ -1,4 +1,4 @@ -use crate::passes::parse::{Def, Expr}; +use crate::passes::parse::{Def, Expr, Param}; use crate::passes::type_check::PrgTypeChecked; use crate::passes::uniquify::PrgUniquified; use crate::utils::gen_sym::{gen_sym, UniqueSym}; @@ -30,12 +30,11 @@ fn uniquify_def<'p>( typ, bdy, } => scope.push_iter( - params.iter().map(|(sym, _)| (*sym, gen_sym(sym))), + params.iter().map(|param| (param.sym, gen_sym(param.sym))), |scope| { let params = params .iter() - .cloned() - .map(|(p, t)| (scope[&p], t)) + .map(|param| Param { sym: scope[¶m.sym], mutable: param.mutable, typ: param.typ.clone() }) .collect(); let bdy = uniquify_expression(bdy, scope); Def::Fn { diff --git a/compiler/src/utils/push_map.rs b/compiler/src/utils/push_map.rs index 3f92d72..fed575a 100644 --- a/compiler/src/utils/push_map.rs +++ b/compiler/src/utils/push_map.rs @@ -5,7 +5,7 @@ use std::hash::Hash; use std::ops::Index; #[derive(Index)] -pub struct PushMap(HashMap); +pub struct PushMap(pub HashMap); impl Default for PushMap { fn default() -> Self { diff --git a/programs/fail/type_check/mut_var.test b/programs/fail/type_check/mut_var.test new file mode 100644 index 0000000..95344b7 --- /dev/null +++ b/programs/fail/type_check/mut_var.test @@ -0,0 +1,11 @@ +## +6 +# +fn test(x: Int) -> Int { + x = 42; + x +} + +fn main() -> Int { + test(8) +} diff --git a/programs/good/mutability/mut_var.test b/programs/good/mutability/mut_var.test new file mode 100644 index 0000000..6f63ba9 --- /dev/null +++ b/programs/good/mutability/mut_var.test @@ -0,0 +1,11 @@ +## +6 +# +fn test(mut x: Int) -> Int { + x = 42; + x +} + +fn main() -> Int { + test(8) +} From f6e87c010d027b7b4314d48a34cff5ef392d09b8 Mon Sep 17 00:00:00 2001 From: jonathan Date: Sun, 29 Oct 2023 15:21:38 +0100 Subject: [PATCH 18/27] Cleanup --- compiler/src/passes/explicate/explicate.rs | 2 +- compiler/src/passes/reveal_functions/mod.rs | 1 - compiler/src/passes/reveal_functions/reveal_functions.rs | 2 +- compiler/src/passes/type_check/check.rs | 4 +++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/src/passes/explicate/explicate.rs b/compiler/src/passes/explicate/explicate.rs index 90714e5..5216743 100644 --- a/compiler/src/passes/explicate/explicate.rs +++ b/compiler/src/passes/explicate/explicate.rs @@ -64,7 +64,7 @@ fn explicate_tail<'p>(expr: AExpr<'p>, blocks: &mut HashMap, Tail< AExpr::FunRef { sym } => Tail::Return { expr: CExpr::FunRef { sym }, }, - AExpr::Loop { bdy } => todo!(), + AExpr::Loop { .. } => todo!(), AExpr::Break { .. } => todo!(), } } diff --git a/compiler/src/passes/reveal_functions/mod.rs b/compiler/src/passes/reveal_functions/mod.rs index 3e6c2a2..6b7e2ac 100644 --- a/compiler/src/passes/reveal_functions/mod.rs +++ b/compiler/src/passes/reveal_functions/mod.rs @@ -1,7 +1,6 @@ pub mod reveal_functions; use crate::passes::parse::{Def, Expr, Lit, Op}; -use crate::passes::type_check::Type; use crate::passes::uniquify::PrgUniquified; use crate::utils::gen_sym::UniqueSym; use std::collections::HashMap; diff --git a/compiler/src/passes/reveal_functions/reveal_functions.rs b/compiler/src/passes/reveal_functions/reveal_functions.rs index 1fee88b..7cbc6ff 100644 --- a/compiler/src/passes/reveal_functions/reveal_functions.rs +++ b/compiler/src/passes/reveal_functions/reveal_functions.rs @@ -54,9 +54,9 @@ fn reveal_expr<'p>(expr: Expr>, scope: &mut PushMap, }, Expr::Let { sym, - mutable, bnd, bdy, + .. } => { let bnd = Box::new(reveal_expr(*bnd, scope)); scope.remove(sym, |scope| RExpr::Let { diff --git a/compiler/src/passes/type_check/check.rs b/compiler/src/passes/type_check/check.rs index 1e8e79c..09d487d 100644 --- a/compiler/src/passes/type_check/check.rs +++ b/compiler/src/passes/type_check/check.rs @@ -1,4 +1,4 @@ -use crate::passes::parse::{Def, Expr, Lit, Op, Param, PrgParsed}; +use crate::passes::parse::{Def, Expr, Lit, Op, PrgParsed}; use crate::passes::type_check::check::TypeError::*; use crate::passes::type_check::PrgTypeChecked; use crate::passes::type_check::*; @@ -74,6 +74,7 @@ impl<'p> PrgParsed<'p> { in_loop: false, }; + // Typecheck all definitions and collect them. let defs = self .defs .into_iter() @@ -100,6 +101,7 @@ impl<'p> PrgParsed<'p> { } } +/// Returns a `PushMap` with all the functions in scope. fn uncover_fns<'p>(program: &PrgParsed<'p>) -> Result, TypeError> { let mut globals = HashMap::new(); From 1ed10ffaaf011de3d29c2ba31180d6e12c1dd31a Mon Sep 17 00:00:00 2001 From: jonathan Date: Sun, 29 Oct 2023 15:30:20 +0100 Subject: [PATCH 19/27] Reveal functions --- compiler/src/passes/atomize/atomize.rs | 32 +++------------- compiler/src/passes/atomize/mod.rs | 26 +++++++++++++ compiler/src/passes/reveal_functions/mod.rs | 37 +++++++++++++++++++ .../reveal_functions/reveal_functions.rs | 31 ++++------------ compiler/src/passes/type_check/check.rs | 24 ------------ compiler/src/passes/type_check/mod.rs | 24 ++++++++++++ compiler/src/passes/uniquify/uniquify.rs | 10 ++++- programs/good/mutability/mut_var.test | 2 +- 8 files changed, 109 insertions(+), 77 deletions(-) diff --git a/compiler/src/passes/atomize/atomize.rs b/compiler/src/passes/atomize/atomize.rs index 41df24d..f9d5333 100644 --- a/compiler/src/passes/atomize/atomize.rs +++ b/compiler/src/passes/atomize/atomize.rs @@ -106,6 +106,8 @@ fn atomize_expr(expr: RExpr) -> AExpr { bdy: Box::new(bdy), }) } + RExpr::Seq { .. } => todo!(), + RExpr::Assign { .. } => todo!(), } } @@ -119,35 +121,11 @@ fn atomize_atom(expr: RExpr) -> (Atom, Option<(UniqueSym, AExpr)>) { | RExpr::Apply { .. } | RExpr::FunRef { .. } | RExpr::Loop { .. } - | RExpr::Break { .. } => { + | RExpr::Break { .. } + | RExpr::Seq { .. } + | RExpr::Assign { .. } => { let tmp = gen_sym("tmp"); (Atom::Var { sym: tmp }, Some((tmp, atomize_expr(expr)))) } } } - -#[cfg(test)] -mod tests { - use crate::interpreter::TestIO; - use crate::passes::parse::PrgGenericVar; - use crate::utils::split_test::split_test; - use test_each_file::test_each_file; - - fn atomize([test]: [&str; 1]) { - let (input, expected_output, expected_return, program) = split_test(test); - let program: PrgGenericVar<_> = program - .type_check() - .unwrap() - .uniquify() - .reveal() - .atomize() - .into(); - let mut io = TestIO::new(input); - let result = program.interpret(&mut io); - - assert_eq!(result, expected_return.into(), "Incorrect program result."); - assert_eq!(io.outputs(), &expected_output, "Incorrect program output."); - } - - test_each_file! { for ["test"] in "./programs/good" as atomize => atomize } -} diff --git a/compiler/src/passes/atomize/mod.rs b/compiler/src/passes/atomize/mod.rs index 57a400c..75d0dbe 100644 --- a/compiler/src/passes/atomize/mod.rs +++ b/compiler/src/passes/atomize/mod.rs @@ -125,3 +125,29 @@ impl<'p> From> for Expr> { } } } + +#[cfg(test)] +mod tests { + use crate::interpreter::TestIO; + use crate::passes::parse::PrgGenericVar; + use crate::utils::split_test::split_test; + use test_each_file::test_each_file; + + fn atomize([test]: [&str; 1]) { + let (input, expected_output, expected_return, program) = split_test(test); + let program: PrgGenericVar<_> = program + .type_check() + .unwrap() + .uniquify() + .reveal() + .atomize() + .into(); + let mut io = TestIO::new(input); + let result = program.interpret(&mut io); + + assert_eq!(result, expected_return.into(), "Incorrect program result."); + assert_eq!(io.outputs(), &expected_output, "Incorrect program output."); + } + + test_each_file! { for ["test"] in "./programs/good" as atomize => atomize } +} diff --git a/compiler/src/passes/reveal_functions/mod.rs b/compiler/src/passes/reveal_functions/mod.rs index 6b7e2ac..773d5d5 100644 --- a/compiler/src/passes/reveal_functions/mod.rs +++ b/compiler/src/passes/reveal_functions/mod.rs @@ -46,6 +46,14 @@ pub enum RExpr<'p> { Break { bdy: Option>>, }, + Seq { + stmt: Box>, + cnt: Box>, + }, + Assign { + sym: UniqueSym<'p>, + bnd: Box>, + }, } impl<'p> From> for PrgUniquified<'p> { @@ -110,6 +118,35 @@ impl<'p> From> for Expr> { RExpr::Break { bdy } => Expr::Break { bdy: bdy.map(|bdy| Box::new((*bdy).into())), }, + RExpr::Seq { stmt, cnt } => Expr::Seq { + stmt: Box::new((*stmt).into()), + cnt: Box::new((*cnt).into()), + }, + RExpr::Assign { sym, bnd } => Expr::Assign { + sym, + bnd: Box::new((*bnd).into()), + }, } } } + +#[cfg(test)] +mod tests { + use crate::interpreter::TestIO; + use crate::passes::uniquify::PrgUniquified; + use crate::utils::split_test::split_test; + use test_each_file::test_each_file; + + fn reveal([test]: [&str; 1]) { + let (input, expected_output, expected_return, program) = split_test(test); + let uniquified_program: PrgUniquified = + program.type_check().unwrap().uniquify().reveal().into(); + let mut io = TestIO::new(input); + let result = uniquified_program.interpret(&mut io); + + assert_eq!(result, expected_return.into(), "Incorrect program result."); + assert_eq!(io.outputs(), &expected_output, "Incorrect program output."); + } + + test_each_file! { for ["test"] in "./programs/good" as reveal => reveal } +} diff --git a/compiler/src/passes/reveal_functions/reveal_functions.rs b/compiler/src/passes/reveal_functions/reveal_functions.rs index 7cbc6ff..84e2a54 100644 --- a/compiler/src/passes/reveal_functions/reveal_functions.rs +++ b/compiler/src/passes/reveal_functions/reveal_functions.rs @@ -83,28 +83,13 @@ fn reveal_expr<'p>(expr: Expr>, scope: &mut PushMap, Expr::Break { bdy } => RExpr::Break { bdy: bdy.map(|bdy| Box::new(reveal_expr(*bdy, scope))), }, - Expr::Seq { .. } => todo!(), - Expr::Assign { .. } => todo!(), - } -} - -#[cfg(test)] -mod tests { - use crate::interpreter::TestIO; - use crate::passes::uniquify::PrgUniquified; - use crate::utils::split_test::split_test; - use test_each_file::test_each_file; - - fn reveal([test]: [&str; 1]) { - let (input, expected_output, expected_return, program) = split_test(test); - let uniquified_program: PrgUniquified = - program.type_check().unwrap().uniquify().reveal().into(); - let mut io = TestIO::new(input); - let result = uniquified_program.interpret(&mut io); - - assert_eq!(result, expected_return.into(), "Incorrect program result."); - assert_eq!(io.outputs(), &expected_output, "Incorrect program output."); + Expr::Seq { stmt, cnt } => RExpr::Seq { + stmt: Box::new(reveal_expr(*stmt, scope)), + cnt: Box::new(reveal_expr(*cnt, scope)), + }, + Expr::Assign { sym, bnd } => RExpr::Assign { + sym, + bnd: Box::new(reveal_expr(*bnd, scope)), + }, } - - test_each_file! { for ["test"] in "./programs/good" as reveal => reveal } } diff --git a/compiler/src/passes/type_check/check.rs b/compiler/src/passes/type_check/check.rs index 09d487d..388cb8f 100644 --- a/compiler/src/passes/type_check/check.rs +++ b/compiler/src/passes/type_check/check.rs @@ -289,27 +289,3 @@ fn expect_type<'p>( }, ) } - -#[cfg(test)] -mod tests { - use crate::passes::parse::parse::parse_program; - use test_each_file::test_each_file; - - fn check([test]: [&str; 1], should_fail: bool) { - let mut test = test.split('#'); - let program = test.nth(3).unwrap().trim(); - let program = parse_program(program).unwrap(); - let res = program.type_check(); - - match (res, should_fail) { - (Ok(_), true) => panic!("Program should not pass type-checking."), - (Err(e), false) => { - panic!("Program should have passed type-checking, but returned error: '{e}'.") - } - _ => {} - } - } - - test_each_file! { for ["test"] in "./programs/good" as type_check_succeed => |p| check(p, false) } - test_each_file! { for ["test"] in "./programs/fail/type_check" as type_check_fail => |p| check(p, true) } -} diff --git a/compiler/src/passes/type_check/mod.rs b/compiler/src/passes/type_check/mod.rs index 7f30caf..277438d 100644 --- a/compiler/src/passes/type_check/mod.rs +++ b/compiler/src/passes/type_check/mod.rs @@ -19,3 +19,27 @@ pub enum Type { #[display(fmt = "fn({}) -> {typ}", r#"args.iter().format(", ")"#)] Fn { typ: Box, args: Vec }, } + +#[cfg(test)] +mod tests { + use crate::passes::parse::parse::parse_program; + use test_each_file::test_each_file; + + fn check([test]: [&str; 1], should_fail: bool) { + let mut test = test.split('#'); + let program = test.nth(3).unwrap().trim(); + let program = parse_program(program).unwrap(); + let res = program.type_check(); + + match (res, should_fail) { + (Ok(_), true) => panic!("Program should not pass type-checking."), + (Err(e), false) => { + panic!("Program should have passed type-checking, but returned error: '{e}'.") + } + _ => {} + } + } + + test_each_file! { for ["test"] in "./programs/good" as type_check_succeed => |p| check(p, false) } + test_each_file! { for ["test"] in "./programs/fail/type_check" as type_check_fail => |p| check(p, true) } +} diff --git a/compiler/src/passes/uniquify/uniquify.rs b/compiler/src/passes/uniquify/uniquify.rs index 0e11704..6714af0 100644 --- a/compiler/src/passes/uniquify/uniquify.rs +++ b/compiler/src/passes/uniquify/uniquify.rs @@ -97,7 +97,13 @@ fn uniquify_expression<'p>( Expr::Break { bdy } => Expr::Break { bdy: bdy.map(|bdy| Box::new(uniquify_expression(*bdy, scope))), }, - Expr::Seq { .. } => todo!(), - Expr::Assign { .. } => todo!(), + Expr::Seq { stmt, cnt } => Expr::Seq { + stmt: Box::new(uniquify_expression(*stmt, scope)), + cnt: Box::new(uniquify_expression(*cnt, scope)), + }, + Expr::Assign { sym, bnd } => Expr::Assign { + sym: scope[sym], + bnd: Box::new(uniquify_expression(*bnd, scope)), + }, } } diff --git a/programs/good/mutability/mut_var.test b/programs/good/mutability/mut_var.test index 6f63ba9..8297889 100644 --- a/programs/good/mutability/mut_var.test +++ b/programs/good/mutability/mut_var.test @@ -1,5 +1,5 @@ ## -6 +42 # fn test(mut x: Int) -> Int { x = 42; From ff0ebc427d1dd49d9c5c1430b82c6fa0e3b2ccb8 Mon Sep 17 00:00:00 2001 From: jonathan Date: Sun, 29 Oct 2023 15:38:15 +0100 Subject: [PATCH 20/27] Atomize --- compiler/src/passes/atomize/atomize.rs | 10 ++++++++-- compiler/src/passes/atomize/mod.rs | 16 ++++++++++++++++ compiler/src/passes/explicate/explicate.rs | 8 ++++++-- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/compiler/src/passes/atomize/atomize.rs b/compiler/src/passes/atomize/atomize.rs index f9d5333..bf9f6ad 100644 --- a/compiler/src/passes/atomize/atomize.rs +++ b/compiler/src/passes/atomize/atomize.rs @@ -106,8 +106,14 @@ fn atomize_expr(expr: RExpr) -> AExpr { bdy: Box::new(bdy), }) } - RExpr::Seq { .. } => todo!(), - RExpr::Assign { .. } => todo!(), + RExpr::Seq { stmt, cnt } => AExpr::Seq { + stmt: Box::new(atomize_expr(*stmt)), + cnt: Box::new(atomize_expr(*cnt)), + }, + RExpr::Assign { sym, bnd } => AExpr::Assign { + sym, + bnd: Box::new(atomize_expr(*bnd)), + }, } } diff --git a/compiler/src/passes/atomize/mod.rs b/compiler/src/passes/atomize/mod.rs index 75d0dbe..106f063 100644 --- a/compiler/src/passes/atomize/mod.rs +++ b/compiler/src/passes/atomize/mod.rs @@ -43,6 +43,14 @@ pub enum AExpr<'p> { Break { bdy: Atom<'p>, }, + Seq { + stmt: Box>, + cnt: Box>, + }, + Assign { + sym: UniqueSym<'p>, + bnd: Box>, + }, } #[derive(Debug, PartialEq, Copy, Clone)] @@ -113,6 +121,14 @@ impl<'p> From> for Expr> { AExpr::Break { bdy } => Expr::Break { bdy: Some(Box::new(bdy.into())), }, + AExpr::Seq { stmt, cnt } => Expr::Seq { + stmt: Box::new((*stmt).into()), + cnt: Box::new((*cnt).into()), + }, + AExpr::Assign { sym, bnd } => Expr::Assign { + sym, + bnd: Box::new((*bnd).into()) + } } } } diff --git a/compiler/src/passes/explicate/explicate.rs b/compiler/src/passes/explicate/explicate.rs index 5216743..af02d52 100644 --- a/compiler/src/passes/explicate/explicate.rs +++ b/compiler/src/passes/explicate/explicate.rs @@ -39,8 +39,6 @@ fn explicate_def<'p>( } } -// if read() > 100 { let x = break 100; unit } else { unit } - fn explicate_tail<'p>(expr: AExpr<'p>, blocks: &mut HashMap, Tail<'p>>) -> Tail<'p> { match expr { AExpr::Atom { atm } => Tail::Return { @@ -66,6 +64,8 @@ fn explicate_tail<'p>(expr: AExpr<'p>, blocks: &mut HashMap, Tail< }, AExpr::Loop { .. } => todo!(), AExpr::Break { .. } => todo!(), + AExpr::Seq { .. } => todo!(), + AExpr::Assign { .. } => todo!(), } } @@ -125,6 +125,8 @@ fn explicate_assign<'p>( } AExpr::Loop { .. } => todo!(), AExpr::Break { .. } => todo!(), + AExpr::Seq { .. } => todo!(), + AExpr::Assign { .. } => todo!(), } } @@ -256,6 +258,8 @@ fn explicate_pred<'p>( } => todo!(), AExpr::Loop { .. } => todo!(), AExpr::Break { .. } => todo!(), + AExpr::Seq { .. } => todo!(), + AExpr::Assign { .. } => todo!(), } } From 6584695fc2ae71789b2476cb2bfb855148e8fe2e Mon Sep 17 00:00:00 2001 From: jonathan Date: Sun, 29 Oct 2023 15:55:43 +0100 Subject: [PATCH 21/27] Explicate mutability --- compiler/src/passes/atomize/mod.rs | 4 +- compiler/src/passes/explicate/explicate.rs | 107 ++++++------------ compiler/src/passes/explicate/mod.rs | 26 +++++ compiler/src/passes/parse/interpreter.rs | 16 ++- .../reveal_functions/reveal_functions.rs | 7 +- compiler/src/passes/type_check/check.rs | 36 ++++-- compiler/src/passes/uniquify/uniquify.rs | 6 +- .../{mutability => loops}/loop_to_42.test | 0 8 files changed, 104 insertions(+), 98 deletions(-) rename programs/good/{mutability => loops}/loop_to_42.test (100%) diff --git a/compiler/src/passes/atomize/mod.rs b/compiler/src/passes/atomize/mod.rs index 106f063..25a6dd9 100644 --- a/compiler/src/passes/atomize/mod.rs +++ b/compiler/src/passes/atomize/mod.rs @@ -127,8 +127,8 @@ impl<'p> From> for Expr> { }, AExpr::Assign { sym, bnd } => Expr::Assign { sym, - bnd: Box::new((*bnd).into()) - } + bnd: Box::new((*bnd).into()), + }, } } } diff --git a/compiler/src/passes/explicate/explicate.rs b/compiler/src/passes/explicate/explicate.rs index af02d52..7cf6bf2 100644 --- a/compiler/src/passes/explicate/explicate.rs +++ b/compiler/src/passes/explicate/explicate.rs @@ -40,37 +40,15 @@ fn explicate_def<'p>( } fn explicate_tail<'p>(expr: AExpr<'p>, blocks: &mut HashMap, Tail<'p>>) -> Tail<'p> { - match expr { - AExpr::Atom { atm } => Tail::Return { - expr: CExpr::Atom { atm }, + let tmp = gen_sym("return"); + let tail = Tail::Return { + expr: CExpr::Atom { + atm: Atom::Var { sym: tmp }, }, - AExpr::Prim { op, args } => Tail::Return { - expr: CExpr::Prim { op, args }, - }, - AExpr::Let { sym, bnd, bdy } => { - explicate_assign(sym, *bnd, explicate_tail(*bdy, blocks), blocks) - } - AExpr::If { cnd, thn, els } => explicate_pred( - *cnd, - explicate_tail(*thn, blocks), - explicate_tail(*els, blocks), - blocks, - ), - AExpr::Apply { fun, args } => Tail::Return { - expr: CExpr::Apply { fun, args }, - }, - AExpr::FunRef { sym } => Tail::Return { - expr: CExpr::FunRef { sym }, - }, - AExpr::Loop { .. } => todo!(), - AExpr::Break { .. } => todo!(), - AExpr::Seq { .. } => todo!(), - AExpr::Assign { .. } => todo!(), - } + }; + explicate_assign(tmp, expr, tail, blocks) } -// def explicate_effect(expr: Expr, cnt: Tail, blocks: HashMap[String, Tail]) : Tail = expr match { - fn explicate_assign<'p>( sym: UniqueSym<'p>, bnd: AExpr<'p>, @@ -125,8 +103,26 @@ fn explicate_assign<'p>( } AExpr::Loop { .. } => todo!(), AExpr::Break { .. } => todo!(), - AExpr::Seq { .. } => todo!(), - AExpr::Assign { .. } => todo!(), + AExpr::Seq { stmt, cnt } => { + let tmp = gen_sym("tmp"); + explicate_assign(tmp, *stmt, explicate_assign(sym, *cnt, tail, blocks), blocks) + }, + AExpr::Assign { + sym: sym_, + bnd: bnd_, + } => explicate_assign( + sym_, + *bnd_, + explicate_assign( + sym, + AExpr::Atom { + atm: Atom::Val { val: Lit::Unit }, + }, + tail, + blocks, + ), + blocks, + ), } } @@ -158,7 +154,6 @@ fn explicate_pred<'p>( thn: create_block(thn), els: create_block(els), }, - AExpr::Atom { atm: Atom::Val { val: Lit::Bool { val }, @@ -170,7 +165,6 @@ fn explicate_pred<'p>( els } } - AExpr::Prim { op, args } => match op { Op::Not => explicate_pred(AExpr::Atom { atm: args[0] }, els, thn, blocks), Op::EQ | Op::NE | Op::GT | Op::GE | Op::LT | Op::LE => Tail::IfStmt { @@ -194,16 +188,13 @@ fn explicate_pred<'p>( blocks, ) } - Op::Read | Op::Print | Op::Plus | Op::Minus | Op::Mul | Op::Mod | Op::Div => { unreachable!() } }, - AExpr::Let { sym, bnd, bdy } => { explicate_assign(sym, *bnd, explicate_pred(*bdy, thn, els, blocks), blocks) } - AExpr::If { cnd: cnd_sub, thn: thn_sub, @@ -229,7 +220,6 @@ fn explicate_pred<'p>( blocks, ) } - AExpr::Apply { fun, args } => { let tmp = gen_sym("tmp"); explicate_assign( @@ -246,45 +236,22 @@ fn explicate_pred<'p>( blocks, ) } - + AExpr::Loop { .. } => todo!(), + AExpr::Break { .. } => todo!(), + AExpr::Seq { stmt, cnt } => { + let sym = gen_sym("tmp"); + explicate_assign(sym, *stmt, explicate_pred(*cnt, thn, els, blocks), blocks) + }, + // cargo format should get some help AExpr::FunRef { .. } | AExpr::Atom { atm: Atom::Val { val: Lit::Int { .. }, }, - } => unreachable!(), - AExpr::Atom { + } + | AExpr::Atom { atm: Atom::Val { val: Lit::Unit }, - } => todo!(), - AExpr::Loop { .. } => todo!(), - AExpr::Break { .. } => todo!(), - AExpr::Seq { .. } => todo!(), - AExpr::Assign { .. } => todo!(), - } -} - -#[cfg(test)] -mod tests { - use crate::interpreter::TestIO; - use crate::utils::split_test::split_test; - use test_each_file::test_each_file; - - fn explicated([test]: [&str; 1]) { - let (input, expected_output, expected_return, program) = split_test(test); - let program = program - .type_check() - .unwrap() - .uniquify() - .reveal() - .atomize() - .explicate(); - - let mut io = TestIO::new(input); - let result = program.interpret(&mut io); - - assert_eq!(result, expected_return.into(), "Incorrect program result."); - assert_eq!(io.outputs(), &expected_output, "Incorrect program output."); + } + | AExpr::Assign { .. } => unreachable!(), } - - test_each_file! { for ["test"] in "./programs/good" as explicate => explicated } } diff --git a/compiler/src/passes/explicate/mod.rs b/compiler/src/passes/explicate/mod.rs index 6238d1c..3c8d3f2 100644 --- a/compiler/src/passes/explicate/mod.rs +++ b/compiler/src/passes/explicate/mod.rs @@ -40,3 +40,29 @@ pub enum CExpr<'p> { Apply { fun: Atom<'p>, args: Vec> }, FunRef { sym: UniqueSym<'p> }, } + +#[cfg(test)] +mod tests { + use crate::interpreter::TestIO; + use crate::utils::split_test::split_test; + use test_each_file::test_each_file; + + fn explicated([test]: [&str; 1]) { + let (input, expected_output, expected_return, program) = split_test(test); + let program = program + .type_check() + .unwrap() + .uniquify() + .reveal() + .atomize() + .explicate(); + + let mut io = TestIO::new(input); + let result = program.interpret(&mut io); + + assert_eq!(result, expected_return.into(), "Incorrect program result."); + assert_eq!(io.outputs(), &expected_output, "Incorrect program output."); + } + + test_each_file! { for ["test"] in "./programs/good" as explicate => explicated } +} diff --git a/compiler/src/passes/parse/interpreter.rs b/compiler/src/passes/parse/interpreter.rs index 0aa9388..15fd83b 100644 --- a/compiler/src/passes/parse/interpreter.rs +++ b/compiler/src/passes/parse/interpreter.rs @@ -49,7 +49,10 @@ impl PrgGenericVar { ) -> Val { match &self.defs[&sym] { Def::Fn { params, bdy, .. } => scope.push_iter( - params.iter().zip(args.iter()).map(|(param, v)| (param.sym, *v)), + params + .iter() + .zip(args.iter()) + .map(|(param, v)| (param.sym, *v)), |scope| self.interpret_expr(bdy, scope, io).val(), ), } @@ -155,12 +158,7 @@ impl PrgGenericVar { } _ => unreachable!(), }, - Expr::Let { - sym, - bnd, - bdy, - .. - } => { + Expr::Let { sym, bnd, bdy, .. } => { let bnd = b!(self.interpret_expr(bnd, scope, io)); b!(scope.push(*sym, bnd, |scope| self.interpret_expr(bdy, scope, io))) } @@ -194,12 +192,12 @@ impl PrgGenericVar { Expr::Seq { stmt, cnt } => { b!(self.interpret_expr(stmt, scope, io)); b!(self.interpret_expr(cnt, scope, io)) - }, + } Expr::Assign { sym, bnd } => { let bnd = b!(self.interpret_expr(bnd, scope, io)); scope.0.insert(*sym, bnd); Val::Unit - }, + } }) } } diff --git a/compiler/src/passes/reveal_functions/reveal_functions.rs b/compiler/src/passes/reveal_functions/reveal_functions.rs index 84e2a54..ee7e7f2 100644 --- a/compiler/src/passes/reveal_functions/reveal_functions.rs +++ b/compiler/src/passes/reveal_functions/reveal_functions.rs @@ -52,12 +52,7 @@ fn reveal_expr<'p>(expr: Expr>, scope: &mut PushMap, .map(|arg| reveal_expr(arg, scope)) .collect(), }, - Expr::Let { - sym, - bnd, - bdy, - .. - } => { + Expr::Let { sym, bnd, bdy, .. } => { let bnd = Box::new(reveal_expr(*bnd, scope)); scope.remove(sym, |scope| RExpr::Let { sym, diff --git a/compiler/src/passes/type_check/check.rs b/compiler/src/passes/type_check/check.rs index 388cb8f..df6a8db 100644 --- a/compiler/src/passes/type_check/check.rs +++ b/compiler/src/passes/type_check/check.rs @@ -40,7 +40,12 @@ struct Env<'a, 'p> { } impl<'a, 'p> Env<'a, 'p> { - pub fn push(&mut self, k: &'p str, v: (bool, Type), sub: impl FnOnce(&mut Env<'_, 'p>) -> O) -> O { + pub fn push( + &mut self, + k: &'p str, + v: (bool, Type), + sub: impl FnOnce(&mut Env<'_, 'p>) -> O, + ) -> O { self.scope.push(k, v, |scope| { sub(&mut Env { scope, @@ -85,9 +90,10 @@ impl<'p> PrgParsed<'p> { ref bdy, ref typ, } => env - .push_iter(params.iter().map(|p| (p.sym, (p.mutable, p.typ.clone()))), |env| { - expect_type(bdy, typ.clone(), env) - }) + .push_iter( + params.iter().map(|p| (p.sym, (p.mutable, p.typ.clone()))), + |env| expect_type(bdy, typ.clone(), env), + ) .map(|_| (sym, def)), }) .collect::, _>>()?; @@ -145,9 +151,14 @@ fn type_check_expr<'p>(expr: &Expr<&'p str>, env: &mut Env<'_, 'p>) -> Result Ok(Type::Bool), Lit::Unit => Ok(Type::Unit), }, - Expr::Var { sym } => env.scope.get(sym).map(|(_, t)| t).cloned().ok_or(UndeclaredVar { - sym: sym.to_string(), - }), + Expr::Var { sym } => env + .scope + .get(sym) + .map(|(_, t)| t) + .cloned() + .ok_or(UndeclaredVar { + sym: sym.to_string(), + }), Expr::Prim { op, args } => match (op, args.as_slice()) { (Op::Plus | Op::Minus | Op::Mul | Op::Mod | Op::Div, [e1, e2]) => { expect_type(e1, Type::Int, env)?; @@ -252,15 +263,20 @@ fn type_check_expr<'p>(expr: &Expr<&'p str>, env: &mut Env<'_, 'p>) -> Result { type_check_expr(stmt, env)?; type_check_expr(cnt, env) - }, + } Expr::Assign { sym, bnd } => { let (mutable, typ) = env.scope.get(sym).cloned().ok_or(UndeclaredVar { sym: sym.to_string(), })?; - expect(mutable, ModifyImmutable { sym: sym.to_string() })?; + expect( + mutable, + ModifyImmutable { + sym: sym.to_string(), + }, + )?; expect_type(bnd, typ, env)?; Ok(Type::Unit) - }, + } } } diff --git a/compiler/src/passes/uniquify/uniquify.rs b/compiler/src/passes/uniquify/uniquify.rs index 6714af0..bc5e823 100644 --- a/compiler/src/passes/uniquify/uniquify.rs +++ b/compiler/src/passes/uniquify/uniquify.rs @@ -34,7 +34,11 @@ fn uniquify_def<'p>( |scope| { let params = params .iter() - .map(|param| Param { sym: scope[¶m.sym], mutable: param.mutable, typ: param.typ.clone() }) + .map(|param| Param { + sym: scope[¶m.sym], + mutable: param.mutable, + typ: param.typ.clone(), + }) .collect(); let bdy = uniquify_expression(bdy, scope); Def::Fn { diff --git a/programs/good/mutability/loop_to_42.test b/programs/good/loops/loop_to_42.test similarity index 100% rename from programs/good/mutability/loop_to_42.test rename to programs/good/loops/loop_to_42.test From 78f13b04574c0304637fcd1f56e03e702745c875 Mon Sep 17 00:00:00 2001 From: jonathan Date: Sun, 29 Oct 2023 16:24:49 +0100 Subject: [PATCH 22/27] Explicate loops --- compiler/src/passes/atomize/atomize.rs | 25 ++--- compiler/src/passes/atomize/mod.rs | 4 +- compiler/src/passes/explicate/explicate.rs | 117 +++++++++++++-------- 3 files changed, 83 insertions(+), 63 deletions(-) diff --git a/compiler/src/passes/atomize/atomize.rs b/compiler/src/passes/atomize/atomize.rs index bf9f6ad..fc736a0 100644 --- a/compiler/src/passes/atomize/atomize.rs +++ b/compiler/src/passes/atomize/atomize.rs @@ -88,24 +88,13 @@ fn atomize_expr(expr: RExpr) -> AExpr { RExpr::Loop { bdy } => AExpr::Loop { bdy: Box::new(atomize_expr(*bdy)), }, - RExpr::Break { bdy } => { - let (atm, extras) = match bdy { - Some(bdy) => atomize_atom(*bdy), - None => { - return AExpr::Break { - bdy: Atom::Val { val: Lit::Unit }, - } - } - }; - - extras - .into_iter() - .rfold(AExpr::Break { bdy: atm }, |bdy, (sym, bnd)| AExpr::Let { - sym, - bnd: Box::new(bnd), - bdy: Box::new(bdy), - }) - } + RExpr::Break { bdy } => AExpr::Break { + bdy: bdy + .map(|bdy| Box::new(atomize_expr(*bdy))) + .unwrap_or(Box::new(AExpr::Atom { + atm: Atom::Val { val: Lit::Unit }, + })), + }, RExpr::Seq { stmt, cnt } => AExpr::Seq { stmt: Box::new(atomize_expr(*stmt)), cnt: Box::new(atomize_expr(*cnt)), diff --git a/compiler/src/passes/atomize/mod.rs b/compiler/src/passes/atomize/mod.rs index 25a6dd9..1d7d117 100644 --- a/compiler/src/passes/atomize/mod.rs +++ b/compiler/src/passes/atomize/mod.rs @@ -41,7 +41,7 @@ pub enum AExpr<'p> { bdy: Box>, }, Break { - bdy: Atom<'p>, + bdy: Box>, }, Seq { stmt: Box>, @@ -119,7 +119,7 @@ impl<'p> From> for Expr> { bdy: Box::new((*bdy).into()), }, AExpr::Break { bdy } => Expr::Break { - bdy: Some(Box::new(bdy.into())), + bdy: Some(Box::new((*bdy).into())), }, AExpr::Seq { stmt, cnt } => Expr::Seq { stmt: Box::new((*stmt).into()), diff --git a/compiler/src/passes/explicate/explicate.rs b/compiler/src/passes/explicate/explicate.rs index 7cf6bf2..6f74454 100644 --- a/compiler/src/passes/explicate/explicate.rs +++ b/compiler/src/passes/explicate/explicate.rs @@ -4,9 +4,20 @@ use crate::passes::parse::{Def, Lit, Op}; use crate::utils::gen_sym::{gen_sym, UniqueSym}; use std::collections::HashMap; +struct Env<'a, 'p> { + blocks: &'a mut HashMap, Tail<'p>>, + /// (block to jump to, variable to write to) + break_target: Option<(UniqueSym<'p>, UniqueSym<'p>)>, +} + impl<'p> PrgAtomized<'p> { pub fn explicate(self) -> PrgExplicated<'p> { let mut blocks = HashMap::new(); + let mut env = Env { + blocks: &mut blocks, + break_target: None, + }; + let fn_params = self .defs .iter() @@ -16,7 +27,7 @@ impl<'p> PrgAtomized<'p> { .collect(); for (_, def) in self.defs { - explicate_def(def, &mut blocks); + explicate_def(def, &mut env); } PrgExplicated { @@ -27,37 +38,34 @@ impl<'p> PrgAtomized<'p> { } } -fn explicate_def<'p>( - def: Def, AExpr<'p>>, - blocks: &mut HashMap, Tail<'p>>, -) { +fn explicate_def<'p>(def: Def, AExpr<'p>>, env: &mut Env<'_, 'p>) { match def { Def::Fn { sym, bdy, .. } => { - let tail = explicate_tail(bdy, blocks); - blocks.insert(sym, tail); + let tail = explicate_tail(bdy, env); + env.blocks.insert(sym, tail); } } } -fn explicate_tail<'p>(expr: AExpr<'p>, blocks: &mut HashMap, Tail<'p>>) -> Tail<'p> { +fn explicate_tail<'p>(expr: AExpr<'p>, env: &mut Env<'_, 'p>) -> Tail<'p> { let tmp = gen_sym("return"); let tail = Tail::Return { expr: CExpr::Atom { atm: Atom::Var { sym: tmp }, }, }; - explicate_assign(tmp, expr, tail, blocks) + explicate_assign(tmp, expr, tail, env) } fn explicate_assign<'p>( sym: UniqueSym<'p>, bnd: AExpr<'p>, tail: Tail<'p>, - blocks: &mut HashMap, Tail<'p>>, + env: &mut Env<'_, 'p>, ) -> Tail<'p> { let mut create_block = |goto: Tail<'p>| { let sym = gen_sym("tmp"); - blocks.insert(sym, goto); + env.blocks.insert(sym, goto); sym }; @@ -86,27 +94,48 @@ fn explicate_assign<'p>( sym: sym_, bnd: bnd_, bdy: bdy_, - } => explicate_assign( - sym_, - *bnd_, - explicate_assign(sym, *bdy_, tail, blocks), - blocks, - ), + } => explicate_assign(sym_, *bnd_, explicate_assign(sym, *bdy_, tail, env), env), AExpr::If { cnd, thn, els } => { let tb = create_block(tail); explicate_pred( *cnd, - explicate_assign(sym, *thn, Tail::Goto { lbl: tb }, blocks), - explicate_assign(sym, *els, Tail::Goto { lbl: tb }, blocks), - blocks, + explicate_assign(sym, *thn, Tail::Goto { lbl: tb }, env), + explicate_assign(sym, *els, Tail::Goto { lbl: tb }, env), + env, ) } - AExpr::Loop { .. } => todo!(), - AExpr::Break { .. } => todo!(), - AExpr::Seq { stmt, cnt } => { - let tmp = gen_sym("tmp"); - explicate_assign(tmp, *stmt, explicate_assign(sym, *cnt, tail, blocks), blocks) - }, + AExpr::Loop { bdy } => { + let loop_block_sym = gen_sym("tmp"); + let tail = create_block(tail); + let mut env = Env { + blocks: env.blocks, + break_target: Some((tail, sym)), + }; + + let loop_block = explicate_assign( + gen_sym("ignore"), + *bdy, + Tail::Goto { + lbl: loop_block_sym, + }, + &mut env, + ); + env.blocks.insert(loop_block_sym, loop_block); + Tail::Goto { + lbl: loop_block_sym, + } + } + AExpr::Break { bdy } => { + let (break_sym, break_var) = env.break_target.unwrap(); + let break_goto = Tail::Goto { lbl: break_sym }; + explicate_assign(break_var, *bdy, break_goto, env) + } + AExpr::Seq { stmt, cnt } => explicate_assign( + gen_sym("ignore"), + *stmt, + explicate_assign(sym, *cnt, tail, env), + env, + ), AExpr::Assign { sym: sym_, bnd: bnd_, @@ -119,9 +148,9 @@ fn explicate_assign<'p>( atm: Atom::Val { val: Lit::Unit }, }, tail, - blocks, + env, ), - blocks, + env, ), } } @@ -130,11 +159,11 @@ fn explicate_pred<'p>( cnd: AExpr<'p>, thn: Tail<'p>, els: Tail<'p>, - blocks: &mut HashMap, Tail<'p>>, + env: &mut Env<'_, 'p>, ) -> Tail<'p> { let mut create_block = |goto: Tail<'p>| { let sym = gen_sym("tmp"); - blocks.insert(sym, goto); + env.blocks.insert(sym, goto); sym }; @@ -166,7 +195,7 @@ fn explicate_pred<'p>( } } AExpr::Prim { op, args } => match op { - Op::Not => explicate_pred(AExpr::Atom { atm: args[0] }, els, thn, blocks), + Op::Not => explicate_pred(AExpr::Atom { atm: args[0] }, els, thn, env), Op::EQ | Op::NE | Op::GT | Op::GE | Op::LT | Op::LE => Tail::IfStmt { cnd: CExpr::Prim { op, args }, thn: create_block(thn), @@ -183,9 +212,9 @@ fn explicate_pred<'p>( }, thn, els, - blocks, + env, ), - blocks, + env, ) } Op::Read | Op::Print | Op::Plus | Op::Minus | Op::Mul | Op::Mod | Op::Div => { @@ -193,7 +222,7 @@ fn explicate_pred<'p>( } }, AExpr::Let { sym, bnd, bdy } => { - explicate_assign(sym, *bnd, explicate_pred(*bdy, thn, els, blocks), blocks) + explicate_assign(sym, *bnd, explicate_pred(*bdy, thn, els, env), env) } AExpr::If { cnd: cnd_sub, @@ -209,15 +238,15 @@ fn explicate_pred<'p>( *thn_sub, Tail::Goto { lbl: thn }, Tail::Goto { lbl: els }, - blocks, + env, ), explicate_pred( *els_sub, Tail::Goto { lbl: thn }, Tail::Goto { lbl: els }, - blocks, + env, ), - blocks, + env, ) } AExpr::Apply { fun, args } => { @@ -231,17 +260,19 @@ fn explicate_pred<'p>( }, thn, els, - blocks, + env, ), - blocks, + env, ) } AExpr::Loop { .. } => todo!(), AExpr::Break { .. } => todo!(), - AExpr::Seq { stmt, cnt } => { - let sym = gen_sym("tmp"); - explicate_assign(sym, *stmt, explicate_pred(*cnt, thn, els, blocks), blocks) - }, + AExpr::Seq { stmt, cnt } => explicate_assign( + gen_sym("ignore"), + *stmt, + explicate_pred(*cnt, thn, els, env), + env, + ), // cargo format should get some help AExpr::FunRef { .. } | AExpr::Atom { From 84f342de2297218e2bf8e19e0f0ab070d0d6413b Mon Sep 17 00:00:00 2001 From: jonathan Date: Sun, 29 Oct 2023 16:39:04 +0100 Subject: [PATCH 23/27] Fix a bug --- compiler/src/passes/compute_interference.rs | 5 +++++ programs/good/loops/loop_break_dead.test | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 programs/good/loops/loop_break_dead.test diff --git a/compiler/src/passes/compute_interference.rs b/compiler/src/passes/compute_interference.rs index b074fd7..7642989 100644 --- a/compiler/src/passes/compute_interference.rs +++ b/compiler/src/passes/compute_interference.rs @@ -32,6 +32,11 @@ impl<'p> LX86VarProgram<'p> { (VarArg::XVar { sym }, ReadWriteOp::Write | ReadWriteOp::ReadWrite) => { LArg::Var { sym: *sym } } + // In case a variable is only read but never written to, we still need to add it to the graph + (VarArg::XVar { sym }, ReadWriteOp::Read) => { + graph.add_node(LArg::Var { sym: *sym }); + return + }, _ => return, }; diff --git a/programs/good/loops/loop_break_dead.test b/programs/good/loops/loop_break_dead.test new file mode 100644 index 0000000..c71219b --- /dev/null +++ b/programs/good/loops/loop_break_dead.test @@ -0,0 +1,9 @@ +## +5 +# +fn main() -> Int { + loop { + break 5; + print(3); + } +} From 50d5997950cac7de4cc272ede5968f21d652defe Mon Sep 17 00:00:00 2001 From: jonathan Date: Sun, 29 Oct 2023 16:45:57 +0100 Subject: [PATCH 24/27] Add the last explicate case --- compiler/src/passes/explicate/explicate.rs | 10 +++++++--- programs/good/loops/loop_in_if.test | 10 ++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 programs/good/loops/loop_in_if.test diff --git a/compiler/src/passes/explicate/explicate.rs b/compiler/src/passes/explicate/explicate.rs index 6f74454..da9831f 100644 --- a/compiler/src/passes/explicate/explicate.rs +++ b/compiler/src/passes/explicate/explicate.rs @@ -265,8 +265,11 @@ fn explicate_pred<'p>( env, ) } - AExpr::Loop { .. } => todo!(), - AExpr::Break { .. } => todo!(), + AExpr::Loop { .. } => { + let tmp = gen_sym("tmp"); + let cnd_ = AExpr::Atom { atm: Atom::Var { sym: tmp }}; + explicate_assign(tmp, cnd, explicate_pred(cnd_, thn, els, env), env) + }, AExpr::Seq { stmt, cnt } => explicate_assign( gen_sym("ignore"), *stmt, @@ -283,6 +286,7 @@ fn explicate_pred<'p>( | AExpr::Atom { atm: Atom::Val { val: Lit::Unit }, } - | AExpr::Assign { .. } => unreachable!(), + | AExpr::Assign { .. } + | AExpr::Break { .. } => unreachable!(), } } diff --git a/programs/good/loops/loop_in_if.test b/programs/good/loops/loop_in_if.test new file mode 100644 index 0000000..d6dbc38 --- /dev/null +++ b/programs/good/loops/loop_in_if.test @@ -0,0 +1,10 @@ +## +5 +# +fn main() -> Int { + if (loop { break true; }) { + 5 + } else { + 3 + } +} From 1386d3997ab4f05835bd6e5af709dcd06c2e386d Mon Sep 17 00:00:00 2001 From: jonathan Date: Sun, 29 Oct 2023 16:55:56 +0100 Subject: [PATCH 25/27] Add another test --- programs/good/integration/is_prime.test | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 programs/good/integration/is_prime.test diff --git a/programs/good/integration/is_prime.test b/programs/good/integration/is_prime.test new file mode 100644 index 0000000..f3b6973 --- /dev/null +++ b/programs/good/integration/is_prime.test @@ -0,0 +1,35 @@ +2 3 4 5 6 7 8 9 10 11 12 13 0 +# +1 1 0 1 0 1 0 0 0 1 0 1 +# +unit +# +fn is_prime(n: Int) -> Bool { + let mut i = 2; + loop { + if i == n { + break true; + } else { + if n % i == 0 { + break false; + } else { + i = i + 1; + } + } + } +} + +fn main() { + loop { + let n = read(); + if n == 0 { + break; + } else { + if is_prime(n) { + print(1); + } else { + print(0); + } + } + } +} From 17b7ddb053cbd26eea88045aa6a350f470acd089 Mon Sep 17 00:00:00 2001 From: jonathan Date: Sun, 29 Oct 2023 16:59:14 +0100 Subject: [PATCH 26/27] Fix bencher --- bencher/src/main.rs | 2 +- compiler/src/passes/compute_interference.rs | 4 ++-- compiler/src/passes/explicate/explicate.rs | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bencher/src/main.rs b/bencher/src/main.rs index 181ef61..0ef3b9f 100644 --- a/bencher/src/main.rs +++ b/bencher/src/main.rs @@ -2,7 +2,6 @@ use clap::Parser; use compiler::elf::ElfFile; use compiler::interpreter::x86var::IStats; use compiler::interpreter::{TestIO, IO}; -use compiler::passes::parse::parse_program; use compiler::utils::split_test::split_test_raw; use git2::{Commit, Repository}; use mongodb::bson; @@ -18,6 +17,7 @@ use std::fs::File; use std::path::Path; use tempdir::TempDir; use walkdir::WalkDir; +use compiler::passes::parse::parse::parse_program; /// Stats gathered by the bencher. // #[derive(Check)] diff --git a/compiler/src/passes/compute_interference.rs b/compiler/src/passes/compute_interference.rs index 7642989..1590daa 100644 --- a/compiler/src/passes/compute_interference.rs +++ b/compiler/src/passes/compute_interference.rs @@ -35,8 +35,8 @@ impl<'p> LX86VarProgram<'p> { // In case a variable is only read but never written to, we still need to add it to the graph (VarArg::XVar { sym }, ReadWriteOp::Read) => { graph.add_node(LArg::Var { sym: *sym }); - return - }, + return; + } _ => return, }; diff --git a/compiler/src/passes/explicate/explicate.rs b/compiler/src/passes/explicate/explicate.rs index da9831f..e6e9259 100644 --- a/compiler/src/passes/explicate/explicate.rs +++ b/compiler/src/passes/explicate/explicate.rs @@ -267,9 +267,11 @@ fn explicate_pred<'p>( } AExpr::Loop { .. } => { let tmp = gen_sym("tmp"); - let cnd_ = AExpr::Atom { atm: Atom::Var { sym: tmp }}; + let cnd_ = AExpr::Atom { + atm: Atom::Var { sym: tmp }, + }; explicate_assign(tmp, cnd, explicate_pred(cnd_, thn, els, env), env) - }, + } AExpr::Seq { stmt, cnt } => explicate_assign( gen_sym("ignore"), *stmt, From e3af1842abb19ab9ba228a3ad4e6636e1735b494 Mon Sep 17 00:00:00 2001 From: jonathan Date: Sun, 29 Oct 2023 17:07:33 +0100 Subject: [PATCH 27/27] Fmt --- bencher/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bencher/src/main.rs b/bencher/src/main.rs index 0ef3b9f..d43dd07 100644 --- a/bencher/src/main.rs +++ b/bencher/src/main.rs @@ -2,6 +2,7 @@ use clap::Parser; use compiler::elf::ElfFile; use compiler::interpreter::x86var::IStats; use compiler::interpreter::{TestIO, IO}; +use compiler::passes::parse::parse::parse_program; use compiler::utils::split_test::split_test_raw; use git2::{Commit, Repository}; use mongodb::bson; @@ -17,7 +18,6 @@ use std::fs::File; use std::path::Path; use tempdir::TempDir; use walkdir::WalkDir; -use compiler::passes::parse::parse::parse_program; /// Stats gathered by the bencher. // #[derive(Check)]