SMIE: Weakness is Power!: Auto-indentation with incomplete information
Stefan Monnier (University of Montreal, Canada)

TL;DR
SMIE offers a robust approach to automatic code indentation that works effectively even with incomplete or erroneous code by leveraging local parsing techniques, enhancing editor resilience.
Contribution
The paper introduces SMIE, a novel indentation engine that uses local parsing to handle incomplete or broken code, improving indentation accuracy in challenging scenarios.
Findings
Enables indentation with incomplete or erroneous code
Provides graceful degradation in parsing accuracy
Improves robustness of code editors
Abstract
Automatic indentation of source code is fundamentally a simple matter of parsing the code and then applying language- and style-specific rules about relative indentation of the various constructs. Yet, in practice, full parsing is not always an option, either because of quirks of the language, or because the code is temporarily syntactically incorrect, or because of an incomplete or broken grammar. I present the design of Emacs's Simple-Minded Indentation Engine (SMIE), which gets its power from the weakness of the underlying parsing technique. It makes it possible to perform local parsing, which is hence unaffected by irrelevant surrounding code. This provides a form of graceful degradation in the face of incomplete, erroneous, or just plain problematic information.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software Testing and Debugging Techniques · Metal and Thin Film Mechanics
