Skip to content

Commit

Permalink
sily lib sync
Browse files Browse the repository at this point in the history
  • Loading branch information
al1-ce committed May 3, 2024
1 parent 5bd319b commit cf2a852
Show file tree
Hide file tree
Showing 31 changed files with 914 additions and 138 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Sily libraries for D programming language.

[![](readme/logo.png)](https://github.com/al1-ce/sily-dlang)
[![](readme/logo-term.png)](https://github.com/al1-ce/sily-terminal)
[![](readme/logo-ray.png)](https://github.com/al1-ce/sily-raylib)
[![](readme/logo-game.png)](https://github.com/al1-ce/sily-gamelib)
[![](readme/logo-jspp.png)](https://github.com/al1-ce/sily-jspp)
[sily](https://github.com/al1-ce/sily-dlang)
[sily-terminal](https://github.com/al1-ce/sily-terminal)
[sily-web](https://github.com/al1-ce/sily-web)
[sily-sdl](https://github.com/al1-ce/sily-sdl)

### *sily-raylib* and *sily-gamelib* will be merged and reworked in *raylight*
### This is V4 library. It will sync dependencies between sister libraries

### Right after V4 will be released V5
### In V5 all sub-libraries will be merged into main one for my own versioning convenience

### README IS WIP (will get full *"wiki"* at some day)

## Modules

* sily.bindbc - BindBC utils
* sily - Core utils
* sily.dyaml - Improved [dyaml](https://github.com/dlang-community/D-YAML) node retrieving
* sily.sdlang - Improved [sdlite](https://github.com/s-ludwig/sdlite)
* sily.unit - Unittest utils
* sily.dyaml - Improved [dyaml](https://github.com/dlang-community/D-YAML) node retrieving (DEPRECATED)
* sily.sdlang - Improved [sdlite](https://github.com/s-ludwig/sdlite) (DEPRECATED)

## core
* `sily.color` and `sily.vector`: Contains color and templated vector structs with utils
Expand Down
6 changes: 0 additions & 6 deletions build.log

This file was deleted.

19 changes: 0 additions & 19 deletions comntregex.txt

This file was deleted.

10 changes: 5 additions & 5 deletions core/sily/matrix.d
Original file line number Diff line number Diff line change
Expand Up @@ -663,17 +663,17 @@ struct Matrix(T, size_t H, size_t W) if (isNumeric!T && W > 0 && H > 0) {
}

/// Constructs 2d scale matrix
static MatType scale(T[2] s, ...) {
static MatType scale(T[2] s...) {
return MatType(s[0], 0, 0, 0, s[1], 0, 0, 0, 1);
}

/// Constructs 2d shear matrix
static MatType shear(T[2] s, ...) {
static MatType shear(T[2] s...) {
return MatType(1, s[0], 0, s[1], 1, 0, 0, 0, 1);
}

/// Constructs 2d translation matrix
static MatType translation(T[2] s, ...) {
static MatType translation(T[2] s...) {
return MatType(1, 0, s[0], 0, 1, s[1], 0, 0, 1);
}
} else
Expand Down Expand Up @@ -730,7 +730,7 @@ struct Matrix(T, size_t H, size_t W) if (isNumeric!T && W > 0 && H > 0) {
}

/// Constructs 3d scale matrix
static MatType scale(T[3] v, ...) {
static MatType scale(T[3] v...) {
return MatType(
v[0], 0, 0, 0,
0, v[1], 0, 0,
Expand All @@ -740,7 +740,7 @@ struct Matrix(T, size_t H, size_t W) if (isNumeric!T && W > 0 && H > 0) {
}

/// Constructs 3d translation matrix
static MatType translation(T[3] v, ...) {
static MatType translation(T[3] v...) {
return MatType(
1, 0, 0, v[0],
0, 1, 0, v[1],
Expand Down
4 changes: 2 additions & 2 deletions core/sily/queue.d
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ struct Queue(T) {
push(vals);
}

/// opOpAssign x += y == x.push(y)
Queue!T opOpAssign(string op)( in T b ) if ( op == "+" ) {
/// opOpAssign x ~= y == x.push(y)
Queue!T opOpAssign(string op: "~")( in T b ) {
push(b);
return this;
}
Expand Down
4 changes: 2 additions & 2 deletions core/sily/stack.d
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ struct Stack(T) {
push(vals);
}

/// opOpAssign x += y == x.push(y)
Stack!T opOpAssign(string op)( in T b ) if ( op == "+" ) {
/// opOpAssign x ~= y == x.push(y)
Stack!T opOpAssign(string op: "~")( in T b ) {
push(b);
return this;
}
Expand Down
4 changes: 3 additions & 1 deletion dub.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name "sily"
description "Personal library"
authors "Alisa Lain"
copyright "Copyright © 2022, Alisa Lain"
license "MIT license"
license "GPL-3.0"
targetType "library"
targetPath "lib"
sourcePaths "core/"
Expand Down Expand Up @@ -33,8 +33,10 @@ subPackage {

subPackage {
name "sdlang"
// TODO: remove
dependency "sdlite" version="~>1.1.2"
dependency "taggedalgebraic" version="~>0.11.22"
dependency "sily" version="*"
targetType "library"
targetPath "lib"
sourcePaths "sdlang/"
Expand Down
2 changes: 1 addition & 1 deletion dyaml/sily/dyaml/package.d
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// dYAML wrapper
module sily.dyaml;
deprecated module sily.dyaml;

import dyaml;

Expand Down
8 changes: 8 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ release:
dust:
dub dustmite ../dustmite/sily-dlang/ --compiler-status=-4 -b=release --no-redirect

test file:
#!/bin/bash
if [[ -f "test/{{file}}.d" ]]; then
dub run --single "test/{{file}}.d"
else
echo "Missing test/{{file}}.d"
fi

# Cheatsheet:
# Set a variable (variable case is arbitrary)
# SINGLE := "--single"
Expand Down
2 changes: 1 addition & 1 deletion sdlang/sily/sdlang/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ title \
"Some title"
---
+/
module sily.sdlang;
deprecated module sily.sdlang;

import sdl = sdlite;
import std.range;
Expand Down
6 changes: 4 additions & 2 deletions test/center → test/center.d
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/usr/bin/env dub
/+ dub.sdl:
name "logtest"
dependency "sily" path="/g/sily-dlang/"
dependency "sily:logger" path="/g/sily-dlang/"
dependency "sily" path="../"
dependency "sily:logger" path="../"
// dependency "logger" path="/g/sily-dlang/logger"
targetType "executable"
targetPath "../bin/"
+/
module test.logtest;

Expand Down
6 changes: 4 additions & 2 deletions test/color → test/color.d
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/env dub
/+ dub.sdl:
name "colortest"
dependency "sily" path="/g/sily-dlang/"
dependency "sily:terminal" path="/g/sily-dlang/"
dependency "sily" path="../"
dependency "sily:terminal" path="../"
targetType "executable"
targetPath "../bin/"
+/

import std.stdio;
Expand Down
4 changes: 3 additions & 1 deletion test/curl → test/curl.d
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env dub
/+ dub.sdl:
name "curltest"
dependency "sily" path="/g/sily-dlang/"
dependency "sily" path="../"
targetType "executable"
targetPath "../bin/"
+/

import std.stdio;
Expand Down
10 changes: 6 additions & 4 deletions test/matrix → test/matrix.d
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/usr/bin/env dub
/+ dub.sdl:
name "matrixtext"
dependency "sily" path="/g/sily-dlang/"
// dependency "sily:unit" path="/g/sily-dlang/"
dependency "sily-terminal" path="/g/sily-terminal/"
dependency "sily-terminal:logger" path="/g/sily-terminal/"
dependency "sily" path="../"
// dependency "sily:unit" path="../"
dependency "sily-terminal" version="~>4"
dependency "sily-terminal:logger" version="~>4"
targetType "executable"
targetPath "../bin/"
+/

import std.stdio: writeln, write;
Expand Down
4 changes: 3 additions & 1 deletion test/property → test/property.d
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env dub
/+ dub.sdl:
name "propertytest"
dependency "sily" path="/g/sily-dlang/"
dependency "sily" path="../"
targetType "executable"
targetPath "../bin/"
+/
module test.propertytest;

Expand Down
12 changes: 7 additions & 5 deletions test/queue → test/queue.d
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/usr/bin/env dub
/+ dub.sdl:
name "queuetest"
dependency "sily" path="/g/sily-dlang/"
dependency "sily-terminal" path="/g/sily-terminal/"
dependency "sily-terminal:logger" path="/g/sily-terminal/"
dependency "sily" path="../"
dependency "sily-terminal" version="~>4"
dependency "sily-terminal:logger" version="~>4"
targetType "executable"
targetPath "../bin/"
+/

import std.stdio;
Expand Down Expand Up @@ -52,7 +54,7 @@ void main() {
ique.toString.eq("[]", "toString()");
ique.push();
ique.toString.eq("[]", "toString()");
ique += 3;
ique ~= 3;
ique.front.eq(3, "front");
ique.push(4, 5, 6, 7, 8, 9, 10);
ique.limitLength(5);
Expand Down Expand Up @@ -82,7 +84,7 @@ void main() {
istk.toString.eq("[]", "toString()");
istk.push();
istk.toString.eq("[]", "toString()");
istk += 3;
istk ~= 3;
istk.front.eq(3, "front");
istk.push(4, 5, 6, 7, 8, 9, 10);
istk.limitLength(5);
Expand Down
65 changes: 0 additions & 65 deletions test/sdlang

This file was deleted.

Loading

0 comments on commit cf2a852

Please sign in to comment.