Skip to content

Q: How the format preserving works in basics? #487

@TomasVotruba

Description

@TomasVotruba

This is rather technical question on how to approach it.
I ask because I work with 3rd party doc block parser and need to build the same feature around it.

Input

The parser returns Nodes (ParamNode for @param Type $name, VarNode etc.),
and lexer returns tokens (/**, , @, param ...).

Change

Let's say I change Type to TypeFoo via $paramNode->type (like here).

How to connect them together so I could print back the original format?

If that helps, I'm aware there is indent in printer and each node has original node on it.

Thank you for any guidance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions