diff --git a/fine/src/tokens.rs b/fine/src/tokens.rs index c4215a7f..36a73ea6 100644 --- a/fine/src/tokens.rs +++ b/fine/src/tokens.rs @@ -40,6 +40,7 @@ pub enum TokenKind { From, Fun, If, + Import, Let, Or, Print, @@ -47,7 +48,6 @@ pub enum TokenKind { Select, This, True, - Use, While, Yield, } @@ -277,6 +277,9 @@ impl<'a> Tokens<'a> { if ident == "if" { return TokenKind::If; } + if ident == "import" { + return TokenKind::Import; + } } 'l' => { if ident == "let" { @@ -311,11 +314,6 @@ impl<'a> Tokens<'a> { return TokenKind::True; } } - 'u' => { - if ident == "use" { - return TokenKind::Use; - } - } 'w' => { if ident == "while" { return TokenKind::While; @@ -533,18 +531,18 @@ mod tests { test_tokens!( more_keywords, - "fun if let print return select this true use while truewhile", + "fun if import let print return select this true while truewhile", (0, Fun, "fun"), (4, If, "if"), - (7, Let, "let"), - (11, Print, "print"), - (17, Return, "return"), - (24, Select, "select"), - (31, This, "this"), - (36, True, "true"), - (41, Use, "use"), - (45, While, "while"), - (51, Identifier, "truewhile") + (7, Import, "import"), + (14, Let, "let"), + (18, Print, "print"), + (24, Return, "return"), + (31, Select, "select"), + (38, This, "this"), + (43, True, "true"), + (48, While, "while"), + (54, Identifier, "truewhile") ); test_tokens!(