aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dub.sdl4
-rw-r--r--source/app.d (renamed from repl.d)6
-rw-r--r--source/base/definition.d (renamed from src/definition.d)4
-rw-r--r--source/base/stack.d (renamed from src/stack.d)6
-rw-r--r--source/primitives/conditional.d (renamed from src/primitives/conditional.d)4
-rw-r--r--source/primitives/core.d (renamed from src/primitives/core.d)8
-rw-r--r--source/primitives/eval.d (renamed from src/primitives/eval.d)8
7 files changed, 22 insertions, 18 deletions
diff --git a/dub.sdl b/dub.sdl
new file mode 100644
index 0000000..0273ce9
--- /dev/null
+++ b/dub.sdl
@@ -0,0 +1,4 @@
+name "slang"
+description "Experimental Forth-like stack language implemented in D"
+authors "Adrian Kummerländer"
+license "MIT"
diff --git a/repl.d b/source/app.d
index 3f2aea4..7d25f7f 100644
--- a/repl.d
+++ b/source/app.d
@@ -4,10 +4,10 @@ import std.variant;
import std.container.util : make;
-import src.stack;
+import base.stack;
-import definition = src.definition;
-import primitives = src.primitives.eval;
+import definition = base.definition;
+import primitives = primitives.eval;
Stack!Token resolve(Token token) {
try {
diff --git a/src/definition.d b/source/base/definition.d
index 9c3606e..cf64f3e 100644
--- a/src/definition.d
+++ b/source/base/definition.d
@@ -1,4 +1,4 @@
-module src.definition;
+module base.definition;
import std.string;
import std.variant;
@@ -6,7 +6,7 @@ import std.typecons;
import std.container : DList;
-import src.stack;
+import base.stack;
alias Words = Stack!Token[string];
diff --git a/src/stack.d b/source/base/stack.d
index 678f3e8..253bac0 100644
--- a/src/stack.d
+++ b/source/base/stack.d
@@ -1,11 +1,11 @@
-module src.stack;
+module base.stack;
import std.conv;
import std.string;
import std.variant;
import std.container : SList;
-static import src.definition;
+import definition = base.definition;
alias Token = Algebraic!(int, bool, string);
alias Stack = SList;
@@ -35,7 +35,7 @@ Token pop(ref Stack!Token stack) {
}
void push(ref Stack!Token stack, Token token) {
- if ( !src.definition.handle(token) ) {
+ if ( !definition.handle(token) ) {
stack.insertFront(token);
}
}
diff --git a/src/primitives/conditional.d b/source/primitives/conditional.d
index ee89ea5..678f516 100644
--- a/src/primitives/conditional.d
+++ b/source/primitives/conditional.d
@@ -1,10 +1,10 @@
-module src.primitives.conditional;
+module primitives.conditional;
import std.variant;
import std.typecons;
import std.container : DList;
-import src.stack;
+import base.stack;
Nullable!(DList!Token) buffer;
bool concluded = true;
diff --git a/src/primitives/core.d b/source/primitives/core.d
index 5b3d43d..45bbeac 100644
--- a/src/primitives/core.d
+++ b/source/primitives/core.d
@@ -1,14 +1,14 @@
-module src.primitives.core;
+module primitives.core;
import std.stdio;
-import src.stack;
-import src.definition;
+import base.stack;
+import definition = base.definition;
Token[string] variables;
void definition_start() {
- src.definition.start;
+ definition.start;
}
void binary_op_variable_bind() {
diff --git a/src/primitives/eval.d b/source/primitives/eval.d
index 08d8fb9..0ddd65a 100644
--- a/src/primitives/eval.d
+++ b/source/primitives/eval.d
@@ -1,10 +1,10 @@
-module src.primitives.eval;
+module primitives.eval;
import std.variant;
-import src.stack;
-import src.primitives.core;
-import conditional = src.primitives.conditional;
+import base.stack;
+import primitives.core;
+import conditional = primitives.conditional;
bool evaluate_primitive(string word) {
switch ( word ) {