paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Syntactic Completions with Material Obligations

带物化义务的语法补全
OOPSLA 9(OOPSLA2)2025匹配度 2/10 · 该论文属于程序语言与编辑器/解析器方向,关注语法错误恢复和补全,并结合形式化解析演算与用户研究;但它不涉及静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析,因此与用户当前核心研究方向交集很少。引用 0 inbox
David Moon, Andrew Blinn, Thomas J. Porter, Cyrus Omar
crossref: 2026-09-10

AI 速览

一句话:提出 tall tylr:用可物化的语法义务抽象多种补全可能,并以 tile 解析演算保证任意输入都能恢复为良构项。

代码编辑器提供的服务在出现语法错误时常常失效。现有的语法错误恢复技术,如 panic mode 与多选项修复,要么过于粗糙(例如删除大段代码),要么导致补全候选爆炸。本文提出 tall tylr——一个错误处理解析器与编辑器生成器,它用「语法义务」(syntactic obligations)补全残缺代码,将结构编辑器中熟悉的 hole 概念泛化为缺失的操作数、运算符、分隔符与 sort 转换。tall tylr 以新的 tile 解析理论为支撑:molder 把 token 变成 tile,melder 则通过运算符优先级解析的错误处理泛化,把 tile 补全并解析为项。作者将 melding 形式化为解析演算 meldr,证明其总能为输入 tile 补充义务并解析为良构项,且对所有输入保证成功;实现中采用最小化义务原则完成 molding 与补全排序。最后通过用户研究评估将语法义务物化呈现给程序员的可用性与有用性,得到若干积极反馈与未来方向。

问题
代码编辑器服务在语法错误下失效,而现有恢复技术要么过度删除代码,要么产生大量补全候选,难以兼顾鲁棒性与精度。
方法
提出 tall tylr 及其 tile 解析理论,用语法义务抽象缺失的语法成分,并将补全与解析形式化为解析演算 meldr,按最小化义务原则排序补全。
评估
形式化 meldr 并论证对所有输入都能补全为良构项;再通过用户研究评估物化语法义务的编辑器是否可用、有用。
原文摘要(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.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot2924,
  title = {Syntactic Completions with Material Obligations},
  author = {David Moon and Andrew Blinn and Thomas J. Porter and Cyrus Omar},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {OOPSLA2},
  year = {2025},
  doi = {10.1145/3763182}
}