Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
named!(left_paren<&[u8], Token>,
do_parse!(tag!("(") >> (Token::LeftParen))
);
named!(right_paren<&[u8], Token>,
do_parse!(tag!(")") >> (Token::RightParen))
);
named!(addition_sign<&[u8], Token>,
do_parse!(tag!("+") >> (Token::Operator(Opcode::Add)))
);
named!(subtraction_sign<&[u8], Token>,
do_parse!(tag!("-") >> (Token::Operator(Opcode::Subtract)))
);
// and several more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.