Commit graph

28 commits

Author SHA1 Message Date
Sebastian Ullrich
619873c842 feat: make System.FilePath opaque 2021-05-28 14:19:59 +02:00
Leonardo de Moura
3b7bcdc449 feat: add endPos field to SourceInfo.original
We need an update stage0 before we use it.
2021-05-17 14:32:58 -07:00
Sebastian Ullrich
fd42b111fb chore: always push missing on a parser error 2021-04-17 23:44:43 +02:00
Leonardo de Moura
6c0f3c277f fix: ignore syntactically incorrect commands that do not contain any symbol
This kind of broken command does not have a position information, and
was producing a panic message in the server because it makes the
reasonable assumption that every command returned by `parserCommand`
has a position.
2021-04-07 14:46:13 -07:00
Leonardo de Moura
fb38955be2 feat: improve command parser error recovery
After a parser error in a command, we are "swallowing" all command
parsing errors until a command was succesfully parsed.
This was producing counterintuitive behavior in the IDEs.
2021-04-05 12:31:33 -07:00
Sebastian Ullrich
d0996fb945 chore: improve EOI error message 2021-04-03 11:56:26 +02:00
Leonardo de Moura
de024274fe feat: elaborate syntactically incorrect commands 2021-03-31 17:05:34 -07:00
Leonardo de Moura
03e3a1cc6b chore: remove hack
It produces weird error messages in some examples, and it will be
obsolete after the new precedence feature.
2021-03-19 11:09:18 -07:00
Leonardo de Moura
164577d94e chore: remove parser! and tparser!
The new macros are called "leading_parser` and `trailing_parser`.

cc @Kha
2021-03-11 09:36:58 -08:00
Sebastian Ullrich
79107a2316 feat: copy & store whole ref range in SourceInfo 2021-01-20 16:48:50 +01:00
Sebastian Ullrich
4380d4a9da feat: parser: store options & pass to evalConst 2020-12-16 23:15:58 +01:00
Leonardo de Moura
3b6d65c3c3 chore: use deriving Inhabited 2020-12-13 10:09:20 -08:00
Sebastian Ullrich
21f4257da5 feat: name resolution during parsing 2020-12-03 17:46:13 +01:00
Leonardo de Moura
0869f38de4 chore: update structure, class, inductive 2020-11-27 15:09:30 -08:00
Leonardo de Moura
13c2a8ff51 chore: remove #lang lean4 header 2020-10-25 09:54:07 -07:00
Leonardo de Moura
7966856b32 chore: move to new frontend 2020-10-21 09:13:55 -07:00
Sebastian Ullrich
e8cf086641 fix: synthesize pretty printers early 2020-10-20 09:50:54 +02:00
Leonardo de Moura
ef01053d58 fix: set mainModuleName in the new frontend 2020-10-15 15:30:03 -07:00
Leonardo de Moura
5d3e08d43a chore: documented modification needed to enable the elaboration of commands containing syntax errors
cc @Kha
2020-10-14 13:20:01 -07:00
Sebastian Ullrich
bdff53fdf5 feat: use ppLine 2020-10-07 09:43:05 +02:00
Leonardo de Moura
dc9626ceab feat: try to improve weird error message
@Kha Before this commit, we were producing the error "expected command" at the `let` token
```lean
check id let x := 1; x
```
The new error is "expected command, but found term; this error may be
due to parsing precedence levels, consider parenthesizing the term".

The example above looks artificial, but it will happen all the time as
users start to define their own notation.
2020-09-21 18:29:01 -07:00
Sebastian Ullrich
f693e910b1 fix: skip minimum amount of tokens during parser recovery
Fixes #186
2020-09-21 11:37:50 +02:00
Leonardo de Moura
0abca5475f refactor: move ppExpr to IO
@Kha I am also tracking `currNamespace` and `openDecls`.

BTW, I also tried an experiment where I added `currNamespace` and
`openDecls` to `Meta.Context`, but it looked weird. This information
is only needed in the elaborator and pretty printer.
The `PPContext` object should contain everything you need. You
can put `currNamespace` and `openDecls` in the `Delaborator.Context`.
2020-09-15 18:48:21 -07:00
Sebastian Ullrich
75b2dc1baf refactor: simplify ppModule using new module parser 2020-08-31 15:44:58 +02:00
Sebastian Ullrich
2418d851fc feat: declarative module parser
/cc @leodemoura
2020-08-31 14:45:21 +02:00
Sebastian Ullrich
e5de32c2dd feat: auto-generate header formatter 2020-08-21 16:43:55 +02:00
Leonardo de Moura
249bda16c0 chore: remove prelude commands from Lean package 2020-06-25 11:21:17 -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/Module.lean (Browse further)