From 1f01146b1f8adb78f1522da761e27e21bed752d8 Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Thu, 15 Aug 2024 23:21:21 -0300 Subject: [PATCH] Minor cleanup --- src/lexer.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lexer.cr b/src/lexer.cr index e30060e..540505c 100644 --- a/src/lexer.cr +++ b/src/lexer.cr @@ -4,7 +4,6 @@ require "./constants/lexers" module Tartrazine class LexerFiles extend BakedFileSystem - bake_folder "../lexers", __DIR__ end @@ -61,7 +60,7 @@ module Tartrazine new_lexer = Lexer.new new_lexer.config = config new_lexer.states = states - new_lexer.state_stack = state_stack[0..-1] + new_lexer.state_stack = ["root"] new_lexer end @@ -87,9 +86,10 @@ module Tartrazine states[@state_stack.last].rules.each do |rule| matched, new_pos, new_tokens = rule.match(text_bytes, pos, self) if matched - # Move position forward, save the tokens, + # Move position forward, save the tokens pos = new_pos tokens += new_tokens + # Start matching rules at new position break end end