2021-12-16 18:23:02 +00:00
|
|
|
// auto-generated: "lalrpop 0.19.6"
|
2021-12-17 02:57:20 +00:00
|
|
|
// sha3: 571c188ccc79ac263d1d3e5f9c8ba79f8d57f5a72af80ada9090216ab299e
|
2021-12-16 23:15:31 +00:00
|
|
|
use crate::{Tree, Literal};
|
2021-12-16 18:23:02 +00:00
|
|
|
#[allow(unused_extern_crates)]
|
|
|
|
extern crate lalrpop_util as __lalrpop_util;
|
|
|
|
#[allow(unused_imports)]
|
|
|
|
use self::__lalrpop_util::state_machine as __state_machine;
|
2021-12-16 22:24:31 +00:00
|
|
|
extern crate core;
|
2021-12-16 23:15:31 +00:00
|
|
|
extern crate alloc;
|
2021-12-16 18:23:02 +00:00
|
|
|
|
|
|
|
#[cfg_attr(rustfmt, rustfmt_skip)]
|
2021-12-16 20:30:28 +00:00
|
|
|
mod __parse__Tree {
|
2021-12-16 18:23:02 +00:00
|
|
|
#![allow(non_snake_case, non_camel_case_types, unused_mut, unused_variables, unused_imports, unused_parens)]
|
|
|
|
|
2021-12-16 22:24:31 +00:00
|
|
|
use crate::{Tree, Literal};
|
2021-12-16 18:23:02 +00:00
|
|
|
#[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;
|
2021-12-16 20:30:28 +00:00
|
|
|
use self::__lalrpop_util::lexer::Token;
|
2021-12-16 18:23:02 +00:00
|
|
|
#[allow(dead_code)]
|
2021-12-16 20:30:28 +00:00
|
|
|
pub(crate) enum __Symbol<'input>
|
2021-12-16 18:23:02 +00:00
|
|
|
{
|
2021-12-16 20:30:28 +00:00
|
|
|
Variant0(&'input str),
|
2021-12-16 23:15:31 +00:00
|
|
|
Variant1(Box<Tree>),
|
2021-12-17 02:57:20 +00:00
|
|
|
Variant2(bool),
|
|
|
|
Variant3(Literal),
|
|
|
|
Variant4(f64),
|
|
|
|
Variant5(String),
|
|
|
|
Variant6(Tree),
|
|
|
|
Variant7(alloc::vec::Vec<Tree>),
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
const __ACTION: &[i8] = &[
|
|
|
|
// State 0
|
2021-12-17 02:57:20 +00:00
|
|
|
14, 15, 2, 0, 0, 0, 16, 17,
|
2021-12-16 18:23:02 +00:00
|
|
|
// State 1
|
2021-12-17 02:57:20 +00:00
|
|
|
14, 15, 2, 0, 4, 5, 16, 17,
|
2021-12-16 18:23:02 +00:00
|
|
|
// State 2
|
2021-12-17 02:57:20 +00:00
|
|
|
14, 15, 2, 20, 0, 0, 16, 17,
|
2021-12-16 18:23:02 +00:00
|
|
|
// State 3
|
2021-12-17 02:57:20 +00:00
|
|
|
0, 0, 0, 0, 0, 0, 0, 17,
|
2021-12-16 18:23:02 +00:00
|
|
|
// State 4
|
2021-12-17 02:57:20 +00:00
|
|
|
14, 15, 2, 0, 0, 0, 16, 17,
|
2021-12-16 18:23:02 +00:00
|
|
|
// State 5
|
2021-12-17 02:57:20 +00:00
|
|
|
14, 15, 2, 0, 0, 0, 16, 17,
|
2021-12-16 18:23:02 +00:00
|
|
|
// State 6
|
2021-12-17 02:57:20 +00:00
|
|
|
14, 15, 2, 0, 0, 0, 16, 17,
|
2021-12-16 18:23:02 +00:00
|
|
|
// State 7
|
2021-12-17 02:57:20 +00:00
|
|
|
14, 15, 2, 0, 0, 0, 16, 17,
|
2021-12-16 18:23:02 +00:00
|
|
|
// State 8
|
2021-12-17 02:57:20 +00:00
|
|
|
-7, -7, -7, -7, 0, 0, -7, -7,
|
2021-12-16 18:23:02 +00:00
|
|
|
// State 9
|
2021-12-17 02:57:20 +00:00
|
|
|
-13, -13, -13, -13, 0, 0, -13, -13,
|
2021-12-16 18:23:02 +00:00
|
|
|
// State 10
|
2021-12-17 02:57:20 +00:00
|
|
|
-6, -6, -6, -6, 0, 0, -6, -6,
|
2021-12-16 18:23:02 +00:00
|
|
|
// State 11
|
2021-12-17 02:57:20 +00:00
|
|
|
-5, -5, -5, -5, 0, 0, -5, -5,
|
2021-12-16 23:15:31 +00:00
|
|
|
// State 12
|
2021-12-17 02:57:20 +00:00
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
2021-12-16 23:15:31 +00:00
|
|
|
// State 13
|
2021-12-17 02:57:20 +00:00
|
|
|
-3, -3, -3, -3, 0, 0, -3, -3,
|
2021-12-16 23:15:31 +00:00
|
|
|
// State 14
|
2021-12-17 02:57:20 +00:00
|
|
|
-2, -2, -2, -2, 0, 0, -2, -2,
|
2021-12-16 23:15:31 +00:00
|
|
|
// State 15
|
2021-12-17 02:57:20 +00:00
|
|
|
-8, -8, -8, -8, 0, 0, -8, -8,
|
2021-12-16 23:15:31 +00:00
|
|
|
// State 16
|
2021-12-17 02:57:20 +00:00
|
|
|
-9, -9, -9, -9, 0, 0, -9, -9,
|
|
|
|
// State 17
|
|
|
|
-14, -14, -14, -14, 0, 0, -14, -14,
|
|
|
|
// State 18
|
|
|
|
-15, -15, -15, -15, 0, 0, -15, -15,
|
|
|
|
// State 19
|
|
|
|
-10, -10, -10, -10, 0, 0, -10, -10,
|
|
|
|
// State 20
|
|
|
|
0, 0, 0, 24, 0, 0, 0, 0,
|
|
|
|
// State 21
|
|
|
|
0, 0, 0, -1, 0, 0, 0, 0,
|
|
|
|
// State 22
|
|
|
|
0, 0, 0, -4, 0, 0, 0, 0,
|
|
|
|
// State 23
|
|
|
|
-11, -11, -11, -11, 0, 0, -11, -11,
|
|
|
|
// State 24
|
|
|
|
0, 0, 0, 26, 0, 0, 0, 0,
|
|
|
|
// State 25
|
|
|
|
-12, -12, -12, -12, 0, 0, -12, -12,
|
2021-12-16 18:23:02 +00:00
|
|
|
];
|
|
|
|
fn __action(state: i8, integer: usize) -> i8 {
|
2021-12-17 02:57:20 +00:00
|
|
|
__ACTION[(state as usize) * 8 + integer]
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
const __EOF_ACTION: &[i8] = &[
|
|
|
|
// State 0
|
2021-12-16 20:30:28 +00:00
|
|
|
0,
|
2021-12-16 18:23:02 +00:00
|
|
|
// State 1
|
2021-12-16 20:30:28 +00:00
|
|
|
0,
|
2021-12-16 18:23:02 +00:00
|
|
|
// State 2
|
|
|
|
0,
|
|
|
|
// State 3
|
2021-12-16 23:15:31 +00:00
|
|
|
0,
|
2021-12-16 18:23:02 +00:00
|
|
|
// State 4
|
2021-12-16 23:15:31 +00:00
|
|
|
0,
|
2021-12-16 18:23:02 +00:00
|
|
|
// State 5
|
2021-12-17 02:57:20 +00:00
|
|
|
0,
|
2021-12-16 18:23:02 +00:00
|
|
|
// State 6
|
2021-12-17 02:57:20 +00:00
|
|
|
0,
|
2021-12-16 23:15:31 +00:00
|
|
|
// State 7
|
2021-12-17 02:57:20 +00:00
|
|
|
0,
|
2021-12-16 18:23:02 +00:00
|
|
|
// State 8
|
2021-12-17 02:57:20 +00:00
|
|
|
-7,
|
2021-12-16 18:23:02 +00:00
|
|
|
// State 9
|
2021-12-17 02:57:20 +00:00
|
|
|
-13,
|
2021-12-16 18:23:02 +00:00
|
|
|
// State 10
|
2021-12-17 02:57:20 +00:00
|
|
|
-6,
|
2021-12-16 23:15:31 +00:00
|
|
|
// State 11
|
2021-12-17 02:57:20 +00:00
|
|
|
-5,
|
2021-12-16 23:15:31 +00:00
|
|
|
// State 12
|
2021-12-17 02:57:20 +00:00
|
|
|
-16,
|
2021-12-16 23:15:31 +00:00
|
|
|
// State 13
|
2021-12-17 02:57:20 +00:00
|
|
|
-3,
|
2021-12-16 23:15:31 +00:00
|
|
|
// State 14
|
2021-12-17 02:57:20 +00:00
|
|
|
-2,
|
2021-12-16 23:15:31 +00:00
|
|
|
// State 15
|
2021-12-17 02:57:20 +00:00
|
|
|
-8,
|
2021-12-16 23:15:31 +00:00
|
|
|
// State 16
|
2021-12-17 02:57:20 +00:00
|
|
|
-9,
|
|
|
|
// State 17
|
|
|
|
0,
|
|
|
|
// State 18
|
|
|
|
0,
|
|
|
|
// State 19
|
|
|
|
-10,
|
|
|
|
// State 20
|
|
|
|
0,
|
|
|
|
// State 21
|
|
|
|
0,
|
|
|
|
// State 22
|
|
|
|
0,
|
|
|
|
// State 23
|
|
|
|
-11,
|
|
|
|
// State 24
|
|
|
|
0,
|
|
|
|
// State 25
|
|
|
|
-12,
|
2021-12-16 18:23:02 +00:00
|
|
|
];
|
|
|
|
fn __goto(state: i8, nt: usize) -> i8 {
|
|
|
|
match nt {
|
2021-12-17 02:57:20 +00:00
|
|
|
0 => 20,
|
|
|
|
1 => 8,
|
|
|
|
2 => 21,
|
|
|
|
3 => 9,
|
|
|
|
4 => 10,
|
|
|
|
5 => match state {
|
|
|
|
3 => 5,
|
|
|
|
_ => 11,
|
2021-12-16 18:23:02 +00:00
|
|
|
},
|
2021-12-17 02:57:20 +00:00
|
|
|
6 => match state {
|
|
|
|
6 => 7,
|
|
|
|
0 => 12,
|
|
|
|
1 => 17,
|
|
|
|
2 => 18,
|
|
|
|
5 => 22,
|
|
|
|
7 => 24,
|
|
|
|
_ => 6,
|
2021-12-16 23:15:31 +00:00
|
|
|
},
|
2021-12-17 02:57:20 +00:00
|
|
|
7 => 2,
|
2021-12-16 18:23:02 +00:00
|
|
|
_ => 0,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fn __expected_tokens(__state: i8) -> alloc::vec::Vec<alloc::string::String> {
|
|
|
|
const __TERMINAL: &[&str] = &[
|
2021-12-17 02:57:20 +00:00
|
|
|
r###""#f""###,
|
|
|
|
r###""#t""###,
|
2021-12-16 18:23:02 +00:00
|
|
|
r###""(""###,
|
|
|
|
r###"")""###,
|
2021-12-16 23:15:31 +00:00
|
|
|
r###""define""###,
|
2021-12-17 02:57:20 +00:00
|
|
|
r###""if""###,
|
2021-12-16 20:30:28 +00:00
|
|
|
r###"r#"[0-9]+(\\.[0-9]+)?"#"###,
|
2021-12-16 22:24:31 +00:00
|
|
|
r###"r#"[A-Za-z!$%&*+\\-./:<=>?@^_~][A-Za-z!$%&*+\\-./:<=>?@^_~0-9]*"#"###,
|
2021-12-16 18:23:02 +00:00
|
|
|
];
|
|
|
|
__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()
|
|
|
|
}
|
2021-12-16 20:30:28 +00:00
|
|
|
pub(crate) struct __StateMachine<'input, 's>
|
2021-12-16 18:23:02 +00:00
|
|
|
where
|
|
|
|
{
|
2021-12-16 20:30:28 +00:00
|
|
|
input: &'input str,
|
|
|
|
__phantom: core::marker::PhantomData<(&'input (), &'s ())>,
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
2021-12-16 20:30:28 +00:00
|
|
|
impl<'input, 's> __state_machine::ParserDefinition for __StateMachine<'input, 's>
|
2021-12-16 18:23:02 +00:00
|
|
|
where
|
|
|
|
{
|
|
|
|
type Location = usize;
|
2021-12-16 20:30:28 +00:00
|
|
|
type Error = &'static str;
|
|
|
|
type Token = Token<'input>;
|
2021-12-16 18:23:02 +00:00
|
|
|
type TokenIndex = usize;
|
2021-12-16 20:30:28 +00:00
|
|
|
type Symbol = __Symbol<'input>;
|
|
|
|
type Success = Tree;
|
2021-12-16 18:23:02 +00:00
|
|
|
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<usize> {
|
2021-12-16 20:30:28 +00:00
|
|
|
__token_to_integer(token, core::marker::PhantomData::<(&(), &())>)
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn action(&self, state: i8, integer: usize) -> i8 {
|
|
|
|
__action(state, integer)
|
|
|
|
}
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn error_action(&self, state: i8) -> i8 {
|
2021-12-17 02:57:20 +00:00
|
|
|
__action(state, 8 - 1)
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[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 {
|
2021-12-16 20:30:28 +00:00
|
|
|
__token_to_symbol(token_index, token, core::marker::PhantomData::<(&(), &())>)
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn expected_tokens(&self, state: i8) -> alloc::vec::Vec<alloc::string::String> {
|
|
|
|
__expected_tokens(state)
|
|
|
|
}
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn uses_error_recovery(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn error_recovery_symbol(
|
|
|
|
&self,
|
|
|
|
recovery: __state_machine::ErrorRecovery<Self>,
|
|
|
|
) -> 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<i8>,
|
|
|
|
symbols: &mut alloc::vec::Vec<__state_machine::SymbolTriple<Self>>,
|
|
|
|
) -> Option<__state_machine::ParseResult<Self>> {
|
|
|
|
__reduce(
|
2021-12-16 20:30:28 +00:00
|
|
|
self.input,
|
2021-12-16 18:23:02 +00:00
|
|
|
action,
|
|
|
|
start_location,
|
|
|
|
states,
|
|
|
|
symbols,
|
2021-12-16 20:30:28 +00:00
|
|
|
core::marker::PhantomData::<(&(), &())>,
|
2021-12-16 18:23:02 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn simulate_reduce(&self, action: i8) -> __state_machine::SimulatedReduce<Self> {
|
|
|
|
panic!("error recovery not enabled for this grammar")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fn __token_to_integer<
|
2021-12-16 20:30:28 +00:00
|
|
|
'input,
|
2021-12-16 18:23:02 +00:00
|
|
|
's,
|
|
|
|
>(
|
2021-12-16 20:30:28 +00:00
|
|
|
__token: &Token<'input>,
|
|
|
|
_: core::marker::PhantomData<(&'input (), &'s ())>,
|
2021-12-16 18:23:02 +00:00
|
|
|
) -> Option<usize>
|
|
|
|
{
|
|
|
|
match *__token {
|
2021-12-16 22:24:31 +00:00
|
|
|
Token(2, _) if true => Some(0),
|
|
|
|
Token(3, _) if true => Some(1),
|
2021-12-16 23:15:31 +00:00
|
|
|
Token(4, _) if true => Some(2),
|
2021-12-17 02:57:20 +00:00
|
|
|
Token(5, _) if true => Some(3),
|
|
|
|
Token(6, _) if true => Some(4),
|
|
|
|
Token(7, _) if true => Some(5),
|
|
|
|
Token(0, _) if true => Some(6),
|
|
|
|
Token(1, _) if true => Some(7),
|
2021-12-16 18:23:02 +00:00
|
|
|
_ => None,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fn __token_to_symbol<
|
2021-12-16 20:30:28 +00:00
|
|
|
'input,
|
2021-12-16 18:23:02 +00:00
|
|
|
's,
|
|
|
|
>(
|
|
|
|
__token_index: usize,
|
2021-12-16 20:30:28 +00:00
|
|
|
__token: Token<'input>,
|
|
|
|
_: core::marker::PhantomData<(&'input (), &'s ())>,
|
|
|
|
) -> __Symbol<'input>
|
2021-12-16 18:23:02 +00:00
|
|
|
{
|
|
|
|
match __token_index {
|
2021-12-17 02:57:20 +00:00
|
|
|
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 => match __token {
|
|
|
|
Token(2, __tok0) | Token(3, __tok0) | Token(4, __tok0) | Token(5, __tok0) | Token(6, __tok0) | Token(7, __tok0) | Token(0, __tok0) | Token(1, __tok0) if true => __Symbol::Variant0(__tok0),
|
2021-12-16 18:23:02 +00:00
|
|
|
_ => unreachable!(),
|
|
|
|
},
|
|
|
|
_ => unreachable!(),
|
|
|
|
}
|
|
|
|
}
|
2021-12-16 22:24:31 +00:00
|
|
|
pub(crate) struct TreeParser {
|
2021-12-16 20:30:28 +00:00
|
|
|
builder: __lalrpop_util::lexer::MatcherBuilder,
|
2021-12-16 18:23:02 +00:00
|
|
|
_priv: (),
|
|
|
|
}
|
|
|
|
|
2021-12-16 20:30:28 +00:00
|
|
|
impl TreeParser {
|
2021-12-16 22:24:31 +00:00
|
|
|
pub(crate) fn new() -> TreeParser {
|
2021-12-16 20:30:28 +00:00
|
|
|
let __builder = super::__intern_token::new_builder();
|
|
|
|
TreeParser {
|
|
|
|
builder: __builder,
|
2021-12-16 18:23:02 +00:00
|
|
|
_priv: (),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(dead_code)]
|
2021-12-16 22:24:31 +00:00
|
|
|
pub(crate) fn parse<
|
2021-12-16 20:30:28 +00:00
|
|
|
'input,
|
2021-12-16 18:23:02 +00:00
|
|
|
's,
|
|
|
|
>(
|
|
|
|
&self,
|
2021-12-16 20:30:28 +00:00
|
|
|
input: &'input str,
|
|
|
|
) -> Result<Tree, __lalrpop_util::ParseError<usize, Token<'input>, &'static str>>
|
2021-12-16 18:23:02 +00:00
|
|
|
{
|
2021-12-16 20:30:28 +00:00
|
|
|
let mut __tokens = self.builder.matcher(input);
|
2021-12-16 18:23:02 +00:00
|
|
|
__state_machine::Parser::drive(
|
|
|
|
__StateMachine {
|
2021-12-16 20:30:28 +00:00
|
|
|
input,
|
|
|
|
__phantom: core::marker::PhantomData::<(&(), &())>,
|
2021-12-16 18:23:02 +00:00
|
|
|
},
|
|
|
|
__tokens,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pub(crate) fn __reduce<
|
2021-12-16 20:30:28 +00:00
|
|
|
'input,
|
2021-12-16 18:23:02 +00:00
|
|
|
's,
|
|
|
|
>(
|
2021-12-16 20:30:28 +00:00
|
|
|
input: &'input str,
|
2021-12-16 18:23:02 +00:00
|
|
|
__action: i8,
|
|
|
|
__lookahead_start: Option<&usize>,
|
|
|
|
__states: &mut alloc::vec::Vec<i8>,
|
2021-12-16 20:30:28 +00:00
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>,
|
|
|
|
_: core::marker::PhantomData<(&'input (), &'s ())>,
|
|
|
|
) -> Option<Result<Tree,__lalrpop_util::ParseError<usize, Token<'input>, &'static str>>>
|
2021-12-16 18:23:02 +00:00
|
|
|
{
|
|
|
|
let (__pop_states, __nonterminal) = match __action {
|
|
|
|
0 => {
|
2021-12-16 20:30:28 +00:00
|
|
|
__reduce0(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&(), &())>)
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
1 => {
|
2021-12-16 20:30:28 +00:00
|
|
|
__reduce1(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&(), &())>)
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
2 => {
|
2021-12-16 20:30:28 +00:00
|
|
|
__reduce2(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&(), &())>)
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
3 => {
|
2021-12-16 20:30:28 +00:00
|
|
|
__reduce3(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&(), &())>)
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
4 => {
|
2021-12-16 20:30:28 +00:00
|
|
|
__reduce4(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&(), &())>)
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
5 => {
|
2021-12-16 20:30:28 +00:00
|
|
|
__reduce5(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&(), &())>)
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
6 => {
|
2021-12-16 20:30:28 +00:00
|
|
|
__reduce6(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&(), &())>)
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
7 => {
|
2021-12-16 20:30:28 +00:00
|
|
|
__reduce7(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&(), &())>)
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
8 => {
|
2021-12-16 23:15:31 +00:00
|
|
|
__reduce8(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&(), &())>)
|
|
|
|
}
|
|
|
|
9 => {
|
|
|
|
__reduce9(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&(), &())>)
|
|
|
|
}
|
|
|
|
10 => {
|
2021-12-17 02:57:20 +00:00
|
|
|
__reduce10(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&(), &())>)
|
|
|
|
}
|
|
|
|
11 => {
|
|
|
|
__reduce11(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&(), &())>)
|
|
|
|
}
|
|
|
|
12 => {
|
|
|
|
__reduce12(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&(), &())>)
|
|
|
|
}
|
|
|
|
13 => {
|
|
|
|
__reduce13(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&(), &())>)
|
|
|
|
}
|
|
|
|
14 => {
|
|
|
|
__reduce14(input, __lookahead_start, __symbols, core::marker::PhantomData::<(&(), &())>)
|
|
|
|
}
|
|
|
|
15 => {
|
2021-12-16 20:30:28 +00:00
|
|
|
// __Tree = Tree => ActionFn(0);
|
2021-12-17 02:57:20 +00:00
|
|
|
let __sym0 = __pop_Variant6(__symbols);
|
2021-12-16 18:23:02 +00:00
|
|
|
let __start = __sym0.0.clone();
|
|
|
|
let __end = __sym0.2.clone();
|
2021-12-16 20:30:28 +00:00
|
|
|
let __nt = super::__action0::<>(input, __sym0);
|
2021-12-16 18:23:02 +00:00
|
|
|
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<
|
2021-12-16 20:30:28 +00:00
|
|
|
'input,
|
2021-12-16 18:23:02 +00:00
|
|
|
>(
|
2021-12-16 20:30:28 +00:00
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>
|
2021-12-16 23:15:31 +00:00
|
|
|
) -> (usize, Box<Tree>, usize)
|
2021-12-16 18:23:02 +00:00
|
|
|
{
|
|
|
|
match __symbols.pop() {
|
|
|
|
Some((__l, __Symbol::Variant1(__v), __r)) => (__l, __v, __r),
|
|
|
|
_ => __symbol_type_mismatch()
|
|
|
|
}
|
|
|
|
}
|
2021-12-17 02:57:20 +00:00
|
|
|
fn __pop_Variant3<
|
2021-12-16 22:24:31 +00:00
|
|
|
'input,
|
|
|
|
>(
|
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>
|
2021-12-16 23:15:31 +00:00
|
|
|
) -> (usize, Literal, usize)
|
2021-12-16 22:24:31 +00:00
|
|
|
{
|
|
|
|
match __symbols.pop() {
|
2021-12-17 02:57:20 +00:00
|
|
|
Some((__l, __Symbol::Variant3(__v), __r)) => (__l, __v, __r),
|
2021-12-16 22:24:31 +00:00
|
|
|
_ => __symbol_type_mismatch()
|
|
|
|
}
|
|
|
|
}
|
2021-12-17 02:57:20 +00:00
|
|
|
fn __pop_Variant5<
|
2021-12-16 22:24:31 +00:00
|
|
|
'input,
|
|
|
|
>(
|
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>
|
2021-12-16 23:15:31 +00:00
|
|
|
) -> (usize, String, usize)
|
2021-12-16 22:24:31 +00:00
|
|
|
{
|
|
|
|
match __symbols.pop() {
|
2021-12-17 02:57:20 +00:00
|
|
|
Some((__l, __Symbol::Variant5(__v), __r)) => (__l, __v, __r),
|
2021-12-16 22:24:31 +00:00
|
|
|
_ => __symbol_type_mismatch()
|
|
|
|
}
|
|
|
|
}
|
2021-12-17 02:57:20 +00:00
|
|
|
fn __pop_Variant6<
|
2021-12-16 20:30:28 +00:00
|
|
|
'input,
|
2021-12-16 18:23:02 +00:00
|
|
|
>(
|
2021-12-16 20:30:28 +00:00
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>
|
2021-12-16 23:15:31 +00:00
|
|
|
) -> (usize, Tree, usize)
|
2021-12-16 22:24:31 +00:00
|
|
|
{
|
|
|
|
match __symbols.pop() {
|
2021-12-17 02:57:20 +00:00
|
|
|
Some((__l, __Symbol::Variant6(__v), __r)) => (__l, __v, __r),
|
2021-12-16 22:24:31 +00:00
|
|
|
_ => __symbol_type_mismatch()
|
|
|
|
}
|
|
|
|
}
|
2021-12-17 02:57:20 +00:00
|
|
|
fn __pop_Variant7<
|
2021-12-16 23:15:31 +00:00
|
|
|
'input,
|
|
|
|
>(
|
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>
|
|
|
|
) -> (usize, alloc::vec::Vec<Tree>, usize)
|
|
|
|
{
|
|
|
|
match __symbols.pop() {
|
2021-12-17 02:57:20 +00:00
|
|
|
Some((__l, __Symbol::Variant7(__v), __r)) => (__l, __v, __r),
|
2021-12-16 23:15:31 +00:00
|
|
|
_ => __symbol_type_mismatch()
|
|
|
|
}
|
|
|
|
}
|
2021-12-17 02:57:20 +00:00
|
|
|
fn __pop_Variant2<
|
|
|
|
'input,
|
|
|
|
>(
|
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>
|
|
|
|
) -> (usize, bool, usize)
|
|
|
|
{
|
|
|
|
match __symbols.pop() {
|
|
|
|
Some((__l, __Symbol::Variant2(__v), __r)) => (__l, __v, __r),
|
|
|
|
_ => __symbol_type_mismatch()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fn __pop_Variant4<
|
2021-12-16 22:24:31 +00:00
|
|
|
'input,
|
|
|
|
>(
|
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>
|
|
|
|
) -> (usize, f64, usize)
|
2021-12-16 18:23:02 +00:00
|
|
|
{
|
|
|
|
match __symbols.pop() {
|
2021-12-17 02:57:20 +00:00
|
|
|
Some((__l, __Symbol::Variant4(__v), __r)) => (__l, __v, __r),
|
2021-12-16 18:23:02 +00:00
|
|
|
_ => __symbol_type_mismatch()
|
|
|
|
}
|
|
|
|
}
|
2021-12-16 20:30:28 +00:00
|
|
|
fn __pop_Variant0<
|
|
|
|
'input,
|
2021-12-16 18:23:02 +00:00
|
|
|
>(
|
2021-12-16 20:30:28 +00:00
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>
|
|
|
|
) -> (usize, &'input str, usize)
|
2021-12-16 18:23:02 +00:00
|
|
|
{
|
|
|
|
match __symbols.pop() {
|
2021-12-16 20:30:28 +00:00
|
|
|
Some((__l, __Symbol::Variant0(__v), __r)) => (__l, __v, __r),
|
2021-12-16 18:23:02 +00:00
|
|
|
_ => __symbol_type_mismatch()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pub(crate) fn __reduce0<
|
2021-12-16 20:30:28 +00:00
|
|
|
'input,
|
2021-12-16 18:23:02 +00:00
|
|
|
's,
|
|
|
|
>(
|
2021-12-16 20:30:28 +00:00
|
|
|
input: &'input str,
|
2021-12-16 18:23:02 +00:00
|
|
|
__lookahead_start: Option<&usize>,
|
2021-12-16 20:30:28 +00:00
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>,
|
|
|
|
_: core::marker::PhantomData<(&'input (), &'s ())>,
|
2021-12-16 18:23:02 +00:00
|
|
|
) -> (usize, usize)
|
|
|
|
{
|
2021-12-17 02:57:20 +00:00
|
|
|
// BTree = Box<Tree> => ActionFn(5);
|
|
|
|
let __sym0 = __pop_Variant1(__symbols);
|
2021-12-16 18:23:02 +00:00
|
|
|
let __start = __sym0.0.clone();
|
2021-12-16 22:24:31 +00:00
|
|
|
let __end = __sym0.2.clone();
|
2021-12-17 02:57:20 +00:00
|
|
|
let __nt = super::__action5::<>(input, __sym0);
|
2021-12-16 20:30:28 +00:00
|
|
|
__symbols.push((__start, __Symbol::Variant1(__nt), __end));
|
2021-12-16 22:24:31 +00:00
|
|
|
(1, 0)
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
pub(crate) fn __reduce1<
|
2021-12-16 20:30:28 +00:00
|
|
|
'input,
|
2021-12-16 18:23:02 +00:00
|
|
|
's,
|
|
|
|
>(
|
2021-12-16 20:30:28 +00:00
|
|
|
input: &'input str,
|
2021-12-16 18:23:02 +00:00
|
|
|
__lookahead_start: Option<&usize>,
|
2021-12-16 20:30:28 +00:00
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>,
|
|
|
|
_: core::marker::PhantomData<(&'input (), &'s ())>,
|
2021-12-16 18:23:02 +00:00
|
|
|
) -> (usize, usize)
|
|
|
|
{
|
2021-12-17 02:57:20 +00:00
|
|
|
// Bool = "#t" => ActionFn(11);
|
|
|
|
let __sym0 = __pop_Variant0(__symbols);
|
2021-12-16 18:23:02 +00:00
|
|
|
let __start = __sym0.0.clone();
|
2021-12-16 22:24:31 +00:00
|
|
|
let __end = __sym0.2.clone();
|
2021-12-17 02:57:20 +00:00
|
|
|
let __nt = super::__action11::<>(input, __sym0);
|
2021-12-16 23:15:31 +00:00
|
|
|
__symbols.push((__start, __Symbol::Variant2(__nt), __end));
|
|
|
|
(1, 1)
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
pub(crate) fn __reduce2<
|
2021-12-16 20:30:28 +00:00
|
|
|
'input,
|
2021-12-16 18:23:02 +00:00
|
|
|
's,
|
|
|
|
>(
|
2021-12-16 20:30:28 +00:00
|
|
|
input: &'input str,
|
2021-12-16 18:23:02 +00:00
|
|
|
__lookahead_start: Option<&usize>,
|
2021-12-16 20:30:28 +00:00
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>,
|
|
|
|
_: core::marker::PhantomData<(&'input (), &'s ())>,
|
2021-12-16 18:23:02 +00:00
|
|
|
) -> (usize, usize)
|
|
|
|
{
|
2021-12-17 02:57:20 +00:00
|
|
|
// Bool = "#f" => ActionFn(12);
|
|
|
|
let __sym0 = __pop_Variant0(__symbols);
|
2021-12-16 20:30:28 +00:00
|
|
|
let __start = __sym0.0.clone();
|
2021-12-16 22:24:31 +00:00
|
|
|
let __end = __sym0.2.clone();
|
2021-12-17 02:57:20 +00:00
|
|
|
let __nt = super::__action12::<>(input, __sym0);
|
2021-12-16 22:24:31 +00:00
|
|
|
__symbols.push((__start, __Symbol::Variant2(__nt), __end));
|
|
|
|
(1, 1)
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
pub(crate) fn __reduce3<
|
2021-12-16 20:30:28 +00:00
|
|
|
'input,
|
2021-12-16 18:23:02 +00:00
|
|
|
's,
|
|
|
|
>(
|
2021-12-16 20:30:28 +00:00
|
|
|
input: &'input str,
|
2021-12-16 18:23:02 +00:00
|
|
|
__lookahead_start: Option<&usize>,
|
2021-12-16 20:30:28 +00:00
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>,
|
|
|
|
_: core::marker::PhantomData<(&'input (), &'s ())>,
|
2021-12-16 18:23:02 +00:00
|
|
|
) -> (usize, usize)
|
|
|
|
{
|
2021-12-17 02:57:20 +00:00
|
|
|
// Box<Tree> = Tree => ActionFn(13);
|
|
|
|
let __sym0 = __pop_Variant6(__symbols);
|
2021-12-16 18:23:02 +00:00
|
|
|
let __start = __sym0.0.clone();
|
2021-12-16 22:24:31 +00:00
|
|
|
let __end = __sym0.2.clone();
|
2021-12-17 02:57:20 +00:00
|
|
|
let __nt = super::__action13::<>(input, __sym0);
|
|
|
|
__symbols.push((__start, __Symbol::Variant1(__nt), __end));
|
2021-12-16 22:24:31 +00:00
|
|
|
(1, 2)
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
pub(crate) fn __reduce4<
|
2021-12-16 20:30:28 +00:00
|
|
|
'input,
|
2021-12-16 18:23:02 +00:00
|
|
|
's,
|
|
|
|
>(
|
2021-12-16 20:30:28 +00:00
|
|
|
input: &'input str,
|
2021-12-16 18:23:02 +00:00
|
|
|
__lookahead_start: Option<&usize>,
|
2021-12-16 20:30:28 +00:00
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>,
|
|
|
|
_: core::marker::PhantomData<(&'input (), &'s ())>,
|
2021-12-16 18:23:02 +00:00
|
|
|
) -> (usize, usize)
|
2021-12-16 23:15:31 +00:00
|
|
|
{
|
2021-12-17 02:57:20 +00:00
|
|
|
// Literal = Sym => ActionFn(6);
|
|
|
|
let __sym0 = __pop_Variant5(__symbols);
|
2021-12-16 23:15:31 +00:00
|
|
|
let __start = __sym0.0.clone();
|
|
|
|
let __end = __sym0.2.clone();
|
|
|
|
let __nt = super::__action6::<>(input, __sym0);
|
2021-12-17 02:57:20 +00:00
|
|
|
__symbols.push((__start, __Symbol::Variant3(__nt), __end));
|
2021-12-16 23:15:31 +00:00
|
|
|
(1, 3)
|
|
|
|
}
|
|
|
|
pub(crate) fn __reduce5<
|
|
|
|
'input,
|
|
|
|
's,
|
|
|
|
>(
|
|
|
|
input: &'input str,
|
|
|
|
__lookahead_start: Option<&usize>,
|
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>,
|
|
|
|
_: core::marker::PhantomData<(&'input (), &'s ())>,
|
|
|
|
) -> (usize, usize)
|
2021-12-17 02:57:20 +00:00
|
|
|
{
|
|
|
|
// Literal = Num => ActionFn(7);
|
|
|
|
let __sym0 = __pop_Variant4(__symbols);
|
|
|
|
let __start = __sym0.0.clone();
|
|
|
|
let __end = __sym0.2.clone();
|
|
|
|
let __nt = super::__action7::<>(input, __sym0);
|
|
|
|
__symbols.push((__start, __Symbol::Variant3(__nt), __end));
|
|
|
|
(1, 3)
|
|
|
|
}
|
|
|
|
pub(crate) fn __reduce6<
|
|
|
|
'input,
|
|
|
|
's,
|
|
|
|
>(
|
|
|
|
input: &'input str,
|
|
|
|
__lookahead_start: Option<&usize>,
|
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>,
|
|
|
|
_: core::marker::PhantomData<(&'input (), &'s ())>,
|
|
|
|
) -> (usize, usize)
|
|
|
|
{
|
|
|
|
// Literal = Bool => ActionFn(8);
|
|
|
|
let __sym0 = __pop_Variant2(__symbols);
|
|
|
|
let __start = __sym0.0.clone();
|
|
|
|
let __end = __sym0.2.clone();
|
|
|
|
let __nt = super::__action8::<>(input, __sym0);
|
|
|
|
__symbols.push((__start, __Symbol::Variant3(__nt), __end));
|
|
|
|
(1, 3)
|
|
|
|
}
|
|
|
|
pub(crate) fn __reduce7<
|
|
|
|
'input,
|
|
|
|
's,
|
|
|
|
>(
|
|
|
|
input: &'input str,
|
|
|
|
__lookahead_start: Option<&usize>,
|
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>,
|
|
|
|
_: core::marker::PhantomData<(&'input (), &'s ())>,
|
|
|
|
) -> (usize, usize)
|
|
|
|
{
|
|
|
|
// Num = r#"[0-9]+(\\.[0-9]+)?"# => ActionFn(10);
|
|
|
|
let __sym0 = __pop_Variant0(__symbols);
|
|
|
|
let __start = __sym0.0.clone();
|
|
|
|
let __end = __sym0.2.clone();
|
|
|
|
let __nt = super::__action10::<>(input, __sym0);
|
|
|
|
__symbols.push((__start, __Symbol::Variant4(__nt), __end));
|
|
|
|
(1, 4)
|
|
|
|
}
|
|
|
|
pub(crate) fn __reduce8<
|
|
|
|
'input,
|
|
|
|
's,
|
|
|
|
>(
|
|
|
|
input: &'input str,
|
|
|
|
__lookahead_start: Option<&usize>,
|
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>,
|
|
|
|
_: core::marker::PhantomData<(&'input (), &'s ())>,
|
|
|
|
) -> (usize, usize)
|
|
|
|
{
|
|
|
|
// Sym = r#"[A-Za-z!$%&*+\\-./:<=>?@^_~][A-Za-z!$%&*+\\-./:<=>?@^_~0-9]*"# => ActionFn(9);
|
|
|
|
let __sym0 = __pop_Variant0(__symbols);
|
|
|
|
let __start = __sym0.0.clone();
|
|
|
|
let __end = __sym0.2.clone();
|
|
|
|
let __nt = super::__action9::<>(input, __sym0);
|
|
|
|
__symbols.push((__start, __Symbol::Variant5(__nt), __end));
|
|
|
|
(1, 5)
|
|
|
|
}
|
|
|
|
pub(crate) fn __reduce9<
|
|
|
|
'input,
|
|
|
|
's,
|
|
|
|
>(
|
|
|
|
input: &'input str,
|
|
|
|
__lookahead_start: Option<&usize>,
|
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>,
|
|
|
|
_: core::marker::PhantomData<(&'input (), &'s ())>,
|
|
|
|
) -> (usize, usize)
|
2021-12-16 18:23:02 +00:00
|
|
|
{
|
2021-12-16 22:24:31 +00:00
|
|
|
// Tree = "(", Tree+, ")" => ActionFn(1);
|
|
|
|
assert!(__symbols.len() >= 3);
|
|
|
|
let __sym2 = __pop_Variant0(__symbols);
|
2021-12-17 02:57:20 +00:00
|
|
|
let __sym1 = __pop_Variant7(__symbols);
|
2021-12-16 20:30:28 +00:00
|
|
|
let __sym0 = __pop_Variant0(__symbols);
|
2021-12-16 18:23:02 +00:00
|
|
|
let __start = __sym0.0.clone();
|
2021-12-16 22:24:31 +00:00
|
|
|
let __end = __sym2.2.clone();
|
|
|
|
let __nt = super::__action1::<>(input, __sym0, __sym1, __sym2);
|
2021-12-17 02:57:20 +00:00
|
|
|
__symbols.push((__start, __Symbol::Variant6(__nt), __end));
|
|
|
|
(3, 6)
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
2021-12-17 02:57:20 +00:00
|
|
|
pub(crate) fn __reduce10<
|
2021-12-16 20:30:28 +00:00
|
|
|
'input,
|
2021-12-16 18:23:02 +00:00
|
|
|
's,
|
|
|
|
>(
|
2021-12-16 20:30:28 +00:00
|
|
|
input: &'input str,
|
2021-12-16 18:23:02 +00:00
|
|
|
__lookahead_start: Option<&usize>,
|
2021-12-16 20:30:28 +00:00
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>,
|
|
|
|
_: core::marker::PhantomData<(&'input (), &'s ())>,
|
2021-12-16 18:23:02 +00:00
|
|
|
) -> (usize, usize)
|
|
|
|
{
|
2021-12-17 02:57:20 +00:00
|
|
|
// Tree = "(", "define", Sym, BTree, ")" => ActionFn(2);
|
2021-12-16 23:15:31 +00:00
|
|
|
assert!(__symbols.len() >= 5);
|
|
|
|
let __sym4 = __pop_Variant0(__symbols);
|
|
|
|
let __sym3 = __pop_Variant1(__symbols);
|
2021-12-17 02:57:20 +00:00
|
|
|
let __sym2 = __pop_Variant5(__symbols);
|
2021-12-16 23:15:31 +00:00
|
|
|
let __sym1 = __pop_Variant0(__symbols);
|
|
|
|
let __sym0 = __pop_Variant0(__symbols);
|
2021-12-16 18:23:02 +00:00
|
|
|
let __start = __sym0.0.clone();
|
2021-12-16 23:15:31 +00:00
|
|
|
let __end = __sym4.2.clone();
|
|
|
|
let __nt = super::__action2::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4);
|
2021-12-17 02:57:20 +00:00
|
|
|
__symbols.push((__start, __Symbol::Variant6(__nt), __end));
|
|
|
|
(5, 6)
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
2021-12-17 02:57:20 +00:00
|
|
|
pub(crate) fn __reduce11<
|
2021-12-16 20:30:28 +00:00
|
|
|
'input,
|
2021-12-16 18:23:02 +00:00
|
|
|
's,
|
|
|
|
>(
|
2021-12-16 20:30:28 +00:00
|
|
|
input: &'input str,
|
2021-12-16 18:23:02 +00:00
|
|
|
__lookahead_start: Option<&usize>,
|
2021-12-16 20:30:28 +00:00
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>,
|
|
|
|
_: core::marker::PhantomData<(&'input (), &'s ())>,
|
2021-12-16 18:23:02 +00:00
|
|
|
) -> (usize, usize)
|
|
|
|
{
|
2021-12-17 02:57:20 +00:00
|
|
|
// Tree = "(", "if", Tree, Tree, Tree, ")" => ActionFn(3);
|
|
|
|
assert!(__symbols.len() >= 6);
|
|
|
|
let __sym5 = __pop_Variant0(__symbols);
|
|
|
|
let __sym4 = __pop_Variant6(__symbols);
|
|
|
|
let __sym3 = __pop_Variant6(__symbols);
|
|
|
|
let __sym2 = __pop_Variant6(__symbols);
|
|
|
|
let __sym1 = __pop_Variant0(__symbols);
|
|
|
|
let __sym0 = __pop_Variant0(__symbols);
|
2021-12-16 20:30:28 +00:00
|
|
|
let __start = __sym0.0.clone();
|
2021-12-17 02:57:20 +00:00
|
|
|
let __end = __sym5.2.clone();
|
|
|
|
let __nt = super::__action3::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5);
|
|
|
|
__symbols.push((__start, __Symbol::Variant6(__nt), __end));
|
|
|
|
(6, 6)
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
2021-12-17 02:57:20 +00:00
|
|
|
pub(crate) fn __reduce12<
|
2021-12-16 20:30:28 +00:00
|
|
|
'input,
|
2021-12-16 18:23:02 +00:00
|
|
|
's,
|
|
|
|
>(
|
2021-12-16 20:30:28 +00:00
|
|
|
input: &'input str,
|
2021-12-16 18:23:02 +00:00
|
|
|
__lookahead_start: Option<&usize>,
|
2021-12-16 20:30:28 +00:00
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>,
|
|
|
|
_: core::marker::PhantomData<(&'input (), &'s ())>,
|
2021-12-16 18:23:02 +00:00
|
|
|
) -> (usize, usize)
|
|
|
|
{
|
2021-12-17 02:57:20 +00:00
|
|
|
// Tree = Literal => ActionFn(4);
|
|
|
|
let __sym0 = __pop_Variant3(__symbols);
|
2021-12-16 18:23:02 +00:00
|
|
|
let __start = __sym0.0.clone();
|
2021-12-16 23:15:31 +00:00
|
|
|
let __end = __sym0.2.clone();
|
2021-12-17 02:57:20 +00:00
|
|
|
let __nt = super::__action4::<>(input, __sym0);
|
2021-12-16 23:15:31 +00:00
|
|
|
__symbols.push((__start, __Symbol::Variant6(__nt), __end));
|
2021-12-17 02:57:20 +00:00
|
|
|
(1, 6)
|
2021-12-16 23:15:31 +00:00
|
|
|
}
|
2021-12-17 02:57:20 +00:00
|
|
|
pub(crate) fn __reduce13<
|
2021-12-16 23:15:31 +00:00
|
|
|
'input,
|
|
|
|
's,
|
|
|
|
>(
|
|
|
|
input: &'input str,
|
|
|
|
__lookahead_start: Option<&usize>,
|
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>,
|
|
|
|
_: core::marker::PhantomData<(&'input (), &'s ())>,
|
|
|
|
) -> (usize, usize)
|
|
|
|
{
|
2021-12-17 02:57:20 +00:00
|
|
|
// Tree+ = Tree => ActionFn(14);
|
2021-12-16 23:15:31 +00:00
|
|
|
let __sym0 = __pop_Variant6(__symbols);
|
|
|
|
let __start = __sym0.0.clone();
|
2021-12-17 02:57:20 +00:00
|
|
|
let __end = __sym0.2.clone();
|
|
|
|
let __nt = super::__action14::<>(input, __sym0);
|
|
|
|
__symbols.push((__start, __Symbol::Variant7(__nt), __end));
|
|
|
|
(1, 7)
|
|
|
|
}
|
|
|
|
pub(crate) fn __reduce14<
|
|
|
|
'input,
|
|
|
|
's,
|
|
|
|
>(
|
|
|
|
input: &'input str,
|
|
|
|
__lookahead_start: Option<&usize>,
|
|
|
|
__symbols: &mut alloc::vec::Vec<(usize,__Symbol<'input>,usize)>,
|
|
|
|
_: core::marker::PhantomData<(&'input (), &'s ())>,
|
|
|
|
) -> (usize, usize)
|
|
|
|
{
|
|
|
|
// Tree+ = Tree+, Tree => ActionFn(15);
|
|
|
|
assert!(__symbols.len() >= 2);
|
|
|
|
let __sym1 = __pop_Variant6(__symbols);
|
|
|
|
let __sym0 = __pop_Variant7(__symbols);
|
|
|
|
let __start = __sym0.0.clone();
|
2021-12-16 20:30:28 +00:00
|
|
|
let __end = __sym1.2.clone();
|
2021-12-17 02:57:20 +00:00
|
|
|
let __nt = super::__action15::<>(input, __sym0, __sym1);
|
|
|
|
__symbols.push((__start, __Symbol::Variant7(__nt), __end));
|
|
|
|
(2, 7)
|
2021-12-16 20:30:28 +00:00
|
|
|
}
|
|
|
|
}
|
2021-12-16 22:24:31 +00:00
|
|
|
pub(crate) use self::__parse__Tree::TreeParser;
|
2021-12-16 20:30:28 +00:00
|
|
|
#[cfg_attr(rustfmt, rustfmt_skip)]
|
|
|
|
mod __intern_token {
|
|
|
|
#![allow(unused_imports)]
|
2021-12-16 22:24:31 +00:00
|
|
|
use crate::{Tree, Literal};
|
2021-12-16 20:30:28 +00:00
|
|
|
#[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]+(\\.[0-9]+)?)", false),
|
2021-12-16 22:24:31 +00:00
|
|
|
("^([!\\$-\\&\\*-\\+\\--/:<-Z\\^-_a-z\\~][!\\$-\\&\\*-\\+\\--:<-Z\\^-_a-z\\~]*)", false),
|
2021-12-17 02:57:20 +00:00
|
|
|
("^(\\#f)", false),
|
|
|
|
("^(\\#t)", false),
|
2021-12-16 20:30:28 +00:00
|
|
|
("^(\\()", false),
|
|
|
|
("^(\\))", false),
|
2021-12-16 23:15:31 +00:00
|
|
|
("^(define)", false),
|
2021-12-17 02:57:20 +00:00
|
|
|
("^(if)", false),
|
2021-12-16 20:30:28 +00:00
|
|
|
(r"^(\s*)", true),
|
|
|
|
];
|
|
|
|
__lalrpop_util::lexer::MatcherBuilder::new(__strs.iter().copied()).unwrap()
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
}
|
2021-12-16 20:30:28 +00:00
|
|
|
pub(crate) use self::__lalrpop_util::lexer::Token;
|
2021-12-16 18:23:02 +00:00
|
|
|
|
2021-12-16 20:30:28 +00:00
|
|
|
#[allow(unused_variables)]
|
2021-12-16 23:15:31 +00:00
|
|
|
fn __action0<
|
|
|
|
'input,
|
|
|
|
's,
|
|
|
|
>(
|
|
|
|
input: &'input str,
|
|
|
|
(_, __0, _): (usize, Tree, usize),
|
|
|
|
) -> Tree
|
|
|
|
{
|
2021-12-16 18:23:02 +00:00
|
|
|
__0
|
|
|
|
}
|
|
|
|
|
2021-12-16 20:30:28 +00:00
|
|
|
#[allow(unused_variables)]
|
2021-12-16 23:15:31 +00:00
|
|
|
fn __action1<
|
|
|
|
'input,
|
|
|
|
's,
|
|
|
|
>(
|
2021-12-16 20:30:28 +00:00
|
|
|
input: &'input str,
|
|
|
|
(_, _, _): (usize, &'input str, usize),
|
|
|
|
(_, __0, _): (usize, alloc::vec::Vec<Tree>, usize),
|
|
|
|
(_, _, _): (usize, &'input str, usize),
|
2021-12-16 23:15:31 +00:00
|
|
|
) -> Tree
|
|
|
|
{
|
2021-12-16 22:24:31 +00:00
|
|
|
Tree::Branch(__0)
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
|
2021-12-16 20:30:28 +00:00
|
|
|
#[allow(unused_variables)]
|
2021-12-16 23:15:31 +00:00
|
|
|
fn __action2<
|
|
|
|
'input,
|
|
|
|
's,
|
|
|
|
>(
|
|
|
|
input: &'input str,
|
|
|
|
(_, _, _): (usize, &'input str, usize),
|
|
|
|
(_, _, _): (usize, &'input str, usize),
|
|
|
|
(_, __0, _): (usize, String, usize),
|
|
|
|
(_, __1, _): (usize, Box<Tree>, usize),
|
|
|
|
(_, _, _): (usize, &'input str, usize),
|
|
|
|
) -> Tree
|
|
|
|
{
|
|
|
|
Tree::Define(__0, __1)
|
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(unused_variables)]
|
|
|
|
fn __action3<
|
|
|
|
'input,
|
|
|
|
's,
|
2021-12-17 02:57:20 +00:00
|
|
|
>(
|
|
|
|
input: &'input str,
|
|
|
|
(_, _, _): (usize, &'input str, usize),
|
|
|
|
(_, _, _): (usize, &'input str, usize),
|
|
|
|
(_, __0, _): (usize, Tree, usize),
|
|
|
|
(_, __1, _): (usize, Tree, usize),
|
|
|
|
(_, __2, _): (usize, Tree, usize),
|
|
|
|
(_, _, _): (usize, &'input str, usize),
|
|
|
|
) -> Tree
|
|
|
|
{
|
|
|
|
Tree::If(Box::new([__0, __1, __2]))
|
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(unused_variables)]
|
|
|
|
fn __action4<
|
|
|
|
'input,
|
|
|
|
's,
|
2021-12-16 23:15:31 +00:00
|
|
|
>(
|
|
|
|
input: &'input str,
|
|
|
|
(_, __0, _): (usize, Literal, usize),
|
|
|
|
) -> Tree
|
|
|
|
{
|
2021-12-16 22:24:31 +00:00
|
|
|
Tree::Leaf(__0)
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
|
2021-12-16 20:30:28 +00:00
|
|
|
#[allow(unused_variables)]
|
2021-12-17 02:57:20 +00:00
|
|
|
fn __action5<
|
|
|
|
'input,
|
|
|
|
's,
|
|
|
|
>(
|
|
|
|
input: &'input str,
|
|
|
|
(_, __0, _): (usize, Box<Tree>, usize),
|
|
|
|
) -> Box<Tree>
|
|
|
|
{
|
|
|
|
__0
|
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(unused_variables)]
|
|
|
|
fn __action6<
|
2021-12-16 23:15:31 +00:00
|
|
|
'input,
|
|
|
|
's,
|
|
|
|
>(
|
|
|
|
input: &'input str,
|
|
|
|
(_, __0, _): (usize, String, usize),
|
|
|
|
) -> Literal
|
|
|
|
{
|
2021-12-16 22:24:31 +00:00
|
|
|
Literal::Sym(__0)
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
|
2021-12-16 20:30:28 +00:00
|
|
|
#[allow(unused_variables)]
|
2021-12-17 02:57:20 +00:00
|
|
|
fn __action7<
|
2021-12-16 23:15:31 +00:00
|
|
|
'input,
|
|
|
|
's,
|
|
|
|
>(
|
|
|
|
input: &'input str,
|
|
|
|
(_, __0, _): (usize, f64, usize),
|
|
|
|
) -> Literal
|
|
|
|
{
|
2021-12-16 22:24:31 +00:00
|
|
|
Literal::Num(__0)
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
|
2021-12-16 20:30:28 +00:00
|
|
|
#[allow(unused_variables)]
|
2021-12-17 02:57:20 +00:00
|
|
|
fn __action8<
|
|
|
|
'input,
|
|
|
|
's,
|
|
|
|
>(
|
|
|
|
input: &'input str,
|
|
|
|
(_, __0, _): (usize, bool, usize),
|
|
|
|
) -> Literal
|
|
|
|
{
|
|
|
|
Literal::Bool(__0)
|
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(unused_variables)]
|
|
|
|
fn __action9<
|
2021-12-16 23:15:31 +00:00
|
|
|
'input,
|
|
|
|
's,
|
|
|
|
>(
|
|
|
|
input: &'input str,
|
|
|
|
(_, __0, _): (usize, &'input str, usize),
|
|
|
|
) -> String
|
|
|
|
{
|
2021-12-16 22:24:31 +00:00
|
|
|
__0.to_owned()
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
|
2021-12-16 20:30:28 +00:00
|
|
|
#[allow(unused_variables)]
|
2021-12-17 02:57:20 +00:00
|
|
|
fn __action10<
|
2021-12-16 23:15:31 +00:00
|
|
|
'input,
|
|
|
|
's,
|
|
|
|
>(
|
|
|
|
input: &'input str,
|
|
|
|
(_, __0, _): (usize, &'input str, usize),
|
|
|
|
) -> f64
|
|
|
|
{
|
2021-12-16 22:24:31 +00:00
|
|
|
__0.parse().unwrap()
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
|
2021-12-16 20:30:28 +00:00
|
|
|
#[allow(unused_variables)]
|
2021-12-17 02:57:20 +00:00
|
|
|
fn __action11<
|
|
|
|
'input,
|
|
|
|
's,
|
|
|
|
>(
|
|
|
|
input: &'input str,
|
|
|
|
(_, __0, _): (usize, &'input str, usize),
|
|
|
|
) -> bool
|
|
|
|
{
|
|
|
|
true
|
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(unused_variables)]
|
|
|
|
fn __action12<
|
|
|
|
'input,
|
|
|
|
's,
|
|
|
|
>(
|
|
|
|
input: &'input str,
|
|
|
|
(_, __0, _): (usize, &'input str, usize),
|
|
|
|
) -> bool
|
|
|
|
{
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(unused_variables)]
|
|
|
|
fn __action13<
|
2021-12-16 23:15:31 +00:00
|
|
|
'input,
|
|
|
|
's,
|
|
|
|
>(
|
|
|
|
input: &'input str,
|
|
|
|
(_, __0, _): (usize, Tree, usize),
|
|
|
|
) -> Box<Tree>
|
|
|
|
{
|
|
|
|
Box::new(__0)
|
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(unused_variables)]
|
2021-12-17 02:57:20 +00:00
|
|
|
fn __action14<
|
2021-12-16 23:15:31 +00:00
|
|
|
'input,
|
|
|
|
's,
|
|
|
|
>(
|
2021-12-16 20:30:28 +00:00
|
|
|
input: &'input str,
|
2021-12-16 22:24:31 +00:00
|
|
|
(_, __0, _): (usize, Tree, usize),
|
2021-12-16 23:15:31 +00:00
|
|
|
) -> alloc::vec::Vec<Tree>
|
|
|
|
{
|
2021-12-16 22:24:31 +00:00
|
|
|
alloc::vec![__0]
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
|
2021-12-16 20:30:28 +00:00
|
|
|
#[allow(unused_variables)]
|
2021-12-17 02:57:20 +00:00
|
|
|
fn __action15<
|
2021-12-16 23:15:31 +00:00
|
|
|
'input,
|
|
|
|
's,
|
|
|
|
>(
|
2021-12-16 20:30:28 +00:00
|
|
|
input: &'input str,
|
|
|
|
(_, v, _): (usize, alloc::vec::Vec<Tree>, usize),
|
2021-12-16 22:24:31 +00:00
|
|
|
(_, e, _): (usize, Tree, usize),
|
2021-12-16 23:15:31 +00:00
|
|
|
) -> alloc::vec::Vec<Tree>
|
|
|
|
{
|
|
|
|
{ let mut v = v; v.push(e); v }
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
|
2021-12-16 23:15:31 +00:00
|
|
|
pub trait __ToTriple<'input, 's, > {
|
|
|
|
fn to_triple(value: Self) -> Result<(usize,Token<'input>,usize), __lalrpop_util::ParseError<usize, Token<'input>, &'static str>>;
|
2021-12-16 18:23:02 +00:00
|
|
|
}
|
|
|
|
|
2021-12-16 23:15:31 +00:00
|
|
|
impl<'input, 's, > __ToTriple<'input, 's, > for (usize, Token<'input>, usize) {
|
|
|
|
fn to_triple(value: Self) -> Result<(usize,Token<'input>,usize), __lalrpop_util::ParseError<usize, Token<'input>, &'static str>> {
|
2021-12-16 18:23:02 +00:00
|
|
|
Ok(value)
|
|
|
|
}
|
|
|
|
}
|
2021-12-16 23:15:31 +00:00
|
|
|
impl<'input, 's, > __ToTriple<'input, 's, > for Result<(usize, Token<'input>, usize), &'static str> {
|
|
|
|
fn to_triple(value: Self) -> Result<(usize,Token<'input>,usize), __lalrpop_util::ParseError<usize, Token<'input>, &'static str>> {
|
2021-12-16 18:23:02 +00:00
|
|
|
match value {
|
|
|
|
Ok(v) => Ok(v),
|
|
|
|
Err(error) => Err(__lalrpop_util::ParseError::User { error }),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|