1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-11-27 04:14:44 +01:00
Commit Graph

698 Commits

Author SHA1 Message Date
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
6bec127e14 Merge pull request #9 from schmittjoh/composer
adds composer.json
2012-01-05 03:14:35 -08:00
Johannes M. Schmitt
71822866aa adds composer.json 2012-01-05 10:46:10 +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
nikic
94d4c30a72 Fully Cover and fix NameResolver
Previously type hints were not resolved due to a typo. Also trait uses were not resolved.
2011-12-10 12:11:53 +01:00
nikic
df691065a6 Fix __halt_compiler() usage in namespace
This fixes the only left bug that was reported by parsing the PHP testsuite :)
2011-12-07 18:36:38 +01:00
nikic
8bdb478785 Cover Parser.php as much as possible 2011-12-07 18:17:05 +01:00
nikic
80065965d3 [5.4] Add new \e escape sequence (0x1B/27) 2011-12-04 17:35:30 +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
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