Commit graph

37 commits

Author SHA1 Message Date
Sebastian Ullrich
d8a1742d57 feat: introduce suppressInsideQuot 2020-10-27 16:50:58 +01:00
Leonardo de Moura
7e244686e9 chore: remove old notation 2020-10-26 09:16:51 -07:00
Leonardo de Moura
13c2a8ff51 chore: remove #lang lean4 header 2020-10-25 09:54:07 -07:00
Leonardo de Moura
1af6f14fa8 chore: move to new frontend 2020-10-21 09:17:02 -07:00
Leonardo de Moura
ef18b0ab49 chore: use [builtinInit] 2020-10-19 14:58:38 -07:00
Leonardo de Moura
3bd75d51d5 feat: add ParserDescr.noWs 2020-10-09 16:26:49 -07:00
Leonardo de Moura
7013ea4098 feat: add interpolatedStr to ParserDescr and Syntax 2020-10-09 14:04:53 -07:00
Sebastian Ullrich
5d76a981b0 chore: adjust pp spacing 2020-10-07 09:44:04 +02:00
Leonardo de Moura
10fc908463 chore: use Tactic.seq1 instead of Tactic.tacticSeq1Indented
Reason: antiquotations.
2020-10-06 08:28:41 -07:00
Leonardo de Moura
93dc94b3b0 chore: remove nodeSepBy1Unbox hack 2020-10-06 07:22:28 -07:00
Leonardo de Moura
87381e3329 feat: add support for parser priorities in the syntax command
@Kha Parser priorities are working :)
2020-09-19 18:47:08 -07:00
Leonardo de Moura
f679b7d803 feat: add notFollowedBy to syntax 2020-09-19 15:43:44 -07:00
Leonardo de Moura
ee6d723554 feat: add stx.quot 2020-09-19 14:40:17 -07:00
Leonardo de Moura
f876177f26 feat: expand macros in syntax declaration 2020-09-19 14:39:49 -07:00
Leonardo de Moura
71de0c8eb9 chore: rename category syntax to stx
Reason: `syntax` is a keywork. So, we can't write `macro "boo" x:syntax`
2020-09-19 14:11:35 -07:00
Leonardo de Moura
8142548237 fix: missing toggleInsideQuot
cc @Kha
2020-09-17 13:23:52 -07:00
Leonardo de Moura
d1c3ab3797 feat: many1Unbox and nodeSepBy1Unbox parser combinators
@Kha I removed the dummy parenthesizer/formatter for `withResultOf`,
and add proper ones for `many1Unbox` and `nodeSepBy1Unbox`.
2020-09-17 13:17:46 -07:00
Leonardo de Moura
2dafdec000 feat: use withResultOf combinator instead of unboxSingleton parameter 2020-09-17 12:12:12 -07:00
Leonardo de Moura
cf944e32cf chore: add back support for Lean3 mixfix/reserve syntax
We have tests that rely on them :(
2020-09-07 16:40:12 -07:00
Leonardo de Moura
804ebcec16 feat: adjust mixfix syntax 2020-09-07 15:55:02 -07:00
Leonardo de Moura
249bda16c0 chore: remove prelude commands from Lean package 2020-06-25 11:21:17 -07:00
Sebastian Ullrich
81376d3902 feat: allow capturing expected type in elab
/cc @leodemoura
2020-06-25 14:58:45 +02:00
Sebastian Ullrich
51e4b49ba6 feat: allow arbitrary syntax in macro/elab 2020-06-25 13:54:11 +02:00
Leonardo de Moura
cefbc27720 feat: add elab and elab_rules command syntax 2020-06-24 18:34:23 -07:00
Leonardo de Moura
18cd41f902 feat: add syntaxAbbrev 2020-06-16 15:18:10 -07:00
Sebastian Ullrich
b3d2e51aff feat: generalize tactic/command macro syntax 2020-06-16 19:21:48 +02:00
Leonardo de Moura
de0a2fefa0 feat: add notationItem 2020-06-10 16:54:46 -07:00
Leonardo de Moura
610ced2de5 chore: appPrec => maxPrec 2020-06-10 16:50:09 -07:00
Leonardo de Moura
1307405300 chore: make sure parser! and tparser! use a syntax similar to the one used at syntax for setting precedences
cc @Kha
2020-06-10 16:09:13 -07:00
Leonardo de Moura
2125687d9c chore: remove unnecessary [appPrec] annotations 2020-06-10 14:44:54 -07:00
Leonardo de Moura
85320d9cf0 chore: add support for old syntax 2020-06-09 14:11:34 -07:00
Leonardo de Moura
7ec23f9401 fix: macro command syntax 2020-06-09 14:11:34 -07:00
Leonardo de Moura
a4f19aac32 fix: macro command 2020-06-09 14:11:34 -07:00
Leonardo de Moura
8972c7e666 feat: revised syntax commands 2020-06-08 16:12:06 -07:00
Leonardo de Moura
8dde9715a9 refactor: associate precedences to parsers instead of tokens
@Kha This is working in progress.
I am convinced we should associated the precedence to parsers. A lot
of weird stuff is gone :)
2020-06-08 16:12:05 -07:00
Leonardo de Moura
6e5cd5fcc0 chore: change coercion from String to Parser
@Kha
I kept `TokenInfo` as is. That is, the `lbp` field is still `Option Nat`.
I changed my mind because we have the combinator `NonReservedSymbol`.
It feels weird to have a combinator that does not create a keyword,
but sets the `lbp`. Recall that it is used at `Lean/Parser/Tactic.lean`.

Other observations:

- We use symbols in auxiliary constructions (e.g., `mkAntiquot`). It
feels weird to set their `lbp` there.

- It felt weird to specify the `lbp` in places such as
```
def structCtor := parser! ident >> optional inferMod >> symbol " :: " 67
```

- We have a few parsing rules where the same symbol appears twice.
It is funny to set the `lbp` twice. Note that the approach we
discussed yesterday (retrieving the `lbp` from the `Environment`)
would not work here.
2020-05-27 15:59:12 -07:00
Leonardo de Moura
4ccc3fef52 chore: move Init.Lean files to Lean package 2020-05-26 15:04:35 -07:00
Renamed from src/Init/Lean/Parser/Syntax.lean (Browse further)