Commit graph

36377 commits

Author SHA1 Message Date
Leonardo de Moura
77e1260ed2 chore: simplify checkPrec 2020-06-10 14:34:58 -07:00
Leonardo de Moura
a677c18683 chore: update stage0 2020-06-10 13:46:43 -07:00
Leonardo de Moura
6d3aff97d5 chore: lbp and rbp ==> prec 2020-06-10 13:41:10 -07:00
Leonardo de Moura
f0a9e54a69 chore: make sure leading and trailing parsers use the same kind of check 2020-06-10 13:41:10 -07:00
Sebastian Ullrich
894098dcc3 chore: de-Nix-ify macOS binary 2020-06-10 21:30:38 +02:00
Sebastian Ullrich
7ecdb8d5ee chore: update Windows CI 2020-06-10 21:30:38 +02:00
Sebastian Ullrich
6019c30a37 chore: remove obsolete MinGW-specific flag 2020-06-10 21:30:38 +02:00
Sebastian Ullrich
8ae25090cf chore: add separate "Linux release" CI job using Nix channel with older glibc for compatibility 2020-06-10 21:30:38 +02:00
Sebastian Ullrich
40463a3ab8 chore: building static executables is hopeless, do mostly static instead 2020-06-10 21:30:38 +02:00
Sebastian Ullrich
485a1d67f8 chore: update CI 2020-06-10 21:30:38 +02:00
Sebastian Ullrich
97fd4e7a87 chore: CI: upload build artifact; remove unused LLVM=ON job 2020-06-10 21:30:38 +02:00
Sebastian Ullrich
6e2b852182 chore: bump minimum cmake version
Apparently cmake 3.10 doesn't like custom `test` targets even when not using CTest in the project

/cc @leodemoura
2020-06-10 21:30:38 +02:00
Leonardo de Moura
f23780a334 chore: add hack for allowing old and new frontends to parse Core.lean 2020-06-09 14:11:34 -07:00
Leonardo de Moura
e62e30ad0f chore: remove whitespace 2020-06-09 14:11:34 -07:00
Leonardo de Moura
85320d9cf0 chore: add support for old syntax 2020-06-09 14:11:34 -07:00
Leonardo de Moura
25c1986439 chore: fix tests 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
7fce8b5d1f fix: notation command
@Kha Note that I had to write the weird pattern

```
match_syntax stx with
| `(notation:$prec $items* => $rhs)    => expandNotationAux stx prec items rhs
| `(notation $noprec* $items* => $rhs) => expandNotationAux stx none items rhs
| _ => Macro.throwUnsupported
```

with the weird `$noprec*` to match the case where the optional
precedence is not provided. I realized this is not a bug, but
I guess most users will be puzzled by this behavior. If we had a kind
for `notationItem`, I would be able to write
```
`(notation $items:notationItems* => $rhs)
```
2020-06-09 14:11:34 -07:00
Sebastian Ullrich
a78ceb8121 fix: parenthesizer 2020-06-09 11:26:00 +02:00
Sebastian Ullrich
c8ee21747b chore: remove obsolete symbolAux, symbolNoWsAux 2020-06-09 10:37:00 +02:00
Leonardo de Moura
4250bc630e chore: fix tests 2020-06-08 16:18:46 -07:00
Leonardo de Moura
2b58ecea60 chore: fix test 2020-06-08 16:13:52 -07:00
Leonardo de Moura
f46dcd7a13 chore: fix some tests 2020-06-08 16:12:06 -07:00
Leonardo de Moura
aa49b3cdb1 feat: elaborate new syntax command 2020-06-08 16:12:06 -07:00
Leonardo de Moura
5099a0bf1b chore: update stage0 2020-06-08 16:12:06 -07:00
Leonardo de Moura
8972c7e666 feat: revised syntax commands 2020-06-08 16:12:06 -07:00
Leonardo de Moura
d2c2d95c47 chore: remove symbolAux 2020-06-08 16:12:06 -07:00
Leonardo de Moura
e525a8d7c3 chore: update stage0 2020-06-08 16:12:06 -07:00
Leonardo de Moura
dd1aa2f271 chore: improve error message
cc @Kha
2020-06-08 16:12:05 -07:00
Leonardo de Moura
c6ea675cae chore: fix test
@Kha The error message changed. Not sure the new one is expected. It
is due to the change in `trailingLoop`. We can discuss it in the next
meeting.
2020-06-08 16:12:05 -07:00
Leonardo de Moura
aa66fc376b chore: fix test 2020-06-08 16:12:05 -07:00
Leonardo de Moura
400aa435f3 fix: add missing precedence to liftMethod and remove unnecessary precedence from doLet 2020-06-08 16:12:05 -07:00
Leonardo de Moura
b3a8d417b2 chore: fix test 2020-06-08 16:12:05 -07:00
Leonardo de Moura
1554f7f99a fix: ParserDescr
This commit also adds the new constructor `ParserDescr.rblLt`
2020-06-08 16:12:05 -07:00
Leonardo de Moura
906e1b9d91 fix: reset should only be performed at trailingLoop 2020-06-08 16:12:05 -07:00
Leonardo de Moura
5f1831812a chore: missing [inline]s and typo 2020-06-08 16:12:05 -07:00
Leonardo de Moura
5765a1160d fix: Parser ==> TrailingParser 2020-06-08 16:12:05 -07:00
Leonardo de Moura
fa2e943c27 fix tokenFnAux 2020-06-08 16:12:05 -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
52c7709cb3 fix: longestMatch at trailing parsers
Before this commit, if we execut `longestMatch [p1, p2]` in a
trailing parser where both `p1` and `p2` succeed, then an incorrect
syntax tree is generated by `p2`. The issue is that before executing
`p2`, the trailing stack is of the form
`#[..., left, syntax-by-p1]`
Then, the trailing parser `p2` incorrectly assumes that `syntax-by-p1`
was the "left" syntax node.
This commit fix this issue by storing the `left` node at the
`ParserContext` at `trailingLoop`

@Kha This bug was introduced when we unified leading and trailing
parsers. I think this is the simplest solution.
We can observe the bug before this commit by using
```
set_option syntaxMaxDepth 1000
set_option trace.Elab true
```
at `choiceMacroRules.lean`.

It is funny the correct result was produced even with the bug.
It was working because the `macro_rules` was matching the
buggy syntax with the nested `syntax-by-p1` there :)
2020-06-08 14:34:50 -07:00
Leonardo de Moura
8b1cb0fcb8 doc: errToSorry field 2020-06-08 14:28:50 -07:00
Leonardo de Moura
62cf913d6a fix: interaction between errToSorry and observing.
@Kha I implemented the solution 1 I described at Zulip.
I also tried to document the issue, and made sure test
`choiceMacroRules` fail if the bug is reintroduced.
2020-06-08 12:37:43 -07:00
Leonardo de Moura
9aa5a5c298 chore: update stage0 2020-06-03 18:11:42 -07:00
Leonardo de Moura
7a323a0c7b feat: allow parser! and tparser! to set the parser precedence 2020-06-03 18:11:13 -07:00
Leonardo de Moura
947369b4ce chore: Parenthesizer issues after removing sortApp
@Kha Could you please double check these modifications.

I added a no-op for `checkRbpLt`. It is used at the `Sort` and `Type`
parsers.
As I described in previous commits, the `checkRBPGreater` comment and
implementation were misleading. It was actually succeeding when the
rbp was less than or equal to the given parameter. So, it was renamed
to `checkRbpLe`. So, is the depArrow parenthesizer ok? I did not check.

I updated the PPRoundtrip.lean.expected.out to make sure the tests
succeed, but we should revise it if there is a problem with the
modifications at Parenthesizer.lean
2020-06-03 15:46:33 -07:00
Leonardo de Moura
cd4affd129 chore: update stage0 2020-06-03 15:33:02 -07:00
Leonardo de Moura
5f0dae3fcb fix: elabSort and elabTypeStx 2020-06-03 15:27:09 -07:00
Leonardo de Moura
2fbf3cff15 chore: update stage0 2020-06-03 15:26:59 -07:00
Leonardo de Moura
9a349a913a chore: remove sortApp
@Kha Note that `checkRBPGreater` comment and name were incorrect. It
was actually checking whether the RBP <= lower
2020-06-03 15:18:16 -07:00