Rename builtins/ -> stdlib/

This commit is contained in:
Bruce Hill 2024-09-13 20:18:08 -04:00
parent 816aa29b79
commit c455e7b67d
65 changed files with 38 additions and 38 deletions

View File

@ -28,10 +28,10 @@ O=-Og
CFLAGS=$(CCONFIG) $(EXTRA) $(CWARN) $(G) $(O) $(OSFLAGS)
CFLAGS_PLACEHOLDER="$$(echo -e '\033[2m<flags...>\033[m')"
LDLIBS=-lgc -lcord -lm -lunistring -lgmp -ldl
BUILTIN_OBJS=builtins/siphash.o builtins/arrays.o builtins/bools.o builtins/channels.o builtins/nums.o builtins/integers.o \
builtins/pointers.o builtins/memory.o builtins/text.o builtins/threads.o builtins/c_strings.o builtins/tables.o \
builtins/types.o builtins/util.o builtins/files.o builtins/ranges.o builtins/shell.o builtins/paths.o \
builtins/optionals.o builtins/patterns.o builtins/metamethods.o builtins/functiontype.o builtins/stdlib.o
BUILTIN_OBJS=stdlib/siphash.o stdlib/arrays.o stdlib/bools.o stdlib/channels.o stdlib/nums.o stdlib/integers.o \
stdlib/pointers.o stdlib/memory.o stdlib/text.o stdlib/threads.o stdlib/c_strings.o stdlib/tables.o \
stdlib/types.o stdlib/util.o stdlib/files.o stdlib/ranges.o stdlib/shell.o stdlib/paths.o \
stdlib/optionals.o stdlib/patterns.o stdlib/metamethods.o stdlib/functiontype.o stdlib/stdlib.o
TESTS=$(patsubst %.tm,%.tm.testresult,$(wildcard test/*.tm))
all: libtomo.so tomo
@ -63,14 +63,14 @@ test: $(TESTS)
@echo -e '\x1b[32;7m ALL TESTS PASSED! \x1b[m'
clean:
rm -f tomo *.o builtins/*.o libtomo.so test/*.tm.{c,h,o,testresult} examples/*.tm.*{c,h,o}
rm -f tomo *.o stdlib/*.o libtomo.so test/*.tm.{c,h,o,testresult} examples/*.tm.*{c,h,o}
%: %.md
pandoc --lua-filter=.pandoc/bold-code.lua -s $< -t man -o $@
install: tomo libtomo.so tomo.1
mkdir -p -m 755 "$(PREFIX)/man/man1" "$(PREFIX)/bin" "$(PREFIX)/include/tomo" "$(PREFIX)/lib" "$(PREFIX)/share/tomo/modules"
cp -v builtins/*.h "$(PREFIX)/include/tomo/"
cp -v stdlib/*.h "$(PREFIX)/include/tomo/"
cp -v libtomo.so "$(PREFIX)/lib/"
rm -f "$(PREFIX)/bin/tomo"
cp -v tomo "$(PREFIX)/bin/"

4
ast.c
View File

@ -5,8 +5,8 @@
#include <printf.h>
#include "ast.h"
#include "builtins/integers.h"
#include "builtins/text.h"
#include "stdlib/integers.h"
#include "stdlib/text.h"
#include "cordhelpers.h"
static const char *OP_NAMES[] = {

4
ast.h
View File

@ -8,8 +8,8 @@
#include <stdlib.h>
#include <printf.h>
#include "builtins/files.h"
#include "builtins/util.h"
#include "stdlib/files.h"
#include "stdlib/util.h"
#define NewAST(_file, _start, _end, ast_tag, ...) (new(ast_t, .file=_file, .start=_start, .end=_end,\
.tag=ast_tag, .__data.ast_tag={__VA_ARGS__}))

View File

@ -7,15 +7,15 @@
#include <uninorm.h>
#include "ast.h"
#include "builtins/integers.h"
#include "builtins/text.h"
#include "stdlib/integers.h"
#include "stdlib/text.h"
#include "compile.h"
#include "cordhelpers.h"
#include "enums.h"
#include "structs.h"
#include "environment.h"
#include "typecheck.h"
#include "builtins/util.h"
#include "stdlib/util.h"
typedef ast_t* (*comprehension_body_t)(ast_t*, ast_t*);

View File

@ -6,7 +6,7 @@
#include <gc.h>
#include <stdio.h>
#include "builtins/util.h"
#include "stdlib/util.h"
#include "environment.h"
CORD expr_as_text(env_t *env, CORD expr, type_t *t, CORD color);

View File

@ -3,7 +3,7 @@
#include <gc/cord.h>
#include <stdarg.h>
#include "builtins/util.h"
#include "stdlib/util.h"
__attribute__((format(printf, 1, 2)))
public CORD CORD_asprintf(CORD fmt, ...)

View File

@ -5,13 +5,13 @@
#include <stdio.h>
#include "ast.h"
#include "builtins/text.h"
#include "stdlib/text.h"
#include "compile.h"
#include "cordhelpers.h"
#include "structs.h"
#include "environment.h"
#include "typecheck.h"
#include "builtins/util.h"
#include "stdlib/util.h"
PUREFUNC static bool has_extra_data(tag_ast_t *tags)
{

View File

@ -3,9 +3,9 @@
#include <stdlib.h>
#include <signal.h>
#include "builtins/tables.h"
#include "builtins/text.h"
#include "builtins/util.h"
#include "stdlib/tables.h"
#include "stdlib/text.h"
#include "stdlib/util.h"
#include "cordhelpers.h"
#include "environment.h"
#include "typecheck.h"

View File

@ -5,7 +5,7 @@
#include <gc/cord.h>
#include "types.h"
#include "builtins/tables.h"
#include "stdlib/tables.h"
typedef struct {
CORD local_typedefs;

View File

@ -12,10 +12,10 @@
#include <signal.h>
#include "ast.h"
#include "builtins/integers.h"
#include "builtins/text.h"
#include "builtins/tables.h"
#include "builtins/util.h"
#include "stdlib/integers.h"
#include "stdlib/text.h"
#include "stdlib/tables.h"
#include "stdlib/util.h"
#include "cordhelpers.h"
// The cache of {filename -> parsed AST} will hold at most this many entries:

4
repl.c
View File

@ -8,8 +8,8 @@
#include <stdlib.h>
#include <unistd.h>
#include "builtins/tomo.h"
#include "builtins/util.h"
#include "stdlib/tomo.h"
#include "stdlib/util.h"
#include "typecheck.h"
#include "parse.h"

View File

@ -5,12 +5,12 @@
#include <stdio.h>
#include "ast.h"
#include "builtins/text.h"
#include "stdlib/text.h"
#include "compile.h"
#include "cordhelpers.h"
#include "environment.h"
#include "typecheck.h"
#include "builtins/util.h"
#include "stdlib/util.h"
static CORD compile_str_method(env_t *env, ast_t *ast)
{

6
tomo.c
View File

@ -10,9 +10,9 @@
#include <sys/wait.h>
#include "ast.h"
#include "builtins/arrays.h"
#include "builtins/datatypes.h"
#include "builtins/text.h"
#include "stdlib/arrays.h"
#include "stdlib/datatypes.h"
#include "stdlib/text.h"
#include "compile.h"
#include "cordhelpers.h"
#include "parse.h"

View File

@ -8,8 +8,8 @@
#include <sys/stat.h>
#include "ast.h"
#include "builtins/text.h"
#include "builtins/util.h"
#include "stdlib/text.h"
#include "stdlib/util.h"
#include "cordhelpers.h"
#include "environment.h"
#include "parse.h"

View File

@ -6,9 +6,9 @@
#include <stdint.h>
#include <sys/param.h>
#include "builtins/integers.h"
#include "builtins/tables.h"
#include "builtins/util.h"
#include "stdlib/integers.h"
#include "stdlib/tables.h"
#include "stdlib/util.h"
#include "cordhelpers.h"
#include "types.h"

View File

@ -6,7 +6,7 @@
#include <stdlib.h>
#include "ast.h"
#include "builtins/arrays.h"
#include "stdlib/arrays.h"
typedef struct type_s type_t;