Skip to content

Commit

Permalink
refactor: ignore headers directory
Browse files Browse the repository at this point in the history
  • Loading branch information
pacifiquem committed Dec 11, 2023
1 parent 8795b3b commit 5e60341
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 41 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ flags = -g
$(exec): $(objects)
gcc $(objects) $(flags) -o $(exec)

%.o: %.c headers/%.h
%.o: %.c ./%.h
gcc -c $(flags) $< -o $@

install:
Expand Down
2 changes: 1 addition & 1 deletion src/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/


#include "headers/common.h"
#include "common.h"

void advance(int *position) {
*position += 1;
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/errors.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#include <stdlib.h>


#include "headers/errors.h"
#include "headers/exit-codes.h"
#include "headers/error-codes.h"
#include "errors.h"
#include "exit-codes.h"
#include "error-codes.h"



Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions src/lexer.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
#include <stdbool.h>
#include <ctype.h>

#include "headers/common.h"
#include "headers/lexer.h"
#include "headers/exit-codes.h"
#include "headers/errors.h"
#include "headers/error-codes.h"
#include "common.h"
#include "lexer.h"
#include "exit-codes.h"
#include "errors.h"
#include "error-codes.h"



Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
#include <stdbool.h>

/* .h files imports */
#include "headers/common.h"
#include "headers/exit-codes.h"
#include "headers/lexer.h"
#include "headers/parser.h"
#include "headers/error-codes.h"
#include "headers/errors.h"
#include "common.h"
#include "exit-codes.h"
#include "lexer.h"
#include "parser.h"
#include "error-codes.h"
#include "errors.h"


/* constants */
Expand Down
13 changes: 7 additions & 6 deletions src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
#include <stdlib.h>

/* custom headers */
#include "headers/parser.h"
#include "headers/lexer.h"
#include "headers/common.h"
#include "headers/errors.h"
#include "headers/error-codes.h"
#include "parser.h"
#include "lexer.h"
#include "common.h"
#include "errors.h"
#include "error-codes.h"

/* Global variables for parser */
int currentTokensPos;
Expand Down Expand Up @@ -47,6 +47,7 @@ Token* initializeTokens() {
Token token = scanToken();
tokens[i] = token;
numberOfTokens++;
printf("%d: \t %s", token.line, token.lexeme);
if (token.type == TOKEN_EOF) { // store EOF token before exiting.
tokens[i] = token;
break;
Expand All @@ -59,7 +60,7 @@ Token* initializeTokens() {

/* entry point of Kin's parser. */
void parser() {
Token* tokens = initializeTokens();
Token* tokens = initializeTokens();
free(tokens);
}

File renamed without changes.
19 changes: 0 additions & 19 deletions src/readme.md

This file was deleted.

0 comments on commit 5e60341

Please sign in to comment.