diff --git a/compile.sh b/compile.sh index e7eea18..abe1f0a 100644 --- a/compile.sh +++ b/compile.sh @@ -2,8 +2,8 @@ set -xe -gcc -ansi -Wall -Wextra -Wpedantic -o xighlight xighlight.c -clang -ansi -Weverything -o xighlight xighlight.c +clang -g -ansi -Weverything -o xighlight xighlight.c +gcc -g -ansi -Wall -Wextra -Wpedantic -o xighlight xighlight.c cat xighlight.c | valgrind --show-leak-kinds=all --leak-check=full ./xighlight exit diff --git a/xighlight.c b/xighlight.c index e0fb572..a289e89 100644 --- a/xighlight.c +++ b/xighlight.c @@ -18,6 +18,7 @@ int main (void) { int length = 0; char * buffer = NULL; + int whitespace = 0; int preprocessor = 0; int line_comment = 0; int multiline_comment = 0; @@ -40,6 +41,7 @@ int main (void) { "char", "short", "int", "long", "signed", "unsigned", "float", "double" }; + syntax_define (& whitespace, 1, 0, " \t\r\n", "", '\0', COLOUR_WHITE, EFFECT_NORMAL); syntax_define (& preprocessor, 0, 0, "#", "\n", '\\', COLOUR_RED, EFFECT_BOLD); syntax_define (& line_comment, 0, 0, "//", "\n", '\0', COLOUR_GREY, EFFECT_BOLD); syntax_define (& multiline_comment, 0, 0, "/*", "*/", '\0', COLOUR_GREY, EFFECT_BOLD);