Commit graph

129 commits

Author SHA1 Message Date
Leonardo de Moura
e5d4af5e75 refactor: split Syntax.lean 2021-06-28 13:52:04 -07:00
Leonardo de Moura
953dd85c06 chore: avoid inline 2021-06-28 10:17:01 -07:00
Sebastian Ullrich
65f2874d86 chore: address reviews 2021-06-21 10:17:26 -07:00
Sebastian Ullrich
91e3100e30 fix: properly resolve syntax kinds in macro/elab_rules 2021-06-21 10:17:26 -07:00
Sebastian Ullrich
3f4ab0a2af feat: implement elab_rules
TODO: infer category from quotation type
2021-06-21 10:17:26 -07:00
Sebastian Ullrich
9101c9d5da feat: support docstrings on syntax/macro/... 2021-06-21 10:17:26 -07:00
Leonardo de Moura
89373bd64f fix: fixes #447 2021-05-08 19:04:12 -07:00
Leonardo de Moura
56c7454a8d fix: fixes #435 2021-05-02 18:16:57 -07:00
tydeu
44f45f426c
feat: add scoped macro_rules (#432) 2021-04-30 09:05:09 +02:00
Sebastian Ullrich
f0960b7f89 fix: ignore antiquotations outside quotations 2021-04-29 13:33:48 +02:00
Sebastian Ullrich
9f0fa19237 feat: notation: unfold to prechecked quotation 2021-04-27 16:38:37 -07:00
Sebastian Ullrich
d15e2b3756 refactor: make notation and macro macros again 2021-04-24 11:25:08 +02:00
Leonardo de Moura
09d438ca1d chore: enforce notation parameter naming convention 2021-04-19 18:54:09 -07:00
Leonardo de Moura
aaca889bea fix: fixes #414 2021-04-19 15:02:26 -07:00
Leonardo de Moura
dbc84c502c chore: make sure we don't lift methods over binders 2021-04-15 12:06:46 -07:00
Sebastian Ullrich
a0eff55772 fix: unhygiene in synthesized notation unexpander 2021-03-23 19:08:06 +01:00
Sebastian Ullrich
ed9c3ba525 doc: LHS precedences 2021-03-22 16:33:37 +01:00
Sebastian Ullrich
cd4cd581be feat: make infix non-associative 2021-03-22 16:33:37 +01:00
Sebastian Ullrich
3d90850fdd feat: add syntax for specifying LHS precedence on trailing parsers 2021-03-22 16:33:36 +01:00
Sebastian Ullrich
29c7db3ed2 feat: term info at many more constants 2021-03-20 08:31:06 -07:00
Sebastian Ullrich
d35fc280d2 refactor: further refactor Lean.Elab.Syntax 2021-03-13 14:47:59 +01:00
Sebastian Ullrich
00a0db4231 fix: unexpanders should inherit scopedness 2021-03-13 13:20:12 +01:00
Leonardo de Moura
5c24906c60 fix: Delaborator for constants
@Kha Could you please take a look at the fix?
This is an example posted by @JasonGross on Zulip.
2021-03-12 19:51:27 -08:00
Leonardo de Moura
be841a7cad chore: throwError! => throwError, throwErrorAt! => throwErrorAt
@Kha I marked the corresponding methods as `protected`.
I currently can't stand `throw_error`, and I am optimistic about
server highlighting feature you are working on :)
2021-03-11 11:59:45 -08:00
Leonardo de Moura
164577d94e chore: remove parser! and tparser!
The new macros are called "leading_parser` and `trailing_parser`.

cc @Kha
2021-03-11 09:36:58 -08:00
Sebastian Ullrich
b69060f350 fix: category quotations in term position 2020-12-29 11:16:34 +01:00
Sebastian Ullrich
ca3dd82ed4 doc: notations & precedence 2020-12-28 00:44:16 +01:00
Leonardo de Moura
f638269a71 fix: name resolution at syntax command
This commit also cleans up `toParserDescr`+`toParserDescrAux`.
2020-12-22 08:40:00 -08:00
Sebastian Ullrich
1c31240ebb feat: token antiquotations in macro 2020-12-22 13:11:04 +01:00
Leonardo de Moura
43255a4af3 feat: local and scoped macros 2020-12-21 17:08:25 -08: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
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
f9dcbbddc4 refactor: remove optional leading pipe from match, use many1Indent instead of sepBy1 2020-12-16 18:27:05 +01:00
Leonardo de Moura
31e1851b21 fix: priority 2020-12-15 21:10:02 -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
abe7481453 feat: elaborate prio DSL 2020-12-14 16:25:10 -08:00
Leonardo de Moura
fcaf38d566 fix: handle prec DSL at infixl macro 2020-12-14 15:35:37 -08:00
Leonardo de Moura
a46505cb8b feat: use new precedence syntax 2020-12-14 15:14:03 -08:00
Sebastian Ullrich
0316c872b9 feat: macro: use appropriate antiquotation kind dependent on bound syntax
/cc @leodemoura
2020-12-14 13:54:34 +01:00
Sebastian Ullrich
554d0b4d4c chore: adapt stdlib to new antiquotation splices 2020-12-12 17:20:03 +01:00
Leonardo de Moura
ffefd8db36 chore: remove weird syntax sugar from macro command
Before this commit,
```
macro term x:term : term => `($x)
```
would generate the notation
```
syntax "term" term : term
```
2020-12-10 08:09:47 -08:00
Leonardo de Moura
a10328e745 chore: simplify syntax patterns using $[...]? 2020-12-09 17:06:19 -08:00
Sebastian Ullrich
4dfa7e1187 feat: use actual separator in sepBy antiquotation scope 2020-12-09 17:48:05 +01:00
Sebastian Ullrich
fd1f74c421 feat: extend sepBy syntax syntax 2020-12-09 17:36:29 +01:00
Sebastian Ullrich
e6493755e9 chore: stdlib: match_syntax ~> match 2020-12-08 17:32:02 +01:00
Sebastian Ullrich
00e167b2f0 feat: match_syntax ~> match 2020-12-08 17:20:36 +01:00
Sebastian Ullrich
93a9d79088 refactor: move around quotation helpers once more 2020-12-08 17:20:36 +01:00
Leonardo de Moura
44d0fe993a feat: ensure scoped instances cannot be used outside namespaces 2020-12-05 16:26:31 -08:00
Leonardo de Moura
1faed06dc1 feat: new attrKind syntax 2020-12-05 13:59:08 -08:00