Skip to content

Best way to determine if any changes were made to AST? #900

@rulatir

Description

@rulatir

Since format-preserving prettyprinting has been experimental for years and will most likely never be capable of rendering unmodified AST to unmodified PHP in every case, I need an alternative strategy for detecting a no-changes-made condition betwen the before AST and the after AST. This is necessary to avoid generating whitespace/formatting-only file changes during large refactorings.

I would like to avoid having to manually track when I make a change (e.g. by setting a flag in the visitor), because that is an immense burden to always remember when writing lots and lots and lots and lots of visitor code.

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