From 3e578583be856472903bde3d682f6f9f97e28405 Mon Sep 17 00:00:00 2001 From: xolatile Date: Fri, 25 Aug 2023 16:58:56 -0400 Subject: [PATCH] Delete... --- example/compile.sh | 8 ----- example/example | Bin 21912 -> 0 bytes example/example.c | 84 ----------------------------------------------------- 3 files changed, 92 deletions(-) delete mode 100644 example/compile.sh delete mode 100755 example/example delete mode 100644 example/example.c diff --git a/example/compile.sh b/example/compile.sh deleted file mode 100644 index 2aee9d5..0000000 --- a/example/compile.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -set -xe - -gcc -ansi -Wall -Wextra -Wpedantic -o example example.c -cat example.c | ./example - -exit diff --git a/example/example b/example/example deleted file mode 100755 index 45faa6eab25663bd723e415b5577139f57cca249..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21912 zcmeHPe{@vUoxhV|AR15yxo?FPH;vaY((Vx91#8x?JEBeS3Hz4!a_ zW-_ro?m7F{+?>q!et+KY{oecTyYIgH?!%tiRRuPi;A9tf2*UOkD@vtil&;YkfJ#v= zF2(OP;%YG&_#{bF{7MDDRjH*Q6BcT^9gy_)X?`}Gt>qZ9hXhG)qI7^9LSiU%JxI?% z42@^QCuR~;2!_lz%PUiSkp=fjqo{|5Ry}ehwOr|?>N4Sjy555tvL2zNH=^}Mv>wAj z9SDXTPl^fsAJO)*;Y#o*F(g?^_3y+QDgVqOiH?JN6j?B2y)Q#ghgwT~I^eLc)8$PR zms0INLtS05AQarb^wtHT#`&ROINmY8qkQT7rMJ4(%5}YWl1LLwB zOh0I@9Q0bya>>t`fPUiy^xG$(mrg)`7<3o@vlGQHmp_+IKz|H$7yh%;Eg)Q%O(Y!c z=cndcDgqtBn1}{^p-{vx{0g+kqM<;TsExww^>_HZO~J4)6xOc5D=?tYpPdx7r7U?mk4johB|L!AR1^6w#Nd|4RtF*k#JyxZ+nQ0G`B{= z+K5+)<`h)DrT~3M{Si)mgZq*VJ;Vl_`*ZxN;3dSpo9c+f*EwI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)^n<9~?gD0g30xjR93S@b!(N7{FaQ+h%x*9XCT3iRt( z$O`?@7*?;Fn%sV@^7G3BZ>-hpr_)HN-Z1;t{jj>3y-Rp~Y;4MLGTPP3< zG`eqFya-2`bRjbx}Hh4EwRo8mRsyySx-yWBh zlxMqCR{o)fyR>(PW4;a?{UYCN$kSmmm9>CB635FDZ=lf^^U<3YdXc4HEHT;`pjIFZ zp~-0^(C+uOK|+-oKrHdTMjO*_y_ne=!3!5U(k9c;xC3o6+3G}`Od9$Fd{)QTAXu4a z*?1e!B08U$E=lX+sxyIGOY`DduMCRw;eDRRj`F~c+nP!wh4DQ5(~Ji zs%z%Qe9anb4#(Zw<3Suwg*SC>!diUoEyCT{8HPOtV^PJS_oDQsPl{>83tlu3@{xkh zwc+icTSnTAtQ#)^g*%4#jKWQ$0E8m47rO&3`nqpvgb~J+su}>42Io$s$>X zb96Ph(Nw~Xi=h=Gi*-2rta(}=z%3thE0rcX-%YcnEawSckAHe5XZ<5O!_WnuHSv9y zX$z6D>hp6ULw(z1am<}F(@LQD@Fc?J^YbG^*5}7Np8v3wHOSDK1?%&3Cc| - -#define ALLOCATION_CHUNK (1024) - -int main (void) { - int buffer_size = 0; - int offset = 0; - int word = 0; - char * buffer = NULL; - - char separator [29] = ".,:;<=>+-*/%!&~^()[]{}'\" \t\r\n"; - - char * c_keywords [32] = { - "register", "volatile", "auto", "const", "static", "extern", "if", "else", - "do", "while", "for", "continue", "switch", "case", "default", "break", - "enum", "union", "struct", "typedef", "goto", "void", "return", "sizeof", - "char", "short", "int", "long", "signed", "unsigned", "float", "double" - }; - - char * c_preprocessor [8] = { - "#include", "#define", "#ifdef", "#ifndef", "#undef", "#elif", "#if", "#endif" - }; - - char * c_common [4] = { - "NULL", "FILE", "size_t", "ssize_t" - }; - - syntax_define (0, 0, 0, "//", "\n", '\0', TERMINAL_COLOUR_GREY, TERMINAL_EFFECT_BOLD); - syntax_define (0, 0, 0, "/*", "*/", '\0', TERMINAL_COLOUR_GREY, TERMINAL_EFFECT_BOLD); - syntax_define (0, 0, 0, "'", "'", '\\', TERMINAL_COLOUR_PINK, TERMINAL_EFFECT_BOLD); - syntax_define (0, 0, 0, "\"", "\"", '\\', TERMINAL_COLOUR_RED, TERMINAL_EFFECT_BOLD); - - do { - syntax_define (0, 0, 1, c_keywords [word], separator, '\0', TERMINAL_COLOUR_YELLOW, TERMINAL_EFFECT_BOLD); - } while (++word != 32); - - word = 0; - - do { - syntax_define (0, 0, 1, c_preprocessor [word], separator, '\0', TERMINAL_COLOUR_YELLOW, TERMINAL_EFFECT_NORMAL); - } while (++word != 8); - - word = 0; - - do { - syntax_define (0, 0, 1, c_common [word], separator, '\0', TERMINAL_COLOUR_YELLOW, TERMINAL_EFFECT_ITALIC); - } while (++word != 4); - - syntax_define (0, 1, 0, "()[]{}", "", '\0', TERMINAL_COLOUR_GREEN, TERMINAL_EFFECT_BOLD); - syntax_define (0, 1, 0, ".,:;<=>+-*/%!&~^", "", '\0', TERMINAL_COLOUR_BLUE, TERMINAL_EFFECT_BOLD); - syntax_define (0, 1, 1, "0123456789", separator, '\0', TERMINAL_COLOUR_CYAN, TERMINAL_EFFECT_BOLD); - syntax_define (0, 1, 1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", separator, '\0', TERMINAL_COLOUR_PINK, TERMINAL_EFFECT_ITALIC); - syntax_define (0, 1, 1, "abcdefghijklmnopqrstuvwxyz", separator, '\0', TERMINAL_COLOUR_WHITE, TERMINAL_EFFECT_ITALIC); - syntax_define (0, 0, 1, "_", separator, '\0', TERMINAL_COLOUR_YELLOW, TERMINAL_EFFECT_ITALIC); - - buffer = realloc (buffer, ALLOCATION_CHUNK); - - do { - if ((buffer_size + 1) % ALLOCATION_CHUNK == 0) { - buffer = realloc (buffer, (unsigned long int) ((buffer_size + 1) / ALLOCATION_CHUNK + 1) * ALLOCATION_CHUNK); - } - - buffer [buffer_size] = '\0'; - - (void) read (STDIN_FILENO, & buffer [buffer_size], sizeof (* buffer)); - - ++buffer_size; - } while (buffer [buffer_size - 1] != '\0'); - - buffer [buffer_size - 1] = '\0'; - - do { - offset += syntax_output (& buffer [offset]); - } while (buffer [offset] != '\0'); - - free (buffer); - - syntax_delete (); - - return (EXIT_SUCCESS); -}