Renamed errors.h and separated bool.h

This commit is contained in:
Kyler Olsen 2025-11-07 12:10:15 -07:00
parent 329a71ca24
commit 40007c27a6
12 changed files with 30 additions and 12 deletions

14
SLS_C/include/sls/bool.h Normal file
View File

@ -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

View File

@ -7,11 +7,7 @@
#define SLS_ERROR_H #define SLS_ERROR_H
#include <stdint.h> #include <stdint.h>
#include <stddef.h>
typedef enum {
FALSE,
TRUE,
} Boolean;
typedef struct { typedef struct {
const char *message; const char *message;

View File

@ -8,7 +8,8 @@
#include <stddef.h> #include <stddef.h>
#include "sls/sls_errors.h" #include "sls/bool.h"
#include "sls/errors.h"
extern const size_t TYPE_NAMES_SAFE_LENGTH; extern const size_t TYPE_NAMES_SAFE_LENGTH;

View File

@ -8,6 +8,8 @@
#include <stddef.h> #include <stddef.h>
#include "bool.h"
int isascii(unsigned char c); int isascii(unsigned char c);
size_t strnlen(const char *s, size_t maxlen); size_t strnlen(const char *s, size_t maxlen);

View File

@ -14,7 +14,8 @@
#include <stdio.h> #include <stdio.h>
#include <math.h> #include <math.h>
#include "sls/sls_errors.h" #include "sls/errors.h"
#include "sls/bool.h"
#include "sls/lexer.h" #include "sls/lexer.h"
#include "sls/string.h" #include "sls/string.h"
#include "tests/lexer_test_helpers.h" #include "tests/lexer_test_helpers.h"

View File

@ -8,7 +8,7 @@
#include <stddef.h> #include <stddef.h>
#include "sls/sls_errors.h" #include "sls/errors.h"
extern const char *TEST_FILE_NAME; extern const char *TEST_FILE_NAME;

View File

@ -11,7 +11,8 @@
#include <stdio.h> #include <stdio.h>
#include <math.h> #include <math.h>
#include "sls/sls_errors.h" #include "sls/errors.h"
#include "sls/bool.h"
#include "sls/lexer.h" #include "sls/lexer.h"
#include "sls/string.h" #include "sls/string.h"

View File

@ -4,6 +4,7 @@
// November 2025 // November 2025
#include <stddef.h> #include <stddef.h>
#include <string.h>
int isascii(unsigned char c) { int isascii(unsigned char c) {
return c < 128; return c < 128;

View File

@ -9,7 +9,8 @@
#include <stdio.h> #include <stdio.h>
#include <math.h> #include <math.h>
#include "sls/sls_errors.h" #include "sls/errors.h"
#include "sls/bool.h"
#include "sls/lexer.h" #include "sls/lexer.h"
#include "sls/string.h" #include "sls/string.h"
#include "tests/lexer_test_helpers.h" #include "tests/lexer_test_helpers.h"

View File

@ -9,7 +9,7 @@
#include <stdio.h> #include <stdio.h>
#include <math.h> #include <math.h>
#include "sls/sls_errors.h" #include "sls/errors.h"
#include "sls/lexer.h" #include "sls/lexer.h"
#include "sls/string.h" #include "sls/string.h"
#include "tests/lexer_test_helpers.h" #include "tests/lexer_test_helpers.h"

View File

@ -7,6 +7,7 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include "sls/errors.h"
#include "tests/tests.h" #include "tests/tests.h"
const char *TEST_FILE_NAME = "TEST_FILE.SLS"; const char *TEST_FILE_NAME = "TEST_FILE.SLS";

View File

@ -16,7 +16,7 @@ file_headers = """\
#include <stdio.h> #include <stdio.h>
#include <math.h> #include <math.h>
#include "sls/sls_errors.h" #include "sls/errors.h"
#include "sls/lexer.h" #include "sls/lexer.h"
#include "sls/string.h" #include "sls/string.h"
#include "tests/lexer_test_helpers.h" #include "tests/lexer_test_helpers.h"