diff options
Diffstat (limited to 'src/MoonP')
-rw-r--r-- | src/MoonP/moon_compiler.cpp | 8 | ||||
-rw-r--r-- | src/MoonP/moon_compiler.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/MoonP/moon_compiler.cpp b/src/MoonP/moon_compiler.cpp index e961a92..d036645 100644 --- a/src/MoonP/moon_compiler.cpp +++ b/src/MoonP/moon_compiler.cpp | |||
@@ -42,12 +42,12 @@ inline std::string s(std::string_view sv) { | |||
42 | return std::string(sv); | 42 | return std::string(sv); |
43 | } | 43 | } |
44 | 44 | ||
45 | const char* moonScriptVersion() { | 45 | const char* version() { |
46 | return "0.5.0-r0.3.6"; | 46 | return "0.3.6"; |
47 | } | 47 | } |
48 | 48 | ||
49 | // name of table stored in lua registry | 49 | // name of table stored in lua registry |
50 | #define MOONP_MODULE "_modules_" | 50 | #define MOONP_MODULE "__moon_modules__" |
51 | 51 | ||
52 | class MoonCompilerImpl { | 52 | class MoonCompilerImpl { |
53 | public: | 53 | public: |
@@ -61,6 +61,7 @@ public: | |||
61 | BLOCK_START | 61 | BLOCK_START |
62 | BREAK_IF(!sameModule); | 62 | BREAK_IF(!sameModule); |
63 | BREAK_IF(!L); | 63 | BREAK_IF(!L); |
64 | _sameModule = true; | ||
64 | int top = lua_gettop(L); | 65 | int top = lua_gettop(L); |
65 | DEFER(lua_settop(L, top)); | 66 | DEFER(lua_settop(L, top)); |
66 | lua_pushliteral(L, MOONP_MODULE); // MOONP_MODULE | 67 | lua_pushliteral(L, MOONP_MODULE); // MOONP_MODULE |
@@ -69,7 +70,6 @@ public: | |||
69 | int idx = static_cast<int>(lua_objlen(L, -1)); // idx = #tb, tb | 70 | int idx = static_cast<int>(lua_objlen(L, -1)); // idx = #tb, tb |
70 | BREAK_IF(idx == 0); | 71 | BREAK_IF(idx == 0); |
71 | _useModule = true; | 72 | _useModule = true; |
72 | _sameModule = true; | ||
73 | BLOCK_END | 73 | BLOCK_END |
74 | } | 74 | } |
75 | 75 | ||
diff --git a/src/MoonP/moon_compiler.h b/src/MoonP/moon_compiler.h index 573f130..d22a95a 100644 --- a/src/MoonP/moon_compiler.h +++ b/src/MoonP/moon_compiler.h | |||
@@ -17,7 +17,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI | |||
17 | 17 | ||
18 | namespace MoonP { | 18 | namespace MoonP { |
19 | 19 | ||
20 | const char* moonScriptVersion(); | 20 | const char* version(); |
21 | 21 | ||
22 | struct MoonConfig { | 22 | struct MoonConfig { |
23 | bool lintGlobalVariable = false; | 23 | bool lintGlobalVariable = false; |