diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2025-02-06 13:59:50 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2025-02-06 13:59:50 +0100 |
commit | 54b4040a8e46c4104e228264fa57b44d17e245c9 (patch) | |
tree | 938f077f1343ee018476bd1cf68924f9181143f1 /src/standard.php | |
parent | 7667162a20ebdedac14de88260df018b961548d4 (diff) |
all current tests passing
Diffstat (limited to 'src/standard.php')
-rw-r--r-- | src/standard.php | 18 |
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"); |