aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authors-over-42023-09-28 10:36:12 -0400
committers-over-42023-09-28 10:36:12 -0400
commitf675656431075450714f2a1054ea8db3a2897e26 (patch)
tree948d28c95dfc19eface1be5b2cb0330f0fe68353 /src
parent3e793a7b079da1208a3baebd1ea66abe54b7ed49 (diff)
preprocessor now preforms basic whitespace removal
Diffstat (limited to 'src')
-rw-r--r--src/main.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/main.c b/src/main.c
index 75ee98f..7366932 100644
--- a/src/main.c
+++ b/src/main.c
@@ -3,17 +3,24 @@
#include "include/util.h"
#include "include/token.h"
+#include "include/pp.h"
#include "include/lexer.h"
#include "include/source.h"
#include "include/hlkt.h"
int main(int argc, char* argv[]) {
char* source;
- lexer_t* lexer;
- int in_file;
+ /*lexer_t* lexer;*/
+ /*int in_file;*/
+ pp_t* pp;
source = source_get(argv[1]);
+ pp = pp_init(source);
+ HLKT_ASS(pp);
+ log_inf("preprocessor created");
+
+ /*
lexer = lexer_init(source);
HLKT_ASS(lexer);
log_inf("lexer created");
@@ -23,22 +30,16 @@ int main(int argc, char* argv[]) {
log_inf("END INPUT");
in_file = 1;
+ */
- while (in_file) {
- token_t* token;
- char* type;
-
- token = lexer_get_next_token(lexer);
- type = token_get_type(token->type);
-
- log_inf("token type: [%s]\t\ttoken value: [%s]", type, token->value);
- (token->type == TOKEN_EOF) && (in_file = 0);
+ pp_run(pp);
- token_destroy(token);
- }
+ log_raw("%s\n%s", source, pp->psrc);
// clean up
- lexer_destroy(lexer);
+ /*lexer_destroy(lexer);*/
+ pp_destroy(pp);
+
free(source);
HLKT_LOG();