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
c3df371998
Cover, fix and cleanup XML unserializer
2011-12-03 15:15:20 +01:00
nikic
b49c55c9e5
Cover NodeTraverser and bugs it found
...
a) ->traverseNode() now operates on a clone of the node, otherwise the original node will be modified too
b) before nodes were passed to the following visitor unchanged, even though they were already changed in the tree
2011-12-02 17:52:03 +01:00
nikic
8c2bf0373c
Some more test improvements (+ fixes)
2011-11-27 21:50:19 +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
b1745ca280
Merge pull request #7 from francisbesset/fixed_tests
...
Skipped test with trait on PHP Version < 5.4.0RC1
2011-11-27 12:47:26 -08:00
Francis Besset
efbf49814e
Launch test with trait only with PHP 5.4
2011-11-27 21:28:08 +01:00
nikic
6ef6e1dab3
Cover errors (and fix errors for namespace names)
2011-11-27 12:58:20 +01:00
nikic
80d090ea14
Fix __halt_compiler with newline after closing tag
...
The newline after the closing tag is now not returned as part of the remaining text (PHP eats one newline after ?>).
2011-11-27 11:21:06 +01:00
nikic
21dc9b32f4
Add test coverage for all nodes
2011-11-27 11:20:35 +01:00
nikic
03a0449b1a
Add tests for other scalar types
2011-11-26 17:10:18 +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
6ed2f43098
Add XML syntax highlighting in docs
2011-11-12 19:30:52 +01:00
nikic
6289ccfa78
More docs
2011-11-12 19:28:53 +01:00
nikic
3b02facf0c
Add an example
2011-11-12 18:29:50 +01:00
nikic
2ec6ae4b03
Make NameResolver add namespacedName subnodes
2011-11-12 13:24:59 +01:00
nikic
c44f6375ef
Start adding more extensive documentation
2011-11-12 13:07:12 +01:00
nikic
c94a4767df
Add tests for XML serialization
...
Also fix the invalid namespace URIs I used.
2011-11-06 18:09:32 +01:00
nikic
d9452e611a
Fix NameResolver for parameters without typehints
2011-11-06 17:16:40 +01:00
nikic
b84553e011
Add XML serialization and unserialization support
...
The unserializiation implementation currently is very hacky => needs some refactoring.
2011-11-06 17:07:38 +01:00
nikic
4e656fc58d
[5.4] Add full array dereferencing support
2011-11-04 07:40:48 +01:00
nikic
c51991bc3c
Improve test run.php
...
* Add two more ignored tests (not real pretty print differences)
* Measure more times
2011-10-30 12:16:31 +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
c7c94f38f1
Stop using ArrayObject for nodes
...
Instead manually implement IteratorAggregate and define the required magic methods. The reasoning behind this is:
a) Extending ArrayObject is always risky, because a lot of magic which is known to be buggy is involved
b) This allows to lateron change the implementation for the nodes altogether, for example it could be changed to using real public fields instead of a $subNodes array.
2011-10-28 23:12:32 +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
a3c24cf86c
[API] Rename Stmt_Func to Stmt_Function
2011-10-28 19:08:01 +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
5f0a1535ff
Fix unit tests
2011-10-26 18:35:37 +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
920f12f958
Allow __halt_compiler(); after braced namespaces
2011-10-20 23:06:38 +02:00
nikic
d9b5814074
run tests with all errors enabled
2011-10-20 22:36:10 +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
dc4182277f
Exclude fatal errors one some files from PHP tests
2011-10-19 20:04:57 +02:00
nikic
9fba1df4e0
Circumvent token_get_all bug with b"$var"
2011-10-19 18:09:13 +02:00
nikic
460f981e84
Improve tests
...
* Script is now at test_old/run.php and is CLI only
* Accepts a test type (Symfony or PHP) and a path to the test files as arguments
* For the PHP testsuite files that expect a parse error are not tested (though Fatal errors are tested, so there are still 49 parse test failures)
* Removed testExpressions.php as this is covered in the PHP testsuite
2011-10-19 17:55:37 +02:00
nikic
69b298c4b5
Recognize halt_compiler() ?> (without ;)
2011-10-18 18:03:28 +02:00
nikic
afdfb6bf08
Make test_old able to run PHP testsuite
2011-10-17 17:49:24 +02:00