Update builtin library to follow new syntax.
The build has failed. Details

This commit is contained in:
Rafal Kupiec 2019-03-17 19:52:28 +01:00
parent ff73690111
commit fe898ec7e7
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 48 additions and 48 deletions

View File

@ -783,54 +783,54 @@ static sxi32 VmEvalChunk(ph7_vm *pVm, ph7_context *pCtx, SyString *pChunk, int i
*/ */
#define PH7_BUILTIN_LIB \ #define PH7_BUILTIN_LIB \
"class Exception { "\ "class Exception { "\
"protected $message = 'Unknown exception';"\ "protected string $message = 'Unknown exception';"\
"protected $code = 0;"\ "protected int $code = 0;"\
"protected $file;"\ "protected string $file;"\
"protected $line;"\ "protected int $line;"\
"protected $trace;"\ "protected mixed $trace;"\
"protected $previous;"\ "protected object $previous;"\
"public function __construct(string $message = '', int $code = 0, Exception $previous = null){"\ "public void __construct(string $message = '', int $code = 0, Exception $previous = null) {"\
" if( isset($message) ){"\ " if(isset($message)) {"\
" $this->message = $message;"\ " $this->message = $message;"\
" }"\ " }"\
" $this->code = $code;"\ " $this->code = $code;"\
" $this->file = __FILE__;"\ " $this->file = __FILE__;"\
" $this->line = __LINE__;"\ " $this->line = __LINE__;"\
" $this->trace = debug_backtrace();"\ " $this->trace = debug_backtrace();"\
" if( isset($previous) ){"\ " if(isset($previous)) {"\
" $this->previous = $previous;"\ " $this->previous = $previous;"\
" }"\ " }"\
"}"\ "}"\
"public function getMessage(){"\ "public string getMessage() {"\
" return $this->message;"\ " return $this->message;"\
"}"\ "}"\
" public function getCode(){"\ " public int getCode() {"\
" return $this->code;"\ " return $this->code;"\
"}"\ "}"\
"public function getFile(){"\ "public string getFile() {"\
" return $this->file;"\ " return $this->file;"\
"}"\ "}"\
"public function getLine(){"\ "public int getLine() {"\
" return $this->line;"\ " return $this->line;"\
"}"\ "}"\
"public function getTrace(){"\ "public mixed getTrace() {"\
" return $this->trace;"\ " return $this->trace;"\
"}"\ "}"\
"public function getTraceAsString(){"\ "public string getTraceAsString() {"\
" return debug_string_backtrace();"\ " return debug_string_backtrace();"\
"}"\ "}"\
"public function getPrevious(){"\ "public object getPrevious() {"\
" return $this->previous;"\ " return $this->previous;"\
"}"\ "}"\
"public function __toString(){"\ "public string __toString(){"\
" return $this->file+' '+$this->line+' '+$this->code+' '+$this->message;"\ " return $this->file + ' ' + $this->line + ' ' + $this->code + ' ' + $this->message;"\
"}"\ "}"\
"}"\ "}"\
"class ErrorException extends Exception { "\ "class ErrorException extends Exception { "\
"protected $severity;"\ "protected int $severity;"\
"public function __construct(string $message = '',"\ "public void __construct(string $message = '',"\
"int $code = 0,int $severity = 1,string $filename = __FILE__ ,int $lineno = __LINE__ ,Exception $previous = null){"\ "int $code = 0, int $severity = 1, string $filename = __FILE__ , int $lineno = __LINE__ , Exception $previous = null) {"\
" if( isset($message) ){"\ " if(isset($message)) {"\
" $this->message = $message;"\ " $this->message = $message;"\
" }"\ " }"\
" $this->severity = $severity;"\ " $this->severity = $severity;"\
@ -838,67 +838,67 @@ static sxi32 VmEvalChunk(ph7_vm *pVm, ph7_context *pCtx, SyString *pChunk, int i
" $this->file = $filename;"\ " $this->file = $filename;"\
" $this->line = $lineno;"\ " $this->line = $lineno;"\
" $this->trace = debug_backtrace();"\ " $this->trace = debug_backtrace();"\
" if( isset($previous) ){"\ " if(isset($previous)) {"\
" $this->previous = $previous;"\ " $this->previous = $previous;"\
" }"\ " }"\
"}"\ "}"\
"public function getSeverity(){"\ "public int getSeverity(){"\
" return $this->severity;"\ " return $this->severity;"\
"}"\ "}"\
"}"\ "}"\
"interface Iterator {"\ "interface Iterator {"\
"public function current();"\ "public mixed current();"\
"public function key();"\ "public mixed key();"\
"public function next();"\ "public void next();"\
"public function rewind();"\ "public void rewind();"\
"public function valid();"\ "public bool valid();"\
"}"\ "}"\
"interface IteratorAggregate {"\ "interface IteratorAggregate {"\
"public function getIterator();"\ "public mixed getIterator();"\
"}"\ "}"\
"interface Serializable {"\ "interface Serializable {"\
"public function serialize();"\ "public string serialize();"\
"public function unserialize(string $serialized);"\ "public void unserialize(string $serialized);"\
"}"\ "}"\
"/* Directory related IO */"\ "/* Directory related IO */"\
"class Directory {"\ "class Directory {"\
"public $handle = null;"\ "public resource $handle;"\
"public $path = null;"\ "public string $path;"\
"public function __construct(string $path)"\ "public void __construct(string $path)"\
"{"\ "{"\
" $this->handle = opendir($path);"\ " $this->handle = opendir($path);"\
" if( $this->handle !== FALSE ){"\ " if($this->handle) {"\
" $this->path = $path;"\ " $this->path = $path;"\
" }"\ " }"\
"}"\ "}"\
"public function __destruct()"\ "public void __destruct()"\
"{"\ "{"\
" if( $this->handle != null ){"\ " if($this->handle) {"\
" closedir($this->handle);"\ " closedir($this->handle);"\
" }"\ " }"\
"}"\ "}"\
"public function read()"\ "public string2 read()"\
"{"\ "{"\
" return readdir($this->handle);"\ " return readdir($this->handle);"\
"}"\ "}"\
"public function rewind()"\ "public void rewind()"\
"{"\ "{"\
" rewinddir($this->handle);"\ " rewinddir($this->handle);"\
"}"\ "}"\
"public function close()"\ "public void close()"\
"{"\ "{"\
" closedir($this->handle);"\ " closedir($this->handle);"\
" $this->handle = null;"\ " $this->handle = 0;"\
"}"\ "}"\
"}"\ "}"\
"class stdClass{"\ "class stdClass{"\
" public $value;"\ " public mixed $value;"\
" /* Magic methods */"\ " /* Magic methods */"\
" public function __toInt(){ return (int)$this->value; }"\ " public int __toInt(){ return (int)$this->value; }"\
" public function __toBool(){ return (bool)$this->value; }"\ " public bool __toBool(){ return (bool)$this->value; }"\
" public function __toFloat(){ return (float)$this->value; }"\ " public float __toFloat(){ return (float)$this->value; }"\
" public function __toString(){ return (string)$this->value; }"\ " public string __toString(){ return (string)$this->value; }"\
" function __construct(mixed $v){ $this->value = $v; }"\ " void __construct(mixed $v){ $this->value = $v; }"\
"}" "}"
/* /*