-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support CompileTimeLocation in K2 (#1213)
- Loading branch information
1 parent
1964df3
commit d5ec637
Showing
5 changed files
with
38 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Compiler for PHP (aka KPHP) | ||
// Copyright (c) 2024 LLC «V Kontakte» | ||
// Distributed under the GPL v3 License, see LICENSE.notice.txt | ||
|
||
#pragma once | ||
|
||
#include "runtime-common/stdlib/visitors/common-visitors-methods.h" | ||
|
||
struct C$CompileTimeLocation : public refcountable_php_classes<C$CompileTimeLocation>, private CommonDefaultVisitorMethods { | ||
string $file; | ||
string $function; | ||
int64_t $line; | ||
|
||
~C$CompileTimeLocation() = default; | ||
|
||
const char *get_class() const noexcept { | ||
return "CompileTimeLocation"; | ||
} | ||
|
||
using CommonDefaultVisitorMethods::accept; | ||
}; | ||
|
||
using CompileTimeLocation = class_instance<C$CompileTimeLocation>; | ||
|
||
inline CompileTimeLocation f$CompileTimeLocation$$__construct(const CompileTimeLocation &v$this, const string &file, const string &function, int64_t line) { | ||
v$this->$file = file; | ||
v$this->$function = function; | ||
v$this->$line = line; | ||
return v$this; | ||
} | ||
|
||
inline CompileTimeLocation f$CompileTimeLocation$$calculate(const CompileTimeLocation &v$passed) { | ||
return v$passed; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@ok k2_skip | ||
@ok | ||
<?php | ||
|
||
require_once 'kphp_tester_include.php'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@ok k2_skip | ||
@ok | ||
<?php | ||
|
||
require_once 'kphp_tester_include.php'; | ||
|