aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/lex.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/lex.rs')
-rw-r--r--src/frontend/lex.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/frontend/lex.rs b/src/frontend/lex.rs
index a51b21d..67c4ae3 100644
--- a/src/frontend/lex.rs
+++ b/src/frontend/lex.rs
@@ -54,15 +54,15 @@ pub enum Literal {
pub enum Keyword {
Pub, Let, Var, Const,
Func, Macro, Type,
- Mod, From, Import,
+ Mod, Use, As,
For, While, Loop,
Block, Static,
- If, When, Elif, Else, Match,
+ If, When, Elif, Else, Match, Where,
Try, Catch, Finally,
Struct, Tuple, Enum, Union, Interface,
Distinct, Ref, Ptr, Mut,
Break, Continue, Return,
- In, Is, Of, As,
+ In, Is, Of,
}
/// All punctuation recognized by the lexer.
@@ -272,9 +272,9 @@ pub fn tokenize(input: &str) -> Result<TokenStream> {
"func" => res.push(Key(Func)),
"macro" => res.push(Key(Macro)),
"type" => res.push(Key(Type)),
- "mod" => res.push(Key(Mod)),
- "from" => res.push(Key(From)),
- "import" => res.push(Key(Import)),
+ "mod" => res.push(Key(Mod)),
+ "use" => res.push(Key(Use)),
+ "as" => res.push(Key(As)),
"for" => res.push(Key(For)),
"while" => res.push(Key(While)),
"loop" => res.push(Key(Loop)),
@@ -285,6 +285,7 @@ pub fn tokenize(input: &str) -> Result<TokenStream> {
"elif" => res.push(Key(Elif)),
"else" => res.push(Key(Else)),
"match" => res.push(Key(Match)),
+ "where" => res.push(Key(Where)),
"try" => res.push(Key(Try)),
"catch" => res.push(Key(Catch)),
"finally" => res.push(Key(Finally)),
@@ -303,7 +304,6 @@ pub fn tokenize(input: &str) -> Result<TokenStream> {
"in" => res.push(Key(In)),
"is" => res.push(Key(Is)),
"of" => res.push(Key(Of)),
- "as" => res.push(Key(As)),
_ => res.push(Word(String::from(&buf)))
}
match x { // () and [] denote both parameters/generics and tuples/arrays
@@ -470,8 +470,8 @@ impl std::fmt::Display for Keyword {
Macro => write!(f, "macro"),
Type => write!(f, "type"),
Mod => write!(f, "mod"),
- From => write!(f, "from"),
- Import => write!(f, "import"),
+ Use => write!(f, "use"),
+ As => write!(f, "as"),
For => write!(f, "for"),
While => write!(f, "while"),
Loop => write!(f, "loop"),
@@ -482,6 +482,7 @@ impl std::fmt::Display for Keyword {
Elif => write!(f, "elif"),
Else => write!(f, "else"),
Match => write!(f, "match"),
+ Where => write!(f, "where"),
Try => write!(f, "try"),
Catch => write!(f, "catch"),
Finally => write!(f, "finally"),
@@ -500,7 +501,6 @@ impl std::fmt::Display for Keyword {
In => write!(f, "in"),
Is => write!(f, "is"),
Of => write!(f, "of"),
- As => write!(f, "as"),
}
}
}