diff options
author | stuebinm | 2021-09-02 23:31:39 +0200 |
---|---|---|
committer | stuebinm | 2021-09-03 00:02:16 +0200 |
commit | ad514f56b6cda288e605c44990ef16d30e6dee53 (patch) | |
tree | bec6de5f4bdabf432c7045394af15ba96f525546 /symbolmacro | |
parent | 715001ba92799839afc97d92c9f0a79924085a69 (diff) |
remove grmtools
the parser using grmtools was way oversized for just doing escape
sequences, and only really existed since I wanted to play around with
it.
The new implementation depends on no external crates, uses just an iter
wrapped into a nicely composable function, and appears to be exactly
equivalent (but faster).
Diffstat (limited to 'symbolmacro')
-rw-r--r-- | symbolmacro/src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/symbolmacro/src/lib.rs b/symbolmacro/src/lib.rs index f99ccd9..636c786 100644 --- a/symbolmacro/src/lib.rs +++ b/symbolmacro/src/lib.rs @@ -39,14 +39,14 @@ pub fn make_symbols(_item: TokenStream) -> TokenStream { let symbols = fetchsymbols(); format!( - "fn symbol(key: &str) -> Option<&'static str> {{ + "fn symbol(key: &str) -> Option<char> {{ match key {{ {} _ => None }} }}", symbols.iter() - .map(|(k,v)| format!("\"{}\" => Some(\"{}\"),",k,v)) + .map(|(k,v)| format!("\"{}\" => Some(\'{}\'),",k,v)) .collect::<Vec<_>>() .join("\n") ).parse().unwrap() |