diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-04-30 16:20:01 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-04-30 16:20:01 +0300 |
| commit | dbcb4228e0301c241b5d921fd64e6d6139f714e3 (patch) | |
| tree | 09bf856ac97e953a27a74f87f61135fddbf8af2a | |
| parent | 2ca159fb5c2a52f33c499eef1fa50a98a863b0f0 (diff) | |
| download | ek-dbcb4228e0301c241b5d921fd64e6d6139f714e3.tar.gz ek-dbcb4228e0301c241b5d921fd64e6d6139f714e3.zip | |
rename to ek
| -rw-r--r-- | Makefile | 9 | ||||
| -rw-r--r-- | check.log | 1 | ||||
| -rw-r--r-- | gen/gen_lexer.c | 6 | ||||
| -rw-r--r-- | gen/gen_lexer.h | 2 | ||||
| -rw-r--r-- | gen/gen_parser.c | 6 | ||||
| -rw-r--r-- | gen/gen_parser.h | 2 | ||||
| -rw-r--r-- | include/cu/path.h | 10 | ||||
| -rw-r--r-- | include/ek/actualize.h (renamed from include/cu/actualize.h) | 0 | ||||
| -rw-r--r-- | include/ek/ast.h (renamed from include/cu/ast.h) | 0 | ||||
| -rw-r--r-- | include/ek/compiler.h (renamed from include/cu/compiler.h) | 8 | ||||
| -rw-r--r-- | include/ek/debug.h (renamed from include/cu/debug.h) | 8 | ||||
| -rw-r--r-- | include/ek/imports.h (renamed from include/cu/imports.h) | 6 | ||||
| -rw-r--r-- | include/ek/parser.h (renamed from include/cu/parser.h) | 2 | ||||
| -rw-r--r-- | include/ek/path.h | 10 | ||||
| -rw-r--r-- | include/ek/res.h (renamed from include/cu/res.h) | 6 | ||||
| -rw-r--r-- | include/ek/scope.h (renamed from include/cu/scope.h) | 0 | ||||
| -rw-r--r-- | include/ek/string.h (renamed from include/cu/string.h) | 6 | ||||
| -rw-r--r-- | src/actualize.c | 6 | ||||
| -rw-r--r-- | src/ast.c | 4 | ||||
| -rw-r--r-- | src/compiler.c | 22 | ||||
| -rw-r--r-- | src/debug.c | 2 | ||||
| -rw-r--r-- | src/imports.c | 4 | ||||
| -rw-r--r-- | src/lexer.l | 4 | ||||
| -rw-r--r-- | src/main.c | 6 | ||||
| -rw-r--r-- | src/parser.y | 4 | ||||
| -rw-r--r-- | src/parser_helper.c | 4 | ||||
| -rw-r--r-- | src/path.c | 10 | ||||
| -rw-r--r-- | src/res.c | 2 | ||||
| -rw-r--r-- | src/scope.c | 6 | ||||
| -rw-r--r-- | src/string.c | 4 |
30 files changed, 84 insertions, 76 deletions
@@ -7,8 +7,7 @@ INCLUDEFLAGS = -Iinclude COMPILEFLAGS = LINKFLAGS = -# should the compiler be renamed ctc? C with Traits Compiler? -all: cu +all: ek # default values CROSS_COMPILE ?= @@ -46,15 +45,15 @@ docs: @doxygen docs/doxygen.conf .PHONY: check -check: cu +check: ek ./tests/check.sh -cu: $(OBJS) +ek: $(OBJS) $(COMPILE) $(OBJS) -o $@ .PHONY: clean clean: - @$(RM) -r build cu deps.mk + @$(RM) -r build ek deps.mk .PHONY: clean_docs clean_docs: diff --git a/check.log b/check.log new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/check.log @@ -0,0 +1 @@ + diff --git a/gen/gen_lexer.c b/gen/gen_lexer.c index cebc5f3..afc5c7b 100644 --- a/gen/gen_lexer.c +++ b/gen/gen_lexer.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-3.0-or-later */ + #line 2 "gen/gen_lexer.c" #line 4 "gen/gen_lexer.c" @@ -595,8 +597,8 @@ static const flex_int16_t yy_chk[433] = #define YY_NO_INPUT 1 #line 3 "src/lexer.l" #define FROM_LEXER -#include <cu/parser.h> -#include <cu/debug.h> +#include <ek/parser.h> +#include <ek/debug.h> static void update_yylloc(struct parser *parser, YYLTYPE *lloc, const char *text) { diff --git a/gen/gen_lexer.h b/gen/gen_lexer.h index 9c3aadb..ce8165e 100644 --- a/gen/gen_lexer.h +++ b/gen/gen_lexer.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-3.0-or-later */ + #ifndef yyHEADER_H #define yyHEADER_H 1 #define yyIN_HEADER 1 diff --git a/gen/gen_parser.c b/gen/gen_parser.c index 96cc7ec..8821b21 100644 --- a/gen/gen_parser.c +++ b/gen/gen_parser.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-3.0-or-later */ + /* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison implementation for Yacc-like parsers in C @@ -77,8 +79,8 @@ #include <stdio.h> #include <stdlib.h> -#include <cu/parser.h> -#include <cu/ast.h> +#include <ek/parser.h> +#include <ek/ast.h> #line 85 "gen/gen_parser.c" diff --git a/gen/gen_parser.h b/gen/gen_parser.h index 1d69ed9..463a988 100644 --- a/gen/gen_parser.h +++ b/gen/gen_parser.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-3.0-or-later */ + /* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison interface for Yacc-like parsers in C diff --git a/include/cu/path.h b/include/cu/path.h deleted file mode 100644 index 700f77f..0000000 --- a/include/cu/path.h +++ /dev/null @@ -1,10 +0,0 @@ -/* SPDX-License-Identifier: GPL-3.0-or-later */ - -#ifndef CT_PATH -#define CT_PATH - -char *cu_basename(const char *file); -char *cu_dirname(const char *file); -char *cu_cwdname(); - -#endif /* CT_PATH */ diff --git a/include/cu/actualize.h b/include/ek/actualize.h index 94a4d30..94a4d30 100644 --- a/include/cu/actualize.h +++ b/include/ek/actualize.h diff --git a/include/cu/ast.h b/include/ek/ast.h index 44850b6..44850b6 100644 --- a/include/cu/ast.h +++ b/include/ek/ast.h diff --git a/include/cu/compiler.h b/include/ek/compiler.h index 325c746..ed60629 100644 --- a/include/cu/compiler.h +++ b/include/ek/compiler.h @@ -1,11 +1,11 @@ /* SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef CT_COMPILER_H -#define CT_COMPILER_H +#ifndef EK_COMPILER_H +#define EK_COMPILER_H -#include <cu/scope.h> +#include <ek/scope.h> int compile(const char *file); int process_file(struct scope **parent, int public, const char *file); -#endif /* CT_COMPILER_H */ +#endif /* EK_COMPILER_H */ diff --git a/include/cu/debug.h b/include/ek/debug.h index 3099b3c..ef97f65 100644 --- a/include/cu/debug.h +++ b/include/ek/debug.h @@ -1,11 +1,11 @@ /* SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef CT_DEBUG_H -#define CT_DEBUG_H +#ifndef EK_DEBUG_H +#define EK_DEBUG_H #include <stdio.h> -#include <cu/ast.h> +#include <ek/ast.h> #if DEBUG #define debug(x, ...) \ @@ -53,4 +53,4 @@ struct src_issue { }; void src_issue(struct src_issue issue, const char *err_msg, ...); -#endif /* CT_DEBUG_H */ +#endif /* EK_DEBUG_H */ diff --git a/include/cu/imports.h b/include/ek/imports.h index 1043cef..3d806f5 100644 --- a/include/cu/imports.h +++ b/include/ek/imports.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef CT_IMPORTS_H -#define CT_IMPORTS_H +#ifndef EK_IMPORTS_H +#define EK_IMPORTS_H #include <stdbool.h> @@ -9,4 +9,4 @@ void add_import_path(const char *dir); const char *find_import(const char *file); bool already_imported(const char *file); -#endif /* CT_IMPORTS_H */ +#endif /* EK_IMPORTS_H */ diff --git a/include/cu/parser.h b/include/ek/parser.h index dfc2b6a..f4e471d 100644 --- a/include/cu/parser.h +++ b/include/ek/parser.h @@ -5,7 +5,7 @@ #include <stddef.h> #include <stdbool.h> -#include <cu/ast.h> +#include <ek/ast.h> struct parser { bool failed; diff --git a/include/ek/path.h b/include/ek/path.h new file mode 100644 index 0000000..f4115e7 --- /dev/null +++ b/include/ek/path.h @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-3.0-or-later */ + +#ifndef EK_PATH +#define EK_PATH + +char *ek_basename(const char *file); +char *ek_dirname(const char *file); +char *ek_cwdname(); + +#endif /* EK_PATH */ diff --git a/include/cu/res.h b/include/ek/res.h index e1a1fc3..b3efd63 100644 --- a/include/cu/res.h +++ b/include/ek/res.h @@ -5,8 +5,8 @@ * Simple resource manager header. */ -#ifndef CT_RES_H -#define CT_RES_H +#ifndef EK_RES_H +#define EK_RES_H #include <stddef.h> @@ -54,4 +54,4 @@ void res_add(struct res *r, void *p); */ void res_destroy(struct res *r); -#endif /* CT_RES_H */ +#endif /* EK_RES_H */ diff --git a/include/cu/scope.h b/include/ek/scope.h index a325fcb..a325fcb 100644 --- a/include/cu/scope.h +++ b/include/ek/scope.h diff --git a/include/cu/string.h b/include/ek/string.h index 75d7c62..709ae90 100644 --- a/include/cu/string.h +++ b/include/ek/string.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef CT_STRING_H -#define CT_STRING_H +#ifndef EK_STRING_H +#define EK_STRING_H #include <stddef.h> #include <string.h> @@ -25,4 +25,4 @@ char str_rindex(struct string *s, size_t i); bool str_compare(struct string *s, const char *c); void str_clear(struct string *s); -#endif /* CT_STRING_H */ +#endif /* EK_STRING_H */ diff --git a/src/actualize.c b/src/actualize.c index b25968f..aa01552 100644 --- a/src/actualize.c +++ b/src/actualize.c @@ -5,9 +5,9 @@ #include <stdlib.h> #include <stdio.h> -#include <cu/actualize.h> -#include <cu/compiler.h> -#include <cu/debug.h> +#include <ek/actualize.h> +#include <ek/compiler.h> +#include <ek/debug.h> #define UNUSED(x) do { (void)(x); } while (0) @@ -7,8 +7,8 @@ #include <assert.h> #include <math.h> -#include <cu/ast.h> -#include <cu/scope.h> +#include <ek/ast.h> +#include <ek/scope.h> #define ALLOC_NODE(n, type) \ struct ast_node *n = calloc(1, sizeof(struct ast_node)); \ diff --git a/src/compiler.c b/src/compiler.c index b124a6f..2fa5b62 100644 --- a/src/compiler.c +++ b/src/compiler.c @@ -8,14 +8,14 @@ #include <limits.h> #include <errno.h> -#include <cu/actualize.h> -#include <cu/compiler.h> -#include <cu/string.h> -#include <cu/parser.h> -#include <cu/debug.h> -#include <cu/scope.h> -#include <cu/path.h> -#include <cu/res.h> +#include <ek/actualize.h> +#include <ek/compiler.h> +#include <ek/string.h> +#include <ek/parser.h> +#include <ek/debug.h> +#include <ek/scope.h> +#include <ek/path.h> +#include <ek/res.h> static char *read_file(const char *file, FILE *f) { @@ -97,18 +97,18 @@ int process_file(struct scope **scope, int public, const char *file) if (!r) return -1; - const char *base = cu_basename(file); + const char *base = ek_basename(file); res_add(r, (void *)base); if (!base) goto out; - const char *dir = cu_dirname(file); + const char *dir = ek_dirname(file); res_add(r, (void *)dir); if (!dir) goto out; /* TODO: iterate through include paths */ - const char *cwd = cu_cwdname(); + const char *cwd = ek_cwdname(); res_add(r, (void *)cwd); if (!cwd) goto out; diff --git a/src/debug.c b/src/debug.c index f850973..2a3a95b 100644 --- a/src/debug.c +++ b/src/debug.c @@ -7,7 +7,7 @@ #include <string.h> #include <stdarg.h> -#include <cu/debug.h> +#include <ek/debug.h> const char *issue_level_str(enum issue_level level) { diff --git a/src/imports.c b/src/imports.c index 9d88056..63d4455 100644 --- a/src/imports.c +++ b/src/imports.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-3.0-or-later */ -#include <cu/imports.h> -#include <cu/debug.h> +#include <ek/imports.h> +#include <ek/debug.h> void add_import_path(const char *dir) { diff --git a/src/lexer.l b/src/lexer.l index ce0b269..8fc10cc 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -1,8 +1,8 @@ %option reentrant noyywrap nounput noinput nodefault %{ #define FROM_LEXER -#include <cu/parser.h> -#include <cu/debug.h> +#include <ek/parser.h> +#include <ek/debug.h> static void update_yylloc(struct parser *parser, YYLTYPE *lloc, const char *text) { @@ -4,9 +4,9 @@ #include <stdio.h> #include <unistd.h> -#include <cu/debug.h> -#include <cu/imports.h> -#include <cu/compiler.h> +#include <ek/debug.h> +#include <ek/imports.h> +#include <ek/compiler.h> static const char *cmdline_usage = "Copper compiler usage:\n" diff --git a/src/parser.y b/src/parser.y index 64f9ef1..5d50fdd 100644 --- a/src/parser.y +++ b/src/parser.y @@ -7,8 +7,8 @@ #include <stdio.h> #include <stdlib.h> -#include <cu/parser.h> -#include <cu/ast.h> +#include <ek/parser.h> +#include <ek/ast.h> %} diff --git a/src/parser_helper.c b/src/parser_helper.c index c382fca..e7cf5c9 100644 --- a/src/parser_helper.c +++ b/src/parser_helper.c @@ -2,8 +2,8 @@ #include <stdarg.h> -#include <cu/parser.h> -#include <cu/debug.h> +#include <ek/parser.h> +#include <ek/debug.h> struct parser *create_parser() { @@ -6,10 +6,10 @@ #include <stdlib.h> #include <errno.h> -#include <cu/path.h> -#include <cu/debug.h> +#include <ek/path.h> +#include <ek/debug.h> -char *cu_basename(const char *file) +char *ek_basename(const char *file) { size_t l = strlen(file); size_t n = l - 1; @@ -24,7 +24,7 @@ char *cu_basename(const char *file) return strndup(file + n + 1, l - n); } -char *cu_dirname(const char *file) +char *ek_dirname(const char *file) { size_t l = strlen(file); size_t n = l - 1; @@ -36,7 +36,7 @@ char *cu_dirname(const char *file) return strndup(file, n); } -char *cu_cwdname() +char *ek_cwdname() { size_t size; long path_max = pathconf(".", _PC_PATH_MAX); @@ -8,7 +8,7 @@ #include <stdint.h> #include <stdlib.h> -#include <cu/res.h> +#include <ek/res.h> /** * Grow resource manager buffer. diff --git a/src/scope.c b/src/scope.c index b5f7960..c37e365 100644 --- a/src/scope.c +++ b/src/scope.c @@ -7,9 +7,9 @@ #include <stdlib.h> #include <assert.h> -#include <cu/debug.h> -#include <cu/scope.h> -#include <cu/actualize.h> +#include <ek/debug.h> +#include <ek/scope.h> +#include <ek/actualize.h> static int generics_trait_type(struct ast_node *generics) { diff --git a/src/string.c b/src/string.c index 9dcbe05..3822052 100644 --- a/src/string.c +++ b/src/string.c @@ -3,8 +3,8 @@ #include <errno.h> #include <stdlib.h> -#include <cu/debug.h> -#include <cu/string.h> +#include <ek/debug.h> +#include <ek/string.h> struct string *new_string(const char *s) { |
