add debug mode and stdin input

This commit is contained in:
hugogogo
2026-05-04 20:40:51 +02:00
parent edc678cee4
commit dff842ccab
5 changed files with 155 additions and 10 deletions

View File

@@ -104,6 +104,8 @@ static void print_context_polynom()
void print_state()
{
if (!debug_mode)
return;
ft_dprintf(STDERR_FILENO, "\nSTATE :\n");
if (input_g_err)
print_context_input();
@@ -123,6 +125,7 @@ int stop_errors(e_program_error err, const char *details, ...)
// map error codes to messages
const char *error_messages[ERROR_SENTINEL] = {
[ERROR_BASE] = "undefined error",
[ARGUMENTS_ERROR] = "arguments error",
[ERROR_UNKNOWN_TOKEN] = "LEXER - unknown token",
[ERROR_NUMBER_TOO_BIG] = "LEXER - number is too big",
[ERROR_PARSING] = "PARSER - too much terms to parse",