From 9dbc1d5062b80e6de3e8e6b7ecff01c825df2553 Mon Sep 17 00:00:00 2001 From: leaf corcoran Date: Sat, 26 Sep 2015 20:06:19 -0700 Subject: [PATCH] misc --- moonscript/base.lua | 4 +--- moonscript/base.moon | 2 +- moonscript/compile.moon | 2 ++ 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/moonscript/base.lua b/moonscript/base.lua index e436678..6bc0d49 100644 --- a/moonscript/base.lua +++ b/moonscript/base.lua @@ -66,9 +66,7 @@ end moon_loader = function(name) local name_path = name:gsub("%.", dirsep) local file, file_path - local _list_0 = split(package.moonpath, ";") - for _index_0 = 1, #_list_0 do - local path = _list_0[_index_0] + for path in package.moonpath:gmatch("[^;]+") do file_path = path:gsub("?", name_path) file = io.open(file_path) if file then diff --git a/moonscript/base.moon b/moonscript/base.moon index b2068f0..3a4502d 100644 --- a/moonscript/base.moon +++ b/moonscript/base.moon @@ -38,7 +38,7 @@ moon_loader = (name) -> name_path = name\gsub "%.", dirsep local file, file_path - for path in *split package.moonpath, ";" + for path in package.moonpath\gmatch "[^;]+" file_path = path\gsub "?", name_path file = io.open file_path break if file diff --git a/moonscript/compile.moon b/moonscript/compile.moon index d05a3bb..6206b26 100644 --- a/moonscript/compile.moon +++ b/moonscript/compile.moon @@ -406,6 +406,8 @@ class Block nil + -- takes the existing set of lines and replaces them with the result of + -- calling fn on them splice: (fn) => lines = {"lines", @_lines} @_lines = Lines!