aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2025-04-17 11:07:37 +0800
committerLi Jin <dragon-fly@qq.com>2025-04-17 11:07:37 +0800
commite5a7243b883c8a7e6358b3e6ef6ac87421de7978 (patch)
treec01e2580d756f1721c159935a4c2cb43fd9d5839 /src
parent0446b12d7be2ba4e8534987864fedfc586510291 (diff)
downloadyuescript-e5a7243b883c8a7e6358b3e6ef6ac87421de7978.tar.gz
yuescript-e5a7243b883c8a7e6358b3e6ef6ac87421de7978.tar.bz2
yuescript-e5a7243b883c8a7e6358b3e6ef6ac87421de7978.zip
Fixed build.
Diffstat (limited to 'src')
-rw-r--r--src/yuescript/yue_compiler.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp
index d5db8a1..590c502 100644
--- a/src/yuescript/yue_compiler.cpp
+++ b/src/yuescript/yue_compiler.cpp
@@ -7,17 +7,18 @@ The above copyright notice and this permission notice shall be included in all c
7THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ 7THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/
8 8
9#include <chrono> 9#include <chrono>
10#include <cmath>
11#include <iomanip>
10#include <memory> 12#include <memory>
11#include <optional> 13#include <optional>
12#include <set> 14#include <set>
15#include <sstream>
13#include <stack> 16#include <stack>
14#include <string> 17#include <string>
15#include <unordered_map> 18#include <unordered_map>
16#include <unordered_set> 19#include <unordered_set>
17#include <variant> 20#include <variant>
18#include <vector> 21#include <vector>
19#include <iomanip>
20#include <ostream>
21 22
22#include "yuescript/yue_compiler.h" 23#include "yuescript/yue_compiler.h"
23#include "yuescript/yue_parser.h" 24#include "yuescript/yue_parser.h"
@@ -4799,7 +4800,7 @@ private:
4799 auto varName = variableToString(ast_to<Variable_t>(var)); 4800 auto varName = variableToString(ast_to<Variable_t>(var));
4800 auto closeVar = getUnusedName("_close_"sv); 4801 auto closeVar = getUnusedName("_close_"sv);
4801 addToScope(closeVar); 4802 addToScope(closeVar);
4802 getCloses.push_back(closeVar + "=if type("s + varName + ") in ['table', 'userdata'] then assert "s + varName + ".<> and "s + varName +".<close>, \""s + "variable '"s + varName + "' got a non-closable value\" elseif "s + varName + " == nil then nil else error \""s + "variable '"s + varName + "' got a non-closable value\""); 4803 getCloses.push_back(closeVar + "=if type("s + varName + ") in ['table', 'userdata'] then assert "s + varName + ".<> and "s + varName + ".<close>, \""s + "variable '"s + varName + "' got a non-closable value\" elseif "s + varName + " == nil then nil else error \""s + "variable '"s + varName + "' got a non-closable value\"");
4803 doCloses.push_front(closeVar + "? "s + varName); 4804 doCloses.push_front(closeVar + "? "s + varName);
4804 } 4805 }
4805 popScope(); 4806 popScope();