#![allow(unused)] #![allow(non_snake_case)] #![allow(non_camel_case_types)] #![allow(clippy::all)] // |==========================================================| // | WARNING: THIS FILE IS AUTOMATICALLY GENERATED. | // | CHANGES TO IT WILL BE DELETED WHEN REGENERATED. | // | IN GENERAL, THIS FILE SHOULD NOT BE MODIFIED IN ANY WAY. | // |==========================================================| use super::prelude::*; impl AstNode for Identifier { fn ast_info(&self) -> &M { let Self(meta, ..) = self; meta } fn constructor(&self) -> &'static str { "identifier" } fn sort(&self) -> &'static str { "identifier" } } impl AstNode for Times { fn ast_info(&self) -> &M { match self { Self::Times(meta, ..) => meta, Self::Divide(meta, ..) => meta, Self::Value(meta, ..) => meta, _ => unreachable!(), } } fn constructor(&self) -> &'static str { match self { Self::Times(..) => "times", Self::Divide(..) => "divide", Self::Value(..) => "value", _ => unreachable!(), } } fn sort(&self) -> &'static str { "times" } } impl AstNode for Equality { fn ast_info(&self) -> &M { match self { Self::Equal(meta, ..) => meta, Self::NotEqual(meta, ..) => meta, Self::Inequality(meta, ..) => meta, _ => unreachable!(), } } fn constructor(&self) -> &'static str { match self { Self::Equal(..) => "equal", Self::NotEqual(..) => "not_equal", Self::Inequality(..) => "inequality", _ => unreachable!(), } } fn sort(&self) -> &'static str { "equality" } } impl AstNode for Program { fn ast_info(&self) -> &M { let Self(meta, ..) = self; meta } fn constructor(&self) -> &'static str { "program" } fn sort(&self) -> &'static str { "program" } } impl AstNode for Int { fn ast_info(&self) -> &M { let Self(meta, ..) = self; meta } fn constructor(&self) -> &'static str { "int" } fn sort(&self) -> &'static str { "int" } } impl AstNode for Statement { fn ast_info(&self) -> &M { match self { Self::Expression(meta, ..) => meta, Self::Let(meta, ..) => meta, _ => unreachable!(), } } fn constructor(&self) -> &'static str { match self { Self::Expression(..) => "expression", Self::Let(..) => "let", _ => unreachable!(), } } fn sort(&self) -> &'static str { "statement" } } impl AstNode for Bool { fn ast_info(&self) -> &M { match self { Self::True(meta, ..) => meta, Self::False(meta, ..) => meta, _ => unreachable!(), } } fn constructor(&self) -> &'static str { match self { Self::True(..) => "true", Self::False(..) => "false", _ => unreachable!(), } } fn sort(&self) -> &'static str { "bool" } } impl AstNode for Value { fn ast_info(&self) -> &M { match self { Self::Const(meta, ..) => meta, Self::Call(meta, ..) => meta, Self::Identifier(meta, ..) => meta, Self::Parens(meta, ..) => meta, _ => unreachable!(), } } fn constructor(&self) -> &'static str { match self { Self::Const(..) => "const", Self::Call(..) => "call", Self::Identifier(..) => "identifier", Self::Parens(..) => "parens", _ => unreachable!(), } } fn sort(&self) -> &'static str { "value" } } impl AstNode for Char { fn ast_info(&self) -> &M { let Self(meta, ..) = self; meta } fn constructor(&self) -> &'static str { "char" } fn sort(&self) -> &'static str { "char" } } impl AstNode for Inequality { fn ast_info(&self) -> &M { match self { Self::LessThan(meta, ..) => meta, Self::LessThanOrEqual(meta, ..) => meta, Self::GreaterThan(meta, ..) => meta, Self::GreaterThanOrEqual(meta, ..) => meta, Self::Plus(meta, ..) => meta, _ => unreachable!(), } } fn constructor(&self) -> &'static str { match self { Self::LessThan(..) => "less_than", Self::LessThanOrEqual(..) => "less_than_or_equal", Self::GreaterThan(..) => "greater_than", Self::GreaterThanOrEqual(..) => "greater_than_or_equal", Self::Plus(..) => "plus", _ => unreachable!(), } } fn sort(&self) -> &'static str { "inequality" } } impl AstNode for Expression { fn ast_info(&self) -> &M { let Self(meta, ..) = self; meta } fn constructor(&self) -> &'static str { "equality" } fn sort(&self) -> &'static str { "expression" } } impl AstNode for Call { fn ast_info(&self) -> &M { let Self(meta, ..) = self; meta } fn constructor(&self) -> &'static str { "call" } fn sort(&self) -> &'static str { "call" } } impl AstNode for String { fn ast_info(&self) -> &M { let Self(meta, ..) = self; meta } fn constructor(&self) -> &'static str { "string" } fn sort(&self) -> &'static str { "string" } } impl AstNode for Plus { fn ast_info(&self) -> &M { match self { Self::Plus(meta, ..) => meta, Self::Minus(meta, ..) => meta, Self::Times(meta, ..) => meta, _ => unreachable!(), } } fn constructor(&self) -> &'static str { match self { Self::Plus(..) => "plus", Self::Minus(..) => "minus", Self::Times(..) => "times", _ => unreachable!(), } } fn sort(&self) -> &'static str { "plus" } } impl AstNode for Layout { fn ast_info(&self) -> &M { let Self(meta, ..) = self; meta } fn constructor(&self) -> &'static str { "layout" } fn sort(&self) -> &'static str { "layout" } } impl AstNode for ConstValue { fn ast_info(&self) -> &M { match self { Self::Int(meta, ..) => meta, Self::Bool(meta, ..) => meta, Self::String(meta, ..) => meta, Self::Char(meta, ..) => meta, _ => unreachable!(), } } fn constructor(&self) -> &'static str { match self { Self::Int(..) => "int", Self::Bool(..) => "bool", Self::String(..) => "string", Self::Char(..) => "char", _ => unreachable!(), } } fn sort(&self) -> &'static str { "const_value" } }