aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/app.d2
-rw-r--r--source/base/stack.d12
2 files changed, 9 insertions, 5 deletions
diff --git a/source/app.d b/source/app.d
index 0f17afc..35b2d88 100644
--- a/source/app.d
+++ b/source/app.d
@@ -38,7 +38,7 @@ void process(string value) {
if ( result.front == current ) {
stack.push(current);
} else {
- buffer.insertFront(result[]);
+ buffer.push(result);
}
}
}
diff --git a/source/base/stack.d b/source/base/stack.d
index e42ff12..c6e1a59 100644
--- a/source/base/stack.d
+++ b/source/base/stack.d
@@ -32,13 +32,17 @@ Token pop(ref Stack!Token stack) {
return token;
}
-void push(ref Stack!Token stack, Token token) {
- stack.insertFront(token);
-}
-
template push(T)
if ( is(T == int) || is(T == bool) || is (T == string) ) {
void push(ref Stack!Token stack, T value) {
stack.push(Token(value));
}
}
+
+void push(ref Stack!Token stack, Token token) {
+ stack.insertFront(token);
+}
+
+void push(ref Stack!Token stack, Stack!Token prefix) {
+ stack.insertFront(prefix[]);
+}