Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions builtin-functions/kphp-light/stdlib/regex-functions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@ define('PREG_SPLIT_DELIM_CAPTURE', 16);
define('PREG_SPLIT_OFFSET_CAPTURE', 32);
define('PREG_UNMATCHED_AS_NULL', 64);

function preg_match ($regex ::: string, $subject ::: string, &$matches ::: mixed = TODO, $flags ::: int = 0, $offset ::: int = 0): int | false;
function preg_match ($regex ::: regexp, $subject ::: string, &$matches ::: mixed = TODO, $flags ::: int = 0, $offset ::: int = 0): int | false;

function preg_match_all ($regex ::: string, $subject ::: string, &$matches ::: mixed = TODO, $flags ::: int = 0, $offset ::: int = 0): int | false;
function preg_match_all ($regex ::: regexp, $subject ::: string, &$matches ::: mixed = TODO, $flags ::: int = 0, $offset ::: int = 0): int | false;

function preg_quote ($str ::: string, $delimiter ::: string = ''): string;

function preg_replace(
$regex ::: string | array,
$regex ::: regexp,
$replace_val ::: string | array,
$subject ::: string | array,
$limit ::: int = -1,
&$replace_count ::: int = TODO): string | ^3 | false | null;

/** @kphp-extern-func-info interruptible */
function preg_replace_callback(
$regex ::: string | array,
$regex ::: regexp,
callable(string[] $x):string $callback,
$subject ::: string | array,
$limit ::: int = -1,
&$replace_count ::: int = TODO,
$flags ::: int = 0): string | ^3 | null;

function preg_split ($pattern ::: string, $subject ::: string, $limit ::: int = -1, $flags ::: int = 0) ::: mixed[] | false;
function preg_split ($pattern ::: regexp, $subject ::: string, $limit ::: int = -1, $flags ::: int = 0) ::: mixed[] | false;

// ===== UNSUPPORTED =====

Expand Down
2 changes: 1 addition & 1 deletion compiler/code-gen/files/const-vars-init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct InitConstVar {
Location save_location = stage::get_location();

VertexPtr init_val = var->init_val;
if (init_val->type() == op_conv_regexp && !G->is_output_mode_k2()) {
if (init_val->type() == op_conv_regexp) {
const auto &location = init_val->get_location();
kphp_assert(location.function && location.file);
W << var->name << ".init (" << var->init_val << ", " << RawString(location.function->name) << ", "
Expand Down
2 changes: 2 additions & 0 deletions runtime-light/state/image-state.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "runtime-light/stdlib/math/math-state.h"
#include "runtime-light/stdlib/rpc/rpc-client-state.h"
#include "runtime-light/stdlib/serialization/serialization-state.h"
#include "runtime-light/stdlib/string/regex-state.h"
#include "runtime-light/stdlib/string/string-state.h"
#include "runtime-light/stdlib/time/time-state.h"
#include "runtime-light/stdlib/visitors/shape-visitors.h"
Expand All @@ -50,6 +51,7 @@ struct ImageState final : private vk::not_copyable {
MathImageState math_image_state;
RpcImageState rpc_image_state;
CurlImageState curl_image_state;
RegexImageState regex_image_state;

ImageState() noexcept {
if (const int64_t sysconf_max_buffer_size{k2::sysconf(_SC_GETPW_R_SIZE_MAX)}; sysconf_max_buffer_size != -1) {
Expand Down
Loading
Loading