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
Leonardo de Moura
d27770ea0e
chore: prepare to add scoped and local instances
2020-12-05 15:36:23 -08:00
Leonardo de Moura
10102bf370
chore: remove "local" before attribute command
...
`local` is now part of the `Term.attrInstance` parser.
2020-12-05 07:47:28 -08:00
Leonardo de Moura
c476954eef
feat: heterogeneous OrElse and AndThen
...
@Kha I had a few issues similar to the `Append` issues.
We used a similar idiom for writing builtin parsers where we may write
```
def p : Parser := "foo " >> "bla "
```
as a shorthand for
```
def p : Parser := symbol "foo " >> symbol "bla "
```
I want to support `builtin syntax` one day :)
That being said, we should decide whether we keep `HAppend`, `HOrElse`,
and `HAndThen` or not.
The only one I wish I had in the past is `HAndThen`.
2020-12-01 18:32:24 -08:00
Leonardo de Moura
5585f9823f
chore: cleaner structure/class syntax
...
@Kha I implemented the syntax for structure/class that we discussed this morning.
It is much cleaner. See new tests at `struct2.lean`.
I updated the documentation to use it.
2020-11-24 13:07:43 -08:00
Leonardo de Moura
5884b9c19a
feat: add support for instance ... where
...
@Kha The fields are not mutually recursive yet, but it is good enough
for writing examples in the manual.
See new test
2020-11-23 18:07:02 -08:00
Leonardo de Moura
ac85650e0a
feat: add optional where clause at declarations
...
closes #191
@Kha Note that it expands into a "let rec".
There are many other places where an optional `where`-clause is
useful. We can add them later. It is relatively easy to add support in
other places using the new helper functions
`expandWhereDeclsOpt` and `expandMatchAltsWhereDecls`
2020-11-23 12:04:51 -08:00
Leonardo de Moura
3f27d7318e
chore: prepare to add where clause to declarations
2020-11-23 10:41:12 -08:00
Leonardo de Moura
0fcf6217ec
feat: optional := before constructors in the inductive command
...
@Kha In the documentation, I will always use `:=`. The idea is to
avoid the issue: why does `structure` have a `:=` but `inductive`
doesn't.
2020-11-19 06:43:14 -08:00
Leonardo de Moura
360fa1638f
chore: rename Parser.try to Parser.atomic
...
Reason: `try` is a keyword.
cc @Kha
2020-11-17 08:25:01 -08:00
Leonardo de Moura
61dfe2b1db
fix: letDecl
...
use `simpleBinderWithoutType` at `declSig` and `optDeclSig`
2020-11-12 16:22:57 -08:00
Sebastian Ullrich
bc8cb5edda
feat: pretty printer: adapt new indentation style
2020-10-30 19:08:39 +01:00
Leonardo de Moura
13c2a8ff51
chore: remove #lang lean4 header
2020-10-25 09:54:07 -07:00
Leonardo de Moura
6ca1768957
fix: optional := in the structure command
2020-10-22 04:39:20 -07:00
Leonardo de Moura
24d41b9518
chore: move to new frontend
2020-10-21 12:16:30 -07:00
Leonardo de Moura
52e676af83
feat: add builtin_initialize command
2020-10-19 15:02:42 -07:00
Leonardo de Moura
60e4f4fee1
feat: improve notFollowedBy error messages
2020-10-15 17:01:10 -07:00
Sebastian Ullrich
78ffc72150
chore: remove ppGroups beneficial only for group but not fill
2020-10-14 14:24:47 +02:00
Leonardo de Moura
77ce42548b
fix: add nonReservedSymbol
2020-10-13 12:52:18 -07:00
Leonardo de Moura
63edecf106
feat: expand initialize macro
2020-10-10 08:23:49 -07:00
Leonardo de Moura
698c3db655
chore: take doSeq at initialize
2020-10-10 07:41:44 -07:00
Sebastian Ullrich
064c9b2e0b
chore: binder spacing
2020-10-07 09:46:47 +02:00
Sebastian Ullrich
21f1a66ceb
feat: add & use ppDedent parser combinator
2020-10-07 09:46:47 +02:00
Sebastian Ullrich
88164a5e91
feat: more pp tweaks
2020-10-07 09:44:05 +02:00
Sebastian Ullrich
5d76a981b0
chore: adjust pp spacing
2020-10-07 09:44:04 +02:00
Sebastian Ullrich
bdff53fdf5
feat: use ppLine
2020-10-07 09:43:05 +02:00
Leonardo de Moura
3d6cc2de08
feat: add notFollowedByCategoryToken parser
2020-09-26 15:53:23 -07:00
Leonardo de Moura
2d8506b7c6
feat: add doElem parser category
2020-09-26 06:18:44 -07:00
Leonardo de Moura
03a361edf4
feat: add initialize command parser
2020-09-20 13:42:50 -07:00
Leonardo de Moura
d1c3ab3797
feat: many1Unbox and nodeSepBy1Unbox parser combinators
...
@Kha I removed the dummy parenthesizer/formatter for `withResultOf`,
and add proper ones for `many1Unbox` and `nodeSepBy1Unbox`.
2020-09-17 13:17:46 -07:00
Leonardo de Moura
2dafdec000
feat: use withResultOf combinator instead of unboxSingleton parameter
2020-09-17 12:12:12 -07:00
Leonardo de Moura
bda85f287c
feat: in trailing command
2020-09-02 09:52:54 -07:00
Leonardo de Moura
b192293b8a
feat: allow arbitrary commands (except end) in a mutual block
...
This is useful, for example, for having a mutual command with macros
that expand into definitions.
2020-08-31 15:37:41 -07:00
Leonardo de Moura
2287c7e7b3
feat: elaborate #print axioms command
2020-08-28 13:08:42 -07:00
Leonardo de Moura
cc1c9f3dfb
feat: add #print axioms
2020-08-28 12:26:07 -07:00
Leonardo de Moura
effaf64a07
feat: allow user to specify attributes letrec declarations
2020-08-26 09:57:46 -07:00
Sebastian Ullrich
aa452b795d
refactor: make formatter precompiled as well
2020-08-20 15:29:33 +02:00
Sebastian Ullrich
d4952dc40b
feat: use insideQuot parsers
2020-08-19 09:56:23 -07:00
Sebastian Ullrich
129b60022d
refactor: use distinct syntax kinds for quotations
2020-08-14 17:18:09 +02:00
Sebastian Ullrich
1f4cc130b7
feat: precompile parenthesizers instead of interpreting them
2020-08-12 09:15:59 -07:00
Leonardo de Moura
7ea9a8c316
feat: add #print command parser
2020-07-28 14:56:10 -07:00
Leonardo de Moura
27c3e23c17
fix: type is optional in explicit fields
...
Reason: default value overriding notation.
2020-07-21 16:57:36 -07:00
Leonardo de Moura
a1fc824336
fix: field syntax
2020-07-17 10:12:43 -07:00
Leonardo de Moura
ba3f461505
chore: we decided to not support private parent structures, nor named parent structures
...
These are obscures features in Lean 3 that AFAIK nobody ever used.
2020-07-17 09:09:34 -07:00
Leonardo de Moura
bf88a35888
feat: add views for structure command
2020-07-16 16:35:00 -07:00
Leonardo de Moura
8a80887fb0
fix: structure command syntax
2020-07-16 16:00:31 -07:00
Leonardo de Moura
c421151e61
feat: allow users to annotate structure constructor and projections with declaration modifiers (e.g., private, protected, doc string, ...)
2020-07-16 10:27:06 -07:00