feat(library/init/lean/elaborator): position on "unknown command" error
This commit is contained in:
parent
0911d16bc3
commit
0e5cfa5e8f
1 changed files with 5 additions and 7 deletions
|
|
@ -650,13 +650,11 @@ do
|
|||
cmd ← current_command,
|
||||
some n ← pure cmd.as_node |
|
||||
error cmd $ "not a command: " ++ to_string cmd,
|
||||
-- TODO(Sebastian): throw error on unknown command when we get serious
|
||||
some elab ← pure $ elaborators.find n.kind.name |
|
||||
-- TODO(Sebastian): reuse `log_message`
|
||||
modify $ λ st, {st with messages := st.messages.add {filename := "foo", pos := ⟨1,0⟩, text := "unknown command: " ++ to_string n.kind.name}},
|
||||
-- error cmd $ "unknown command: " ++ to_string n.kind.name,
|
||||
catch elab $ λ e,
|
||||
modify $ λ st, {st with messages := st.messages.add e})
|
||||
catch
|
||||
(do some elab ← pure $ elaborators.find n.kind.name |
|
||||
error cmd $ "unknown command: " ++ to_string n.kind.name,
|
||||
elab)
|
||||
(λ e, modify $ λ st, {st with messages := st.messages.add e}))
|
||||
elaborator.max_recursion,
|
||||
match p with
|
||||
| except.ok ((), st) := pure st.messages
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue