diff --git a/lex.c b/lex.c index 5006e94..c52c8fe 100644 --- a/lex.c +++ b/lex.c @@ -160,7 +160,7 @@ void lex_next(struct lexer *lex) { return; } -struct token *lex_token(struct lexer *lex) { +const struct token *lex_token(const struct lexer *lex) { return &lex->tok; } diff --git a/lex.h b/lex.h index 3314ec0..304737a 100644 --- a/lex.h +++ b/lex.h @@ -76,7 +76,7 @@ void lex_next(struct lexer *lex); * @param lex Lexer * @return Adresa na token */ -struct token *lex_token(struct lexer *lex); +const struct token *lex_token(const struct lexer *lex); /** * @brief Vypíše informaci o aktuální pozici ve vstupním řetězci