From e7ebe7ddef897d9a3549601d02cef6ce8b16eb09 Mon Sep 17 00:00:00 2001 From: falsycat Date: Fri, 4 Oct 2019 00:00:00 +0000 Subject: [PATCH] [add] Added package.d module. --- sjscript/src/sjscript/package.d | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sjscript/src/sjscript/package.d diff --git a/sjscript/src/sjscript/package.d b/sjscript/src/sjscript/package.d new file mode 100644 index 0000000..4946b9c --- /dev/null +++ b/sjscript/src/sjscript/package.d @@ -0,0 +1,25 @@ +/// License: MIT +module sjscript; + +import std.algorithm; + +import dast.tokenize : Tokenize; + +import sjscript.Token, + sjscript.parse, + sjscript.preprocess; + +public { + import sjscript.Expression, + sjscript.ParametersBlock, + sjscript.exception; +} + +/// +ParametersBlock[] CreateScriptAst(string src) { + return src. + Tokenize!TokenType(). + filter!(x => x.type != TokenType.Whitespace). + Preprocess(). + Parse(); +}