diff --git a/fine/src/tokens.rs b/fine/src/tokens.rs index c2bccfb9..6c851f28 100644 --- a/fine/src/tokens.rs +++ b/fine/src/tokens.rs @@ -44,6 +44,7 @@ pub enum TokenKind { Select, This, True, + Use, While, Yield, @@ -326,6 +327,11 @@ impl<'a> Tokens<'a> { return TokenKind::True; } } + 'u' => { + if ident == "use" { + return TokenKind::Use; + } + } 'w' => { if ident == "while" { return TokenKind::While; @@ -535,7 +541,7 @@ mod tests { test_tokens!( more_keywords, - "fun if let print return select this true while truewhile", + "fun if let print return select this true use while truewhile", (0, Fun, "fun"), (4, If, "if"), (7, Let, "let"), @@ -544,8 +550,9 @@ mod tests { (24, Select, "select"), (31, This, "this"), (36, True, "true"), - (41, While, "while"), - (47, Identifier, "truewhile") + (41, Use, "use"), + (45, While, "while"), + (51, Identifier, "truewhile") ); test_tokens!(