Documentation
¶
Overview ¶
Package naive provides a deliberately minimal PHP parser and pretty-printer.
The parser recognises only two node types---blocks (scopes) and generic statements (or list items)---so it does not model PHP’s full grammar. The printer can re-emit any valid PHP file (and often even invalid ones), but it normalises the output: spacing, line breaks, and other cosmetic trivia may differ from the original source, although the program’s behaviour is preserved.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options uint8
const ( // TrailingComma enables adding trailing commas in all [] and () scopes. TrailingComma Options = 1 << iota // AlignColumns causes Fprint to align elements in columns using spaces. AlignColumns // PHP74Compat switches formatting to PHP 7.4 compatibility mode. // // - This will remove support for trailing comma. // - The concat operator (.) is formatted according to PHP 7.4 precedence rules. PHP74Compat // Standard is the default, “standard” formatting style. Standard = TrailingComma | AlignColumns )
type SyntaxError ¶
SyntaxError records an error and the position it occurred on.
func (*SyntaxError) Error ¶
func (e *SyntaxError) Error() string
Click to show internal directories.
Click to hide internal directories.