Closed monperrus closed 5 years ago
depends on #1168
useful for repairnator and co
see #1358
closed per #1927
FYI: An Algorithm for Layout Preservation in Refactoring Transformations https://link.springer.com/chapter/10.1007/978-3-642-28830-2_3
More papers on high-fidelity / layout preserving code transformation:
High-fidelity C/C++ code transformation (2017) https://www.sciencedirect.com/science/article/pii/S0167642307000718/pdf
Detaching and reconstructing the documentary structure of source code (2010) https://www.researchgate.net/profile/Gabor_Kusper/publication/284888833_ICAI2010-volume2/links/5659ad0408aeafc2aac4c23a/ICAI2010-volume2.pdf#page=401
Layout preserving parser for refactoring in Erlang (2009) https://pdfs.semanticscholar.org/8487/eeda4c867e8f7cd13d83391488b2abec4a39.pdf
revcpp: A reversible c++ preprocessor (2015) https://www.lrde.epita.fr/~sigoure/revcpp.pdf
Scrap you reprinter (2017) https://www.cs.kent.ac.uk/people/staff/dao7/publ/reprinter2017.pdf
Transformation tools with high-fidelity / layout preserving features (thanks to @jurgenvinju):
Tools:
Relevant papers:
the paper which coined the term "hifi" transformation for "no loss of layout and source code comments":
"High Fidelity C/C++ Code Transformation" by Daniel Waddington and Bin Yao https://www.researchgate.net/publication/222998573_High-Fidelity_CC_Code_Transformation
FYI, JavaParser calls this feature "lexical preservation", see @ftomassetti's post https://tomassetti.me/lexical-preservation-javaparser/
This paper by Rodin T. A. Aarssen and Tijs van der Storm suggesting "Separator Syntax Trees" might be of interest:
High-fidelity metaprogramming with separator syntax trees (2020) https://dl.acm.org/doi/abs/10.1145/3372884.3373162
we only rewrite the changed nodes, keeping the original formatting.
see ROADMAP