Nikita Popov
cdcf78f730
Fix lexer/compiler interdependency
2014-07-18 15:05:31 +02:00
Nikita Popov
359f99fe48
Use dedicated func_decl ast node
...
Functions need a bunch of extra info, that becomes inconvenient
to handle using the normal ast structure.
2014-07-18 14:57:00 +02:00
Nikita Popov
3ad55e001e
Small cleanup
...
Current problem: build_runtime_defined_function_key is lexer
coupled
2014-07-18 13:15:58 +02:00
Nikita Popov
ae5ba9abfb
Port closures
2014-07-18 12:58:24 +02:00
Nikita Popov
abfc8bd894
Port closure use
2014-07-18 12:30:39 +02:00
Nikita Popov
20d2a044ee
Lineno corrections
2014-07-16 23:33:22 +02:00
Nikita Popov
64a7132185
Port __METHOD__
2014-07-16 23:23:25 +02:00
Nikita Popov
a75921dcb1
Port __FUNCTION__ to AST
2014-07-16 23:10:16 +02:00
Nikita Popov
f589713cc4
Preliminary function decl support
...
Problem: __FUNCTION__ etc don't work anymore, due to lexer/parser
interdependency.
2014-07-16 00:07:09 +02:00
Nikita Popov
1ee3277aba
Port parameter defs
...
Has one bug re \self
2014-07-14 23:03:53 +02:00
Dmitry Stogov
bcc677789c
Fixed ZTS build
2014-07-14 15:46:09 +04:00
Dmitry Stogov
af7cb16907
Implemented builtin instruction for strlen()
2014-07-14 15:43:11 +04:00
Dmitry Stogov
42c4bcaed1
Fixed ZTS build
2014-07-14 14:25:04 +04:00
Dmitry Stogov
7dfb4f6b38
Implemented builtin instruction for type check functions - is_*()
2014-07-14 10:33:11 +04:00
Nikita Popov
47f0717a69
Rename params -> args
2014-07-13 13:11:55 +02:00
Nikita Popov
484ad86958
Moar removal
2014-07-12 19:20:21 +02:00
Nikita Popov
f9ed83469c
Remove more dead code
2014-07-12 19:18:09 +02:00
Nikita Popov
b934dfe088
Remove dead code
2014-07-12 19:10:19 +02:00
Nikita Popov
856e2a05b6
Fix + improve try/catch
2014-07-12 19:08:09 +02:00
Nikita Popov
069da161cf
approx correct linenos in errors
2014-07-12 17:10:10 +02:00
Nikita Popov
c58079b4fd
Port static vars
...
Need to figure out the constant expr stuff
2014-07-12 17:00:53 +02:00
Nikita Popov
86a1cd0d82
Verious fixes
2014-07-12 16:25:47 +02:00
Nikita Popov
8577f58e52
Store (bad) estimate of lineno with ast
...
Currently not used yet
2014-07-12 14:03:42 +02:00
Nikita Popov
e367e68111
Port try/catch
...
Down to 50 failing Zend tests
2014-07-12 13:50:58 +02:00
Dmitry Stogov
6c8db864e0
Implemented builtin instruction for strlen()
2014-07-11 18:52:27 +04:00
Nikita Popov
32ca08f249
Fix leak
2014-07-11 15:33:39 +02:00
Nikita Popov
dde9faee2e
Port switch
2014-07-11 15:31:47 +02:00
Nikita Popov
f12c1482a3
Port foreach
2014-07-11 12:16:21 +02:00
Dmitry Stogov
de306e7088
Implement call_user_func() and call_user_func_array() using special opcodes.
...
In some rare cases it leads to insignificant changes in error messages.
2014-07-11 00:32:18 +04:00
Nikita Popov
4215969904
Port if (partial)
2014-07-10 16:38:04 +02:00
Nikita Popov
3be63fca48
Port for
2014-07-10 15:51:47 +02:00
Nikita Popov
1738ee7e5a
Port do/while
2014-07-10 14:46:22 +02:00
Nikita Popov
c7656c06cc
Port while
...
Note: From here on everything is broken
2014-07-10 14:35:59 +02:00
Nikita Popov
68777b72b2
Expr stmts go through ast
2014-07-10 00:04:27 +02:00
Nikita Popov
1de1bc96a5
Make statement asty
2014-07-10 00:00:48 +02:00
Nikita Popov
117714d122
Port goto label
2014-07-09 23:46:22 +02:00
Nikita Popov
d14b763bb9
Make unticked_statement an ast node (usually NULL)
2014-07-09 23:39:21 +02:00
Nikita Popov
fc541418f2
Port goto
2014-07-09 23:11:32 +02:00
Nikita Popov
cc8a6fa91e
Port break/continue
2014-07-09 23:05:21 +02:00
Nikita Popov
5bf0c28fe3
Port throw
2014-07-09 22:48:42 +02:00
Dmitry Stogov
b36aaea6ed
ZEND_SEND_VAR and ZEND_SEND_VAL specialization
2014-07-08 02:13:53 +04:00
Nikita Popov
289265402a
Port echo
2014-07-07 21:14:14 +02:00
Nikita Popov
36c3cf3198
Port return statement
2014-07-07 21:06:02 +02:00
Nikita Popov
2d4c962c61
Fix ZTS build
2014-07-05 14:12:20 +02:00
Nikita Popov
77fddc0ca2
Use zend_string* in some places
2014-07-05 00:11:00 +02:00
Nikita Popov
17c2d16d79
Refactor class name resolution as well
2014-07-04 23:45:20 +02:00
Nikita Popov
b3336270f6
Hack around global leak for now
2014-07-04 23:15:31 +02:00
Xinchen Hui
1d1226afa2
Suppress warning "cast from pointer to integer of different size"
2014-07-01 10:36:19 +08:00
Dmitry Stogov
b7715c7e8a
Refactored parameter passing mechanism.
...
In PHP-5.6 and below each argument passed to user function was copies on VM stack twice.
Now we always have ZEND_INIT_FCALL (or simular) opcode that pushes "call frame" on top of VM stack.
"Call frame" is actually the same zend_execute_data structure.
All the following ZEND_SEND instructions push arguments on top of the stack in a way that they directly comes into corresponding CV variables of the called frame. Extra arguments are copied at the end of stack frame (after all CV and TMP variables) on function enterance.
There are two minor incompatibilities:
1) It's not allowed to decalre functions redefining arguments e.g. "function foo($a,$a) {}".
2) func_get_arg() and func_get args() return the current value of argument and not the original value that was sent.
2014-06-30 15:43:45 +04:00
Nikita Popov
fb98dd31a0
Some refactoring of fn/const resolution
2014-06-28 22:27:06 +02:00