Commit graph

7042 commits

Author SHA1 Message Date
Leonardo de Moura
0c6d6f1ff1 chore: fix test 2020-06-17 21:28:37 -07:00
Leonardo de Moura
82780be144 chore: fix tests 2020-06-17 21:28:37 -07:00
Leonardo de Moura
dbbacb3bfd chore: remove comment from Linter
Old frontend is just providing `Syntax.missing`
2020-06-17 21:28:03 -07:00
Sebastian Ullrich
0f0f1407af chore: fix test 2020-06-17 18:07:44 +02:00
Sebastian Ullrich
fff0cdc0ec test: Webserver: maybe-final version 2020-06-17 17:37:08 +02:00
Sebastian Ullrich
3c547db67c test: Webserver: introduce antiquotations for custom parsers, remove Prelim namespace
/cc @leodemoura
2020-06-17 11:54:41 +02:00
Sebastian Ullrich
5a10ac8f80 chore: delete platform-specific test 2020-06-17 10:53:10 +02:00
Leonardo de Moura
0c089b8cbd feat: elaborate syntaxAbbrev as a definition
@Kha I elaborated it as a definition. It works because we can now
reference Parser declarations in `syntax` command.
This change allowed us to replace `p.getArg 0` with `p` in the
`Websever` demo.
2020-06-16 15:43:17 -07:00
Leonardo de Moura
3e028e3812 feat: allow syntax command to use existing parser declarations
@Kha Note that I had to change the pattern. After I replaced,
```
syntax text : child
```
with
```
syntax Prelim.text  : child
```
Thus, I wrote
```
`(child|$t:text)
```
as
```
`(child|$t)
```
It works for this example, but it may be a problem in general.
2020-06-16 15:08:23 -07:00
Leonardo de Moura
c6e7ea8fd5 feat: add ParserDescr.parser constructor for embedding parser definitions into parser descriptions 2020-06-16 14:06:46 -07:00
Leonardo de Moura
f61e4ffbbd chore: ParserDescr.parser ==> ParserDescr.cat 2020-06-16 13:40:16 -07:00
Sebastian Ullrich
ade961bcf3 test: webserver demo 2020-06-16 22:10:43 +02:00
Sebastian Ullrich
fe20860c3d chore: delete unused file 2020-06-16 10:41:42 -07:00
Sebastian Ullrich
cfd1900625 fix: #eval: redirect stdout/stderr 2020-06-16 12:06:53 +02:00
Simon Hudon
a64e78b90b feat: add std streams
Co-authored-by: Sebastian Ullrich <sebasti@nullri.ch>
2020-06-16 12:06:53 +02:00
Leonardo de Moura
bc6dba89f3 chore: fix tests 2020-06-15 14:39:30 -07:00
Sebastian Ullrich
e6b988a10a feat: add natural language demo 2020-06-13 16:20:23 +02:00
Sebastian Ullrich
43caef0130 fix: parenthesizer 2020-06-13 11:13:37 +02:00
Leonardo de Moura
6f0192581a feat: change precedence for fun and do parsing rules to maxPrec
Motivation: avoid `$`. See new test.

cc @Kha
2020-06-11 16:24:04 -07:00
Leonardo de Moura
f92166e913 chore: fix test 2020-06-10 16:43:44 -07:00
Leonardo de Moura
f838b80e03 fix: elaboration functions for parser! and tparser! 2020-06-10 16:42:42 -07:00
Leonardo de Moura
77e1260ed2 chore: simplify checkPrec 2020-06-10 14:34:58 -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
Leonardo de Moura
25c1986439 chore: fix tests 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
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
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
b3a8d417b2 chore: fix test 2020-06-08 16:12:05 -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
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
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
Sebastian Ullrich
6614b4d6e3 fix: use exact instead of prefix token match when inheriting precedence
/cc @leodemoura :)
2020-05-28 14:14:52 +02:00
Leonardo de Moura
5dffa0093a feat: retrieve implicit lbp from Environment at syntax command
@Kha It is not clear to me why I had to change the following line
```
-syntax term ">>>" term : foo
+syntax term:1 ">>>":1 term : foo
```
The test breaks without it.
2020-05-27 17:11:57 -07:00
Leonardo de Moura
17b6957f6c chore: fix tests 2020-05-26 15:05:01 -07:00
Leonardo de Moura
9c0bd9dd41 chore: fix tests 2020-05-26 15:05:00 -07:00
Sebastian Ullrich
c11e88c768 test: Reparen: don't remove parentheses in syntax quotations 2020-05-26 14:32:42 +02:00
Sebastian Ullrich
674fea4876 fix: parenthesizer: adjust lbp after parenthesization 2020-05-26 14:32:42 +02:00
Sebastian Ullrich
b519997b58 feat: parenthesizer: handle choice 2020-05-26 14:32:42 +02:00
Sebastian Ullrich
60ac03916e feat: introduce anonymous antiquotations for all categories 2020-05-26 14:32:42 +02:00
Sebastian Ullrich
9247911e09 fix: basic parenthesizer approach, document 2020-05-26 11:26:57 +02:00
Sebastian Ullrich
52b9bb35ea test: reparenthesize files 2020-05-26 11:26:57 +02:00
Sebastian Ullrich
c50cd2527c fix: include headers in test 2020-05-23 12:39:49 +02:00
Leonardo de Moura
a2e339e868 chore: fix test 2020-05-22 14:47:39 -07:00
Leonardo de Moura
ee0fb1bfd8 chore: fix test
@Kha

I was having several errors of the form
```
224: /Users/leonardodemoura/projects/lean4/build/release/stage0.5/bin/../include/lean/runtime/exception.h:23:13: error: exception specification of overriding function is more lax than base version
224:     virtual ~throwable() noexcept;
224:             ^
224: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/exception:102:13: note: overridden virtual function is here
224:     virtual ~exception() _NOEXCEPT;
224:             ^
224: In file included from myfuns.cpp:1:
```

As far as I can tell, the error ocurrs because my compiler uses an old
C++ standard if the option `-std` is not used.
I guess `-std=c++11` would also works, but I decided to use the same
standard we used to compile Lean.
2020-05-22 09:33:46 -07:00
Sebastian Ullrich
36e040ecfa test: reimplement compiler/foreign on top of leanmake 2020-05-22 09:22:26 -07:00
Leonardo de Moura
3d166f6400 chore: fix syntax
This is a set of examples that exposes problems with the old frontend
elaborator. These issues have been fixed in the new frontend.
2020-05-21 09:57:35 -07:00