Commit graph

45 commits

Author SHA1 Message Date
Leonardo de Moura
4ccc3fef52 chore: move Init.Lean files to Lean package 2020-05-26 15:04:35 -07:00
Leonardo de Moura
bd58048449 chore: { <source> with ... } syntax 2020-05-20 15:08:43 -07:00
Sebastian Ullrich
b28eedbd98 refactor: make all fields of SourceInfo optional 2020-05-20 11:54:53 -07:00
Sebastian Ullrich
86d2b82c29 refactor: get rid of antiquotExpr hack 2020-02-18 10:57:27 -08:00
Sebastian Ullrich
25f764daad feat: antiquotation escapes 2020-02-18 10:57:12 -08:00
Leonardo de Moura
54bdddb98f fix: toParserDescrAux 2020-01-30 20:38:14 -08:00
Leonardo de Moura
31ebccea58 chore: remove ParserDescr.pushLeading 2020-01-30 19:04:07 -08:00
Sebastian Ullrich
b818994bbe fix: do not swallow errors from parser interpreter
@leodemoura I think we should only use `throwUnsupportedSyntax` in the
top level `match_syntax` of a transformer/elaborator
2020-01-30 08:56:14 -08:00
Sebastian Ullrich
9160c561c1 feat: postfix syntax for optional syntax parser 2020-01-30 08:56:14 -08:00
Leonardo de Moura
8525584a78 refactor: naming consistency ensure List and Array have similar find* methods
`find?`     -> takes predicate
`findSome?` -> takes a function (A -> Option B)
2020-01-26 15:13:05 -08:00
Leonardo de Moura
5ff63c2bc6 choice: better error message 2020-01-26 13:58:51 -08:00
Leonardo de Moura
7133d3fc84 feat: handle explicit node kinds in macro_rules, and handle choice kind 2020-01-26 09:39:46 -08:00
Leonardo de Moura
e52c4291cc feat: allow macro_rules block with different syntax node kinds 2020-01-26 08:39:40 -08:00
Leonardo de Moura
6a0208630e feat: add sanity checking at macro_rules 2020-01-25 20:31:58 -08:00
Leonardo de Moura
32b36f0ea3 feat: update macro_rules 2020-01-25 18:19:16 -08:00
Leonardo de Moura
364bb7bdf7 fix: proper Name literals
cc @kha
2020-01-24 12:38:15 -08:00
Leonardo de Moura
b47caaa0a5 refactor: notation and macro commands are now just macros 2020-01-23 13:04:21 -08:00
Leonardo de Moura
954c69de35 feat: use macroscopes for creating fresh kinds 2020-01-23 12:38:31 -08:00
Leonardo de Moura
87d002bb43 feat: extend MacroM
It now has access to `mainModule` and a name generator.
2020-01-23 09:48:37 -08:00
Leonardo de Moura
67535441ad fix: macroTail issue
cc @Kha
2020-01-22 20:14:09 -08:00
Leonardo de Moura
ae84270226 feat: include result of sequence of macro expansions
@Kha I added this feature to help debugging macros.
I was using `set_option trace.Elab true` as a workaround, but it is
too verbose.
For example, in the following buggy code

```
new_frontend

macro "foo" x:term : term => `(x + 1)
macro "bla" x:term : term => `(foo $x)
```

We get the error message
```
<input>:6:11: error: unknown identifier 'x.15'
with resulting expansion
   x  +  1
while expanding
   foo 1
while expanding
  bla 1
```

Perhaps we should preserve the macroscopes at "with resulting
expansion". Anyway, I think it is better than the previous error.

```
<input>:6:11: error: unknown identifier 'x.15'
while expanding
   foo 1
while expanding
  bla 1
```
2020-01-22 16:08:07 -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
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
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
Sebastian Ullrich
129442a76a fix: syntax: do not qualify fresh kinds 2020-01-20 14:58:58 -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
Sebastian Ullrich
6c2a2cfa35 feat: support postfix syntax in macro 2020-01-19 11:58:17 -08:00
Leonardo de Moura
be571e8d42 feat: elaborate new macro argument types 2020-01-18 19:41:17 -08:00
Leonardo de Moura
3e86608ce2 fix: erase macro scopes from parser categories 2020-01-18 19:10:35 -08:00
Leonardo de Moura
284447e43b chore: style 2020-01-18 18:58:56 -08:00
Leonardo de Moura
b2ade985a8 feat: elaborate macro command 2020-01-17 19:52:29 -08:00
Leonardo de Moura
7cfd3f13ca chore: update function name 2020-01-17 17:48:18 -08:00
Leonardo de Moura
2eafb70585 chore: add auxiliary functions and simplify Quotation 2020-01-17 16:00:39 -08:00
Leonardo de Moura
a98b6763ad fix: code and tests 2020-01-17 08:11:06 -08:00
Leonardo de Moura
0e8c8784a5 feat: elaborate notation 2020-01-15 20:53:24 -08:00
Leonardo de Moura
f919041400 feat: expand precedence 2020-01-15 20:53:23 -08:00
Leonardo de Moura
6ff732f698 refactor: move notation comands to Syntax.lean 2020-01-15 20:53:23 -08:00
Leonardo de Moura
d9c6624a0a feat: add support for trailing syntax 2020-01-15 20:53:23 -08:00
Leonardo de Moura
b9c161b30c feat: elaborate macro command 2020-01-15 20:53:23 -08:00
Leonardo de Moura
b14c7cb69b feat: allow user to set nodeKind at syntax command 2020-01-14 18:51:31 -08:00
Leonardo de Moura
664172d266 feat: elaborate syntax command 2020-01-14 18:18:43 -08:00
Leonardo de Moura
2d83d49341 refactor: add Elab/Syntax.lean 2020-01-14 14:22:55 -08:00