Commit graph

107 commits

Author SHA1 Message Date
Gabriel Ebner
f219188c95 fix: indent declaration signatures 2021-12-15 11:42:38 +00:00
Gabriel Ebner
e90bdd00db fix: indent where definitions and add space before 2021-12-15 11:42:38 +00:00
Gabriel Ebner
f5a2562575 fix: indent structure fields 2021-12-15 11:42:38 +00:00
Leonardo de Moura
55db56f80d feat: add noncomputable section parser 2021-12-13 10:35:16 -08:00
Leonardo de Moura
bf3b0c53ad chore: add helper parser 2021-12-12 08:16:42 -08:00
Leonardo de Moura
b6ef65d8fd fix: where structure instance parser
closes #753
2021-12-12 07:52:52 -08:00
Scott Morrison
43315f7f94
fix: correct spacing in the pretty printer 2021-11-23 09:13:31 +01:00
Leonardo de Moura
85c49cfeb3 feat: apply termination tactic provided by user 2021-10-03 18:47:52 -07:00
Leonardo de Moura
23740778d4 refactor: termination hints 2021-10-03 18:09:35 -07:00
Leonardo de Moura
d22a42358f feat: add decreasing_tactic notation 2021-10-03 17:16:29 -07:00
Leonardo de Moura
8425a53377 feat: improve termination_by notation 2021-09-22 21:08:01 -07:00
Leonardo de Moura
6211b95e06 feat: add termination_by parser 2021-09-21 13:19:01 -07:00
Sebastian Ullrich
585fba69e8 refactor: remove redundancy from common register_parser_alias case
/cc @leodemoura
2021-09-20 13:20:23 +02:00
Leonardo de Moura
bbb74bfd9a feat: elaborate optional deriving after def 2021-09-03 10:22:17 -07:00
Leonardo de Moura
8a268e184b feat: update def parser with optional deriving ... 2021-09-03 09:42:17 -07:00
Leonardo de Moura
56961060d4 fix: use rawIdent at eraseAttr parser
Reason: some attribute names are also keywords (e.g., `instance`).
2021-08-31 15:07:21 -07:00
Leonardo de Moura
79e6732fc6 fix: update tokenTable at withNamespace parser combinator
It also moves `withOpen` and `withOpenDecl` applications to simplify
their definitions and make sure we do not need to reset the cache.
2021-08-23 09:41:36 -07:00
Leonardo de Moura
7edc42fdfc fix: scoped command after open command
The issue was reported at
https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Ending.20a.20command
2021-08-23 08:29:30 -07:00
Leonardo de Moura
d93c4317d1 feat: add withOpenDecl and withOpen parsers
It allow us to process `open .. in ..` while parsing.
This is useful for activating a scoped parser while parsing.
TODO: `openOnly` and `openHiding`, these two cases are rarely used
with `open .. in ..`

closes #529
2021-08-22 20:50:35 -07:00
Leonardo de Moura
54316fabb4 feat: add nonrec parser 2021-08-21 16:39:18 -07:00
Leonardo de Moura
519bb1e7d4 feat: add open scoped parser 2021-08-21 07:06:50 -07:00
Leonardo de Moura
8d5964ce19 feat: add module doc parser 2021-08-06 13:17:56 -07:00
Leonardo de Moura
f9672fe4c6 feat: add optional visibitily modifier to initialize and builtin_initialize commands 2021-08-03 14:37:22 -07:00
Leonardo de Moura
fb3ea8109f fix: structure instance parser 2021-07-27 12:54:17 -07:00
Wojciech Nawrocki
cfb5d34dd3 fix: parser arity 2021-07-24 10:45:28 +02:00
Wojciech Nawrocki
4a3c172ac9 feat: parametrised deriving handlers 2021-07-24 10:45:28 +02:00
Wojciech Nawrocki
a8d599a955 fix: typo 2021-07-15 21:57:55 +02:00
Leonardo de Moura
90a79a0b06 chore: remove command universes
Now, `universe` may declare many universes. The goal is to make it
consistent with the `variable` command
2021-06-29 17:01:07 -07:00
Leonardo de Moura
71cd067e94 feat: add helper command 2021-05-13 22:10:35 -07:00
Sebastian Ullrich
73cf3533a1 fix: count quotation depth in parser correctly 2021-04-29 13:33:48 +02:00
Sebastian Ullrich
8119daeb18 feat: syntax & attribute for double-quoted quotations 2021-04-27 16:38:37 -07:00
Daniel Selsam
d35091da56 feat: parser alias for 'declVal' 2021-04-12 16:59:54 -07:00
Leonardo de Moura
2fc775954c fix: error recovery
@kha We have a few parsers that invoke `tokenFn`, and return error
depending of what is on the top of the stack (e.g., `ident`).
These parsers were not restoring the stack size when reporting errord,
and messing up the error recovery. We never notice the problem because
operators such as <|> restore the stack size, and we were not trying
to elaborate syntacticly incorrect terms.
2021-03-31 17:05:34 -07:00
Leonardo de Moura
c35f96ac82 feat: avoid bizarre error message for definition without body
@kha This is a temporary hack to avoid a incomprehensible error
message. I will try to tweak the parser error recovery in another
commit.
2021-03-31 17:05:34 -07: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
b3d83aa199 feat: set_option parser for terms and tactics 2021-03-06 15:38:02 -08:00
Leonardo de Moura
4bcfc5f9a6 feat: open parser for terms and tactics 2021-03-06 15:32:59 -08:00
Leonardo de Moura
960e964b71 feat: allow user to "erase" [simp] lemmas 2021-03-04 11:36:12 -08:00
Sebastian Ullrich
8a02dfec4f feat: subsume variables under variable
/cc @leodemoura
2021-01-22 14:36:05 +01:00
Leonardo de Moura
308c61027a feat: save doc strings
We can now document `let rec` too.
2021-01-10 07:13:33 -08:00
Leonardo de Moura
e74ba14f4c feat: modify structSimpleBinder parser
@Kha It felt odd that we can write
```
   map f x := ...
```
in instances, but we had to write
```
   map (f x) := ...
```
when setting the field default value in a class.
2020-12-23 08:23:14 -08:00
Leonardo de Moura
4fc06bfcca feat: add optional (priority := <prio>) to instance command 2020-12-21 10:02:12 -08:00
Leonardo de Moura
c7a8fa2629 chore: expose a few auxiliary command parsers 2020-12-14 09:15:26 -08:00
Leonardo de Moura
0862df9ade fix: missing ppSpace at set_option parser 2020-12-13 15:52:03 -08:00
Leonardo de Moura
8fd6870931 fix: optDeriving parser 2020-12-12 18:58:44 -08:00
Leonardo de Moura
01ec581617 chore: update deriving instance syntax 2020-12-12 16:48:12 -08:00
Leonardo de Moura
3743f877f4 feat: add deriving parsers 2020-12-12 15:33:36 -08:00
Leonardo de Moura
76fb1799fe chore: goodies for deriving command 2020-12-11 18:08:50 -08:00
Leonardo de Moura
1c0943ad82 feat: add #reduce command parser 2020-12-06 09:32:25 -08:00
Leonardo de Moura
fdc2c9f281 feat: process local instance ... and scoped instance ... commands 2020-12-05 15:46:25 -08:00