forked from AbleOS/ableos
adding better api
This commit is contained in:
parent
fef0583e9c
commit
aa276d88fa
|
@ -114,7 +114,6 @@ pub enum TokenKind {
|
||||||
Ident,
|
Ident,
|
||||||
Number,
|
Number,
|
||||||
Eof,
|
Eof,
|
||||||
String,
|
|
||||||
|
|
||||||
Return,
|
Return,
|
||||||
If,
|
If,
|
||||||
|
@ -180,7 +179,6 @@ gen_token_kind! {
|
||||||
Number,
|
Number,
|
||||||
Eof,
|
Eof,
|
||||||
Directive,
|
Directive,
|
||||||
String,
|
|
||||||
#[keywords]
|
#[keywords]
|
||||||
Return = b"return",
|
Return = b"return",
|
||||||
If = b"if",
|
If = b"if",
|
||||||
|
|
|
@ -239,7 +239,7 @@ impl<'a, 'b> Parser<'a, 'b> {
|
||||||
let mut expr = match token.kind {
|
let mut expr = match token.kind {
|
||||||
T::Directive if self.lexer.slice(token.range()) == "use" => {
|
T::Directive if self.lexer.slice(token.range()) == "use" => {
|
||||||
self.expect_advance(TokenKind::LParen);
|
self.expect_advance(TokenKind::LParen);
|
||||||
let str = self.expect_advance(TokenKind::String);
|
let str = self.expect_advance(TokenKind::DQuote);
|
||||||
self.expect_advance(TokenKind::RParen);
|
self.expect_advance(TokenKind::RParen);
|
||||||
let path = self.lexer.slice(str.range()).trim_matches('"');
|
let path = self.lexer.slice(str.range()).trim_matches('"');
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue