Commit graph

43 commits

Author SHA1 Message Date
Leonardo de Moura
ef51087138 feat: do not log error messages with synthetic sorry's
Before this commit, only error messages caught at `elabTerm` were
filtered.

cc @Kha
2020-12-23 10:52:27 -08:00
Leonardo de Moura
7e76446d9d fix: error message 2020-12-23 07:35:12 -08:00
Leonardo de Moura
04a07c15b9 chore: use deriving Inhabited 2020-12-13 11:57:59 -08:00
Leonardo de Moura
3b6d65c3c3 chore: use deriving Inhabited 2020-12-13 10:09:20 -08:00
Leonardo de Moura
9d304df757 feat: heterogeneous Append experiment
@Kha This one required a bunch of manual fixes. The main issue is that
before we added the string interpolation feature, we created
`MessageData`s using `++` and coercions. For example, given
`(e : Expr)`, we would write
```
let msg : MessageData := "type: " ++ e
```
and rely on the coercions `String -> MessageData` and
`Expr -> MessageData`, and the instance `Append MessageData`.
However, heterogeneous operators "block" the expected type propagation downwards.
This kind of code is obsolete now since we can write a more compact
version using string interpolation
```
let msg := m!"type: {e}"
```
2020-12-01 16:32:41 -08:00
Leonardo de Moura
0869f38de4 chore: update structure, class, inductive 2020-11-27 15:09:30 -08:00
Leonardo de Moura
276a8b99dd refactor: move ppGoal to Meta
We need `MetaM` methods such as `isProp` to improve `ppGoal`.
This commit also moves `currNamespace` and `openDecls` to
`Core.Context`. Without this change, `Meta.ppExpr` was not taking
`open` commands into account.
2020-11-25 14:17:13 -08:00
Leonardo de Moura
d6f778bec4 refactor: arbitrary without explicit arguments
@Kha I was tired of writing `arbitrary _` :)
There 0 places in the stdlib where the type needs to be provided.
If in the future we need to specify the type we can use
`arbitrary (α := <type>)`
2020-11-25 09:07:38 -08:00
Leonardo de Moura
c305c2691f chore: use := 2020-11-19 07:22:31 -08:00
Leonardo de Moura
db5fe843de chore: add expandInterpolatedStr helper function, rename msg! => m! 2020-11-14 13:52:52 -08:00
Leonardo de Moura
65dafaf07c fix: stdlib and tests
We also declare a few macros for the syntax command.
2020-11-12 07:12:30 -08:00
Leonardo de Moura
898a08a0c1 chore: avoid Has prefix in type classes
closes #203
2020-10-27 18:29:19 -07:00
Leonardo de Moura
ff493751b5 chore: HasFormat ==> ToFormat 2020-10-27 16:19:14 -07:00
Sebastian Ullrich
c0e117daa4 fix: Option.ToMessageData 2020-10-27 14:09:33 +01:00
Leonardo de Moura
13c2a8ff51 chore: remove #lang lean4 header 2020-10-25 09:54:07 -07:00
Leonardo de Moura
ea829b75c0 chore: remove coercions for old frontend 2020-10-21 17:37:35 -07:00
Leonardo de Moura
7111eb4d79 chore: move to new frontend 2020-10-21 13:30:43 -07:00
Sebastian Ullrich
5351bffb99 chore: revert obsolete workaround 2020-10-21 11:21:56 +02:00
Leonardo de Moura
518faa71b4 chore: move to new frontend 2020-10-20 11:19:44 -07:00
Leonardo de Moura
5402ea88a2 feat: add withNestedTraces 2020-10-18 16:31:01 -07:00
Leonardo de Moura
bc072eceea chore: document temporary workaround 2020-10-18 12:22:20 -07:00
Leonardo de Moura
a9d2620a6c feat: add ToMessageData (Option ...) instance 2020-10-18 11:53:43 -07:00
Leonardo de Moura
cfa02bf16a chore: add missing : 2020-10-14 13:20:01 -07:00
Leonardo de Moura
be252743b3 feat: add string interpolation for MessageData 2020-10-09 20:43:26 -07:00
Sebastian Ullrich
d51101b884 feat: sanitize Syntax in messages
Fixes #182
2020-09-29 07:59:22 -07:00
Sebastian Ullrich
af8dc5eeab feat: pretty print Syntax in messages 2020-09-29 07:59:22 -07:00
Leonardo de Moura
a28679358e refactor: remove MonadError 2020-09-18 09:58:13 -07:00
Leonardo de Moura
9c8f57f322 fix: preserve info messages from candidates that failed to be elaborated
@Kha Not sure whether we should have an option for supressing this
information or not.
We need this information for diagnosing problems. For example, I was trying to
understand why the elaborator was looping. I suspected it was the
TC module, but I was not getting any trace messages since the symbol
was overloaded, and the case that did not work was the expensive one :(
2020-09-17 17:08:14 -07:00
Sebastian Ullrich
f4e6635f2b chore: getMessageStringEx: show exception 2020-09-17 08:12:28 -07:00
Leonardo de Moura
e10cd085f4 feat: use sanitizeNames at ppGoal 2020-09-16 13:39:06 -07:00
Leonardo de Moura
18a7f5a489 feat: new name sanitizer 2020-09-16 11:57:55 -07:00
Leonardo de Moura
0abca5475f refactor: move ppExpr to IO
@Kha I am also tracking `currNamespace` and `openDecls`.

BTW, I also tried an experiment where I added `currNamespace` and
`openDecls` to `Meta.Context`, but it looked weird. This information
is only needed in the elaborator and pretty printer.
The `PPContext` object should contain everything you need. You
can put `currNamespace` and `openDecls` in the `Delaborator.Context`.
2020-09-15 18:48:21 -07:00
Leonardo de Moura
19a7927f10 feat: sanitizeNames
@Kha I am using `_shadowed.<idx>` suffix for marking variables that
have been shadowed. It is a bit verbose, but at least it is easy to
understand understand error messages such as
```
shadow.lean:4:0: error: type mismatch
  h
has type
  x._shadowed.1 = x._shadowed.1
but it is expected to have type
  x = x
```
It is better than the old cryptic version
```
shadow.lean:4:0: error: type mismatch
  h
has type
  x = x
but it is expected to have type
  x = x
```
2020-09-15 16:28:50 -07:00
Leonardo de Moura
61bd10997a feat: add coercions for the new frontend 2020-09-10 13:24:13 -07:00
Leonardo de Moura
b136c519e2 fix: scope and improve error message 2020-09-09 16:44:43 -07:00
Leonardo de Moura
e5c35d3a4e feat: add AddMessageDataContext 2020-08-28 18:05:42 -07:00
Leonardo de Moura
5349a73655 chore: add MessageData.nestD
"default nest"
2020-08-27 11:22:47 -07:00
Leonardo de Moura
40ec0b7ae4 feat: add helper functions and generalize 2020-08-19 09:53:45 -07:00
Leonardo de Moura
e423533bca chore: improve DepElim trace messages 2020-08-06 11:02:57 -07:00
Leonardo de Moura
20210928da fix: missing line breaks 2020-07-24 11:18:28 -07:00
Leonardo de Moura
11ed7c6195 chore: move PersistentArray to Std 2020-06-25 13:02:21 -07:00
Leonardo de Moura
249bda16c0 chore: remove prelude commands from Lean package 2020-06-25 11:21:17 -07:00
Leonardo de Moura
4ccc3fef52 chore: move Init.Lean files to Lean package 2020-05-26 15:04:35 -07:00
Renamed from src/Init/Lean/Message.lean (Browse further)