Syntactic Completions with Material Obligations
David Moon, Andrew Blinn, Thomas Porter, Cyrus Omar
Abstract
Code editors provide essential services that help developers understand, navigate, and modify programs. However, these services often fail in the presence of syntax errors. Existing syntax error recovery techniques, like panic mode and multi-option repairs, are either too coarse, e.g. in deleting large swathes of code, or lead to a proliferation of possible completions. This paper introduces tall tylr, an error-handling parser and editor generator that completes malformed code with syntactic obligations that abstract over many possible completions. These obligations generalize the familiar notion of holes in structure editors to cover missing operands, operators, delimiters, and sort transitions.
tall tylr is backed by a novel theory of tile-based parsing, conceptually organized around a molder that turns tokens into tiles and a melder that completes and parses tiles into terms using an error-handling generalization of operator-precedence parsing. We formalize melding as a parsing calculus, meldr, that completes input tiles with additional obligations such that it can be parsed into a well-formed term, with success guaranteed over all inputs. We further describe how tall tylr implements molding and completionranking using the principle of minimizing obligations.
Obligations offer a useful way to scaffold internal program representations, but in tall tylr we go further to investigate the potential of materializing these obligations visually to the programmer. We conduct a user study to evaluate the extent to which an editor like tall tylr that materializes syntactic obligations might be usable and useful, finding both points of positivity and interesting new avenues for future work.
CCS Concepts: • Software and its engineering → General programming languages.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext cb8566ff-ca78-460d-ba40-2c8dfc693adbBuilds on1
Related papers
- Pantograph: A Fluid and Typed Structure EditorJacob Prinz, Henry Blanchette, Leonidas LampropoulosPOPL 2025 · 1 citation
- Language-parametric static semantic code completionDaniël A. A. Pelsmaeker, Hendrik van Antwerpen, Casper Bach Poulsen, Eelco VisserOOPSLA 2022 · 10 citations
- Structured Editing for All: Deriving Usable Structured Editors from GrammarsTom Beckmann, Patrick Rein, Stefan Ramson, Joana Bergsiek et al.CHI 2023 · 21 citations
- Total Type Error Localization and Recovery with HolesEric Zhao, Raef Maroof, Anand Dukkipati, Andrew Blinn et al.POPL 2024 · 15 citations
- Automated Repair of Programs from Large Language ModelsZhiyu Fan, Xiang Gao, Martin Mirchev, Abhik Roychoudhury et al.ICSE 2023 · 213 citations
