فهرست منبع

Update compiler.cpp

blueloveTH 1 سال پیش
والد
کامیت
0c3134f5c5
1فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 3 2
      src/compiler.cpp

+ 3 - 2
src/compiler.cpp

@@ -1278,10 +1278,11 @@ __EAT_DOTS_END:
         std::string_view version = deserializer.read_string('\n');
         std::string_view version = deserializer.read_string('\n');
 
 
         if(version != PK_VERSION){
         if(version != PK_VERSION){
-            SyntaxError(_S("precompiled version mismatch: ", version, "!=" PK_VERSION));
+            Str error = _S("precompiled version mismatch: ", version, "!=" PK_VERSION);
+            throw std::runtime_error(error.c_str());
         }
         }
         if(deserializer.read_uint('\n') != (i64)mode()){
         if(deserializer.read_uint('\n') != (i64)mode()){
-            SyntaxError("precompiled mode mismatch");
+            throw std::runtime_error("precompiled mode mismatch");
         }
         }
 
 
         int count = deserializer.read_count();
         int count = deserializer.read_count();