Auto-update dlang core files [skip ci]

This commit is contained in:
Gitea Actions Bot committed 2026-10-13 14:14:57 +00:00
1 parent c8a040ed7c
commit 890f4290b6
5 files changed
+21 -10

No files matched your search

+5 -4
View File
@@ -14,10 +14,10 @@ static void NativeRegexMatch(DlangVM* vm)
try {
std::regex rx(pattern);
bool matched = std::regex_match(text, rx);
dlang_pushnumber(vm, matched ? 1.0 : 0.0);
dlang_pushboolean(vm, matched);
}
catch (...) {
dlang_pushnumber(vm, 0.0);
dlang_pushboolean(vm, false);
}
}
@@ -29,10 +29,10 @@ static void NativeRegexSearch(DlangVM* vm)
try {
std::regex rx(pattern);
bool found = std::regex_search(text, rx);
dlang_pushnumber(vm, found ? 1.0 : 0.0);
dlang_pushboolean(vm, found);
}
catch (...) {
dlang_pushnumber(vm, 0.0);
dlang_pushboolean(vm, false);
}
}
@@ -45,6 +45,7 @@ static void NativeRegexReplace(DlangVM* vm)
try {
std::regex rx(pattern);
std::string result = std::regex_replace(text, rx, fmt);
dlang_pushstring(vm, result);
dlang_pushindex(vm);
}
+1 -1
View File
@@ -143,4 +143,4 @@ inline void openlib_string(DlangVM* vm)
dlang_setglobal(vm, "string");
}
#endif
#endif