change format of error info

parser now can report exact place where is lacking ';' or ','
This commit is contained in:
ValKmjolnir
2022-06-30 23:15:10 +08:00
parent a4a7f5075a
commit c993c77b78
5 changed files with 71 additions and 46 deletions
+8 -4
View File
@@ -87,10 +87,14 @@ nasal_ast nasal_import::lib_import()
const std::vector<std::string> libpath=
{
"lib.nas",
"stl/lib.nas"
#ifdef __WIN32
".\\lib.nas",
".\\stl\\lib.nas"
#else
"./lib.nas",
"./stl/lib.nas"
#endif
};
std::string filename="";
for(auto& i:libpath)
if(access(i.c_str(),F_OK)!=-1)
@@ -103,7 +107,7 @@ nasal_ast nasal_import::lib_import()
std::string paths="";
for(auto& i:libpath)
paths+=" "+i+"\n";
nerr.err("link","cannot find lib file in these paths:\n"+paths,' ');
nerr.err("link","cannot find lib file in these paths:\n"+paths);
nerr.chkerr();
return {0,ast_root};
}