From d235b47bc53344a094b648e0cffd3eb4197f6dba Mon Sep 17 00:00:00 2001 From: greg <greg.shuflin@protonmail.com> Date: Fri, 1 Dec 2017 03:00:42 -0800 Subject: [PATCH] Change Symbol -> Word for token --- src/rukka_lang/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rukka_lang/mod.rs b/src/rukka_lang/mod.rs index 0127635..45778c1 100644 --- a/src/rukka_lang/mod.rs +++ b/src/rukka_lang/mod.rs @@ -58,7 +58,7 @@ fn read(input: &str) -> Result<Vec<Sexp>, String> { enum Token { LParen, RParen, - Symbol(String) + Word(String) } #[derive(Debug)] @@ -90,7 +90,7 @@ fn tokenize(input: &mut Peekable<Chars>) -> Vec<Token> { _ => true } }).collect(); - tokens.push(Symbol(format!("{}{}", c, sym))); + tokens.push(Word(format!("{}{}", c, sym))); } } } @@ -100,7 +100,7 @@ fn tokenize(input: &mut Peekable<Chars>) -> Vec<Token> { fn parse(tokens: &mut Peekable<IntoIter<Token>>) -> Result<Sexp, String> { use self::Token::*; match tokens.next() { - Some(Symbol(s)) => Ok(Sexp::Atom(AtomT::Symbol(s))), + Some(Word(s)) => Ok(Sexp::Atom(AtomT::Symbol(s))), Some(LParen) => parse_sexp(tokens), Some(RParen) => Err(format!("Unexpected ')'")), None => Err(format!("Unexpected end of input")),