minor fixes

This commit is contained in:
bronku 2025-11-25 16:06:03 +01:00
parent 60eaba951a
commit 0bc67209b9
4 changed files with 24 additions and 14 deletions

View file

@ -5,7 +5,7 @@
%{
#include "scanner.hpp"
#include "indent_helper.hpp"
#include "indent_stack.hpp"
%}
@ -14,8 +14,8 @@
^[ \t]*#.*\n { /* Ignore comment-only lines */ }
^[ \t]* {
int col = indent_helper.calculateColumn(yytext, yyleng);
auto action = indent_helper.processLine(col);
int col = indent_stack.calculateColumn(yytext, yyleng);
auto action = indent_stack.updateIndentation(col);
if (action == IndentAction::Indent) return yy::parser::token::TOK_INDENT;
if (action == IndentAction::Dedent) return yy::parser::token::TOK_DEDENT;