Commit graph

303 commits

Author SHA1 Message Date
Leonardo de Moura
73903267a5 feat: extend cases tactic syntax 2020-11-02 16:46:33 -08:00
Leonardo de Moura
f64bd9e1e3 chore: remove unnecessary with at induction/cases tactics 2020-11-02 13:30:54 -08:00
Leonardo de Moura
85a3810b10 fix: where is not a term
See #191

TODO: add proper support for it in key places
2020-10-31 19:19:18 -07:00
Leonardo de Moura
d20081c548 feat: add term version of unless, for, try, and return notations 2020-10-31 19:19:17 -07:00
Leonardo de Moura
b880181cee feat: add let rec tactic parser 2020-10-30 14:58:17 -07:00
Leonardo de Moura
0a56057db1 feat: better error message for "unknown" tactic
@Kha The hack I posted at Zulip didn't really work
```
macro x:ident : tactic => throw $ Lean.Macro.Exception.error x s!"unknown tactic '{x.getId}'"
```

For example, we would still get a weird error message at
```
theorem ex3 (x : Nat) : x = x → x = x :=
  have x = x by foo (aaa bbb) -- The error would be at `bbb`
  fun h => h
```
There were other minor issues that could be fixed, but this one was bad.
2020-10-30 14:58:17 -07:00
Sebastian Ullrich
0731d3f080 fix: double indentation inside parentheses
Ideally we would skip the indentation after any leading token without trailing
whitespace, but it's not quite clear how to do that in general
2020-10-30 19:10:08 +01:00
Sebastian Ullrich
bc8cb5edda feat: pretty printer: adapt new indentation style 2020-10-30 19:08:39 +01:00
Leonardo de Moura
672436bc5f feat: allow user to assign parsing priorities in the macro and elab commands 2020-10-29 20:33:51 -07:00
Leonardo de Moura
956a646a9c chore: admit as a macro 2020-10-29 18:58:29 -07:00
Leonardo de Moura
6670378907 fix: withIds parser 2020-10-29 18:50:08 -07:00
Leonardo de Moura
6858cb5fb6 chore: cleanup 2020-10-29 10:24:16 -07:00
Leonardo de Moura
6765440724 chore: remove clutter 2020-10-28 14:11:06 -07:00
Leonardo de Moura
88fb6acae3 chore: remove clutter 2020-10-28 13:29:17 -07:00
Sebastian Ullrich
8f01619c3d perf: work around parser performance issue I forgot about and the speedcenter had to remind me of 2020-10-28 10:11:45 +01:00
Leonardo de Moura
898a08a0c1 chore: avoid Has prefix in type classes
closes #203
2020-10-27 18:29:19 -07:00
Leonardo de Moura
10c32fcf94 chore: HasToString => ToString 2020-10-27 16:11:48 -07:00
Leonardo de Moura
9d82b965b3 feat: allow by ... at suffices 2020-10-27 13:05:13 -07:00
Leonardo de Moura
ec28b26233 chore: improve StateRefT notation 2020-10-27 13:05:12 -07:00
Leonardo de Moura
f80e2c1db6 feat: elaborate StateRefT macro 2020-10-27 13:05:12 -07:00
Leonardo de Moura
828c0b832f chore: add StateRefT macro 2020-10-27 13:05:12 -07:00
Sebastian Ullrich
bc1acf7a9f doc: document orelse restriction for the pretty printer 2020-10-27 17:29:57 +01:00
Sebastian Ullrich
78a8bc7b7e feat: adapt elaborator to preceding change 2020-10-27 16:50:58 +01:00
Sebastian Ullrich
d8a1742d57 feat: introduce suppressInsideQuot 2020-10-27 16:50:58 +01:00
Sebastian Ullrich
912d24a3ee fix: disambiguate fun syntax alternatives to help the pretty printer 2020-10-27 16:48:31 +01:00
Sebastian Ullrich
73323a7500 fix: remove obsolete workaround confusing the formatter
We don't generate antiquotations for `tparser!` anymore
2020-10-27 14:09:33 +01:00
Sebastian Ullrich
43c875fd7a fix: tactic block indentation 2020-10-27 14:09:33 +01:00
Leonardo de Moura
7e244686e9 chore: remove old notation 2020-10-26 09:16:51 -07:00
Leonardo de Moura
13c2a8ff51 chore: remove #lang lean4 header 2020-10-25 09:54:07 -07:00
Leonardo de Moura
9e181f5d91 fix: location parser 2020-10-24 16:46:30 -07:00
Leonardo de Moura
34cdc3a1f1 chore: avoid Array.foldlFrom 2020-10-22 16:30:05 -07:00
Leonardo de Moura
af968c60e6 chore: cleanup 2020-10-22 07:32:23 -07:00
Leonardo de Moura
6ca1768957 fix: optional := in the structure command 2020-10-22 04:39:20 -07:00
Leonardo de Moura
ea829b75c0 chore: remove coercions for old frontend 2020-10-21 17:37:35 -07:00
Leonardo de Moura
24d41b9518 chore: move to new frontend 2020-10-21 12:16:30 -07:00
Leonardo de Moura
cb66295149 chore: cleanup 2020-10-21 11:34:44 -07:00
Leonardo de Moura
d25ec3417b chore: remove some [inline] and [specialize] annotations from Parser/Basic 2020-10-21 11:27:18 -07:00
Leonardo de Moura
e5c17463c5 chore: move to new frontend 2020-10-21 10:06:53 -07:00
Leonardo de Moura
1af6f14fa8 chore: move to new frontend 2020-10-21 09:17:02 -07:00
Leonardo de Moura
7966856b32 chore: move to new frontend 2020-10-21 09:13:55 -07:00
Leonardo de Moura
f8971200af chore: move to new frontend 2020-10-20 17:01:29 -07:00
Leonardo de Moura
a052446414 feat: simplify decide! and nativeDecide! macros 2020-10-20 15:08:16 -07:00
Leonardo de Moura
702ceb7a3f fix: return optional result
cc @Kha
2020-10-20 09:33:50 -07:00
Sebastian Ullrich
e8cf086641 fix: synthesize pretty printers early 2020-10-20 09:50:54 +02:00
Sebastian Ullrich
490c482af2 fix: allow [runParserAttributeHooks] on imported declarations, add non-builtin variant 2020-10-20 09:39:50 +02:00
Leonardo de Moura
52e676af83 feat: add builtin_initialize command 2020-10-19 15:02:42 -07:00
Leonardo de Moura
ef18b0ab49 chore: use [builtinInit] 2020-10-19 14:58:38 -07:00
Leonardo de Moura
84a0cd1f59 feat: add [builtinInit] attribute 2020-10-19 14:51:23 -07:00
Leonardo de Moura
c7efb1d37d fix: do notation else if
The following `do` block
```lean
if c_1 then
  action_1
else
  if cond_2 then
    action_2
  action_3
```
was being being parsed as
```lean
if c_1 then
  action_1
else if cond_2 then
  action_2
action_3
```

cc @Kha
2020-10-19 14:29:31 -07:00
Leonardo de Moura
e54a207986 refactor: provide Options to lean_eval_const
add `ImportM` monad for `addImportedFn`

cc @Kha
2020-10-19 10:21:38 -07:00