remove nonce (unused)

This commit is contained in:
Niko Matsakis 2015-06-18 05:57:32 -04:00
parent 8755723e7a
commit 753244f598
2 changed files with 0 additions and 28 deletions

View File

@ -1,6 +1,5 @@
//! The grammar definition.
pub mod nonce;
pub mod parse_tree;
pub mod repr;
// pub mod token;

View File

@ -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<u32> = 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 }
})
}
}