Renemed all variables to fit into a namespace

Basically, all Toy varaibles, functions, etc. are prepended with "Toy_",
and macros are prepended with "TOY_". This is to reduce namespace
pollution, which was an issue pointed out to be - blame @GyroVorbis.

I've also bumped the minor version number - theoretically I should bump
the major number, but I'm not quite ready for 1.0 yet.
This commit is contained in:
2023-01-25 12:52:07 +00:00
parent 047ccc5f16
commit 2e2bee4fa3
55 changed files with 4837 additions and 4707 deletions

View File

@@ -1,7 +1,7 @@
#pragma once
#include "toy_common.h"
#include "token_types.h"
#include "toy_token_types.h"
//lexers are bound to a string of code, and return a single token every time scan is called
typedef struct {
@@ -9,18 +9,18 @@ typedef struct {
int start; //start of the token
int current; //current position of the lexer
int line; //track this for error handling
} Lexer;
} Toy_Lexer;
//tokens are intermediaries between lexers and parsers
typedef struct {
TokenType type;
Toy_TokenType type;
char* lexeme;
int length;
int line;
} Token;
} Toy_Token;
TOY_API void initLexer(Lexer* lexer, char* source);
Token scanLexer(Lexer* lexer);
TOY_API void Toy_initLexer(Toy_Lexer* lexer, char* source);
Toy_Token Toy_scanLexer(Toy_Lexer* lexer);
//for debugging
void printToken(Token* token);
void Toy_printToken(Toy_Token* token);