Commit graph

12649 commits

Author SHA1 Message Date
Leonardo de Moura
a7a36f80bb feat: add termIdToAntiquot 2020-01-22 13:18:09 -08:00
Leonardo de Moura
5193ce45e4 refactor: move Syntax helper functions to LeanInit 2020-01-22 12:58:06 -08:00
Leonardo de Moura
a5bcebb07f feat: add antiquotation support for strLit, numLit and charLit 2020-01-22 12:57:28 -08:00
Leonardo de Moura
0be31c14ec fix: workaround for term parser antiquotation issue
@Kha this is a temporary workaround. We should discuss how to cleanup
in the next Dev meeting.
2020-01-22 12:05:12 -08:00
Leonardo de Moura
642850efb2 fix: antiquotation for all categories 2020-01-22 11:52:08 -08:00
Leonardo de Moura
e8c54ad1bf fix: use nonReservedSymbol when defining tactic new syntax 2020-01-21 14:37:29 -08:00
Leonardo de Moura
a83487ca5f chore: simplify toParserDescr 2020-01-21 14:00:29 -08:00
Leonardo de Moura
14347456d7 feat: extensible tactics 2020-01-21 13:25:45 -08:00
Leonardo de Moura
6f9f581566 feat: add Syntax.identToAtom 2020-01-21 13:25:20 -08:00
Leonardo de Moura
8fb710c31e chore: remove simple parser kind
Now, the previous commit makes sure pratt's parsers subsume simple parsers
2020-01-21 09:16:38 -08:00
Leonardo de Moura
f3c1928d2d feat: improve prattParser tables
We can delete the simple category after this change

cc @Kha
2020-01-21 09:16:38 -08:00
Leonardo de Moura
67fb63c9fd feat: use mpz_pow_ui to implement Nat.pow 2020-01-21 09:16:38 -08:00
Leonardo de Moura
cb8f68b407 fix: put limit on Nat.pow constant folding 2020-01-21 09:16:38 -08:00
Sebastian Ullrich
458eed730f chore: fix confusing indentation 2020-01-21 11:16:04 +01:00
Leonardo de Moura
b279433236 feat: improve checkNoWsBefore (skip None nodes) 2020-01-20 22:24:01 -08:00
Leonardo de Moura
47c85cc351 fix: bug at ParserDescr.ident 2020-01-20 21:55:16 -08:00
Leonardo de Moura
1dbfc4b337 fix: add checkNoWsBefore before option * in mkAntiquot
@kha we need it, otherwise we can't process rules such as
```
| `(FOO $t >>> $r) => `($t * $r)
```
without adding parenthesis at `(($t) * $r)
2020-01-20 21:48:40 -08:00
Leonardo de Moura
0725d966e9 chore: remove unnecessary parser! 2020-01-20 21:25:31 -08:00
Leonardo de Moura
98033f298f feat: add support for simple category 2020-01-20 20:55:54 -08:00
Leonardo de Moura
6d8ca3ed62 feat: allow user to specify the kind of parser used to implement a new categoy 2020-01-20 20:14:18 -08:00
Leonardo de Moura
4ff001fa04 feat: add new kind of parser category 2020-01-20 20:06:04 -08:00
Sebastian Ullrich
129442a76a fix: syntax: do not qualify fresh kinds 2020-01-20 14:58:58 -08:00
Leonardo de Moura
b63e0a82ea feat: try and repeat can be macros 2020-01-20 14:42:53 -08:00
Leonardo de Moura
4d57790cc5 fix: add workaround for setting correct LBP for $ in antiquotations 2020-01-20 10:42:58 -08:00
Leonardo de Moura
f20d4aaa83 fix: avoid termParser at mkAntiquot
@kha `mkAntiquot` is used in all categories. I removed
`termParser (appPrec + 1)` to avoid nasty interactions between
`termParser` and the surrounding category.
This commity ensures the antiquotation prefix is one of the following
forms `$<id>` or `$(<term>)`.
I made the two cases look like term syntax because I didn't want to
change your expander. We should fix this next week.
2020-01-20 10:19:16 -08:00
Leonardo de Moura
9425ec6a06 chore: remove workaround 2020-01-20 09:58:13 -08:00
Leonardo de Moura
1665cea8e9 fix: antiquotation ambiguity 2020-01-20 09:53:49 -08:00
Leonardo de Moura
b5fc9c19fe feat add evalIntros 2020-01-19 17:48:19 -08:00
Simon Hudon
c0a7495495 feat: MonadIO now extends MonadExcept IO.Error 2020-01-19 17:23:37 -08:00
Simon Hudon
961861ceab fix: thread local storage of std streams 2020-01-19 17:23:24 -08:00
Simon Hudon
bd87ea5d5e feat: override standard streams 2020-01-19 17:23:12 -08:00
Simon Hudon
7575a32035 feat: add std streams
This reverts commit 021ce21d5f70c2efcc58a0588ed6dc4999be6a33.
2020-01-19 17:22:58 -08:00
Leonardo de Moura
81c26214c5 feat: expand repeat 2020-01-19 17:06:19 -08:00
Leonardo de Moura
e931fac3bb feat: add evalTry 2020-01-19 16:52:39 -08:00
Leonardo de Moura
b94e0381ad feat: add evalSkip and evalTraceState 2020-01-19 16:37:01 -08:00
Leonardo de Moura
038ffcffc3 fix: TacticM should not see pending syntheticMVars from caller 2020-01-19 16:27:40 -08:00
Leonardo de Moura
0a3e9abccb feat: eval apply tactic 2020-01-19 16:23:32 -08:00
Leonardo de Moura
03fb591604 feat: add findMVar? 2020-01-19 16:03:01 -08:00
Leonardo de Moura
b577ff2073 feat: add renameMVar and improve forallMetaTelescopeReducingAux 2020-01-19 15:48:42 -08:00
Leonardo de Moura
0d25c5f55c feat: add Array.filterM 2020-01-19 15:18:01 -08:00
Leonardo de Moura
4638b6589e chore: add mayPostpone 2020-01-19 14:44:47 -08:00
Leonardo de Moura
e57d3431ee refactor: move basic Syntax API to LeanInit
We want to make them available for `macro`-building
2020-01-19 14:44:03 -08:00
Leonardo de Moura
b2c92d57b3 feat: add withReducible 2020-01-19 14:24:11 -08:00
Leonardo de Moura
312ea061b1 chore: use toExpr
cc @Kha
2020-01-19 11:58:17 -08:00
Sebastian Ullrich
6e1d70aaf2 feat: elaborate quoted names 2020-01-19 11:58:17 -08:00
Sebastian Ullrich
6c2a2cfa35 feat: support postfix syntax in macro 2020-01-19 11:58:17 -08:00
Sebastian Ullrich
3ee99b5859 feat: remove last superscript letter from list of valid identifier chars 2020-01-19 11:58:17 -08:00
Leonardo de Moura
655da9baef fix: tag refine subgoals 2020-01-19 11:58:17 -08:00
Sebastian Ullrich
15bed7c95c chore: support old notation syntax 2020-01-19 18:45:08 +01:00
Sebastian Ullrich
7f4e1db86b refactor: replace mkTermIdFromIdent with antiquotation kind where possible 2020-01-19 08:28:49 -08:00