lr_parser 0.1.2

macros for ruly2
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use proc_macro::{TokenTree, TokenTree::*};

pub fn get_ident_string(arg: Option<TokenTree>) -> String {
    if let Some(Ident(id)) = arg {
        let s = id.to_string();
        if s.contains("_") {
            panic!("The identifiers are not allowd to contain \"_\"! ({})", s);
        }
        s
    } else {
        panic!()
    }
}