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

237 Commits

Author SHA1 Message Date
nikic
db6b13378a Finish up code generation docs 2012-04-23 13:37:12 +02:00
nikic
9329c91591 Merge branch 'codeGeneration'
* codeGeneration:
  Add docs for templates
  Add a filesystem template loader.
  Add simple templating support.
  Add usage example for builders to docs
  Add function builder
  Add ability to specify arrays as default values
  Add property builder
  Add parameter builder
  Add method builder
  Add class builder
2012-04-23 13:32:16 +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
nikic
e2a9745bf1 Make Serializer_XML::_serialize protected 2012-04-19 00:25:13 +02:00
nikic
a45360ccaf Add tests for node attributes
Also fix the @inheritDoc declarations and do some whitespace normalization
2012-04-19 00:22:31 +02:00
nikic
510599d8b8 Merge pull request #15 from sebastianbergmann/master
Typo fix
2012-04-04 08:51:43 -07:00
Sebastian Bergmann
b9e3565587 Fugbix typo. 2012-04-04 15:54:45 +02:00
nikic
d6d51ec3bf Add docs for node attributes 2012-04-04 14:10:21 +02:00
nikic
337da5648c Fix XML unserializer
The subNodes array was not initialized, so for empty nodes it would just
be null. Due to the addition of attributes for nodes those have to be
initialized too.
2012-04-04 14:06:08 +02:00
nikic
e17bd0b17f Remove duplicate bootstrap.php
The tests had a separate bootstrap.php, which basically replicated the main
bootstrap.php.
2012-04-04 13:50:21 +02:00
nikic
ce08ea46c2 Merge pull request #14 from schmittjoh/patch-1
Adds capabilities for storing additional information in nodes
2012-04-04 04:48:20 -07:00
nikic
cf78797333 Add docs for templates 2012-04-04 12:29:30 +02:00
nikic
a048112e2c Add a filesystem template loader.
The template loaders loads templates from a base directory (and can
optionally use a suffix). For example

    $templateLoader = new PHPParser_TemplateLoader(
        $parser, './templates', '.php'
    );

    // loads ./templates/TestTemplate.php
    $templateLoader->load('TestTemplate');

Again the implementation is not optimal. The loader probably shouldn't
intantiate the Template itself, but instead should accept a
TemplateFactory. This seemed like overkill to me, so I left it out.
2012-04-03 23:52:00 +02:00
nikic
19c1f80589 Add simple templating support.
Templates use __name__ placeholders. A variant of the placeholder with a
capitalized first latter can be accessed using __Name__ (this is useful
for camel case identifiers, e.g. get__Name__).

Currently the implemention is not particularly clean, because the Template
instantiates a Lexer itself. Fixing this requires a major refactoring of
the lexer/parser interface.
2012-04-03 22:47:41 +02:00
Johannes
2ccae143d0 added implementations for the new interface methods 2012-04-03 13:07:10 -05:00
Johannes
e932711fa4 added some methods for storing metadata to the interface 2012-04-03 13:04:24 -05:00
nikic
77d58a4151 Fix NameResolver tests on PHP 5.2 2012-03-17 13:52:17 +01:00
nikic
c24a697c2d Add Travis config file 2012-03-17 13:18:16 +01:00
nikic
72586235c4 Add usage example for builders to docs 2012-03-11 09:23:32 +01:00
nikic
b8b68a969c Add function builder 2012-03-11 09:02:52 +01:00
nikic
9e5c95b6aa Add ability to specify arrays as default values 2012-03-11 08:53:04 +01:00
nikic
3ce3542032 Add property builder 2012-03-11 08:42:13 +01:00
nikic
4c8351fa86 Add parameter builder 2012-03-11 00:06:02 +01:00
nikic
48f0322aef Add method builder 2012-03-10 23:25:26 +01:00
nikic
88e1f2eeab Add class builder 2012-03-10 17:56:56 +01:00
nikic
e856fe3944 Remove obsolete test skip
The test no longer depends on PHP 5.4, so don't skip it.
2012-03-10 10:55:34 +01:00
nikic
d7407af87d Remove unused variable 2012-03-03 17:01:28 +01:00
nikic
2ed6cac7c1 Don't traverse nodes merged by another visitor
If a NodeVisitor returns an array of nodes to merge these will no longer be traversed by all other visitors. That "feature" turned out to be a real pain in the ass on some occasions ;)
2012-03-03 16:50:45 +01:00
nikic
6657ac4b76 Clarify that parser is autogenerated 2012-03-02 00:43:34 +01:00
nikic
0c0515c7de Replace /e modifier with callback + eval()
As this also fixes the overescaping issue, some stuff in the tests can be written more nicely now.
2012-03-02 00:28:46 +01:00
nikic
48f089a111 Tweak readme 2012-02-21 19:58:11 +01:00
nikic
517562e05a Add a little into to readme 2012-02-21 19:52:49 +01:00
nikic
168982a912 Don't replace \ followed by { with NS_SEPARATOR 2012-02-21 19:28:40 +01:00
nikic
b0883f2bb8 Update docs to mention emulative lexer 2012-02-21 19:02:04 +01:00
nikic
10ba9f8dda Add some tests for the emulative lexer 2012-02-21 18:45:07 +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
608cfbba4e Factor out error handling out of Lexer construcor
Makes the constructor more concise and puts the strange error handling stuff in separate methods
2012-02-21 17:00:49 +01:00
nikic
584f6b0ab3 Make old testrunner PHP 5.2 compatible 2012-01-15 16:55:01 +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
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