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
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
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
98033f298f
feat: add support for simple category
2020-01-20 20:55:54 -08:00
Leonardo de Moura
4ff001fa04
feat: add new kind of parser category
2020-01-20 20:06:04 -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
Sebastian Ullrich
15bed7c95c
chore: support old notation syntax
2020-01-19 18:45:08 +01:00
Leonardo de Moura
58b21fe0c9
feat: mark literals as valid kinds
2020-01-18 19:41:40 -08:00
Leonardo de Moura
98d9022321
chore: cleanup and new test
2020-01-17 18:07:58 -08:00
Sebastian Ullrich
ec8227cfd4
fix: antiquotation kinds :term should not be new tokens
2020-01-17 09:42:34 -08:00
Leonardo de Moura
f2231ebbc0
feat: improve macro command parser
2020-01-17 09:37:36 -08:00
Leonardo de Moura
14ae1166b1
feat: add unboxSingleton trick to sepBy1
2020-01-16 20:57:18 -08:00
Leonardo de Moura
d9c6624a0a
feat: add support for trailing syntax
2020-01-15 20:53:23 -08:00
Leonardo de Moura
570ae2ff0e
feat: add mkFreshKind
2020-01-14 18:07:14 -08:00
Leonardo de Moura
c889d0ce48
fix: infixR helper only works for termParsers
2020-01-14 18:06:57 -08:00
Leonardo de Moura
ab8cbdc7e0
feat: improve syntax rules
2020-01-14 14:15:48 -08:00
Leonardo de Moura
dd2936d28e
chore: move helper functions to Parser.lean
2020-01-14 13:33:20 -08:00
Leonardo de Moura
15a2d7d8ca
chore: tacticSymbol ==> nonReservedSymbol
2020-01-14 13:08:38 -08:00
Leonardo de Moura
e9d1014d63
feat: add ParserDescrCore.tacticSymbol constructor
2020-01-13 16:54:52 -08:00
Leonardo de Moura
2f5f00ed4f
feat: improve leadingIdentAsSymbol trick
2020-01-13 16:42:49 -08:00
Leonardo de Moura
397addb958
doc: leadingIdentAsSymbol trick
2020-01-13 16:38:12 -08:00
Leonardo de Moura
b8146cc235
feat: add leadingIdentAsSymbol to ParserCategory
2020-01-13 16:07:21 -08:00
Leonardo de Moura
340d5f01f5
chore: symbolOrIdent ==> nonReservedSymbol
2020-01-13 14:32:34 -08:00
Sebastian Ullrich
c6100ed25f
feat: antiquoting rawIdent
2020-01-12 10:32:27 -08:00
Simon Hudon
92c8773137
feat: file IO using handles
2020-01-12 08:02:48 -08:00
Leonardo de Moura
82a36fbfe2
feat: declare_syntax_cat without importing Init.Lean
...
cc @Kha
2020-01-11 09:02:50 -08:00
Leonardo de Moura
e817257922
feat: elaborate declare_syntax_cat
...
TODO: `registerParserCategory` uses `registerAttribute` which relies
on the environment having a declaration of type `AttributeImpl`.
This is bad since forces users to import `Init.Lean`.
@Kha The key problem is that we cannot serialize `AttributeImpl`.
I will try to address this issue tomorrow. I am considering different
workarounds.
2020-01-10 21:10:02 -08:00
Leonardo de Moura
799914daf2
feat: registerParserCategory
2020-01-10 20:32:16 -08:00
Leonardo de Moura
48600dbbfc
refactor: registerAttribute ==> registerBuiltinAttribute
2020-01-10 17:08:12 -08:00
Leonardo de Moura
a76b104f61
chore: move Message to Lean
2020-01-10 10:58:50 -08:00
Leonardo de Moura
c06d515027
fix: typo
2020-01-08 21:22:46 -08:00
Leonardo de Moura
48578c9743
chore: remove hacks
2020-01-08 21:09:17 -08:00
Leonardo de Moura
d92e59a6fb
chore: add temporary staging workaround
2020-01-08 21:09:17 -08:00
Leonardo de Moura
c98e3290e4
refactor: parser attributes
2020-01-08 21:09:11 -08:00
Leonardo de Moura
c4ad3a2390
refactor: ParserContextCore and ParserContext
2020-01-08 14:20:53 -08:00
Leonardo de Moura
b774ed1505
fix: update tokens
2020-01-08 08:28:15 -08:00
Sebastian Ullrich
bece6f7a32
feat: command quotations
2020-01-06 10:09:26 -08:00
Leonardo de Moura
0231841984
feat: applyAttributes
2020-01-05 16:22:46 -08:00
Leonardo de Moura
54fd9a2e4a
chore: naming convention
2020-01-03 12:12:45 -08:00
Leonardo de Moura
3f51857275
feat: add where syntax
2020-01-02 14:55:18 -08:00
Leonardo de Moura
1d4ef0eff5
feat: register new syntax node kinds
2019-12-31 16:50:04 -08:00
Leonardo de Moura
90178dc3d9
feat: add syntaxNodeKindExtension
...
It contains all `SyntaxNodeKind`s registered in the system.
2019-12-31 16:36:50 -08:00
Leonardo de Moura
af5b52092d
feat: register parser extensions tokens
2019-12-31 16:05:14 -08:00
Leonardo de Moura
b17f822488
fix: mkInitial
2019-12-31 13:51:12 -08:00