]> granicus.if.org Git - php/commit
Switch to bison location tracking
authorNikita Popov <nikita.ppv@gmail.com>
Fri, 15 Mar 2019 11:36:49 +0000 (12:36 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 21 Mar 2019 15:27:48 +0000 (16:27 +0100)
commite528762c1c59bc0bd0bd6d78246c14269630cf0f
treee8ee4eec737685c2a0ea5c2ba78fb86fd54035e5
parent1cf84f1579c54233c69a9394a8c02d29e092e32a
Switch to bison location tracking

Locations for AST nodes are now tracked with the help of bison
location tracking. This is more accurate than what we currently do
and easier to extend with more information.

A zend_ast_loc structure is introduced, which is used for the location
stack. Currently it only holds the start lineno, but can be extended
to also hold end lineno and offset/column information in the future.

All AST constructors now accept a zend_ast_loc* as first argument, and
will use it to determine their lineno. Previously this used either the
CG(zend_lineno), or the smallest AST lineno of child nodes.

On the parser side, the location structure for a whole rule can be
obtained using the &@$ character salad.
Zend/zend_ast.c
Zend/zend_ast.h
Zend/zend_compile.c
Zend/zend_compile.h
Zend/zend_globals.h
Zend/zend_highlight.c
Zend/zend_language_parser.y
Zend/zend_language_scanner.l
ext/tokenizer/tokenizer.c