//from scientific_names.lalrpop | |
// parse the final noun of a scientific name. | |
// match it to one of the legal final nouns. | |
pub FinalNoun : FinalNoun = { | |
"kablooie" => FinalNoun::Kablooie, | |
"swoosh" => FinalNoun::Swoosh, | |
"frobber" => FinalNoun::Frobber, | |
"atomizer" => FinalNoun::Atomizer, | |
"event" => FinalNoun::Event, | |
"device" => FinalNoun::Device, | |
}; | |
// this is a simple enumerated type | |
// it's basically a list of legal values | |
// it derives from std traits that allow it to be | |
// copied around and compared. | |
#[derive(Debug, Copy, Clone, PartialEq)] | |
pub enum FinalNoun { | |
Kablooie, | |
Swoosh, | |
Frobber, | |
Atomizer, | |
Event, | |
Device | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment