umajho / dicexp

Dicexp 是一种表示掷骰的表达式。本仓库代码用于对该表达式求值,并作为该表达式的事实标准。
https://umajho.github.io/dicexp/
MIT License
2 stars 0 forks source link

友好处理解析错误 #15

Closed umajho closed 1 year ago

umajho commented 1 year ago

目前对解析错误的处理方式仅仅是表示知道出现了这样的错误。 虽然考虑到复杂性,目前不打算提供指导性的错误信息,但至少应该标示出出现错误的位置位移。 解析错误在 API 中的呈现方式应该与运行时错误保持一致。

此外,在编辑器中,应该使用红色波浪线标注解析错误。

umajho commented 1 year ago

done: https://github.com/umajho/dicexp/commit/fa2c3e5b21933653fbd000a243a942369169129a, https://github.com/umajho/dicexp/commit/66c1a0e82bb684521c8089e5d5e2d7172fa51761