Commit graph

15119 commits

Author SHA1 Message Date
Leonardo de Moura
ffc4abed32 fix: UInt* and USize Inhabited instances 2020-11-13 16:30:48 -08:00
Leonardo de Moura
21bfb6a51e chore: use mutual instead of old idiom: high order functions + specialize
Before we moved to the new frontend, we used to simulate mutual
recursion using high order functions + `[specialize]`. This is not
needed anymore, and the new generated code is more efficient and compact.

@Kha I don't usually indent `mutual` blocks, but I found it helpful
for big ones like this one. Not sure whether we should keep indenting
them or not.
2020-11-13 16:00:33 -08:00
Leonardo de Moura
cca9cceab0 chore: minor cleanup 2020-11-13 16:00:33 -08:00
Leonardo de Moura
5025d7eafd chore: control generated code size 2020-11-13 16:00:33 -08:00
Leonardo de Moura
35f1844d16 feat: add ParserDescr.checkPrec 2020-11-13 16:00:31 -08:00
Leonardo de Moura
8c4ac7ccc1 refactor: rename LeanInit ==> Meta, and reduce dependencies 2020-11-13 16:00:31 -08:00
Leonardo de Moura
70385b87fa feat: add instance MonadRef MacroM 2020-11-13 16:00:31 -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
71f62fe5cb feat: use ParserDescr.nodeWithAntiquot at syntaxAbbrev 2020-11-13 16:00:31 -08:00
Leonardo de Moura
f64d6c4514 feat: add ParserDescr.nodeWithAntiquot 2020-11-13 16:00:31 -08:00
Leonardo de Moura
98ca335a85 chore: fix comment 2020-11-13 16:00:31 -08:00
Leonardo de Moura
51d0579e20 fix: bug at toParserDescr 2020-11-13 16:00:31 -08:00
Leonardo de Moura
d277b53c34 chore: remove dead code 2020-11-13 16:00:31 -08:00
Sebastian Ullrich
1add44916c chore: remove broken & redundant "new parser Core.lean" benchmark 2020-11-13 21:08:46 +01:00
Sebastian Ullrich
fe03e70a8a fix: robust linking of cyclically dependent libraries 2020-11-13 21:08:46 +01:00
Leonardo de Moura
b0e8183663 fix: error position for unsolved goals at cases and induction tactics 2020-11-13 07:59:50 -08:00
Leonardo de Moura
d137ecf4e8 feat: improve addLValArg
@Kha the module as classes test is now working.
2020-11-12 18:59:59 -08:00
Leonardo de Moura
61dfe2b1db fix: letDecl
use `simpleBinderWithoutType` at `declSig` and `optDeclSig`
2020-11-12 16:22:57 -08:00
Leonardo de Moura
fc6c8e0348 fix: beta reduce value at processAssignmentFOApprox 2020-11-12 14:46:28 -08:00
Leonardo de Moura
367432defc fix: fixes #217 2020-11-12 14:36:47 -08:00
Leonardo de Moura
cae6aa95dc feat: support simpleBinder at letDecl 2020-11-12 13:25:38 -08:00
Leonardo de Moura
5c33440050 chore: update Init.lean 2020-11-12 13:23:18 -08:00
Leonardo de Moura
22ff6bb125 chore: process indent' without underscore hack 2020-11-12 12:05:00 -08:00
Leonardo de Moura
9c331c92d8 chore: prepare to remove underscore hack 2020-11-12 11:50:02 -08:00
Leonardo de Moura
49d7a83934 chore: tacticSeq as a parser alias 2020-11-12 11:32:18 -08:00
Leonardo de Moura
bd76458210 feat: add support for nonReservedSymbol at syntax command 2020-11-12 07:32:18 -08:00
Leonardo de Moura
65dafaf07c fix: stdlib and tests
We also declare a few macros for the syntax command.
2020-11-12 07:12:30 -08:00
Leonardo de Moura
6fbaea6563 feat: simplify syntax command syntax 2020-11-12 07:01:20 -08:00
Leonardo de Moura
0510f746fc feat: add macro registerParserAlias!
It register the parser, parenthesizer, and formatter.
2020-11-11 19:34:14 -08:00
Leonardo de Moura
3f95541a32 chore: delete temporary ParserDescrNew 2020-11-11 19:02:21 -08:00
Leonardo de Moura
3bfc5248ca chore: ParserDescrNew => ParserDescr 2020-11-11 18:57:49 -08:00
Leonardo de Moura
ba9a06dfc9 feat: compact ParserDescr 2020-11-11 18:52:26 -08:00
Leonardo de Moura
bd8bb163e2 feat: add parser aliases tables 2020-11-11 17:41:20 -08:00
Leonardo de Moura
2eb76580f1 feat: add notation for coe 2020-11-11 16:39:01 -08:00
Leonardo de Moura
2537a2b84a chore: implement list and array literals using syntax command 2020-11-11 13:50:25 -08:00
Leonardo de Moura
792196e6a9 chore: remove list/array literal builtin parsers 2020-11-11 13:21:51 -08:00
Leonardo de Moura
78da6b3aa2 chore: add space for pretty printer 2020-11-11 11:39:11 -08:00
Leonardo de Moura
83584f6a81 fix: do not use deleted Lean.Parser.Term.if node kind 2020-11-11 11:33:47 -08:00
Leonardo de Moura
100670e3b5 feat: add if-then-else macros 2020-11-11 11:15:31 -08:00
Leonardo de Moura
34178034a0 chore: fix warning 2020-11-11 11:15:31 -08:00
Leonardo de Moura
fedd49de45 feat: remove if-then-else builtin parser 2020-11-11 10:57:06 -08:00
Leonardo de Moura
d55f039a07 chore: do not use if-then-else notation at compileStxMatch 2020-11-11 10:47:02 -08:00
Leonardo de Moura
b882dff754 chore: do not use if-then-else notation at Prelude.lean 2020-11-11 10:37:19 -08:00
Leonardo de Moura
5490235447 chore: remove renamed functions 2020-11-11 10:14:26 -08:00
Leonardo de Moura
f17e226638 chore: naming convention
Example: `mkNameStr` => `Name.mkStr`

cc @Kha
2020-11-11 10:08:55 -08:00
Leonardo de Moura
df5b7fdc24 chore: naming convention
Use namespaces (e.g., `mkStxLit` ==> `Syntax.mkLit`)

cc @Kha
2020-11-11 09:55:23 -08:00
Leonardo de Moura
dbf99a17b6 chore: define notation using infix commands 2020-11-11 08:26:12 -08:00
Leonardo de Moura
353aba579c chore: remove builtin infix operators 2020-11-11 07:23:28 -08:00
Leonardo de Moura
f936fe306c chore: fix annotation 2020-11-11 07:15:13 -08:00
Leonardo de Moura
bf7660ff5a chore: avoid infix operators at Prelude.lean
We also fix the copyright date
2020-11-11 06:56:45 -08:00