[fine] Use -> Import
I don't know what I'm doing
This commit is contained in:
parent
d2d144a5ec
commit
5968fb1f6a
1 changed files with 14 additions and 16 deletions
|
|
@ -40,6 +40,7 @@ pub enum TokenKind {
|
||||||
From,
|
From,
|
||||||
Fun,
|
Fun,
|
||||||
If,
|
If,
|
||||||
|
Import,
|
||||||
Let,
|
Let,
|
||||||
Or,
|
Or,
|
||||||
Print,
|
Print,
|
||||||
|
|
@ -47,7 +48,6 @@ pub enum TokenKind {
|
||||||
Select,
|
Select,
|
||||||
This,
|
This,
|
||||||
True,
|
True,
|
||||||
Use,
|
|
||||||
While,
|
While,
|
||||||
Yield,
|
Yield,
|
||||||
}
|
}
|
||||||
|
|
@ -277,6 +277,9 @@ impl<'a> Tokens<'a> {
|
||||||
if ident == "if" {
|
if ident == "if" {
|
||||||
return TokenKind::If;
|
return TokenKind::If;
|
||||||
}
|
}
|
||||||
|
if ident == "import" {
|
||||||
|
return TokenKind::Import;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
'l' => {
|
'l' => {
|
||||||
if ident == "let" {
|
if ident == "let" {
|
||||||
|
|
@ -311,11 +314,6 @@ impl<'a> Tokens<'a> {
|
||||||
return TokenKind::True;
|
return TokenKind::True;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
'u' => {
|
|
||||||
if ident == "use" {
|
|
||||||
return TokenKind::Use;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'w' => {
|
'w' => {
|
||||||
if ident == "while" {
|
if ident == "while" {
|
||||||
return TokenKind::While;
|
return TokenKind::While;
|
||||||
|
|
@ -533,18 +531,18 @@ mod tests {
|
||||||
|
|
||||||
test_tokens!(
|
test_tokens!(
|
||||||
more_keywords,
|
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"),
|
(0, Fun, "fun"),
|
||||||
(4, If, "if"),
|
(4, If, "if"),
|
||||||
(7, Let, "let"),
|
(7, Import, "import"),
|
||||||
(11, Print, "print"),
|
(14, Let, "let"),
|
||||||
(17, Return, "return"),
|
(18, Print, "print"),
|
||||||
(24, Select, "select"),
|
(24, Return, "return"),
|
||||||
(31, This, "this"),
|
(31, Select, "select"),
|
||||||
(36, True, "true"),
|
(38, This, "this"),
|
||||||
(41, Use, "use"),
|
(43, True, "true"),
|
||||||
(45, While, "while"),
|
(48, While, "while"),
|
||||||
(51, Identifier, "truewhile")
|
(54, Identifier, "truewhile")
|
||||||
);
|
);
|
||||||
|
|
||||||
test_tokens!(
|
test_tokens!(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue