Compare commits

..

No commits in common. "a3a09d3b54f159c3895360a78408befd818e39ea" and "a1b514925a36670f065b025af5225a3400f177a4" have entirely different histories.

16 changed files with 43 additions and 70 deletions

10
README
View file

@ -2,18 +2,10 @@
jc.jai jc.jai
------ ------
# Direct installation cd [jai install directory]/modules
cd [jai install dir]/modules
git clone https://git.brut.systems/judah/jc.jai.git jc git clone https://git.brut.systems/judah/jc.jai.git jc
# Indirect installation
git clone https://git.brut.systems/judah/jc.jai.git
ln -s "/path/to/jc.jai" [jai install dir]/modules/jc # POSIX install
mklink /D "C:\path\to\jc.jai" [jai install dir]\jc # Windows install
#import "jc"; #import "jc";
#import "jc/[module]";
What What
---- ----

2
TODO
View file

@ -47,8 +47,8 @@
038 [encoding] add html support, via code - blocked by 008 038 [encoding] add html support, via code - blocked by 008
039 [encoding] add rivit support, via code (https://judahcaruso.com/rivit.htm) - blocked by 038 039 [encoding] add rivit support, via code (https://judahcaruso.com/rivit.htm) - blocked by 038
040 [encoding] add markdown (commonmark?) support, via code - blocked by 038 040 [encoding] add markdown (commonmark?) support, via code - blocked by 038
042 [x] use absolute imports internally (ie. #import "jc/math"), update symlink/install process in README
*** DONE *** *** DONE ***
010 [x] make base jai files standalone (ie. [array], [memory], etc... big maybe) 010 [x] make base jai files standalone (ie. [array], [memory], etc... big maybe)
042 [x] use absolute imports internally (ie. #import "jc/math"), update symlink/install process in README

View file

@ -2,9 +2,6 @@
compiler :: #import "Compiler"; compiler :: #import "Compiler";
compiler.set_build_options_dc(.{ do_output = false }); compiler.set_build_options_dc(.{ do_output = false });
// @note(judah): we use relative imports here because that'll
// print cleaner file locations.
#import,file "./array/module.jai"(true); #import,file "./array/module.jai"(true);
#import,file "./encoding/module.jai"(true); #import,file "./encoding/module.jai"(true);
#import,file "./hash/module.jai"(true); #import,file "./hash/module.jai"(true);
@ -12,8 +9,8 @@
#import,file "./meta/module.jai"(true); #import,file "./meta/module.jai"(true);
rmath :: #import,file "./math/module.jai"(.radians, true); rmath :: #import,file "./math/module.jai"(.radians, true);
dmath :: #import,file "./math/module.jai"(.degrees, true); // dmath :: #import,file "./math/module.jai"(.degrees, true);
tmath :: #import,file "./math/module.jai"(.turns, true); // tmath :: #import,file "./math/module.jai"(.turns, true);
} }

View file

@ -5,5 +5,5 @@
#scope_module; #scope_module;
#if RUN_TESTS { #if RUN_TESTS {
test :: #import "jc/test"; test :: #import,file "../test/module.jai";
} }

View file

@ -77,20 +77,15 @@ make_dynamic :: (a: *Static_Array) -> [..]a.T {
#scope_file; #scope_file;
mem :: #import,file "../memory/module.jai";
basic :: #import "Basic"; // @future
ensure_array_has_room :: (array: *Static_Array, count: int, loc := #caller_location) #expand { ensure_array_has_room :: (array: *Static_Array, count: int, loc := #caller_location) #expand {
basic.assert(array.count + count <= array.capacity, "attempt to add too many elements! want: %, Max: %", array.count + count, array.capacity, loc = loc); basic.assert(array.count + count <= array.capacity, "attempt to add too many elements! want: %, Max: %", array.count + count, array.capacity, loc = loc);
} }
mem :: #import "jc/memory";
basic :: #import "Basic"; // @future
// ----------------------------------------------------------
// TESTS
// ----------------------------------------------------------
#if RUN_TESTS #run { #if RUN_TESTS #run {
test :: #import "jc/test"; test :: #import,file "../test/module.jai";
test.run("basic operations", (t) => { test.run("basic operations", (t) => {
a: Static_Array(10, int); a: Static_Array(10, int);

View file

@ -156,14 +156,10 @@ encoded_length :: (count: int, with_padding := false) -> int {
#scope_file; #scope_file;
basic :: #import "Basic"; // @future basic :: #import "Basic";
strings :: #import "String"; // @future strings :: #import "String";
// ----------------------------------------------------------
// TESTS
// ----------------------------------------------------------
#if RUN_TESTS #run { #if RUN_TESTS #run {
test.run("encodes", (t) => { test.run("encodes", (t) => {
str :: "Hello, World"; str :: "Hello, World";

View file

@ -603,8 +603,7 @@ at_end :: inline (p: *Parser) -> bool {
return p.offset >= p.data.count.(u64); return p.offset >= p.data.count.(u64);
} }
basic :: #import "Basic";
basic :: #import "Basic"; // @future strings :: #import "String";
strings :: #import "String"; // @future

View file

@ -7,5 +7,5 @@
#scope_module; #scope_module;
#if RUN_TESTS { #if RUN_TESTS {
test :: #import "jc/test"; test :: #import,file "../test/module.jai";
} }

View file

@ -6,7 +6,6 @@
#load "vec.jai"; #load "vec.jai";
#load "mat.jai"; #load "mat.jai";
#scope_module; #scope_module;
bounds_check_index :: ($$idx: int, $count: int, loc := #caller_location) #expand { bounds_check_index :: ($$idx: int, $count: int, loc := #caller_location) #expand {
@ -19,8 +18,8 @@ bounds_check_index :: ($$idx: int, $count: int, loc := #caller_location) #expand
} }
basic :: #import "Basic"; // @future basic :: #import "Basic";
#if RUN_TESTS { #if RUN_TESTS {
test :: #import "jc/test"; test :: #import,file "../test/module.jai";
} }

View file

@ -349,8 +349,7 @@ quat :: (x: float = 0, y: float = 0, z: float = 0, w: float = 0) -> Quat #expand
return .{ x = x, y = y, z = z, w = w }; return .{ x = x, y = y, z = z, w = w };
} }
#scope_file
#scope_file; meta :: #import,file "../meta/module.jai";
meta :: #import "jc/meta";
math :: #import "Math"; // @future math :: #import "Math"; // @future

View file

@ -164,20 +164,19 @@ arena_alloc :: (a: *Arena, count: int, alignment := Default_Align, loc := #calle
} }
#scope_file; #scope_file;
meta :: #import "jc/meta"; // @note(judah): this will cause a cyclic import cycle if we import meta's module.jai
// @todo(judah): switch to abslote imports everywhere (ie. "jc/meta")
meta :: #import,file "../meta/type_info.jai";
basic :: #import "Basic"; // @future basic :: #import "Basic"; // @future
compiler :: #import "Compiler"; // @future compiler :: #import "Compiler"; // @future
// ----------------------------------------------------------
// TESTS
// ----------------------------------------------------------
#if RUN_TESTS #run { #if RUN_TESTS #run {
test :: #import "jc/test"; test :: #import,file "../test/module.jai";
test.run("make:dynamic arrays", (t) => { test.run("make:dynamic arrays", (t) => {
a1 := make([..]int); a1 := make([..]int);

View file

@ -36,15 +36,10 @@ snake_to_pascal :: (name: string) -> string {
#scope_module; #scope_module;
mem :: #import "jc/memory"; mem :: #import,file "../memory/module.jai";
// ----------------------------------------------------------
// TESTS
// ----------------------------------------------------------
#if RUN_TESTS { #if RUN_TESTS {
test :: #import "jc/test"; test :: #import,file "../test/module.jai";
#run test.run("snake_to_pascal", t => { #run test.run("snake_to_pascal", t => {
test.expect(t, snake_to_pascal("some_name") == "SomeName"); test.expect(t, snake_to_pascal("some_name") == "SomeName");

View file

@ -81,6 +81,8 @@ G: *struct {
print("in: teardown\n"); print("in: teardown\n");
} }
#import "jx";
#poke_name reload frame; #poke_name reload frame;
#poke_name reload init; #poke_name reload init;
#poke_name reload setup; #poke_name reload setup;
@ -90,6 +92,6 @@ G: *struct {
// Use the default build options // Use the default build options
build_options :: () => reload.Simple_Build_Options.{}; build_options :: () => reload.Simple_Build_Options.{};
reload :: #import "jc/reload"; reload :: #import "jx/reload";
#import "Basic"; #import "Basic";

View file

@ -24,6 +24,7 @@ G: *struct {
} }
#import "jx";
#import "Basic"; #import "Basic";
DISABLE_HOT_RELOADING :: false; DISABLE_HOT_RELOADING :: false;
@ -49,7 +50,7 @@ DISABLE_HOT_RELOADING :: false;
} }
} }
else { else {
reload :: #import "jc/reload"; reload :: #import "jx/reload";
#poke_name reload frame; #poke_name reload frame;
#poke_name reload init; #poke_name reload init;
#poke_name reload setup; #poke_name reload setup;

View file

@ -154,11 +154,8 @@ user_options :: #run -> Simple_Build_Options {
file_delete(temp_path); file_delete(temp_path);
} }
#import "Basic";
#scope_file; #import "File";
#import "File_Utilities";
#import "Basic"; // @future #import "String";
#import "File"; // @future #import "Compiler";
#import "File_Utilities"; // @future
#import "String"; // @future
#import "Compiler"; // @future

View file

@ -230,8 +230,10 @@ else {
#assert(false, "only windows, mac, and linux are supported for now"); #assert(false, "only windows, mac, and linux are supported for now");
} }
basic :: #import "Basic"; // @future #import "jx";
system :: #import "System"; // @future
file :: #import "File"; // @future basic :: #import "Basic";
futils :: #import "File_Utilities"; // @future system :: #import "System";
strings :: #import "String"; // @future file :: #import "File";
futils :: #import "File_Utilities";
strings :: #import "String";