Commit graph

44 commits

Author SHA1 Message Date
Kyle Miller
a1be9ec850
chore: tidying up Lean.unresolveNameGlobal (#4091)
The main loop logic could be simplified, and `if let` could be used to
make control flow more obvious.

Also adds a check for macro scopes to prevent `unresolveNameGlobal` from
returning names with macro scopes in the event there's an alias with
one.

This is a follow up to #3946.
2024-05-10 22:37:34 +00:00
Kyle Miller
a9db0d2e53
fix: use Name.appendCore instead of Name.append in unresolveNameGlobal (#3946)
`Name.append` has special handling of macro scopes, and it would cause
`unresolveNameGlobal` to panic. Using `Name.appendCore` to append name
parts is justified by the fact that it's being used to reassemble a
disassembled name.

Closes #2291
2024-04-24 15:07:18 +00:00
Joachim Breitner
ea910794fa
doc: crosslink {realize,resolve}GlobalName[NoOverload]?[WithInfo]?, (#3897)
Co-authored-by: David Thrane Christiansen <david@davidchristiansen.dk>
2024-04-16 11:59:22 +00:00
Leonardo de Moura
7a93a7b877
fix: reserved name resolution (#3803)
This PR includes the following fixes:

- Reserved name resolution inside namespaces
- Equation theorems for `match`er declarations are not private anymore
- Equation theorems for `match`er declarations are realizable
- `foo.match_<idx>.splitter` is now a reserved name
2024-03-29 02:56:48 +00:00
Leonardo de Moura
173b956961
feat: reserved names (#3675)
- Add support for reserved declaration names. We use them for theorems
generated on demand.
- Equation theorems are not private declarations anymore.
- Generate equation theorems on demand when resolving symbols.
- Prevent users from creating declarations using reserved names. Users
can bypass it using meta-programming.

See next test for examples.
2024-03-15 00:33:22 +00:00
Leonardo de Moura
4d0c0e2328
fix: allow users to disable builtin simprocs in simp args (#3441) 2024-02-21 20:01:11 +00:00
Henrik Böving
23e49eb519 perf: add prelude to all Lean modules 2024-02-18 14:55:17 -08:00
int-y1
8d7520b36f chore: fix typos in comments 2023-10-08 10:46:05 +02:00
Sebastian Ullrich
de180e5c7a fix: private + pp.fullNames 2022-12-21 21:59:05 +01:00
Leonardo de Moura
83d8e36773 fix: fixes #1780 2022-10-26 07:46:38 -07:00
Mario Carneiro
391aef5cd7 feat: automatic extension names 2022-10-06 17:19:30 -07:00
Mario Carneiro
d56708c0e5
fix: handle multi namespace/section in foldingRange and documentSymbol (#1680) 2022-10-04 17:37:52 +00:00
Mario Carneiro
9a9f3263d4 feat: add tactic.simp.trace option 2022-09-25 06:40:56 -07:00
Sebastian Ullrich
5ce5576b5d fix: hygienic resolution of namespaces 2022-08-20 22:29:46 +02:00
Mario Carneiro
f6211b1a74
chore: convert doc/mod comments from /- to /--//-! (#1354) 2022-07-22 12:05:31 -07:00
Gabriel Ebner
eba400543d refactor: use computed fields for Name 2022-07-11 14:19:41 -07:00
Leonardo de Moura
5901fef43a feat: protected aliases
See message: https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Namespace-based.20overloading.20does.20not.20find.20exports/near/287633118
2022-06-27 13:56:58 -07:00
Leonardo de Moura
e985eb2b8a fix: refine resolveNamespace
see issue #1224
2022-06-17 09:51:00 -07:00
Leonardo de Moura
8ca3e14651 feat: change namespace resolution procedure
see #1224
2022-06-16 17:31:49 -07:00
Leonardo de Moura
d56163bd0e refactor: resolveNamespace now return a List 2022-06-16 17:16:36 -07:00
E.W.Ayers
917fa74366 doc: docstrings for decls and attributes
Co-authored-by: Sebastian Ullrich <sebasti@nullri.ch>
2022-04-08 04:19:38 -07:00
Leonardo de Moura
47c2d335d4 fix: completion for aliases
closes #863
2021-12-10 12:14:11 -08:00
Wojciech Nawrocki
7d3db49a15 chore: log errors at identifier 2021-08-24 08:57:41 -07:00
Sebastian Ullrich
2833c61a60 fix: respect preresolved names at resolveConst*
This makes sure we can properly quote e.g. `deriving` clauses and avoids
a suspicious `eraseMacroScopes` call (though not at `Elab.Syntax`, since
categories do not have to be declaration names)
2021-07-30 07:17:50 -07:00
Leonardo de Moura
565ca259b1 fix: issue raised by Andrew 2021-04-12 10:51:44 -07:00
Leonardo de Moura
0586fe3200 feat: activate auto completion
There are many pending TODO's, and issues with the error recovery code.
We also need a test suite.
2021-04-03 21:01:17 -07:00
Leonardo de Moura
d75c4e2101 chore: cleanup 2021-03-06 15:32:59 -08:00
Leonardo de Moura
bfc1a16c02 chore: adjust instance param order 2021-01-13 18:31:41 -08:00
Leonardo de Moura
4001407f10 refactor: add MonadError class abbreviation 2020-12-14 09:15:26 -08:00
Leonardo de Moura
0869f38de4 chore: update structure, class, inductive 2020-11-27 15:09:30 -08:00
Leonardo de Moura
8898988747 fix: namespace resolution 2020-11-26 08:17:35 -08:00
Leonardo de Moura
f67c93191f feat: use |>. 2020-11-19 08:38:47 -08:00
Leonardo de Moura
396e767f3d refactor: move Ref to Prelude and rename it to MonadRef
`MacroM` will implement `MonadRef` because
1- It will be easier to throw errors from macros
2- We will be able to `getRef` to retrieve the syntax node at macro
rules.

I renamed `Ref` to `MonadRef` to make it consistent with other classes
providing monadic methods (e.g. `MonadEnv`, `MonadState`, etc).

cc @Kha
2020-11-13 16:00:31 -08:00
Leonardo de Moura
13c2a8ff51 chore: remove #lang lean4 header 2020-10-25 09:54:07 -07:00
Leonardo de Moura
0ab38742db chore: cleanup 2020-10-24 06:18:01 -07:00
Leonardo de Moura
af968c60e6 chore: cleanup 2020-10-22 07:32:23 -07:00
Leonardo de Moura
b3678954f4 chore: move to new frontend 2020-10-20 17:19:05 -07:00
Leonardo de Moura
1495f403a1 chore: use builtin_initialize instead of initialize at src/Lean 2020-10-19 15:17:02 -07:00
Leonardo de Moura
7a8fb1b66c chore: remove workaround
`elabAppArgsAux` has been improved in the previous commit.
2020-10-11 15:08:12 -07:00
Leonardo de Moura
cd20e2ef8d chore: use interpolated string 2020-10-11 15:08:12 -07:00
Leonardo de Moura
a53ab799d9 chore: remove workaround 2020-10-10 16:20:44 -07:00
Leonardo de Moura
069faf0a0a chore: move ResolveName to new frontend 2020-10-10 13:03:46 -07:00
Leonardo de Moura
fa6b7b6393 feat: add MonadResolveName type class
`AttrM` can now resolve names.
2020-10-10 11:33:52 -07:00
Leonardo de Moura
eacf3ed6c7 refactor: move ResolveName to Lean directory 2020-10-10 11:07:14 -07:00
Renamed from src/Lean/Elab/ResolveName.lean (Browse further)