diff options
author | Adrian Kummerlaender | 2017-04-14 23:21:51 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2017-04-14 23:21:51 +0200 |
commit | c6d2b259a4f253403929f6f1104395a6a71b1be6 (patch) | |
tree | 6d4cdfa4ab50fbe0fa982db601d772c67e4dda20 | |
parent | 963ace2e5ba0337130e5f343d7ab97a30b4547ae (diff) | |
download | slang-c6d2b259a4f253403929f6f1104395a6a71b1be6.tar slang-c6d2b259a4f253403929f6f1104395a6a71b1be6.tar.gz slang-c6d2b259a4f253403929f6f1104395a6a71b1be6.tar.bz2 slang-c6d2b259a4f253403929f6f1104395a6a71b1be6.tar.lz slang-c6d2b259a4f253403929f6f1104395a6a71b1be6.tar.xz slang-c6d2b259a4f253403929f6f1104395a6a71b1be6.tar.zst slang-c6d2b259a4f253403929f6f1104395a6a71b1be6.zip |
Convert structure to _dub_ build system
-rw-r--r-- | dub.sdl | 4 | ||||
-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
@@ -0,0 +1,4 @@ +name "slang" +description "Experimental Forth-like stack language implemented in D" +authors "Adrian Kummerländer" +license "MIT" @@ -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 ) { |