adding better api

This commit is contained in:
mlokr 2024-07-06 15:05:56 +02:00
parent dc0562553d
commit 9fe734c68c
No known key found for this signature in database
GPG key ID: DEA147DDEE644993
2 changed files with 1 additions and 3 deletions

View file

@ -114,7 +114,6 @@ pub enum TokenKind {
Ident,
Number,
Eof,
String,
Return,
If,
@ -180,7 +179,6 @@ gen_token_kind! {
Number,
Eof,
Directive,
String,
#[keywords]
Return = b"return",
If = b"if",

View file

@ -239,7 +239,7 @@ impl<'a, 'b> Parser<'a, 'b> {
let mut expr = match token.kind {
T::Directive if self.lexer.slice(token.range()) == "use" => {
self.expect_advance(TokenKind::LParen);
let str = self.expect_advance(TokenKind::String);
let str = self.expect_advance(TokenKind::DQuote);
self.expect_advance(TokenKind::RParen);
let path = self.lexer.slice(str.range()).trim_matches('"');