Commit Graph

451 Commits

Author SHA1 Message Date
Nikita Popov
545fd5168e Don't distinguish between ast/list in parser
This removes the need to use $<ast>{n} or $<list>$ casts in the
reduction actions.

Keeping the distinction in the parser doesn't really give us any
benefit and only makes changing the grammar harder.
2014-08-29 21:02:10 +02:00
Nikita Popov
25d57aace3 Introduce optional_expr 2014-08-29 18:51:58 +02:00
Nikita Popov
c6a5c3c6c5 Remove parenthesis_expr
This was necessary previously to handle yields, now it only clutters
up the grammar.
2014-08-29 18:46:46 +02:00
Nikita Popov
7722d2c584 Simplify argument production 2014-08-29 18:42:05 +02:00
Nikita Popov
f3b629c982 Move =&new deprecation message into compiler 2014-08-26 23:36:53 +02:00
Nikita Popov
f8abb9a462 Handle remaining magic constants in parser as well
As far as I can see the !filename case cannot occur, so I dropped
it.
2014-08-26 23:36:52 +02:00
Nikita Popov
49b4e12e54 Add backup_doc_comment production
Bison can't detect the type of a mid-rule action, even if it accesses
$<str>$, so need to create a separate rule for this.
2014-08-26 22:31:58 +02:00
Nikita Popov
b7876e734a eval() with parse error uses clean shutdown now 2014-08-26 22:31:58 +02:00
Nikita Popov
6c687e0d9b Add type annotations to parser
Conflicts:

	Zend/zend_language_parser.y
2014-08-26 22:31:58 +02:00
Nikita Popov
6db293d5e0 Merge remote-tracking branch 'php-src/master' into ast
Conflicts:
	Zend/zend_compile.c
	Zend/zend_compile.h
	Zend/zend_globals.h
	Zend/zend_language_parser.y
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner.l
	Zend/zend_types.h
2014-08-25 21:52:18 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Nikita Popov
458f67cd21 Fix encoding declaration handling
As the encoding declaration influences lexing it needs to be
immidiately handled in the parser.
2014-08-18 16:27:53 +02:00
Nikita Popov
ef5f3390e7 Implement a[0] syntax from merge 2014-08-16 22:13:33 +02:00
Anatol Belski
8ee2a4a9b5 first shot on merging the core fro the int64 branch 2014-08-16 11:16:11 +02:00
Dmitry Stogov
7301994c28 Merge branch 'master' into phpng
* master: (46 commits)
  PHP_INT_MIN and _MAX tests
  NEWS and UPGRADING
  Added PHP_INT_MIN
  Fix wrong lenght size
  Bug #51096 - Remove unnecessary ? for first/last day of
  Moved streams related functions to xp_ssl.c
  Remove duplicate NEWS
  Update NEWS
  Update NEWS
  Update NEWS
  BFN
  BFN
  Fixed bug #67715 (php-milter does not build and crashes randomly).
  We need to turn off any strict mode here for this warning to show up
  Disable restrictions regarding arrays in constants at run-time. For the discussion around it, see the thread on the mailing list: http://www.mail-archive.com/internals@lists.php.net/msg68245.html
  Revert "Fix bug #67064 in a BC safe way"
  Updated NEWS for #67693
  Updated NEWS for #67693
  Fixed bug #67693 - incorrect push to the empty array
  add missing entry to NEWS
  ...

Conflicts:
	Zend/tests/errmsg_040.phpt
	Zend/tests/ns_059.phpt
	Zend/zend_language_parser.y
	Zend/zend_vm_def.h
	ext/openssl/openssl.c
	ext/reflection/php_reflection.c
	ext/session/session.c
	ext/spl/spl_directory.c
	ext/spl/spl_iterators.c
	ext/sqlite3/sqlite3.c
	ext/standard/array.c
2014-08-04 13:56:27 +04:00
Nikita Popov
6cf89612db Support doc comments for propreties 2014-07-30 19:12:48 +02:00
Bob Weinand
d5ddd2dbb2 Disable restrictions regarding arrays in constants at run-time.
For the discussion around it, see the thread on the mailing list:
http://www.mail-archive.com/internals@lists.php.net/msg68245.html
2014-07-30 17:57:07 +02:00
Nikita Popov
7889050685 Add zend_ prefix for emit_op(_tmp) 2014-07-28 22:03:16 +02:00
Nikita Popov
cf7f0c412d zend_ast_create determined child count automatically 2014-07-28 18:18:47 +02:00
Nikita Popov
39d480e471 Remove zend_ast_create_unary etc 2014-07-28 17:59:12 +02:00
Nikita Popov
38c4125c2e Cleanup dead/duplicate code 2014-07-28 15:23:00 +02:00
Nikita Popov
1d79fb308b Add zend_ast_list* variant to parser stack element 2014-07-28 15:10:58 +02:00
Nikita Popov
f29b84ab46 Minor cleanups in AST code 2014-07-28 14:51:08 +02:00
Nikita Popov
d3cb239305 Use separate node type for lists
This saves storing the children count for normal ast nodes.
2014-07-28 12:06:57 +02:00
Nikita Popov
21eb6807c9 Store lineno for zval ast nodes more efficiently 2014-07-27 13:25:32 +02:00
Nikita Popov
bea85f58bb Use more specific parser stack nodes 2014-07-27 12:46:54 +02:00
Nikita Popov
a74515e240 Separate class type and start lineno 2014-07-27 12:37:28 +02:00
Nikita Popov
0b86b1c8e5 Store doc comments in separate stack entry from start lineno 2014-07-27 12:31:17 +02:00
Nikita Popov
1ea9a2d934 Cleanup member modifier code 2014-07-27 12:19:01 +02:00
Nikita Popov
df42793cd2 Create namespace_name via AST 2014-07-26 21:53:50 +02:00
Nikita Popov
4ca4b423be Make lexer return AST nodes 2014-07-26 21:22:54 +02:00
Nikita Popov
a51e00a8cd Add functions for create str/long ast directly 2014-07-26 19:01:14 +02:00
Nikita Popov
689891c2b2 Expose ast via CG(ast) 2014-07-24 20:51:01 +02:00
Nikita Popov
1859674061 Port ZEND_BIND_GLOBAL optimization 2014-07-22 20:24:47 +02:00
Nikita Popov
b9be66ebf2 Implement declare() 2014-07-22 16:11:19 +02:00
Nikita Popov
2653b8b5dc Handle __halt_compiler() 2014-07-22 15:50:23 +02:00
Nikita Popov
3becdb3376 __halt_compiler() without haling compiler 2014-07-22 14:25:19 +02:00
Nikita Popov
de2f132f33 Add NS error checks
Those can probably be implemented in a better way now...
2014-07-22 14:08:52 +02:00
Nikita Popov
776800b0a0 Discard NS doc comments 2014-07-22 13:54:54 +02:00
Nikita Popov
cc0bef6636 Fix namespace\, maybe 2014-07-22 13:25:47 +02:00
Nikita Popov
9c69c41a64 Port top level stmt
Problem: namespace\foo no longer works :/
2014-07-22 13:02:51 +02:00
Nikita Popov
8a2ff6b53d Partial NS port (semicolon, no errors) 2014-07-22 12:45:44 +02:00
Nikita Popov
b6c9eb21d4 Port constant declaration 2014-07-22 11:55:07 +02:00
Nikita Popov
64151ec37a Port function/const use 2014-07-21 23:41:11 +02:00
Nikita Popov
37ac1b96ed Port use statement 2014-07-21 22:49:31 +02:00
Nikita Popov
18fd2a1897 Port __TRAIT__ and __CLASS__ to AST 2014-07-21 17:34:00 +02:00
Nikita Popov
005315510a Mostly finish class declarations (~50 failing tests) 2014-07-21 17:14:01 +02:00
Nikita Popov
b24bda6be1 Partial port of class declarations 2014-07-21 16:34:45 +02:00
Nikita Popov
461bce5222 Prepare zend_ast_decl for reuse with classes 2014-07-21 15:38:21 +02:00
Nikita Popov
028c7d20fb Throw \self etc error
Could only enable this now that everything uses the new format
2014-07-19 23:44:33 +02:00