summaryrefslogtreecommitdiff
path: root/src/standard.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/standard.php')
-rw-r--r--src/standard.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/standard.php b/src/standard.php
new file mode 100644
index 0000000..351c9e8
--- /dev/null
+++ b/src/standard.php
@@ -0,0 +1,18 @@
+<?php
+
+use Mnml\Lexer\Lexer;
+use Mnml\Parser\Parser;
+
+$import = function (string $library) {
+ $input = file_get_contents(dirname(__FILE__) . "/" . $library);
+ $lexer = new Lexer($input);
+ $tokens = $lexer->lex();
+ $parser = new Parser($tokens);
+ $nodes = $parser->parse();
+};
+
+$print = function (string $string) {
+ echo $string;
+};
+
+return compact("import", "print");