From 40007c27a62117a8cb69f53ba2ab4fa6111ce02c Mon Sep 17 00:00:00 2001 From: Kyler Date: Fri, 7 Nov 2025 12:10:15 -0700 Subject: [PATCH] Renamed errors.h and separated bool.h --- SLS_C/include/sls/bool.h | 14 ++++++++++++++ SLS_C/include/sls/{sls_errors.h => errors.h} | 6 +----- SLS_C/include/sls/lexer.h | 3 ++- SLS_C/include/sls/string.h | 2 ++ SLS_C/include/tests/lexer_test_helpers.h | 3 ++- SLS_C/include/tests/tests.h | 2 +- SLS_C/src/lexer.c | 3 ++- SLS_C/src/string.c | 1 + SLS_C/tests/lexer_test_helpers.c | 3 ++- SLS_C/tests/lexer_tests.c | 2 +- SLS_C/tests/tests.c | 1 + SLS_Tests/yaml_to_c_tests.py | 2 +- 12 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 SLS_C/include/sls/bool.h rename SLS_C/include/sls/{sls_errors.h => errors.h} (89%) diff --git a/SLS_C/include/sls/bool.h b/SLS_C/include/sls/bool.h new file mode 100644 index 0000000..0095647 --- /dev/null +++ b/SLS_C/include/sls/bool.h @@ -0,0 +1,14 @@ +// Kyler Olsen +// YREA SLS +// SLS Boolean Header +// November 2025 + +#ifndef SLS_BOOLEAN_H +#define SLS_BOOLEAN_H + +typedef enum { + FALSE, + TRUE, +} Boolean; + +#endif // SLS_BOOLEAN_H diff --git a/SLS_C/include/sls/sls_errors.h b/SLS_C/include/sls/errors.h similarity index 89% rename from SLS_C/include/sls/sls_errors.h rename to SLS_C/include/sls/errors.h index 73d768f..6fdeda7 100644 --- a/SLS_C/include/sls/sls_errors.h +++ b/SLS_C/include/sls/errors.h @@ -7,11 +7,7 @@ #define SLS_ERROR_H #include - -typedef enum { - FALSE, - TRUE, -} Boolean; +#include typedef struct { const char *message; diff --git a/SLS_C/include/sls/lexer.h b/SLS_C/include/sls/lexer.h index dcecdbc..e91d18b 100644 --- a/SLS_C/include/sls/lexer.h +++ b/SLS_C/include/sls/lexer.h @@ -8,7 +8,8 @@ #include -#include "sls/sls_errors.h" +#include "sls/bool.h" +#include "sls/errors.h" extern const size_t TYPE_NAMES_SAFE_LENGTH; diff --git a/SLS_C/include/sls/string.h b/SLS_C/include/sls/string.h index 5362332..e068a0c 100644 --- a/SLS_C/include/sls/string.h +++ b/SLS_C/include/sls/string.h @@ -8,6 +8,8 @@ #include +#include "bool.h" + int isascii(unsigned char c); size_t strnlen(const char *s, size_t maxlen); diff --git a/SLS_C/include/tests/lexer_test_helpers.h b/SLS_C/include/tests/lexer_test_helpers.h index 8c3d200..4d41aa0 100644 --- a/SLS_C/include/tests/lexer_test_helpers.h +++ b/SLS_C/include/tests/lexer_test_helpers.h @@ -14,7 +14,8 @@ #include #include -#include "sls/sls_errors.h" +#include "sls/errors.h" +#include "sls/bool.h" #include "sls/lexer.h" #include "sls/string.h" #include "tests/lexer_test_helpers.h" diff --git a/SLS_C/include/tests/tests.h b/SLS_C/include/tests/tests.h index 5fcafc0..8d14217 100644 --- a/SLS_C/include/tests/tests.h +++ b/SLS_C/include/tests/tests.h @@ -8,7 +8,7 @@ #include -#include "sls/sls_errors.h" +#include "sls/errors.h" extern const char *TEST_FILE_NAME; diff --git a/SLS_C/src/lexer.c b/SLS_C/src/lexer.c index a748296..7eb8cc3 100644 --- a/SLS_C/src/lexer.c +++ b/SLS_C/src/lexer.c @@ -11,7 +11,8 @@ #include #include -#include "sls/sls_errors.h" +#include "sls/errors.h" +#include "sls/bool.h" #include "sls/lexer.h" #include "sls/string.h" diff --git a/SLS_C/src/string.c b/SLS_C/src/string.c index 0c195a1..b7a86e3 100644 --- a/SLS_C/src/string.c +++ b/SLS_C/src/string.c @@ -4,6 +4,7 @@ // November 2025 #include +#include int isascii(unsigned char c) { return c < 128; diff --git a/SLS_C/tests/lexer_test_helpers.c b/SLS_C/tests/lexer_test_helpers.c index 03eba37..e200a56 100644 --- a/SLS_C/tests/lexer_test_helpers.c +++ b/SLS_C/tests/lexer_test_helpers.c @@ -9,7 +9,8 @@ #include #include -#include "sls/sls_errors.h" +#include "sls/errors.h" +#include "sls/bool.h" #include "sls/lexer.h" #include "sls/string.h" #include "tests/lexer_test_helpers.h" diff --git a/SLS_C/tests/lexer_tests.c b/SLS_C/tests/lexer_tests.c index fd2ab5a..fb22dd4 100644 --- a/SLS_C/tests/lexer_tests.c +++ b/SLS_C/tests/lexer_tests.c @@ -9,7 +9,7 @@ #include #include -#include "sls/sls_errors.h" +#include "sls/errors.h" #include "sls/lexer.h" #include "sls/string.h" #include "tests/lexer_test_helpers.h" diff --git a/SLS_C/tests/tests.c b/SLS_C/tests/tests.c index 1962e78..d99d186 100644 --- a/SLS_C/tests/tests.c +++ b/SLS_C/tests/tests.c @@ -7,6 +7,7 @@ #include #include +#include "sls/errors.h" #include "tests/tests.h" const char *TEST_FILE_NAME = "TEST_FILE.SLS"; diff --git a/SLS_Tests/yaml_to_c_tests.py b/SLS_Tests/yaml_to_c_tests.py index 9df7726..8b21ee8 100644 --- a/SLS_Tests/yaml_to_c_tests.py +++ b/SLS_Tests/yaml_to_c_tests.py @@ -16,7 +16,7 @@ file_headers = """\ #include #include -#include "sls/sls_errors.h" +#include "sls/errors.h" #include "sls/lexer.h" #include "sls/string.h" #include "tests/lexer_test_helpers.h"