From d66fe7ed6ee905ec4e2557cdb1025c0a9061e2bc Mon Sep 17 00:00:00 2001 From: jasonwilliams Date: Wed, 15 Aug 2018 21:04:58 +0100 Subject: [PATCH] macro_rules --- src/lib/syntax/lexer.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/lib/syntax/lexer.rs b/src/lib/syntax/lexer.rs index b0980c058a..c1ed43d090 100644 --- a/src/lib/syntax/lexer.rs +++ b/src/lib/syntax/lexer.rs @@ -7,6 +7,20 @@ use std::str::FromStr; use syntax::ast::punc::Punctuator; use syntax::ast::token::{Token, TokenData}; +#[allow(unused)] +macro_rules! vop { + ($this:ident, $assign_op:expr, $op:expr) => { + let preview = $this.preview_next()?; + match preview { + '=' => { + $this.next()?; + $assign_op; + } + _ => $op, + } + }; +} + // Defining an error type #[derive(Debug, Clone)] pub struct LexerError {