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
Leonardo de Moura
b247d4901c
feat: allow commands such as variable and universe in the preamble of a mutual command block
2020-07-16 09:55:51 -07:00
Leonardo de Moura
3fc6d8ce61
chore: improve constructor syntax
...
I think
```
inductive Foo
| private mk : Foo -> Foo
```
looks better than
```
inductive Foo
private | mk : Foo -> Foo
```
cc @Kha
2020-07-13 16:22:48 -07:00
Leonardo de Moura
6e12987dd9
feat: add declModifiers to constructor declarations
...
The goal is to allow users to attach doc strings and
`private/protected` to constructor declarations.
TODO: reject non applicable modifiers such as `unsafe` and `partial`.
cc @Kha
2020-07-13 16:22:48 -07:00
Leonardo de Moura
667f2ed601
feat: resolve inductive and ctor names
2020-07-13 16:22:48 -07:00
Leonardo de Moura
30f03ad18c
feat: add mutual syntax
2020-06-26 12:47:43 -07:00
Leonardo de Moura
249bda16c0
chore: remove prelude commands from Lean package
2020-06-25 11:21:17 -07:00
Sebastian Ullrich
1ccaadfcf0
feat: add #eval syntax
2020-06-16 10:56:47 +02:00
Leonardo de Moura
2125687d9c
chore: remove unnecessary [appPrec] annotations
2020-06-10 14:44:54 -07:00
Leonardo de Moura
8dde9715a9
refactor: associate precedences to parsers instead of tokens
...
@Kha This is working in progress.
I am convinced we should associated the precedence to parsers. A lot
of weird stuff is gone :)
2020-06-08 16:12:05 -07:00
Leonardo de Moura
6e5cd5fcc0
chore: change coercion from String to Parser
...
@Kha
I kept `TokenInfo` as is. That is, the `lbp` field is still `Option Nat`.
I changed my mind because we have the combinator `NonReservedSymbol`.
It feels weird to have a combinator that does not create a keyword,
but sets the `lbp`. Recall that it is used at `Lean/Parser/Tactic.lean`.
Other observations:
- We use symbols in auxiliary constructions (e.g., `mkAntiquot`). It
feels weird to set their `lbp` there.
- It felt weird to specify the `lbp` in places such as
```
def structCtor := parser! ident >> optional inferMod >> symbol " :: " 67
```
- We have a few parsing rules where the same symbol appears twice.
It is funny to set the `lbp` twice. Note that the approach we
discussed yesterday (retrieving the `lbp` from the `Environment`)
would not work here.
2020-05-27 15:59:12 -07:00
Leonardo de Moura
4ccc3fef52
chore: move Init.Lean files to Lean package
2020-05-26 15:04:35 -07:00