Skip to content

Instantly share code, notes, and snippets.

@wraithan
Created November 24, 2015 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wraithan/f6ceb0e72fd0ccabb854 to your computer and use it in GitHub Desktop.
Save wraithan/f6ceb0e72fd0ccabb854 to your computer and use it in GitHub Desktop.
#[derive(Debug,PartialEq,Eq)]
enum Constant {
True,
False,
Zero
}
named!(constants<Constant>, alt!(
tag!("0") => { |_| Constant::Zero}
| tag!("true") => { |_| Constant::True}
| tag!("false") => { |_| Constant::False}
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment