Convert codebase to C89 compatibility and update test scripts

This commit is contained in:
2026-04-29 10:20:30 +02:00
parent 189c21667b
commit 146aa4d9d1
14 changed files with 287 additions and 192 deletions
+18 -18
View File
@@ -10,41 +10,41 @@
* A list of all possible tokens.
*/
typedef enum {
// Keywords
TOKEN_MODULE,
/* Keywords */
TOKEN_MODULE,
TOKEN_IMPORT,
TOKEN_SEMICOLON,
// Symbols
TOKEN_PARENT_OPEN,
/* Symbols */
TOKEN_PARENT_OPEN,
TOKEN_PARENT_CLOSE,
TOKEN_BRACKET_OPEN,
TOKEN_BRACKET_CLOSE,
TOKEN_COMMA,
// Primitives
TOKEN_VOID,
/* Primitives */
TOKEN_VOID,
// Variable
TOKEN_IDENTIFIER,
/* Variable */
TOKEN_IDENTIFIER,
// Others
TOKEN_EOF,
TOKEN_UNKNOWN,
/* Others */
TOKEN_EOF,
TOKEN_UNKNOWN
} TokenType;
/**
* Holds additional information about a token.
*/
typedef struct {
/// @brief The actual token.
TokenType token;
/* @brief The actual token. */
TokenType token;
/// @brief The textual representation of a token.
String text;
/* @brief The textual representation of a token. */
String text;
/// @brief The location of the token.
Location location;
/* @brief The location of the token. */
Location location;
} Token;
typedef struct TokenStream TokenStream;
@@ -71,4 +71,4 @@ void tokenstream_close(TokenStream* ts);
*/
Token tokenstream_next(TokenStream* ts);
#endif
#endif