diff options
Diffstat (limited to 'src/MoonP/moonplus.h')
-rw-r--r-- | src/MoonP/moonplus.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/MoonP/moonplus.h b/src/MoonP/moonplus.h index 83d4c75..b18ab64 100644 --- a/src/MoonP/moonplus.h +++ b/src/MoonP/moonplus.h | |||
@@ -1,4 +1,4 @@ | |||
1 | R"moonscript_codes( | 1 | R"moonplus_codes( |
2 | --[[ | 2 | --[[ |
3 | Copyright (C) 2020 by Leaf Corcoran, modified by Li Jin | 3 | Copyright (C) 2020 by Leaf Corcoran, modified by Li Jin |
4 | 4 | ||
@@ -73,6 +73,7 @@ get_options = function(...) | |||
73 | end | 73 | end |
74 | end | 74 | end |
75 | create_moonpath = function(package_path) | 75 | create_moonpath = function(package_path) |
76 | local extension = moonp.extension | ||
76 | local moonpaths | 77 | local moonpaths |
77 | do | 78 | do |
78 | local _accum_0 = { } | 79 | local _accum_0 = { } |
@@ -87,7 +88,7 @@ create_moonpath = function(package_path) | |||
87 | _continue_0 = true | 88 | _continue_0 = true |
88 | break | 89 | break |
89 | end | 90 | end |
90 | _accum_0[_len_0] = prefix .. ".moon" | 91 | _accum_0[_len_0] = prefix .. "." .. extension |
91 | _len_0 = _len_0 + 1 | 92 | _len_0 = _len_0 + 1 |
92 | _continue_0 = true | 93 | _continue_0 = true |
93 | until true | 94 | until true |
@@ -134,7 +135,7 @@ moon_loader = function(name) | |||
134 | end | 135 | end |
135 | return res | 136 | return res |
136 | end | 137 | end |
137 | return nil, "Could not find moon file" | 138 | return nil, "Could not find moonp file" |
138 | end | 139 | end |
139 | moon_call = function(f, ...) | 140 | moon_call = function(f, ...) |
140 | local args = { | 141 | local args = { |
@@ -148,7 +149,7 @@ moon_call = function(f, ...) | |||
148 | end | 149 | end |
149 | loadstring = function(...) | 150 | loadstring = function(...) |
150 | local options, str, chunk_name, mode, env = get_options(...) | 151 | local options, str, chunk_name, mode, env = get_options(...) |
151 | chunk_name = chunk_name or "=(moonscript.loadstring)" | 152 | chunk_name = chunk_name or "=(moonplus.loadstring)" |
152 | local code, err = moonp.to_lua(str, options) | 153 | local code, err = moonp.to_lua(str, options) |
153 | if not code then | 154 | if not code then |
154 | return nil, err | 155 | return nil, err |
@@ -247,4 +248,4 @@ for k, v in pairs({ | |||
247 | }) do | 248 | }) do |
248 | moonp[k] = v | 249 | moonp[k] = v |
249 | end | 250 | end |
250 | )moonscript_codes"; | 251 | )moonplus_codes"; |