Skip to content

Commit

Permalink
Merge pull request #191 from Eclalang/issue-#190-update-go-modules
Browse files Browse the repository at this point in the history
Issue #190 update go modules
  • Loading branch information
Axou89 authored Feb 7, 2024
2 parents 910d603 + fd21d63 commit 17bc76c
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 62 deletions.
32 changes: 7 additions & 25 deletions DEMO/libDoc/console.ecla
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,26 @@ function testClear() {
}
testClear();

# Test function Confirm
function testConfirm() {
var check bool = console.confirm("Do you want to continue :");
if (check) {
console.println("You have confirmed.");
} else {
console.println("You have not confirmed.");
}
}
testConfirm();

# Test function Input
function testInput() {
var input string = console.input("Enter your name : ");
console.print("Enter your name : ");
var input string = console.input();
console.println("Hello " + input + "!");
}
testInput();

# Test function InputFloat
function testInputFloat() {
var input float = console.inputFloat("Enter a float : ");
console.print("Enter a float : ");
var input float = console.inputFloat();
console.println("You entered " + input + ".");
}
testInputFloat();

# Test function InputInt
function testInputInt() {
var input int = console.inputInt("Enter an int : ");
console.print("Enter an int : ");
var input int = console.inputInt();
console.println("You entered " + input + ".");
}
testInputInt();
Expand All @@ -58,7 +50,7 @@ testPrintf();

# Test function PrintInColor
function testPrintInColor() {
console.printInColor("red", "Hello World!");
console.printInColor("\033[0;31m", "Hello Color!\n");
}
testPrintInColor();

Expand All @@ -68,13 +60,3 @@ function testPrintln() {
console.println("Hello", "user", "?");
}
testPrintln();

# Test function ProgressBar
function testProgressBar() {
for (var i int = 0, i <= 100, i+= 10) {
console.progressBar(i);
time.sleep(1);
console.clear();
}
}
testProgressBar();
13 changes: 4 additions & 9 deletions DEMO/libDoc/encoding.ecla
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ function testDecodeBase64() {
}
testDecodeBase64();

# TODO : Fix the conversion in Ecla to make this work
# Test function DecodeGob
function testDecodeGob() {
var intArr []int = [16, 12, 0, 13, 72, 101, 108, 108, 111, 44, 32, 87, 111, 114, 108, 100, 33];
var str string = encoding.decodeGob(intArr);
console.println(str);
}
##testDecodeGob();
testDecodeGob();

# Test function DecodeHex
function testDecodeHex() {
Expand All @@ -36,34 +35,30 @@ function testDecodeHex() {
}
testDecodeHex();

# TODO : Fix the conversion in Ecla to make this work
# Test function EncodeBase64
function testEncodeBase64() {
var intArr []int = [65, 66, 67];
var str string = encoding.encodeBase64(intArr);
console.println(str);
}
##testEncodeBase64();
testEncodeBase64();

# TODO : Fix the conversion in Ecla to make this work
# Test function EncodeGob
function testEncodeGob() {
var str string = "Gob is awesome!";
var intArr []int = encoding.encodeGob(str);
console.println(intArr);
}
##testEncodeGob();
testEncodeGob();

# TODO : Fix the conversion in Ecla to make this work
# Test function EncodeHex
function testEncodeHex() {
var intArr []int = [65, 66, 67];
var str string = encoding.encodeHex(intArr);
console.println(str);
}
##testEncodeHex();
testEncodeHex();

# TODO : Fix the conversion in Ecla to make this work
# Test function StringToAscii
function testStringToAscii() {
var str string = "ABC";
Expand Down
13 changes: 11 additions & 2 deletions DEMO/libDoc/json.ecla
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,28 @@

import "console";
import "json";
import "strings";

# Test function Marshal
function testMarshal() {
var mapStr map[string]string = {"name": "Ecla", "members": "7", "language": "Golang"};
var str string = json.marshal(mapStr);
console.println(str);

var arrMap []map[string]string = [{"name": "Ecla", "members": "7", "language": "Golang"}, {"name": "Ecla", "members": "7", "language": "Golang"}];
str = json.marshal(arrMap);
console.println(str);
}
testMarshal();

# Test function Unmarshal
function testUnmarshal() {
var str string = "{'name': 'Ecla', 'members': '7', 'language': 'Golang'}";
var str string = "{\"name\": \"Ecla\", \"members\": \"7\", \"language\": \"Golang\"}";
var obj map[string]string = json.unmarshal(str);
console.println(obj);

var strArr string = "[{\"name\": \"Ecla\", \"members\": \"7\", \"language\": \"Golang\"}, {\"name\": \"Test\", \"members\": \"12\", \"language\": \"Python\"}]";
var objArr []map[string]string = json.unmarshal(strArr);
console.println(objArr);
}
testUnmarshal();
testUnmarshal();
2 changes: 1 addition & 1 deletion DEMO/libDoc/math.ecla
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ testExp();

# Test function Fact
function testFact() {
console.println(math.fact(5));
console.println(math.fact(5.0));
}
testFact();

Expand Down
7 changes: 3 additions & 4 deletions DEMO/libDoc/strings.ecla
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,19 @@ function testCount() {
}
testCount();

# TODO : Fix this it's not working
# Test function Cut
function testCut() {
var str string = "Hello World";
var substr string = "W";
var before []string;
var before string;
var after string;
var found bool;
before = strings.cut(str, substr);
before, after, found = strings.cut(str, substr);
console.println(before);
console.println(after);
console.println(found);
}
#testCut();
testCut();

# Test function HasPrefix
function testHasPrefix() {
Expand Down
23 changes: 12 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ module github.com/Eclalang/Ecla

go 1.21.1

require github.com/Eclalang/LibraryController v0.0.0-20240207163638-1857ea2c8744

require (
github.com/Eclalang/LibraryController v0.0.0-20240110155126-b5b581cf4cf0
github.com/Eclalang/cast v0.0.0-20230412075237-1628861597c7
github.com/Eclalang/console v0.0.0-20230412145904-e88489fbc97d
github.com/Eclalang/encoding v0.0.0-20230426103355-d5d8ac9cebd8
github.com/Eclalang/hash v0.0.0-20230412075750-64b0e5c5265f
github.com/Eclalang/json v0.0.0-20230412080015-0eb60c596892
github.com/Eclalang/math v0.0.0-20230425163002-59ae1105b4f0
github.com/Eclalang/os v0.0.0-20230412080141-90c64a283c44
github.com/Eclalang/regex v0.0.0-20230412080238-d04497c06e2a
github.com/Eclalang/strings v0.0.0-20230426085402-f6ea22be551e
github.com/Eclalang/time v0.0.0-20230412080614-ad9ed2a84fb1
github.com/Eclalang/cast v0.0.0-20230412075237-1628861597c7 // indirect
github.com/Eclalang/console v0.0.0-20240207094633-ad734f120a0a // indirect
github.com/Eclalang/encoding v0.0.0-20230426103355-d5d8ac9cebd8 // indirect
github.com/Eclalang/hash v0.0.0-20230412075750-64b0e5c5265f // indirect
github.com/Eclalang/json v0.0.0-20240207094829-384a74bcf3ef // indirect
github.com/Eclalang/math v0.0.0-20240207094845-3339ca7db7ff // indirect
github.com/Eclalang/os v0.0.0-20240207163028-e6e2204c0b60 // indirect
github.com/Eclalang/regex v0.0.0-20230412080238-d04497c06e2a // indirect
github.com/Eclalang/strings v0.0.0-20240207094647-1af7a6fff1bf // indirect
github.com/Eclalang/time v0.0.0-20230412080614-ad9ed2a84fb1 // indirect
)
30 changes: 20 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
github.com/Eclalang/LibraryController v0.0.0-20240110155126-b5b581cf4cf0 h1:WFIKt6oqlMOIqef1oH4YIPVcWwdJm+jo8Bwt27iSrjQ=
github.com/Eclalang/LibraryController v0.0.0-20240110155126-b5b581cf4cf0/go.mod h1:mXfoGWI3Va1vvgCRmjvFJn0zuWVorxlpB7gUcsOwOz0=
github.com/Eclalang/LibraryController v0.0.0-20240124155327-7709af1fd1bf h1:qNtqZBnoysnoqdWXFp+0u3rVSfjRL9sXFH/SCgaHs9U=
github.com/Eclalang/LibraryController v0.0.0-20240124155327-7709af1fd1bf/go.mod h1:IjjRku6ZJ0e9/JleqPZd24BaK6EhQyif5DfrIotmKWs=
github.com/Eclalang/LibraryController v0.0.0-20240207101427-314a20beadbe h1:0Hwk68fsStwVPVYqRklxeO78NPTUZoczB5tfv7RaZaE=
github.com/Eclalang/LibraryController v0.0.0-20240207101427-314a20beadbe/go.mod h1:/wurCkCnkFvOyjoDr6RHn5MLCg9TBDXfeAAoKgbXaM8=
github.com/Eclalang/LibraryController v0.0.0-20240207150136-5017e2cefc7f h1:FyuZ/QpVW3/m3fYDe9l/f5d6wC7l6vz5aEcdgsTNu5s=
github.com/Eclalang/LibraryController v0.0.0-20240207150136-5017e2cefc7f/go.mod h1:/wurCkCnkFvOyjoDr6RHn5MLCg9TBDXfeAAoKgbXaM8=
github.com/Eclalang/LibraryController v0.0.0-20240207154344-9b96e9da3ceb h1:reYLod2BU0RVs6ClWixssLXGASts6d9jwNOH9xanJ2o=
github.com/Eclalang/LibraryController v0.0.0-20240207154344-9b96e9da3ceb/go.mod h1:/wurCkCnkFvOyjoDr6RHn5MLCg9TBDXfeAAoKgbXaM8=
github.com/Eclalang/LibraryController v0.0.0-20240207163638-1857ea2c8744 h1:DkaODHuKQLWK50fFx9QvSwiKYvfl+ymFWF1aJye+4Sk=
github.com/Eclalang/LibraryController v0.0.0-20240207163638-1857ea2c8744/go.mod h1:nc8mdoUKsBOon3oN58qQZQaZaRAUJHuxVE79+3kd/PA=
github.com/Eclalang/cast v0.0.0-20230412075237-1628861597c7 h1:pKeX3GmAplWLKg6uKvkBY//kZFzKASk2YjLeiCoMeV4=
github.com/Eclalang/cast v0.0.0-20230412075237-1628861597c7/go.mod h1:RJAiwgqiEPT3kmoSYTBK+JhpGOI8YXRdxrQ99zJyA00=
github.com/Eclalang/console v0.0.0-20230412145904-e88489fbc97d h1:Xf5MWfgpnhCbzmrmCMec7QCxNHB/Q5VcX/dId5XmgLo=
github.com/Eclalang/console v0.0.0-20230412145904-e88489fbc97d/go.mod h1:RHRoUAVzxpcTVzX/rPm5VFjOUrshw4v9pBVDlCEmwQM=
github.com/Eclalang/console v0.0.0-20240207094633-ad734f120a0a h1:IBaYgeCVG28vqB9hC3Hf4bOTIJ0cak+HnmtqGqITjmE=
github.com/Eclalang/console v0.0.0-20240207094633-ad734f120a0a/go.mod h1:RHRoUAVzxpcTVzX/rPm5VFjOUrshw4v9pBVDlCEmwQM=
github.com/Eclalang/encoding v0.0.0-20230426103355-d5d8ac9cebd8 h1:WqTJN7ui5vYITJeiinOba/x40IXuKYPuyLkTKpQk/X0=
github.com/Eclalang/encoding v0.0.0-20230426103355-d5d8ac9cebd8/go.mod h1:fc3/K5xxbEf8fRSBhxunDFRerN3Wr6CXJ2lyA1nbxWA=
github.com/Eclalang/hash v0.0.0-20230412075750-64b0e5c5265f h1:sS4I2LJbWvT1wFDT0IyZhbZ1i1JxnY9Lw7Vei+Pp9gI=
github.com/Eclalang/hash v0.0.0-20230412075750-64b0e5c5265f/go.mod h1:/ZoCq7JP9TBYTl79nIvL2X+VowFnarTwa8/fa9APK/w=
github.com/Eclalang/json v0.0.0-20230412080015-0eb60c596892 h1:G+VMJaqfNngzTYItN7V1uMr2C8tjHb7bpHOKzl2ggms=
github.com/Eclalang/json v0.0.0-20230412080015-0eb60c596892/go.mod h1:FH/nXnNXMThd0LVoajFWBTRMjWVvjN1CIG2BkZ1z8mE=
github.com/Eclalang/math v0.0.0-20230425163002-59ae1105b4f0 h1:RHNEIqlOhOIOxsQZU+j8WZRjh6a8mMk3wkuIeV/n2MA=
github.com/Eclalang/math v0.0.0-20230425163002-59ae1105b4f0/go.mod h1:fsm8hu/CrnnYL1HNvftRyQp47ENW4QRs5AC+f2V+hOc=
github.com/Eclalang/json v0.0.0-20240207094829-384a74bcf3ef h1:nLRLTTGMK1qmBIyltxiz+r7OK7PPXGGAZFqi6MYXVtE=
github.com/Eclalang/json v0.0.0-20240207094829-384a74bcf3ef/go.mod h1:yr0YD25iKfdqzbchd0LY04/IswgBow51BPomNXIK+2k=
github.com/Eclalang/math v0.0.0-20240207094845-3339ca7db7ff h1:iWve/tVWztLItNshB1nUepm/MmUyE8BpuL1u2p8gmcM=
github.com/Eclalang/math v0.0.0-20240207094845-3339ca7db7ff/go.mod h1:fsm8hu/CrnnYL1HNvftRyQp47ENW4QRs5AC+f2V+hOc=
github.com/Eclalang/os v0.0.0-20230412080141-90c64a283c44 h1:qB0RWqDOMWzyFcTsGZny8tmdMzhr6VJTJQCem7MrvSM=
github.com/Eclalang/os v0.0.0-20230412080141-90c64a283c44/go.mod h1:aOlOP4WanamjHncVvr4hRCUkF0FRh6Yud1Suu9EviRo=
github.com/Eclalang/os v0.0.0-20240207163028-e6e2204c0b60 h1:vEQbT4mJQeB3pI1xO47DJ5v0syV+w/LgMgJ3xZW3tR4=
github.com/Eclalang/os v0.0.0-20240207163028-e6e2204c0b60/go.mod h1:aOlOP4WanamjHncVvr4hRCUkF0FRh6Yud1Suu9EviRo=
github.com/Eclalang/regex v0.0.0-20230412080238-d04497c06e2a h1:pcfPdmyk16qjlJfdTuQvL0xK+KYfsStevoAgtvS6w+U=
github.com/Eclalang/regex v0.0.0-20230412080238-d04497c06e2a/go.mod h1://L9ebqTHyWDZWhmsvbmWFjfczjNUHGcRKpZj8dDR00=
github.com/Eclalang/strings v0.0.0-20230426085402-f6ea22be551e h1:yK1ahDhSIi9SdbKnQ8LcCipMBpvnukMlw7Mo2sKLUrk=
github.com/Eclalang/strings v0.0.0-20230426085402-f6ea22be551e/go.mod h1:2FgmYwPkfSu/cd2gZ8Wy37QfMzv2eraF86V/dDrLLhk=
github.com/Eclalang/strings v0.0.0-20240207094647-1af7a6fff1bf h1:P19Ady2ppkTbzWlRCj4HDNTsmppoa0JxbGBzKBNGBLI=
github.com/Eclalang/strings v0.0.0-20240207094647-1af7a6fff1bf/go.mod h1:2FgmYwPkfSu/cd2gZ8Wy37QfMzv2eraF86V/dDrLLhk=
github.com/Eclalang/time v0.0.0-20230412080614-ad9ed2a84fb1 h1:d0EBdW1690SPusWNj+tjmihWAApch/A1OtdIUToAvoY=
github.com/Eclalang/time v0.0.0-20230412080614-ad9ed2a84fb1/go.mod h1://+Z1TD75utJJ7ob1E+D60sNezGOI3T7rhN17jYGnvM=

0 comments on commit 17bc76c

Please sign in to comment.