wip improve printer

This commit is contained in:
hugogogo
2026-05-10 02:17:25 +02:00
parent 8445604656
commit 647c9a54b1
3 changed files with 51 additions and 85 deletions

View File

@@ -33,6 +33,7 @@ void launch_computorv1(char *input);
typedef enum
{
TOKEN_END = 0, // null (end of input)
TOKEN_VARIABLE, // x, y, etc.
TOKEN_NUMBER_INT, // int
TOKEN_NUMBER_DOUBLE, // double
@@ -43,12 +44,11 @@ typedef enum
TOKEN_FACTOR_MULT, // *
TOKEN_FACTOR_DIV, // / or :
TOKEN_EQUAL, // =
TOKEN_END // null (end of input)
} e_token_type;
typedef enum
{
TOKEN_NO_TAG,
TOKEN_NO_TAG = 0,
TOKEN_NUMBER,
TOKEN_SIGN,
TOKEN_FACTOR,
@@ -74,16 +74,16 @@ void lexerize(const char *input, s_token *tokens);
typedef enum
{
TERM_LEFT, // a in "a = b"
TERM_RIGHT, // b in "a = b"
TERM_POS_END, // last term
TERM_POS_END = 0, // for last term
TERM_LEFT, // a in "a = b"
TERM_RIGHT, // b in "a = b"
} e_term_position;
typedef enum
{
TERM_PLUS = '+', // +
TERM_MINUS = '-', // -
TERM_SIGN_END, // last term
TERM_SIGN_END = 0, // for last term
TERM_PLUS = '+', // +
TERM_MINUS = '-', // -
} e_term_sign;
typedef struct
@@ -115,9 +115,9 @@ int reduce(s_term *terms, s_polynom *polynom, int max_exponent);
typedef enum
{
DELTA_ZERO = 0,
DELTA_PLUS = 1,
DELTA_MINUS = -1,
DELTA_ZERO = 0,
} e_delta_sign;
typedef struct