Commit graph

472 commits

Author SHA1 Message Date
Leonardo de Moura
a05ca020f4 chore: prepare to move tactic match parser back to Lean/Parser/Tactic 2020-12-22 06:52:41 -08:00
Sebastian Ullrich
1c31240ebb feat: token antiquotations in macro 2020-12-22 13:11:04 +01:00
Sebastian Ullrich
07c7638fd7 feat: token source info antiquotations tk%$id
/cc @leodemoura
2020-12-22 13:11:04 +01:00
Leonardo de Moura
0642a62848 chore: prepare to add scoped macro and elab commands 2020-12-21 16:50:29 -08:00
Leonardo de Moura
0083e1996a fix: scoped tokens
Tokens introduced by scoped (local) parsers should be scoped (local).
2020-12-21 13:11:09 -08:00
Leonardo de Moura
4fc06bfcca feat: add optional (priority := <prio>) to instance command 2020-12-21 10:02:12 -08:00
Leonardo de Moura
43284cc5fa feat: improve notation for setting parser names and priorities 2020-12-21 09:11:12 -08:00
Sebastian Ullrich
cf73233dd2 refactor: use quotations & implicit token positions from getRef to clean up a bit 2020-12-21 17:32:36 +01:00
Leonardo de Moura
c524bcf2d3 feat: improve universe level pretty printer 2020-12-21 07:34:48 -08:00
Sebastian Ullrich
bc3e9ce961 feat: if let pat ← ... 2020-12-20 23:58:29 +01:00
Sebastian Ullrich
90f747e346 fix: don't change antiquotations semantics in do if 2020-12-20 17:51:37 +01:00
Sebastian Ullrich
eeb0cad29e feat: if let
/cc @leodemoura
2020-12-20 16:46:03 +01:00
Leonardo de Moura
0911936502 feat: parallel for notation 2020-12-19 19:26:53 -08:00
Leonardo de Moura
15335efae2 refactor: move Format to Init package
We are going to use it to define `Repr` class.
2020-12-18 11:21:30 -08:00
Sebastian Ullrich
4380d4a9da feat: parser: store options & pass to evalConst 2020-12-16 23:15:58 +01:00
Sebastian Ullrich
f9dcbbddc4 refactor: remove optional leading pipe from match, use many1Indent instead of sepBy1 2020-12-16 18:27:05 +01:00
Sebastian Ullrich
d22d639fcb refactor: rename "antiquot scope" ~> "antiquot splice" 2020-12-16 17:44:20 +01:00
Leonardo de Moura
97642bd000 fix: prio issue 2020-12-16 07:44:48 -08:00
Leonardo de Moura
a008816102 chore: remove workaround 2020-12-16 07:34:40 -08:00
Leonardo de Moura
3d5082dde3 feat: simplify Attr.simple parser 2020-12-16 07:29:18 -08:00
Leonardo de Moura
7b67cd2c4a chore: fix priorities 2020-12-16 07:11:02 -08:00
Leonardo de Moura
e3540a5d8f chore: remove high builtin parser
It doesn't allow us to use `high` at `Prelude.lean` because
the macro expander for it is only defined at `Notation.lean`
2020-12-16 06:42:52 -08:00
Leonardo de Moura
16747d3986 chore: remove attrParam syntax category 2020-12-15 21:47:24 -08:00
Leonardo de Moura
901e58b131 fix: priority 2020-12-15 20:57:00 -08:00
Leonardo de Moura
ed87480093 refactor: move to attr syntax category 2020-12-15 20:22:04 -08:00
Leonardo de Moura
095a27c197 feat: add missing attribute parsers 2020-12-15 20:18:26 -08:00
Leonardo de Moura
eeac7fb9f4 feat: declare builtin attr parsers for builtin attributes
@Kha I believe this is the minimal set for covering the attributes we
have right now. The parser `simple` covers most of them, and the
dispatch is performed using the identifier.
Otherwise, the dispatch will be based on the node kind.
The `simple` parser is a bit hackish, but it is quite covenient for
simple attributes that do not require complex parameters.
2020-12-15 17:20:28 -08:00
Leonardo de Moura
6100ed9283 feat: add LeadingIdentBehavior type
Different strategies for handling the leading identifier in the
`Pratt` parser loop.
2020-12-15 16:45:14 -08:00
Leonardo de Moura
9e3b3b2495 refactor: move attribute related parsers to separate file 2020-12-15 16:13:11 -08:00
Leonardo de Moura
c9f766af5a feat: we don't want attribute names as keywords 2020-12-15 15:59:48 -08:00
Leonardo de Moura
3ee6aec466 feat: add attr parser category 2020-12-15 15:44:46 -08:00
Leonardo de Moura
6985223a55 chore: switch to attrParam 2020-12-14 17:52:28 -08:00
Leonardo de Moura
69e8385f8d refactor: move prioParser to Term.lean 2020-12-14 17:33:38 -08:00
Leonardo de Moura
0004196977 feat: add attrParam builtin parsers 2020-12-14 17:27:28 -08:00
Leonardo de Moura
a3fe907a28 feat: add attrParam syntax category
cc @Kha
2020-12-14 16:45:05 -08:00
Leonardo de Moura
abe7481453 feat: elaborate prio DSL 2020-12-14 16:25:10 -08:00
Leonardo de Moura
acba8d4a4a chore: cleanup 2020-12-14 16:01:52 -08:00
Leonardo de Moura
a46505cb8b feat: use new precedence syntax 2020-12-14 15:14:03 -08:00
Leonardo de Moura
f95a450894 feat: add builtin prec/prio parsers 2020-12-14 15:05:39 -08:00
Leonardo de Moura
216d34e178 feat: add prio parser category 2020-12-14 13:24:56 -08:00
Leonardo de Moura
c5e201bce6 feat: add prec syntax category 2020-12-14 13:09:27 -08:00
Leonardo de Moura
ac692bfc79 feat: add new static quotations
For users that are writing (not-trivial) macros without `import Lean`.

cc @Kha
2020-12-14 09:21:26 -08:00
Leonardo de Moura
c7a8fa2629 chore: expose a few auxiliary command parsers 2020-12-14 09:15:26 -08:00
Sebastian Ullrich
314c5c9d41 feat: run single non-category quotation under interpreter as well 2020-12-14 17:13:59 +01:00
Sebastian Ullrich
a9bdb2f70a feat: prefer interpreter for running builtin parsers in quotations 2020-12-14 16:45:32 +01:00
Leonardo de Moura
0862df9ade fix: missing ppSpace at set_option parser 2020-12-13 15:52:03 -08:00
Leonardo de Moura
3b6d65c3c3 chore: use deriving Inhabited 2020-12-13 10:09:20 -08:00
Leonardo de Moura
8fd6870931 fix: optDeriving parser 2020-12-12 18:58:44 -08:00
Leonardo de Moura
01ec581617 chore: update deriving instance syntax 2020-12-12 16:48:12 -08:00
Leonardo de Moura
3743f877f4 feat: add deriving parsers 2020-12-12 15:33:36 -08:00