Leonardo de Moura
2994747ed9
chore: remove workaround
2021-08-13 18:25:32 -07:00
Leonardo de Moura
4b58c4cc02
refactor: instances that "hide" coercions
...
Example:
```
instance [CoeHTCT α β] [Add β] : HAdd α β β where
hAdd a b := Add.add a b
```
2021-08-13 17:18:55 -07:00
Leonardo de Moura
a6b6d61b39
chore: simplify mkProjStx?
2021-08-12 09:50:43 -07:00
Leonardo de Moura
da03262937
fix: check redundant sources at structure instance notation
2021-08-12 09:16:30 -07:00
Leonardo de Moura
c68882ca67
feat: structure instance notation with multiple sources
...
closes #462
closes #463
2021-08-12 06:18:47 -07:00
Leonardo de Moura
a02a490a10
feat: add mkProjStx?
2021-08-12 05:41:00 -07:00
Leonardo de Moura
accf198a88
feat: add ExplicitSourceInfo
2021-08-12 04:29:19 -07:00
Leonardo de Moura
c591902547
refactor: add structure to Source.explicit
2021-08-12 04:10:47 -07:00
Leonardo de Moura
45e4dc26e1
refactor: simplify Source.explicit
2021-08-12 03:40:30 -07:00
Leonardo de Moura
67103f54a9
chore: add TODOs for multiple sources
2021-08-11 19:28:49 -07:00
Leonardo de Moura
d78101f00d
chore: remove mutual recursion workaround
...
It was a leftover hack for the old frontend.
2021-08-11 16:57:53 -07:00
Leonardo de Moura
4abbb3d74c
chore: cleanup
2021-08-11 16:05:07 -07:00
Leonardo de Moura
f1738ce2a0
feat: add macro for expanding field abbrev notation
...
The new macro allows us to use the field abbrev notation in patterns
too. See new test.
2021-08-11 16:02:50 -07:00
Leonardo de Moura
09c2b668e6
feat: allow multiple sources in the structure instance parser
...
This commit also fixes some macros, and make sure the elaborator still
works, but it does not support multiple sources yet.
2021-08-11 13:07:56 -07:00
Leonardo de Moura
63ad42ba47
refactor: move and generalize reduceProj?
2021-08-10 20:21:04 -07:00
Leonardo de Moura
3f3e5d9dcb
fix: private field + default value bug
2021-08-09 19:01:08 -07:00
Leonardo de Moura
0869bbe558
fix: missig registerMVarErrorImplicitArgInfo for postponed instance mvars
2021-08-04 16:58:00 -07:00
Leonardo de Moura
cfb7e27b87
fix: isStructure vs isStructureLike
2021-08-02 18:54:19 -07:00
Wojciech Nawrocki
f51b80060d
feat: generic tagged Format
2021-08-01 09:58:44 +02:00
Leonardo de Moura
3f22d5f624
feat: take auto params into account in the structure instance notation
...
closes #461
2021-07-27 15:49:23 -07:00
Leonardo de Moura
714cadfb31
fix: bug at structure instance notation
...
It was exposed by the second example at #461 .
2021-07-27 11:56:33 -07:00
Wojciech Nawrocki
dfcdc57302
feat: go-to for structure fields
2021-07-05 19:42:01 +02:00
Leonardo de Moura
953dd85c06
chore: avoid inline
2021-06-28 10:17:01 -07:00
Leonardo de Moura
ae6a28af52
chore: remove unnecessary specialize
2021-06-28 10:11:23 -07:00
Leonardo de Moura
e8aa02cd51
feat: closes #415
2021-05-03 18:04:01 -07:00
Leonardo de Moura
1e41e2eb4a
chore: use double backticks
2021-05-03 14:26:27 -07:00
Leonardo de Moura
292bab5a11
fix: loop due to error recovery
2021-04-13 08:12:39 -07:00
Leonardo de Moura
7de9cfeac8
chore: fix StructInst and add mkGroupNode
2021-04-07 22:46:07 -07:00
Leonardo de Moura
578b3b822f
fix: do not use nullKind for group combinator
...
We use `nullKind` for the `group` parser combinator.
When pattern matching `nullKind` nodes, we check their arities.
So, error recovery often fails for parsers that use the `group`
combinator.
For example, we have the parser
```
def whereDecls := leading_parser "where " >> many1Indent (group (letRecDecl >> optional ";"))
```
If there is syntax error at `letRecDecl`, the node corresponding to
```
group (letRecDecl >> optional ";")
```
will contain only one child, and the pattern matching at
```
def expandWhereDecls (whereDecls : Syntax) (body : Syntax) : MacroM Syntax :=
match whereDecls with
| `(whereDecls|where $[$decls:letRecDecl $[;]?]*) => `(let rec $decls:letRecDecl,*; $body)
| _ => Macro.throwUnsupported
```
fails, and we can't elaborate the partial syntax tree for
`letRecDecl`, and auto-completion will not work there.
We address this issue by using a new kind for the `group` combinator.
The idea is to pattern match `group` as we pattern match `node`s with
proper syntax node kinds. This change is consistent with the way we
use `group` where it mainly a convenience for saving us the trouble of
defining a new parser definition that is used only once.
2021-04-07 22:30:51 -07:00
Leonardo de Moura
566fad77d4
chore: helper methods
2021-03-27 18:48:03 -07:00
Leonardo de Moura
dc87bef04c
fix: error message
...
This is a fix for bug reported by @JasonGross at Zulip
2021-03-11 12:16:15 -08:00
Leonardo de Moura
be841a7cad
chore: throwError! => throwError, throwErrorAt! => throwErrorAt
...
@Kha I marked the corresponding methods as `protected`.
I currently can't stand `throw_error`, and I am optimistic about
server highlighting feature you are working on :)
2021-03-11 11:59:45 -08:00
Leonardo de Moura
164577d94e
chore: remove parser! and tparser!
...
The new macros are called "leading_parser` and `trailing_parser`.
cc @Kha
2021-03-11 09:36:58 -08:00
Leonardo de Moura
68143ca8ba
chore: trace[...]! ==> trace[...]
...
@Kha I think this one is a good change, there is no real reason for
using the `!` suffix here.
2021-03-10 18:44:43 -08:00
Leonardo de Moura
5e0b6a404f
chore: naming convention
2021-02-11 15:05:26 -08:00
Leonardo de Moura
ea0fda39bc
chore: Declaration.lean naming convention
...
`Declaration.lean` was one of the first Lean 4 files, and was still
using an old naming convention.
cc @Kha
2021-01-20 17:07:02 -08:00
Leonardo de Moura
58d51bc764
feat: add FieldInfo
2021-01-15 15:01:45 -08:00
Leonardo de Moura
0672247ce8
chore: make comments VS Code friendly
2021-01-15 13:53:37 -08:00
Leonardo de Moura
b756562d4a
feat: simp beta/proj/recursor/matcher
2021-01-01 08:29:21 -08:00
Leonardo de Moura
480462fa24
feat: improve {...} error message
2020-12-24 09:35:55 -08:00
Leonardo de Moura
04a07c15b9
chore: use deriving Inhabited
2020-12-13 11:57:59 -08:00
Leonardo de Moura
1977b66573
feat: proper node for optional .. at structInst
2020-12-10 11:56:37 -08:00
Leonardo de Moura
28feed9c45
feat: proper node for structInstLVal
2020-12-10 11:50:12 -08:00
Sebastian Ullrich
c63b770a7c
refactor: reduce dependencies on Lean.Elab.Quotation
2020-12-08 17:13:32 +01:00
Leonardo de Moura
ae5aa51712
chore: add explicit discard
2020-12-08 06:18:18 -08:00
Leonardo de Moura
0869f38de4
chore: update structure, class, inductive
2020-11-27 15:09:30 -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
104ade010f
chore: weird line break
2020-11-20 16:22:01 -08:00
Leonardo de Moura
fcbd72f2af
feat: optional , at structure instances
2020-11-20 15:24:34 -08:00
Leonardo de Moura
c305c2691f
chore: use :=
2020-11-19 07:22:31 -08:00