Commit graph

28 commits

Author SHA1 Message Date
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
Renamed from src/Init/Lean/Parser/Command.lean (Browse further)