From 9fe734c68c954274d17e959a3d0e29e58a5345a1 Mon Sep 17 00:00:00 2001 From: mlokr Date: Sat, 6 Jul 2024 15:05:56 +0200 Subject: [PATCH] adding better api --- hblang/src/lexer.rs | 2 -- hblang/src/parser.rs | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/hblang/src/lexer.rs b/hblang/src/lexer.rs index df15019..f1b3d57 100644 --- a/hblang/src/lexer.rs +++ b/hblang/src/lexer.rs @@ -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", diff --git a/hblang/src/parser.rs b/hblang/src/parser.rs index aaa0ed9..a632f0d 100644 --- a/hblang/src/parser.rs +++ b/hblang/src/parser.rs @@ -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('"');