Commit graph

26011 commits

Author SHA1 Message Date
Sebastian Ullrich
d88ef52b68 feat: scoped KeyedDeclsAttribute 2021-03-13 12:40:58 +01:00
Sebastian Ullrich
fb4d07de49 chore: lean4-mode: use proper hook for goal refresh
debounced and should wait until after initialization
2021-03-13 12:20:52 +01:00
Leonardo de Moura
5c24906c60 fix: Delaborator for constants
@Kha Could you please take a look at the fix?
This is an example posted by @JasonGross on Zulip.
2021-03-12 19:51:27 -08:00
Leonardo de Moura
a406e41fcb chore: fix documentation 2021-03-12 18:11:06 -08:00
Leonardo de Moura
fb40b5e80d chore: fix test 2021-03-12 18:07:58 -08:00
Leonardo de Moura
75051778ce chore: update stage0 2021-03-12 18:02:53 -08:00
Leonardo de Moura
a30a256123 refactor: remove Tactic/Binders.lean
These macro expansion functions can be now implemented using `macro` and `macro_rules`.
2021-03-12 17:59:21 -08:00
Leonardo de Moura
50fd39db89 fix: bug at allGoals 2021-03-12 17:48:33 -08:00
Leonardo de Moura
a7c5db6d21 chore: update stage0 2021-03-12 17:41:06 -08:00
Leonardo de Moura
1df84e3a6d feat: allow haveDecl, sufficesDecl, letRecDecls in antiquotations 2021-03-12 17:40:16 -08:00
Leonardo de Moura
d330f1e2e2 feat: rotateLeft and rotateRight tactics 2021-03-12 17:13:03 -08:00
Leonardo de Moura
27e15961cd fix: no coercions at exact and refine 2021-03-12 17:12:25 -08:00
Leonardo de Moura
091fadbf64 feat: add List.rotateLeft and List.rotateRight 2021-03-12 17:09:22 -08:00
Leonardo de Moura
7627458aac chore: fix tests
We are not using the `!` suffix anymore for keywords.
2021-03-12 15:10:50 -08:00
Leonardo de Moura
3d58c4d115 chore: remove old notation 2021-03-12 15:05:06 -08:00
Leonardo de Moura
5eb0a7a4fc chore: update stage0 2021-03-12 14:58:44 -08:00
Leonardo de Moura
bf8119a5cd chore: convert keywords to snake_case
Again `!` is only for functions that can panic.
2021-03-12 13:34:51 -08:00
Leonardo de Moura
472c5fb900 fix: indentation issues 2021-03-12 11:09:28 -08:00
Leonardo de Moura
a683aee360 chore: update stage0 2021-03-12 11:09:28 -08:00
Leonardo de Moura
df994fd16f fix: add checkColGe to matchAlt
@Kha this is a fix for the example that @gebner posted on Zulip.
There are other possible workarounds, but I think this one is
"intuitive".

Here is the problem description and workaround.
We currently use the `withPosition` combinator at `matchAlts`. The
original motivation was nested `match`-expressions without
parenthesis.
We also have the `checkColGt` in the application parser.

Thus, `frob 5` is not parsed as an application. That is, the term
parser after the `then` keyword stops at `frob`.
Then, we get the weird "expected 'else'" error message at `5` :)

In this commit, I add a `checkColGe` check at the beginning of each
alternative right-hand-side.

The effect on the stdlib was minimal. It basically affected old code
that used the Lean 3 workaround for partial functions
```
partial def f : N -> N | i =>
  ...
```
In Lean 4, we can use the more natural
```
partial def f (i : N) : N :=
...
```
or
```
partial def f : N -> N := fun i =>
...
```

It also affected code such as
```
instance : Repr String.Iterator where
  reprPrec | ⟨s, pos⟩, prec =>
    Repr.addAppParen ("String.Iterator.mk " ++ reprArg s ++ " " ++ reprArg pos) prec
```
This is a workaround for a missing feature. We really wanted to write
```
instance : Repr String.Iterator where
  reprPrec ⟨s, pos⟩ prec :=
    Repr.addAppParen ("String.Iterator.mk " ++ reprArg s ++ " " ++ reprArg pos) prec
```
2021-03-12 11:06:07 -08:00
Leonardo de Moura
25f1980ddd fix: fixes #345 2021-03-11 18:59:39 -08:00
Leonardo de Moura
865316bbf9 feat: improve error message when stuck solving universe constraints
closes #343
2021-03-11 17:46:44 -08:00
Sebastian Ullrich
03af37c29d doc: lean4-mode: update keybindings 2021-03-11 21:20:36 +01:00
Leonardo de Moura
dc87bef04c fix: error message
This is a fix for bug reported by @JasonGross at Zulip
2021-03-11 12:16:15 -08:00
Leonardo de Moura
be841a7cad chore: throwError! => throwError, throwErrorAt! => throwErrorAt
@Kha I marked the corresponding methods as `protected`.
I currently can't stand `throw_error`, and I am optimistic about
server highlighting feature you are working on :)
2021-03-11 11:59:45 -08:00
Leonardo de Moura
03bd608b00 chore: fix doc 2021-03-11 11:40:39 -08:00
Leonardo de Moura
d46cb80362 chore: fix tests 2021-03-11 11:35:51 -08:00
Leonardo de Moura
40426f8b5f chore: update stage0 2021-03-11 11:26:35 -08:00
Leonardo de Moura
ffb57e661f chore: remove old notation 2021-03-11 11:24:52 -08:00
Leonardo de Moura
2b19ff16d9 chore: update stage0 2021-03-11 11:20:22 -08:00
Leonardo de Moura
1112ab6eff chore: use new notation 2021-03-11 11:19:33 -08:00
Leonardo de Moura
63b898364c chore: update stage0 2021-03-11 11:00:58 -08:00
Leonardo de Moura
ca0baf12b6 chore: avoid ! suffix in builtin notation 2021-03-11 10:58:06 -08:00
Leonardo de Moura
656b7a8d87 chore: fix tests 2021-03-11 10:51:11 -08:00
Leonardo de Moura
a818478e37 chore: update stage0 2021-03-11 10:45:50 -08:00
Leonardo de Moura
5049d92968 chore: remove let! and let* notation 2021-03-11 10:42:50 -08:00
Leonardo de Moura
2d1c19b8e6 chore: update stage0 2021-03-11 10:41:18 -08:00
Leonardo de Moura
e7140959c4 chore: add elaborator for let_fun and let_delayed 2021-03-11 10:40:25 -08:00
Leonardo de Moura
90abace21a chore: update stage0 2021-03-11 10:32:19 -08:00
Leonardo de Moura
a97bdd6a67 chore: add let_delayed and let_fun notation
They will replace `let*` and `let!`
2021-03-11 10:31:04 -08:00
Leonardo de Moura
8188789cf4 chore: fix test 2021-03-11 10:16:37 -08:00
Leonardo de Moura
55c5234100 chore: update stage0 2021-03-11 09:39:40 -08: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
96e580a653 chore: update stage0 2021-03-11 09:19:49 -08:00
Leonardo de Moura
0af0957af4 chore: add leading_parser and trailing_parser elaborator 2021-03-11 09:19:10 -08:00
Leonardo de Moura
a50042dcde chore: update stage0 2021-03-11 09:13:03 -08:00
Leonardo de Moura
327717ade8 chore: add leading_parser and trailing_parser notation
It will replace `parser!` and `tparser!`
2021-03-11 09:08:35 -08:00
Leonardo de Moura
3b6ec3bfcc chore: fix doc 2021-03-11 09:06:33 -08:00
Leonardo de Moura
fda7055c1a chore: update stage0 2021-03-11 08:07:11 -08:00
Leonardo de Moura
9f88ea8047 chore: remove old decide!, nativeRefl!, and nativeDecide! 2021-03-11 08:06:20 -08:00