mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-01-16 14:48:32 +01:00
e50c67b7a9
Add a new "indent" option for the pretty printer, which can be use to control the indentation width, or switch it to use tabs. Tab width is currenlty hardcoded to 4, but also shouldn't matter much. Possibly the formatting-preserving printer should auto-detect the indentation in the future.
Table of Contents
Guide
Component documentation
- Walking the AST
- Node visitors
- Modifying the AST from a visitor
- Short-circuiting traversals
- Interleaved visitors
- Simple node finding API
- Parent and sibling references
- Name resolution
- Name resolver options
- Name resolution context
- Pretty printing
- Converting AST back to PHP code
- Customizing formatting
- Formatting-preserving code transformations
- AST builders
- Fluent builders for AST nodes
- Lexer
- Emulation
- Tokens, positions and attributes
- Error handling
- Column information for errors
- Error recovery (parsing of syntactically incorrect code)
- Constant expression evaluation
- Evaluating constant/property/etc initializers
- Handling errors and unsupported expressions
- JSON representation
- JSON encoding and decoding of ASTs
- Performance
- Disabling Xdebug
- Reusing objects
- Garbage collection impact
- Frequently asked questions
- Parent and sibling references