From 753244f5988e70c9403ba9660b8dcf625e927480 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Thu, 18 Jun 2015 05:57:32 -0400 Subject: [PATCH] remove nonce (unused) --- src/grammar/mod.rs | 1 - src/grammar/nonce.rs | 27 --------------------------- 2 files changed, 28 deletions(-) delete mode 100644 src/grammar/nonce.rs diff --git a/src/grammar/mod.rs b/src/grammar/mod.rs index 29bb5cd..f679e36 100644 --- a/src/grammar/mod.rs +++ b/src/grammar/mod.rs @@ -1,6 +1,5 @@ //! The grammar definition. -pub mod nonce; pub mod parse_tree; pub mod repr; // pub mod token; diff --git a/src/grammar/nonce.rs b/src/grammar/nonce.rs deleted file mode 100644 index 89d8f3f..0000000 --- a/src/grammar/nonce.rs +++ /dev/null @@ -1,27 +0,0 @@ -/*! - -A NONCE is just a guaranteed unique identifier. We use it to create -persistent identity for alternatives as we transform the grammar. - -*/ - -use std::cell::Cell; - -thread_local! { - static NONCE: Cell = Cell::new(0) -} - -#[derive(Copy, Clone, PartialEq, Eq, Hash)] -pub struct Nonce { - counter: u32 -} - -impl Nonce { - pub fn new() -> Nonce { - NONCE.with(|counter| { - let c = counter.get(); - counter.set(c.checked_add(1).unwrap()); - Nonce { counter: c } - }) - } -}