adding better api

This commit is contained in:
mlokr 2024-07-06 15:05:56 +02:00
parent fef0583e9c
commit aa276d88fa
2 changed files with 1 additions and 3 deletions

View file

@ -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",

View file

@ -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('"');