This commit is contained in:
udo
2026-06-13 02:07:38 +00:00
parent eb8f303f94
commit 577aae076e
27 changed files with 2937 additions and 21 deletions
+54
View File
@@ -1,7 +1,9 @@
#include "functionlib.h"
#ifndef __UCE_WASM_CORE__
#define PCRE2_CODE_UNIT_WIDTH 8
#include <pcre2.h>
#endif
#include <cctype>
#include <stdexcept>
#include <algorithm>
@@ -296,6 +298,7 @@ String replace(String s, String search, String replace_with)
return(result);
}
#ifndef __UCE_WASM_CORE__
namespace {
String regex_flags_label(String flags)
@@ -637,6 +640,47 @@ StringList regex_split(String pattern, String subject, String flags)
return(result);
}
#else
bool regex_match(String pattern, String subject, String flags)
{
(void)pattern; (void)subject; (void)flags;
return(false);
}
DValue regex_search(String pattern, String subject, String flags)
{
DValue result;
result["matched"].set_bool(false);
result["pattern"] = pattern;
result["flags"] = flags == "" ? "default" : flags;
return(result);
}
DValue regex_search_all(String pattern, String subject, String flags)
{
DValue result;
result["matched"].set_bool(false);
result["pattern"] = pattern;
result["flags"] = flags == "" ? "default" : flags;
result["count"] = (f64)0;
return(result);
}
String regex_replace(String pattern, String replacement, String subject, String flags)
{
(void)pattern; (void)replacement; (void)flags;
return(subject);
}
StringList regex_split(String pattern, String subject, String flags)
{
(void)pattern; (void)flags;
return(StringList{ subject });
}
#endif
String trim(String raw)
{
s64 len = raw.length();
@@ -1323,7 +1367,12 @@ String xml_decode_text(String s)
void xml_throw(String message)
{
#ifdef __UCE_WASM_CORE__
(void)message;
__builtin_trap();
#else
throw std::runtime_error("xml_decode(): " + message);
#endif
}
struct XmlParser
@@ -1856,7 +1905,12 @@ String yaml_decode_quoted(String raw)
void yaml_throw(String message)
{
#ifdef __UCE_WASM_CORE__
(void)message;
__builtin_trap();
#else
throw std::runtime_error("yaml_decode(): " + message);
#endif
}
struct YamlParser