Commit Graph

9 Commits

Author SHA1 Message Date
nikic
417a8bb07e Add support for yield expressions (PHP 5.5)
This adds a new Yield expression type, with subnodes key and value.
2012-09-07 23:41:57 +02:00
nikic
ae3774f0f2 Add support for finally clauses (PHP 5.5)
This adds a new finallyStmts subnode to the TryCatch node. If there is
no finally clause it will be null.
2012-09-07 23:41:56 +02:00
nikic
dd711f2a04 Generalize the attribute generation for nodes
Now two arrays are fetched from the lexer: $startAttributes and
$endAttributes. When constructing the attributes for a node, the
$startAttributes from the first token of the node and the $endAttributes
of the last token of the node are merged.

Now the end line is saved in the endLine attribute.
2012-05-05 17:34:27 +02:00
nikic
3701e02d32 Use inject-once approach for lexer
Now the lexer is injected only once when creating the parser. Instead of

    $parser = new PHPParser_Parser;
    $parser->parse(new PHPParser_Lexer($code));
    $parser->parse(new PHPParser_Lexer($code2));

you write:

    $parser = new PHPParser_Parser(new PHPParser_Lexer);
    $parser->parse($code);
    $parser->parse($code2);
2012-05-04 10:16:46 +02:00
nikic
168982a912 Don't replace \ followed by { with NS_SEPARATOR 2012-02-21 19:28:40 +01:00
nikic
d98a65086b Minor refactor and comments for emlative lexer
The emulative lexer is a single dirty hack so it needs a few more comments :)
2012-02-21 17:56:07 +01:00
nikic
faf0351bab Fix emulation of binary floats
All binary literals were lexed as integers, even if they were floats
2012-01-15 16:37:18 +01:00
nikic
bf252b2813 Fix NOWDOC emulation
Strings where the NOWDOC label appeared at the beginning of a line, but not followed by a newline were not correctly recognized.
2012-01-15 14:37:53 +01:00
nikic
c5c7aa5125 Add initial version of an emulative lexer
The emulative lexer allows lexing of PHP 5.4 on PHP 5.3 and PHP 5.2.
2011-12-18 17:03:11 +01:00