Commit graph

14270 commits

Author SHA1 Message Date
Leonardo de Moura
1f9f12975c chore: seal EnvExtensionState and EnvExtensionEntry 2020-09-21 11:48:57 -07:00
Leonardo de Moura
c9e902034d fix: typo 2020-09-21 11:44:26 -07:00
Leonardo de Moura
0de92b069f chore: move function 2020-09-21 08:58:41 -07:00
Leonardo de Moura
aa6d6c4dda feat: expose mkModuleInitializationFunctionName
cc @Kha

for https://github.com/leanprover/lean4/issues/185
2020-09-21 08:53:29 -07:00
Sebastian Ullrich
f693e910b1 fix: skip minimum amount of tokens during parser recovery
Fixes #186
2020-09-21 11:37:50 +02:00
Leonardo de Moura
9eb978946c chore: add quotedCharCoreFn 2020-09-20 17:05:47 -07:00
Leonardo de Moura
241eabfc41 fix: non termination on ill-formed string literals 2020-09-20 17:05:18 -07:00
Leonardo de Moura
03a361edf4 feat: add initialize command parser 2020-09-20 13:42:50 -07:00
Leonardo de Moura
d33f7c7885 feat: attribute command 2020-09-20 09:11:36 -07:00
Leonardo de Moura
7d9118d2e2 feat: add resolveGlobalConst and resolveGlobalConstNoOverload 2020-09-20 08:54:24 -07:00
Leonardo de Moura
6ed69525ad chore: move functions to Environment namespace 2020-09-20 08:28:43 -07:00
Leonardo de Moura
ac2a9539f9 fix: old&new frontend interference
The new test was not working because new frontend was using old
frontend function.
2020-09-20 08:25:45 -07:00
Leonardo de Moura
d5cb3aa85a chore: add elabAttr
WIP
2020-09-20 07:51:11 -07:00
Leonardo de Moura
12acbaf392 doc: resolveGlobalName 2020-09-20 07:50:29 -07:00
Leonardo de Moura
6ac227a63c chore: elabAttrs, elabDeclAttrs 2020-09-20 07:39:14 -07:00
Leonardo de Moura
4786cb12b5 fix: unknown namespace error message 2020-09-20 07:10:23 -07:00
Leonardo de Moura
d2ee641e7f chore: restore macro 2020-09-19 19:08:35 -07:00
Leonardo de Moura
9fdef2e4eb fix: commands that expand into syntax 2020-09-19 19:04:21 -07:00
Leonardo de Moura
87381e3329 feat: add support for parser priorities in the syntax command
@Kha Parser priorities are working :)
2020-09-19 18:47:08 -07:00
Leonardo de Moura
f0ab743ad0 chore: remove temporary workaround 2020-09-19 18:00:45 -07:00
Leonardo de Moura
fe2d3be821 feat: parser priorities 2020-09-19 17:55:17 -07:00
Leonardo de Moura
3ee9cdd2dc doc: document issue
@Kha One possible fix: we store `currNamespace` and `openDecls` at `CoreM`.
The issue is similar to the one we had with the pretty printer.
2020-09-19 16:55:50 -07:00
Leonardo de Moura
f679b7d803 feat: add notFollowedBy to syntax 2020-09-19 15:43:44 -07:00
Leonardo de Moura
c43450f027 feat: macros for the syntax category
This is the last of a series of commits for adding this feature.
2020-09-19 15:00:41 -07:00
Leonardo de Moura
ee6d723554 feat: add stx.quot 2020-09-19 14:40:17 -07:00
Leonardo de Moura
f876177f26 feat: expand macros in syntax declaration 2020-09-19 14:39:49 -07:00
Leonardo de Moura
17d4117637 chore: remove temporary hacks 2020-09-19 14:21:38 -07:00
Leonardo de Moura
25b40b4b89 chore: disable macro 2020-09-19 14:15:24 -07:00
Leonardo de Moura
71de0c8eb9 chore: rename category syntax to stx
Reason: `syntax` is a keywork. So, we can't write `macro "boo" x:syntax`
2020-09-19 14:11:35 -07:00
Leonardo de Moura
11e65fba2a refactor: factor out macros from mutual elaborator 2020-09-19 13:10:10 -07:00
Leonardo de Moura
3e9b2a0b08 feat: add expandMacro? and expandMacros methods to MacroM 2020-09-19 13:02:27 -07:00
Leonardo de Moura
065a845bfd chore: factor out nested macro at structInst elaborator
@Kha The new macro is another example where it would be super nice to
have better support for `optional` at `match_syntax`.
2020-09-19 11:56:20 -07:00
Leonardo de Moura
dc928d7b05 chore: cleanup do elaborator
Use the fact the macros are executed before elaboration functions.

cc @Kha
2020-09-19 11:49:47 -07:00
Leonardo de Moura
caa624c936 chore: cleanup 2020-09-19 09:24:50 -07:00
Leonardo de Moura
052e67d1af feat: rewrite tactic 2020-09-18 16:13:14 -07:00
Leonardo de Moura
f7bd174bb8 chore: improve error message 2020-09-18 15:23:28 -07:00
Leonardo de Moura
43bc429abf fix: typo 2020-09-18 15:18:20 -07:00
Leonardo de Moura
839f1e1ec8 feat: add elabTermWithHoles 2020-09-18 14:46:04 -07:00
Sebastian Ullrich
68568e78d3 feat: formatter: use hard space after opening structure instance brace 2020-09-18 13:15:40 -07:00
Sebastian Ullrich
519eda2459 feat: formatter: interpret checkWsBefore as soft space 2020-09-18 13:15:40 -07:00
Sebastian Ullrich
95007171a8 feat: formatter: group+indent binders and structure instance fields 2020-09-18 13:15:40 -07:00
Sebastian Ullrich
97a2198fe0 feat: change default indent width from 4 to 2 spaces 2020-09-18 13:15:40 -07:00
Sebastian Ullrich
ec3682ce15 feat: formatter: automatically group+indent syntax categories 2020-09-18 13:15:40 -07:00
Sebastian Ullrich
ac6c2b7a8e feat: formatter: interpret space after token as soft space 2020-09-18 13:15:40 -07:00
Leonardo de Moura
5a24cb5ef7 feat: add hygienicIntro option
@Kha `hygienicIntro` is true by default. `hygienicIntro == false` is
the Lean3 behavior. If we find `hygienicIntro` too inconvenient in
practice, we set the default to false.
2020-09-18 13:02:38 -07:00
Leonardo de Moura
12aabcb731 feat: add introNP and intro1P
Versions of `introN` and `intro1` that preserve the binder name.
They are used to implement the idiom: "revert", do something, re-"intro"-tuce
Before this commit `introNP mvarId n` was `intro1 mvarId n [] false`.
2020-09-18 12:35:25 -07:00
Leonardo de Moura
02e6f019c4 refactor: move nextMacroScope to Core.State
@Kha We now can create scoped user-facing names at `CoreM` and `MetaM`
methods.
2020-09-18 12:00:24 -07:00
Leonardo de Moura
22dc784c3e chore: cleanup 2020-09-18 11:37:51 -07:00
Leonardo de Moura
0e8f8117a1 refactor: simpler mechanism for never backtracking traces
We do backtrack messages but not traces.

cc @Kha
2020-09-18 10:31:42 -07:00
Leonardo de Moura
a28679358e refactor: remove MonadError 2020-09-18 09:58:13 -07:00