Convert codebase to C89 compatibility and update test scripts
This commit is contained in:
+18
-18
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user