aboutsummaryrefslogtreecommitdiff
path: root/nomsu_compiler.moon
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-07-13 14:30:32 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-07-13 14:30:39 -0700
commit01a4f36398bfe66a7286a83fdd797c8b20541681 (patch)
treeb2ef8fc3ff0459295d6165832f62f06d0dca3055 /nomsu_compiler.moon
parent84c0058e69a18d5aec0ca4641725e87eddf4362f (diff)
Minor changes.
Diffstat (limited to 'nomsu_compiler.moon')
-rw-r--r--nomsu_compiler.moon1
1 files changed, 1 insertions, 0 deletions
diff --git a/nomsu_compiler.moon b/nomsu_compiler.moon
index dd3000e..283fa52 100644
--- a/nomsu_compiler.moon
+++ b/nomsu_compiler.moon
@@ -231,6 +231,7 @@ with NomsuCompiler
.run = (to_run, source=nil)=>
source or= to_run.source or Source(to_run, 1, #to_run)
+ if type(source) == 'string' then source = Source\from_string(source)
if not files.read(source.filename) then files.spoof(source.filename, to_run)
tree = if AST.is_syntax_tree(to_run) then to_run else @parse(to_run, source)
if tree == nil -- Happens if pattern matches, but there are no captures, e.g. an empty string