-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com-Nic:slothlang/sloth
- Loading branch information
Showing
12 changed files
with
172 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
node_modules/ | ||
*.vsix | ||
|
||
cbuild.sh | ||
# Added by cargo | ||
|
||
/target | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
[workspace] | ||
resolver = "2" | ||
members = [ "sloth" ] | ||
|
||
[workspace.package] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!DOCTYPE html> | ||
<head> | ||
<title>sloth</title> | ||
</head> | ||
<html> | ||
<body> | ||
<h1>Sloth</h1> | ||
<p>paragraph</p> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
fn main() Int { | ||
var port: Int = 8080; | ||
var addr: String = "auto"; | ||
while true { | ||
var server: Int = serversock(port, addr, 10, true); | ||
sendsock("HTTP/1.0 200 OK\r\nServer: webserver-c\r\nContent-type: text/html\r\n\r\n<html>hello, world</html>\r\n", server); | ||
wait(0.5); | ||
closesock(server, false); | ||
} | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
[toolchain] | ||
channel = "nightly-2023-06-15" | ||
channel = "nightly-2023-06-19" | ||
components = [ "rust-src", "rust-analyzer" ] | ||
targets = [ "wasm32-unknown-unknown" ] | ||
profile = "default" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#![feature(let_chains)] | ||
#![warn( | ||
clippy::wildcard_imports, | ||
clippy::string_add, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
fn main() Int { | ||
print("print()"); | ||
println("println()"); | ||
var read: String = readln(); | ||
println(read); | ||
var file: String = filer("std/testing.sloth"); | ||
println(file); | ||
curshide(); | ||
readln(); | ||
cursshow(); | ||
readln(); | ||
wait(3); | ||
var sle: Int = slen("Sloth"); | ||
println(istr(sle)); | ||
var parse: Int = parse_int("45"); | ||
if sequals("Sloth", "Sloth") { | ||
println("sequals"); | ||
} | ||
if sequals("sloth", "Sloth") { | ||
println("sequals error"); | ||
} | ||
var asint: Int = as_int(3.0); | ||
system("echo hello_echo"); | ||
wait(5); | ||
termclear(); | ||
print("randGen: "); | ||
println(istr(randGen(0,10))); | ||
print("abs: "); | ||
println(istr(abs(-5))); | ||
print("fabs: "); | ||
println(istr(as_int(fabs(-3.0)))); | ||
print("max: "); | ||
println(istr(max(3, 10))); | ||
print("min: "); | ||
println(istr(min(3, 10))); | ||
print("fmax: "); | ||
println(istr(as_int(fmax(3.0, 10.0)))); | ||
print("fmin: "); | ||
println(istr(as_int(fmin(3.0, 10.0)))); | ||
print("pow: "); | ||
println(istr(as_int(pow(5.0, 2.0)))); | ||
print("floor: "); | ||
println(istr(floor(3.7))); | ||
print("ceil: "); | ||
println(istr(ceil(3.3))); | ||
print("round: "); | ||
println(istr(round(3.5))); | ||
print("round: "); | ||
println(istr(round(3.4))); | ||
print("round: "); | ||
println(istr(round(3.6))); | ||
|
||
return 0; | ||
} |