diff --git a/lexer/src/states/begin.rs b/lexer/src/states/begin.rs index 432ba9a..cea8aa5 100644 --- a/lexer/src/states/begin.rs +++ b/lexer/src/states/begin.rs @@ -19,7 +19,7 @@ impl State for Begin { // TODO: Figure out some way to track newlines. c if c.is_whitespace() => StateResult::Continue, c if c.is_identifier_initial() => StateResult::Advance { to: Box::new(IdSub{}) }, - c if c.is_hash() => StateResult::Advance { to: Box::new(Hash{}) }, + c if c.is_hash() => StateResult::Advance { to: Box::new(Hash::new()) }, _ => { let msg = format!("Invalid character: {}", c); StateResult::Fail { msg } diff --git a/lexer/src/states/hash.rs b/lexer/src/states/hash.rs index 53eb0b3..2ff45c3 100644 --- a/lexer/src/states/hash.rs +++ b/lexer/src/states/hash.rs @@ -16,6 +16,10 @@ const FALSE: &'static str = "false"; #[derive(Debug)] pub struct Hash; #[derive(Debug)] pub struct BoolSub(String); +impl Hash { + pub fn new() { Hash{} } +} + impl State for Hash { fn lex(&mut self, c: char) -> StateResult { match c {