W3
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user