fix: panic when Syntax.missing
I got a panic error message today in VS Code because of this function. It is weird because, as far as I can tell, this function is only used by the `register_simp_attr` macro, and this macro was not being used in the files I was editing. I think the fix is resonable for a `Syntax.missing` case. cc @gebner
This commit is contained in:
parent
506cf01d94
commit
a2631ce037
1 changed files with 1 additions and 0 deletions
|
|
@ -95,6 +95,7 @@ def getDocStringText [Monad m] [MonadError m] [MonadRef m] (stx : TSyntax `Lean.
|
|||
def TSyntax.getDocString (stx : TSyntax `Lean.Parser.Command.docComment) : String :=
|
||||
match stx.raw[1] with
|
||||
| Syntax.atom _ val => val.extract 0 (val.endPos - ⟨2⟩)
|
||||
| Syntax.missing => ""
|
||||
| _ => panic! s!"unexpected doc string\n{stx.raw[1]}"
|
||||
|
||||
end Lean
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue