summaryrefslogtreecommitdiffstats
path: root/Sencha-lang/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Sencha-lang/main.cpp')
-rw-r--r--Sencha-lang/main.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/Sencha-lang/main.cpp b/Sencha-lang/main.cpp
index c7b9780..22d7b71 100644
--- a/Sencha-lang/main.cpp
+++ b/Sencha-lang/main.cpp
@@ -54,6 +54,18 @@ SenchaObject print(vector<ASTExpression *> arguments)
std::cout << value.str();
}
+ return SenchaObject();
+}
+
+SenchaObject println(vector<ASTExpression *> arguments)
+{
+ for (auto argument: arguments)
+ {
+ auto value = argument->evaluate();
+
+ std::cout << value.str();
+
+ }
std::cout << std::endl;
return SenchaObject();
}
@@ -157,6 +169,7 @@ void interactive()
ContextManager context_manager;
context_manager.context("global")->register_function("print", print);
+ context_manager.context("global")->register_function("println", println);
context_manager.context("global")->register_function("sin", s_sin);
context_manager.context("global")->register_function("cos", s_cos);
context_manager.context("global")->register_function("tan", s_tan);
@@ -212,6 +225,7 @@ int main(int argc, char *argv[])
Lexer lexer;
ContextManager context_manager;
context_manager.context("global")->register_function("print", print);
+ context_manager.context("global")->register_function("println", println);
context_manager.context("global")->register_function("sin", s_sin);
context_manager.context("global")->register_function("cos", s_cos);
context_manager.context("global")->register_function("tan", s_tan);