aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock36
-rw-r--r--Cargo.toml11
-rw-r--r--benches/sylt_benchmark.rs (renamed from benches/tihdy_benchmark.rs)8
-rw-r--r--src/main.rs12
-rw-r--r--sylt_macro/Cargo.toml (renamed from tihdy_derive/Cargo.toml)4
-rw-r--r--sylt_macro/src/lib.rs (renamed from tihdy_derive/src/lib.rs)8
6 files changed, 39 insertions, 40 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 3e3759e..fde14d2 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -499,6 +499,24 @@ dependencies = [
]
[[package]]
+name = "sylt"
+version = "0.1.0"
+dependencies = [
+ "criterion",
+ "logos",
+ "owo-colors",
+ "sylt_macro",
+]
+
+[[package]]
+name = "sylt_macro"
+version = "0.1.0"
+dependencies = [
+ "quote",
+ "syn",
+]
+
+[[package]]
name = "syn"
version = "1.0.58"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -519,24 +537,6 @@ dependencies = [
]
[[package]]
-name = "tihdy"
-version = "0.1.0"
-dependencies = [
- "criterion",
- "logos",
- "owo-colors",
- "tihdy_derive",
-]
-
-[[package]]
-name = "tihdy_derive"
-version = "0.1.0"
-dependencies = [
- "quote",
- "syn",
-]
-
-[[package]]
name = "tinytemplate"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index e78987e..f6b763f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,25 +1,24 @@
[package]
-name = "tihdy"
+name = "sylt"
version = "0.1.0"
-authors = ["Edvard Thörnros <edvard.thornros@gmail.com>"]
+authors = ["Edvard Thörnros <edvard.thornros@gmail.com>", "Gustav Sörnäs <gustav@sornas.net>"]
edition = "2018"
[lib]
-name = "tihdy"
+name = "sylt"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
logos = "0.11.4"
owo-colors = { git="https://github.com/FredTheDino/owo-colors.git" }
-tihdy_derive = { path = "tihdy_derive" }
+sylt_macro = { path = "sylt_macro" }
criterion = { version = "0.3", optional = true }
[profile.release]
-debug = true
lto = "thin"
[[bench]]
-name = "tihdy_benchmark"
+name = "sylt_benchmark"
harness = false
diff --git a/benches/tihdy_benchmark.rs b/benches/sylt_benchmark.rs
index f639fb0..a68a762 100644
--- a/benches/tihdy_benchmark.rs
+++ b/benches/sylt_benchmark.rs
@@ -17,8 +17,8 @@ for , j < 1000, j = j + 1 {
a <=> 12586269025
}
";
- let compiled = tihdy::compiler::compile("main", Path::new("prog"), tihdy::tokenizer::string_to_tokens(prog)).unwrap();
- c.bench_function("fib 50", |b| b.iter(|| tihdy::vm::run_block(&compiled).unwrap()));
+ let compiled = sylt::compiler::compile("main", Path::new("prog"), sylt::tokenizer::string_to_tokens(prog)).unwrap();
+ c.bench_function("fib 50", |b| b.iter(|| sylt::vm::run_block(&compiled).unwrap()));
}
pub fn fib_90(c: &mut Criterion) {
@@ -34,8 +34,8 @@ for i := 0, i < 90, i = i + 1 {
}
a <=> 2880067194370816120
";
- let compiled = tihdy::compiler::compile("main", Path::new("prog"), tihdy::tokenizer::string_to_tokens(prog)).unwrap();
- c.bench_function("fib 90", |b| b.iter(|| tihdy::vm::run_block(&compiled).unwrap()));
+ let compiled = sylt::compiler::compile("main", Path::new("prog"), sylt::tokenizer::string_to_tokens(prog)).unwrap();
+ c.bench_function("fib 90", |b| b.iter(|| sylt::vm::run_block(&compiled).unwrap()));
}
criterion_group!(benches, fib_50, fib_90);
diff --git a/src/main.rs b/src/main.rs
index c52acc8..37ae256 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,6 +1,6 @@
use std::path::{Path, PathBuf};
-use tihdy::run_file;
+use sylt::run_file;
struct Args {
file: Option<PathBuf>,
@@ -39,12 +39,12 @@ fn parse_args() -> Args {
args
}
-tihdy_derive::extern_function!(
+sylt_macro::extern_function!(
extern_test
- [tihdy::Value::Float(x), tihdy::Value::Float(y)] -> tihdy::Type::Float => {
- Ok(tihdy::Value::Float(x + y))
+ [sylt::Value::Float(x), sylt::Value::Float(y)] -> sylt::Type::Float => {
+ Ok(sylt::Value::Float(x + y))
},
- [tihdy::Value::Float(x)] -> tihdy::Type::Float => {
- Ok(tihdy::Value::Float(*x))
+ [sylt::Value::Float(x)] -> sylt::Type::Float => {
+ Ok(sylt::Value::Float(*x))
},
);
diff --git a/tihdy_derive/Cargo.toml b/sylt_macro/Cargo.toml
index 411f1ab..9ac045e 100644
--- a/tihdy_derive/Cargo.toml
+++ b/sylt_macro/Cargo.toml
@@ -1,7 +1,7 @@
[package]
-name = "tihdy_derive"
+name = "sylt_macro"
version = "0.1.0"
-authors = ["Gustav Sörnäs <gustav@sornas.net>"]
+authors = ["Edvard Thörnros <edvard.thornros@gmail.com", "Gustav Sörnäs <gustav@sornas.net>"]
edition = "2018"
[lib]
diff --git a/tihdy_derive/src/lib.rs b/sylt_macro/src/lib.rs
index c0806ab..241ef7d 100644
--- a/tihdy_derive/src/lib.rs
+++ b/sylt_macro/src/lib.rs
@@ -65,20 +65,20 @@ pub fn extern_function(tokens: TokenStream) -> TokenStream {
let tokens = quote! {
pub fn #function (
- __values: &[tihdy::Value],
+ __values: &[sylt::Value],
__typecheck: bool
- ) -> ::std::result::Result<tihdy::Value, tihdy::error::ErrorKind>
+ ) -> ::std::result::Result<sylt::Value, sylt::error::ErrorKind>
{
if __typecheck {
#[allow(unused_variables)]
match __values {
#(#typecheck_blocks),*
- _ => Err(tihdy::error::ErrorKind::ExternTypeMismatch(stringify!(#function).to_string(), __values.iter().map(|v| tihdy::Type::from(v)).collect()))
+ _ => Err(sylt::error::ErrorKind::ExternTypeMismatch(stringify!(#function).to_string(), __values.iter().map(|v| sylt::Type::from(v)).collect()))
}
} else {
match __values {
#(#eval_blocks),*
- _ => Err(tihdy::error::ErrorKind::ExternTypeMismatch(stringify!(#function).to_string(), __values.iter().map(|v| tihdy::Type::from(v)).collect()))
+ _ => Err(sylt::error::ErrorKind::ExternTypeMismatch(stringify!(#function).to_string(), __values.iter().map(|v| sylt::Type::from(v)).collect()))
}
}
}