Commit Graph

307 Commits

Author SHA1 Message Date
Nikita Popov
3e158a2313 Wrap List_ in ArrayItem
This was correctly done for the 'key'=>list() form, but not for
unkeyed nested lists.
2016-12-01 13:32:37 +01:00
Nikita Popov
e52ffc4447 Support recovery from Foo:: 2016-11-22 19:47:04 +01:00
Nikita Popov
c5cdd5ad73 Support recovery from free-standing $ 2016-11-21 17:01:39 +01:00
Nikita Popov
c0630f8169 Support recovery for new without class name 2016-11-21 16:51:53 +01:00
Nikita Popov
caa5c0cc76 Graceful handling for "special" errors
Nearly all special errors are now handled gracefully, i.e. the
parser will be able to continue after encountering them. In some
cases the associated error range has been improved using the new
end attribute stack.

To achieve this the error handling code has been moved out of the
node constructors and into special methods in the parser.
2016-10-09 12:38:18 +02:00
Nikita Popov
2be7838fc6 Correctly assign attrs for encaps vars 2016-10-08 23:58:39 +02:00
Nikita Popov
f6eb341b15 Fix GroupUse prefix attribute assignment 2016-10-08 23:55:46 +02:00
Nikita Popov
a7120116b0 Merge branch '2.x' 2016-08-30 22:38:34 +02:00
Nikita Popov
83f34e7fa4 Retain comments on blocks on first inner statement 2016-08-30 22:37:51 +02:00
Nikita Popov
d0cfb98133 Merge branch '2.x'
Conflicts:
	lib/PhpParser/Parser/Php7.php
2016-08-30 22:14:09 +02:00
Nikita Popov
13f7321def Forbid "=& new" in PHP 7 mode 2016-08-30 22:12:01 +02:00
Nat Zimmermann
46495abb49 Fix typo in grammar/README.md 2016-08-11 16:17:08 +02:00
Nikita Popov
977cbab8e7 Decrement errorState when recovering from -> error
It's likely that an error after -> will trigger another one due to
missing semicolon without shifting a single token. We prevent an
immediate failure in this case by manually setting errorState to 2,
which will suppress the duplicate error message, but allow error
recovery.
2016-07-25 17:37:54 +02:00
Nikita Popov
09086fbe0a Support partial parsing of $foo->
Introduce Error node for this purpose.
2016-07-25 17:03:58 +02:00
Nikita Popov
5f97b12576 Introduce explicit Finally node 2016-07-25 14:25:04 +02:00
Nikita Popov
eefcfeed23 Remove analyze.php
Has outlived its usefulness...
2016-07-25 13:38:05 +02:00
Nikita Popov
867ae5148d Bring Trait constructor in line with Class/interface 2016-07-22 17:01:51 +02:00
Nikita Popov
537b59d4d1 PHP 7.1: Support multi-catch
Catch::$type is now an array Catch::$types.
2016-07-22 15:40:00 +02:00
Nikita Popov
574665b45b PHP 7.1: list() with keys
Expr\List will now contain ArrayItems instead of plain variables.
I'm reusing ArrayItem, because code handling list() must also handle
arrays, and this allows both to go through the same code path.

This also renames Expr\List->vars to ->items.

TODO: Should Expr\List be dropped in favor of Expr\Array with an
extra flag?
2016-07-09 21:55:55 +02:00
Nikita Popov
437890d386 PHP 7: Short destructuring syntax
Potentially the pretty printer should force use of [] in assignment
context, instead of relying on the existance of the right attribute.
2016-07-06 23:43:23 +02:00
Nikita Popov
1edf72c040 PHP 7: Support nullable types
Using a new NullableType node.
2016-07-06 18:36:18 +02:00
Nikita Popov
5ea2a76d80 PHP 7.1: Class constant visibility support 2016-07-05 23:01:06 +02:00
Nikita Popov
5044fce1ff PHP 7.1: Add void+iterable support
In PHP 7 mode, these will now be represented as strings 'void'
and 'iterable'.
2016-07-05 22:35:27 +02:00
Nikita Popov
96cbd48df6 Improve error recovery quality
In particular, support recovering from a missing trailing semicolon,
while keeping the rest of the expression.
2016-04-20 16:47:50 +02:00
Nikita Popov
90eb1165d1 Switch Exit kind attribute to flag
To be consistent with everything else.
2016-04-19 14:51:05 +02:00
Nikita Popov
e7869b9f14 Forbid invalid octals in PHP 7 mode 2016-04-18 13:59:18 +02:00
Nikita Popov
588e6a4d4c Add string kinds and doc string labels
Scalar\String_ and Scalar\Encapsed now have an additional "kind"
attribute, which may be one of:

 * String_::KIND_SINGLE_QUOTED
 * String_::KIND_DOUBLE_QUOTED
 * String_::KIND_NOWDOC
 * String_::KIND_HEREDOC

Additionally, if the string kind is one of the latter two, an
attribute "docLabel" is provided, which contains the doc string
label (STR in <<<STR) that was originally used.

The pretty printer will try to take the original kind of the string,
as well as the used doc string label into account.
2016-04-07 12:09:00 +09:00
Nikita Popov
14de71898e Fix nop statement comment assignment
Keep around the start attributes on the lookahead token around in
a separate parser property.
2016-04-05 19:19:15 +09:00
Nikita Popov
f493219c7d Move "kind" attribute handling out of lexer
Doesn't belong there and will cause issue with multiple assignments.
2016-03-10 12:55:15 +01:00
Nikita Popov
aa199120c7 Add kind attribute for arrays
To distinguish array() and [] syntax. The pretty printer respects
this attribute. The shortArraySyntax pretty printer option acts as
a default in case the attribute is not specified.
2016-03-09 21:31:54 +01:00
Nikita Popov
7eac2cfd8b Introduce Nop statement to collect dangling comments
A Nop statement will be inserted into statement lists if there are
any trailing comments in the list (which would otherwise not be
associated with any node).

The pretty printer output currently still contains a superfluous
newline.
2016-03-09 19:48:36 +01:00
Nikita Popov
d6361136e1 Update semi-reserved keyword list
Magic constant names have been added after the PHP 7 release.

We do not support and likely will not support __halt_compiler here
due to lexer limitations.
2016-02-09 13:30:39 +01:00
Nikita Popov
719ca71d4a Distinguish declare(); and declare(){}
It makes semantic difference and the latter form is actually
forbidden for strict_types.

This sets Declare->stmts to null for the body-less case.
2015-12-07 12:12:00 +01:00
Nikita Popov
a9074c7444 Introduce Scalar\EncapsedStringPart 2015-12-03 22:55:07 +01:00
Nikita Popov
eecaf1e93b Merge branch '1.x'
Conflicts:
	grammar/rebuildParsers.php
	lib/PhpParser/Parser.php
2015-09-19 22:07:29 +08:00
Nikita Popov
950ada4cba Fix issue #227
Use \z instead of $.
2015-09-19 22:05:23 +08:00
Nikita Popov
f57d217e91 Update group use support
To conform with current PHP 7 implementation

* Allow use \Foo\{Bar};
* Disallow use Foo\{\Bar};
* Disallow missing trailing semicolon (that was a bug)
2015-08-20 16:42:49 +02:00
Nikita Popov
2496cd38ad Various docs fixes 2015-07-14 21:11:54 +02:00
Nikita Popov
ef9a154d09 Add support for unicode escape sequences
Only parsed if the PHP 7 parser is used.
2015-06-13 20:51:02 +02:00
Nikita Popov
0da72fad00 Support scalar type declarations 2015-06-13 20:16:09 +02:00
Nikita Popov
bc21514ecf Move token constants into separate class
As these are shared between Php5 and Php7 parsers they should be
in some common place, otherwise we'd have to always reference either
one or the other.
2015-06-13 18:39:55 +02:00
Nikita Popov
61e060694d Implement generalized yield operator
And split tokens.y off, so I don't waste time debugging this again...
2015-06-13 18:11:40 +02:00
Nikita Popov
602b9807eb Import some UVS tests 2015-06-13 15:42:09 +02:00
Nikita Popov
d18dcc0c7f Implement UVS 2015-06-13 14:59:24 +02:00
Nikita Popov
74c57eef0e Test PHP 5 and PHP 7 parsers
At this point they should return the same result.
2015-06-13 13:56:45 +02:00
Nikita Popov
fdbddc4b8c Add Multiple parser 2015-06-13 13:38:24 +02:00
Nikita Popov
ca3b44bf60 Fork separate PHP 7 parser
Also add ParserInterface
2015-06-13 13:09:34 +02:00
Nikita Popov
dca46febc9 Implement semi-reserved identifiers 2015-06-13 12:47:13 +02:00
Nikita Popov
1a1bd1448d Support mixed group use declarations 2015-06-13 11:27:38 +02:00
Nikita Popov
9620f79cdc Add partial group use support
Supported via Stmt\GroupUse which has Name $prefix in addition to
the usual.

Still missing: Mixed group uses.
2015-06-12 23:05:28 +02:00
Nikita Popov
a0e7d5e0aa Set correct number of s/r conflicts 2015-05-02 22:51:38 +02:00
Nikita Popov
51ec2a25fe Move parser to Parser\Php5
Old name still exists.
2015-05-02 22:50:11 +02:00
Nikita Popov
9d42e4a2e2 Drop short array simulation from .phpy syntax
Instead use real short array syntax.
2015-05-02 22:30:44 +02:00
Nikita Popov
23bf4f0c13 Add some error documentation 2015-04-30 21:58:45 +02:00
Nikita Popov
57ac7e39bf Drop name magic from rebuildParser.php
Now using explicitly imported names, instead of magically
prepending Name\.

Also remove trailing whitespace from generated file.
2015-04-30 19:20:38 +02:00
Nikita Popov
3b7d8e8b5d Enable basic error recovery
Adding only a single recovery rule for now.

The API is now:
 * throwOnError parser option must be disabled.
 * List of Errors is available through $parser->getErrors(). This
   method is available either way.
 * If no recovery is possible $parser->parse() will return null.
   (Obviously only if throwOnError is disabled).
2015-04-30 17:41:57 +02:00
Nikita Popov
e1a0ec3724 Add support for anonymous classes
Has not landed upstream yet, but syntax is unlikely to change.
2015-04-26 23:04:31 +02:00
Nikita Popov
ab80054e97 Add support for "yield from" 2015-04-26 11:56:02 +02:00
Nikita Popov
a6d2cd69f8 Clarify attribute assignment code
* Don't assign to attribute stack on reduce - why was that there
in the first place?
* Assign attributes to the position in the stack where the first
token of the production is, instead of one position earlier.
* Add a comment to clarify why we also assign attributes on read,
instead of just on shift.
2015-04-26 11:56:01 +02:00
Nikita Popov
6996db1e3a Build node attributes inside semantic action methods
Minor performance improvement for parsing, also allows to access
attributes with higher granulity in the parser, though this is not
currently done.

* #n can now be used to access the stack position of a token. $n
  is the same as $this->semStack[#n]. (Post-translate $n will
  actually be the stack position.)
* $attributeStack is now $this->startAttributeStack and
  $endAttributes is now $this->endAttributes.
* Attributes for a node are now computed inside the individual
  reduction methods, instead of being passed as a parameter.
  Accessible through the attributes() macro.
2015-04-26 11:55:59 +02:00
Nikita Popov
7a40498cb4 Regenerate parser
Also drop the error() parser macro.
2015-04-19 18:12:56 +02:00
Nikita Popov
65f1adbe65 Merge primary error recovery code
The grammar does not yet actually implement error recovery.
2015-04-19 18:11:05 +02:00
Nikita Popov
8982315b4e Rename Cast\Object as well
As it will very likely be soft-reserved in PHP 7.

Old alias is still available, as usual.
2015-03-21 18:57:55 +01:00
Nikita Popov
0f556c16f5 Fix a few more Scalar\String_ occurances
Totally forgot that the parser uses macros...
2015-03-21 18:54:52 +01:00
Nikita Popov
7ec277e1e1 Replace another Scalar\String occurance
Also canonicalize NameResover tests to avoid those pesky CRLF
issues.
2015-03-21 18:47:20 +01:00
Nikita Popov
1a627872f0 Rename nodes for compat with PHP 7
The old names will still be available on PHP 5.x.
2015-03-20 21:49:38 +01:00
Nikita Popov
251e689283 Add support for spaceship operator (<=>) [PHP 7]
Added as Expr\BinaryOp\Spaceship.
2015-03-12 23:13:31 +01:00
Nikita Popov
01f4be6b4d Add support for null coalesce operator (??) [PHP 7]
Added as Expr\BinaryOp\Coalesce.
2015-03-12 22:45:56 +01:00
Nikita Popov
3ad0d4b310 Add support for return type declarations [PHP 7]
This adds an additional "returnType" subnode to Stmt\Function_,
Stmt\ClassMethod and Expr\Closure, as well as the corresponding
support in the name resolver and pretty printer.
2015-03-12 22:16:12 +01:00
Thomas Ruiz
73cace360d Implicit public should not generate as explicit public 2015-03-08 20:21:01 +01:00
nikic
3e1665bbbd Disallow new without a class name
Fixes #137.
2014-09-28 12:41:35 +02:00
nikic
452e1c0180 Add constant dereferencing, a list-minute 5.6 change 2014-08-31 16:14:36 +02:00
nikic
ef121e690c Preserve case of "static" class name 2014-08-11 21:44:50 +02:00
nikic
6d1f77132c Move Stmt\Namespace_::postprocess() to parser 2014-04-21 12:30:55 +02:00
nikic
947a897238 Make names in the parser more descriptive
And improve the code a tad bit in general.

I left YY2TBLSTATES and YYNLSTATES around, because I don't fully
understand their role in the action double indexing.
2014-04-20 23:05:51 +02:00
nikic
1edbc89749 Use normal properties instead of static ones 2014-04-20 00:34:31 +02:00
nikic
0faa844a75 Separate parser code from generated data 2014-04-20 00:19:35 +02:00
nikic
4743e9b0b8 Update constant scalar expression support 2014-04-19 22:53:13 +02:00
nikic
3b7829b011 Add support for function and constant import (PHP 5.6) 2014-03-26 22:33:45 +01:00
nikic
bea89a0bf2 Add support for constant scalar expressions (PHP 5.6) 2014-03-26 21:48:12 +01:00
nikic
cda6f575f0 Add support for pow operator (PHP 5.6) 2014-03-26 19:18:16 +01:00
nikic
b5bcfa1168 Add support for argument unpacking (PHP 5.6) 2014-03-26 18:42:46 +01:00
nikic
96f1151ab2 Add support for variadic parameters (PHP 5.6) 2014-03-26 18:23:30 +01:00
nikic
8c59f41d02 Remove inline Name[] creations
This ensures that the attributes on the Name nodes are correct.
2014-03-22 14:24:33 +01:00
nikic
1c8481bff6 Merge branch '0.9'
Conflicts:
	lib/PhpParser/Lexer.php
	lib/PhpParser/Node/Stmt/Class.php
	lib/PhpParser/Node/Stmt/ClassMethod.php
	lib/PhpParser/Node/Stmt/Interface.php
	lib/PhpParser/Node/Stmt/Namespace.php
	lib/PhpParser/Node/Stmt/UseUse.php
	lib/PhpParser/Parser.php
2014-02-12 20:23:12 +01:00
Martin Hasoň
118f28344d Synchronized error messages with native php error messages 2014-02-12 20:19:48 +01:00
Martin Hasoň
d6eac28955 Fixed typo 2014-02-12 14:12:55 +01:00
nikic
f82862ec9c Port library to use namespaces, with BC for old names 2014-02-06 20:29:35 +01:00
nikic
c8695a8f56 Remove obsolete item from grammar/README.md 2013-08-04 16:14:44 +02:00
nikic
09c106d11f Fix notices when generating expected tokens list 2013-07-27 18:48:49 +02:00
nikic
a249c002dd Add support for ClassName::class (PHP 5.5) 2013-02-14 21:46:58 +01:00
nikic
fbaa1e5fc3 Add information on expected tokens to syntax errors
This now mimics the error messages provided by PHP itself (pre 5.4).
2013-01-15 17:30:14 +01:00
nikic
222c9612ab Use RegexIterator in docs (by @lstrojny)
Also fix formatting in changelog and be more specific in a doc comment.
2012-12-21 13:28:35 +01:00
nikic
cdbad02fb2 Fix endAttributes assignment
The end attributes previously were always assigned from the last read token,
which does not necessarily correspond to the last token in the reduced rule.
In particular this occurs if the parser read a new token and based on that
lookahead decided to reduce a rule. The behavior was only correct if the
newly read token was first shifted and then the rule was reduced.

This is fixed by buffering the endAttributes of the new token in a temporary
variable and only assigning them once the token is shifted.
2012-11-20 16:12:19 +01:00
nikic
759c04db9b Turn rebuildParser.php into a CLI script
The paths are now more generic so it can be run from any directory, not
just grammar/.
2012-10-19 19:11:47 +02:00
nikic
9e43acee2c Scalar_String::create() -> Scalar_String::parse()
Directly creating the node isn't necessary anymore, the token only needs
to be parsed. This makes it consistent with the other scalar parsing
methods and removes the need to pass $arguments around.
2012-10-19 15:17:08 +02:00
nikic
af5d288fb3 Add support for expressions in empty (PHP 5.5)
Apart from the grammar modifications this also renames the Empty subnode
from var to expr. This breaks BC.
2012-09-07 23:42:01 +02:00
nikic
f6c1ab6657 Adjust list and yield parsing, update prettyprinter
* nested list()s will now create nested List nodes (instead of just
   nested arrays)
 * yield $k => $v was parsed with key and value swapped. This is now fixed
 * the pretty printer now works with the newly added language constructs
2012-09-07 23:41:59 +02:00
nikic
4259b44a84 Add support for constant dereferencing (PHP 5.5)
Examples: "foo"[2], [1, 2, 3][2]
2012-09-07 23:41:58 +02:00
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
f8f1e17e41 Add support for list() in foreach (PHP 5.5)
Example: foreach ($coords as list($x, $y)) { ... }

This change slightly breaks backwards compatability, as it changes the
node structure for the previously existing `list(...) = $foo` assignments.
Those no longer have a dedicated `AssignList` node; instead they are
parsed as a normal `Assign` node with a `List` as `var`. Similarly the
use in `foreach` will generate a `List` for `valueVar`.
2012-09-07 23:41:55 +02:00
nikic
8d218110db Fix some doc comments 2012-09-07 23:41:54 +02:00
nikic
5a947e9843 Fix parsing of $foo =& new Bar;
By-reference assignments of new expressions are now parsed as AssignRef
(instead of just Assign).

Closes issue #31.
2012-07-23 11:36:47 +02:00
nikic
e16513a0eb Fix parsing of new expressions in parenthesis
The new dereferencing syntaxes (new Foo)->bar and (new Foo)['bar'] were
causing a shift/reduce conflict with the '(' expr ')' rule. When
(new Foo) was encountered (without dereference operators following) the
parser thus threw a parse error.

The fix simply adds a special '(' new_expr ')' rule to expr. This does not
remove the shift/reduce conflict itself, but makes it irrelevant.

This fixes issue #20.
2012-05-12 14:11:10 +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
2f5ebf7c4d Store line and doc comment as attributes 2012-05-04 10:16:59 +02:00
nikic
f66a672dd0 Start refactoring parser skeleton
The yacc parser skeleton with all those odd $yy short names is quite
non-obvious. This commits starts to refactor it a bit, to use more
obvious names and logic.
2012-05-04 10:16:49 +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
5b27fb40ce Fix line numbers for some list structures
When defining a list in the grammar the list elements have to get a separate
rule, otherwise they'll all be assigned the same line number.
2012-04-19 00:52:44 +02:00
Sebastian Bergmann
b9e3565587 Fugbix typo. 2012-04-04 15:54:45 +02:00
nikic
6657ac4b76 Clarify that parser is autogenerated 2012-03-02 00:43:34 +01:00
nikic
cf3117d82d Fix parsing of integers that overflow into floats
Integers in hex/oct/bin notation that overflowed into floats were parsed incorrectly.
2012-01-15 16:54:48 +01:00
nikic
8bdb478785 Cover Parser.php as much as possible 2011-12-07 18:17:05 +01:00
nikic
1449cc2092 Disallow array deref using alternative syntax
f(){0} and a::b(){0} aren't allowed anymore (in compliance with PHP).
$a->b(){0} support stays for now (for technical reason).
2011-12-04 17:07:17 +01:00
nikic
fa5f9e0740 Formatting fix 2011-12-04 17:03:01 +01:00
nikic
db3181aff1 More test coverage and doc string parsing fixes
The parser didn't account for the additional newline after the content of doc strings, which is left there by the tokenizer for some reason. Additoinally esacape sequences were parsed in nowdoc strings.

Additionally this contains some minor changes to the grammar: Some _list nonterminals were refactored to have the possible single elements in a reparate rule and only assemble those single elements. (This reduces duplication and gives better assignment of line number context.)
2011-12-04 16:52:43 +01:00
nikic
3a4cc1a0f0 Do not distribute debug parser anymore
The debug parser (and the debug y.output) can be still built using rebuildParser.php?debug.
2011-11-27 21:48:34 +01:00
nikic
6ef6e1dab3 Cover errors (and fix errors for namespace names) 2011-11-27 12:58:20 +01:00
nikic
933bebb9b8 Fix parsing of special int syntaxes
Also add the means to test code parsing.
2011-11-26 16:09:39 +01:00
nikic
adfa67cdcf [5.4] Add direct dereferencing of new expression
(new A)->b(), (new A)->b, (new A)[0]. The feature is not implemented fully compliant (implemented as a `variable`, not `expr_without_variable`: Awaiting input on that on internals@.
2011-11-21 18:43:35 +01:00
nikic
4e656fc58d [5.4] Add full array dereferencing support 2011-11-04 07:40:48 +01:00
nikic
6ecae86981 [5.4] Add support for traits 2011-10-30 12:03:29 +01:00
nikic
613aa84f80 [5.4] Add support for static closures
This adds another property to Expr_Closure named "static". It's true for static closures and false otherwise.
2011-10-29 00:16:29 +02:00
nikic
c88d227597 Move some uses of the toArray() macro
Previously it was applied both to the result of inner_statement_list and statement, whereas only the latter required it.
2011-10-28 23:59:00 +02:00
nikic
126efbc056 Make more things optional
Make $stmts and $subNodes optional in most places
2011-10-28 19:14:06 +02:00
nikic
f202aa9814 [API] Make all constructors specialized
For nodes that accept many optional arguments I chose to keep the $subNodes argument, but provide default values instead.
2011-10-28 19:06:24 +02:00
nikic
25f37ccc28 [API] Rename LambdaFunc to Closure
The term "closure" is more commonly used in PHP, even if the function doesn't use() any variables.
2011-10-26 18:34:12 +02:00
nikic
734dbecbc9 Add some more constructors 2011-10-21 16:51:37 +02:00
nikic
82c495657e Remove zend_language_parser.y from distribution 2011-10-21 14:38:25 +02:00
nikic
7806bf025e [5.4] Add support for ClassName::{expr} 2011-10-21 14:09:41 +02:00
nikic
73cc546140 Slightly clean up scalar/static_sclar/common_sclar
name rule is now in common_scalar as it is shared. T_STRING_VARNAME is in encaps_var now.
2011-10-21 12:22:41 +02:00
nikic
ef9d0283e9 Add class_name_or_var nonterminal (to simplify)
class_name_or_var nonterminal is class_name | reference_variable
2011-10-21 11:50:03 +02:00
nikic
08ea0e3d56 [5.4] Add callable typehint
Need to refactor how typehints are saved. Saving array and callable typehints as strings isn't clean
2011-10-21 11:30:27 +02:00
nikic
ab982567d7 [5.4] Add support for short array syntax 2011-10-21 11:27:29 +02:00
nikic
1eb1118ee1 [5.4] Add object method array dereferencing
Other array dereferencing support will follow. Added this in advance as it simplified the code.
2011-10-21 11:12:51 +02:00
nikic
eae1abb6d7 [5.4] Add new tokens
This is to not throw noticed when parsing not yet supported code on 5.4
2011-10-21 11:12:34 +02:00
nikic
3233fdd24d Add support for ClassName::$$a() 2011-10-20 22:29:34 +02:00
nikic
aea2f67c52 Fix AST for ClassName::$methodName() 2011-10-20 22:16:25 +02:00
nikic
9ed77427a2 Rename Expr_List to Expr_AssignList 2011-10-16 14:49:13 +02:00
nikic
6fc85143ca Fix parsing of $$$a 2011-10-16 14:30:22 +02:00
nikic
2d57f52d24 Add more specialized constructors 2011-10-15 19:28:15 +02:00
nikic
535cf21b73 Swap argument order for Node_Case
$cond is now the first parameter and is not optional.
2011-09-30 19:19:17 +02:00
nikic
d5f148b43f Merge Node_Name and Node_Name_Normal 2011-09-24 23:31:18 +02:00
nikic
df7cb44eed Use seperate Name node classes instead of type subnode 2011-09-24 16:53:40 +02:00
nikic
858545732c Add shared Node_Const
Node_Const is shared between Node_Stmt_ClassConst and Node_Stmt_Const. Maybe one could generalize it to a Node_NameToValue to share it with Node_Stmt_Declare too.
2011-09-23 21:00:59 +02:00
nikic
ea65ea7a32 Make some doc comments more precise
Additionally add two further constructors
2011-09-23 18:45:29 +02:00
nikic
ee4e55dc75 Move Node_Expr_FuncCallArg to Node_Arg (just like Node_Param) 2011-09-22 20:34:35 +02:00
nikic
06b7d63406 Add specialized constructors for statement nodes with only one subnode 2011-09-22 20:27:12 +02:00
nikic
847cdbc5c6 Swap argument order for ArrayItem 2011-09-02 19:49:46 +02:00