Commit graph

113 commits

Author SHA1 Message Date
Leonardo de Moura
ab27e1c7be feat(library/init/lean/parser/parser): change many p behavior
We should not ingore an error in `p` if error position > initial position
2019-07-16 13:32:42 -07:00
Leonardo de Moura
e59edb27cd feat(library/init/lean/parser/term): allow type annotation after pattern 2019-07-16 13:21:02 -07:00
Leonardo de Moura
5d077ad592 feat(library/init/lean/parser/term): add andM and orM notation 2019-07-16 10:56:44 -07:00
Leonardo de Moura
0dcdc2c198 feat(library/init/lean/parser/term): add support for "named" patterns n@(x :: s)
@kha, the implementation is a little bit hackish. It is whitespace
sensitive to avoid `f @g`, an application with argument `@g` to be
parsed as a named pattern.
Here are other approaches I have considered:

1- In the `namedPattern`, we add a guard that ensures the pattern
is *not* an identifier. Thus, `f @g` would not be considered a valid
`namedPattern`. Drawback: we would always try to parse it as a
namedPattern first, fail, and then try as an application.

2- Enforce whitespace before application arguments. Drawback: `f(a+b)`
would not be a valid application anymore.
2019-07-16 10:09:01 -07:00
Leonardo de Moura
f206b30fd7 feat(library/init/lean/parser): add charLit 2019-07-16 07:22:09 -07:00
Leonardo de Moura
07e52fb36c feat(library/init/lean/parser/term): quoted names 2019-07-15 16:06:51 -07:00
Leonardo de Moura
9f828f015f fix(library/init/lean/parser/term): allow empty anonymousCtor 2019-07-15 15:32:25 -07:00
Leonardo de Moura
7af9de41ca feat(library/init/lean/parser/term): add borrowed syntax 2019-07-15 14:12:13 -07:00
Leonardo de Moura
299c3a0791 fix(library/init/lean/parser/term): typo 2019-07-15 14:09:31 -07:00
Leonardo de Moura
52157cebf7 feat(library/init/lean/parser): add ParserAttribute skeleton 2019-07-14 07:16:14 -07:00
Leonardo de Moura
728598520b chore(library/init/lean/parser/term): add new parser! and tparser! notations 2019-07-12 15:51:10 -07:00
Leonardo de Moura
3370ab7398 feat(library/init/lean/parser/term): allow equations to be used in let-decls 2019-07-11 13:13:08 -07:00
Leonardo de Moura
99393433a4 feat(library/init/lean/parser/term): do notation 2019-07-11 12:38:55 -07:00
Leonardo de Moura
711ab9f222 feat(library/init/lean/parser/term): missing notation 2019-07-11 10:34:49 -07:00
Leonardo de Moura
295cabed2e chore(library/init): remove unnecessary notations 2019-07-11 10:27:16 -07:00
Leonardo de Moura
57e2f1be2a feat(library/init/lean/parser/term): builtin operators 2019-07-11 10:13:00 -07:00
Leonardo de Moura
195fb27ce5 feat(library/init/lean/parser/term): add let 2019-07-11 09:51:34 -07:00
Leonardo de Moura
7b91d880d7 feat(library/init/lean/parser/term): add sortApp, inaccessible and explicit 2019-07-11 09:05:21 -07:00
Leonardo de Moura
2c979459a9 feat(library/init/lean/parser/parser): add many1Indent1 combinator
It is useful for create whitespace sensitive notation such as `match` expressions.
2019-07-10 16:10:41 -07:00
Leonardo de Moura
140cc45491 feat(library/init/lean/parser/term): whitespace sensitive match expression 2019-07-10 15:13:28 -07:00
Leonardo de Moura
e55e5953d5 chore(library/init/lean/parser/term): remove manual eta expansions 2019-07-09 16:35:06 -07:00
Leonardo de Moura
5dae0303af chore(library/init/lean/parser): force eta expansion and remove unnecessary [inline]
TODO: improve eta-expansion step in the compiler.
2019-07-09 14:09:24 -07:00
Leonardo de Moura
eb69c914e8 chore(library/init/lean/parser/term): add missing [inline] 2019-07-08 22:06:52 -07:00
Leonardo de Moura
95dc2c5ade chore(library/init/lean/parser): minor 2019-07-08 14:45:20 -07:00
Leonardo de Moura
f37cd3cd11 feat(library/init/lean/parser/term): match-expression
TODO: add whitespace sensitivity
2019-07-08 14:14:49 -07:00
Leonardo de Moura
846ec9578d fix(library/init/lean/parser/term): allow namedArgument notation in applications only 2019-07-08 13:43:12 -07:00
Leonardo de Moura
4a17cf134b feat(library/init/lean/parser/term): add forall parser 2019-07-08 13:03:21 -07:00
Leonardo de Moura
a6f9633e64 feat(library/init/lean/parser/term): dependent arrow notation 2019-07-08 12:57:49 -07:00
Leonardo de Moura
d3ca360e7f feat(library/init/lean/parser): depArrow proof of concept 2019-07-08 10:49:54 -07:00
Leonardo de Moura
8b3d932212 chore(library/init/lean/parser): maxPrec ==> appPrec 2019-07-08 09:17:32 -07:00
Leonardo de Moura
9334f54b87 feat(library/init/lean/parser/parser): support for whitespace sensitive left binding power
We use this new feature to implement array access notation `a[i]`.
2019-07-07 07:21:10 -07:00
Leonardo de Moura
2498f197b8 feat(library/init/lean/parser/term): declare some builtin infix operators
In Lean4, several builtin operators will be defined programmatically to
make sure we can bootstrap the system before we have all primitives
necessary for defining parsers.
2019-07-05 18:51:14 -07:00
Leonardo de Moura
794edcb18c chore(library/init/lean/parser): minor modifications 2019-07-05 18:31:03 -07:00
Leonardo de Moura
483b7ae51a feat(library/init/lean/parser/term): add field notation trailing parser 2019-07-05 16:23:25 -07:00
Leonardo de Moura
68d29fcdd4 feat(library/init/lean/parser/term): structure instances and subtypes 2019-07-05 12:09:59 -07:00
Leonardo de Moura
326c22e75d feat(library/init/lean/parser/term): anonymous constructors and lambdas 2019-07-05 10:26:39 -07:00
Leonardo de Moura
0bee94886e feat(frontends/lean/builtin_exprs): , from ==> from, and cleanup suffices 2019-07-02 17:22:50 -07:00
Leonardo de Moura
9f24e77200 chore(library/init/lean/parser/term): add show and have parsers 2019-07-02 16:59:43 -07:00
Leonardo de Moura
44730314ff feat(library/init/lean/parser/term): add ifTerm 2019-07-02 16:32:09 -07:00
Leonardo de Moura
a02443d23d chore(frontends/lean): fun x, e ==> fun x => e 2019-07-02 13:22:11 -07:00
Leonardo de Moura
39221adcd6 chore(frontends/lean/builtin_exprs): remove assume notation 2019-07-02 10:40:07 -07:00
Leonardo de Moura
d4a5306d82 feat(library/init/lean/parser/term): explicit universe notation in the new parser 2019-07-02 09:00:58 -07:00
Leonardo de Moura
9d50b3ca47 feat(library/init/lean/parser/term): paren parser 2019-07-01 19:44:13 -07:00
Leonardo de Moura
5691450b5b feat(library/init/lean/parser): term parser skeleton 2019-07-01 15:04:13 -07:00
Leonardo de Moura
55626ba60d chore(library/init/lean): disable new frontend for now
We are going to start making drastic changes in the parser,
elaborator, attributes, etc. Examples:
- No View objects. I am going to implement match_syntax.
- No RecT in the parser. I am going to implement parser extensions
using an approach similar to the one I used to implement environment
extensions.
- No Parsec. I will use an approach similar to the one used in the
experiment https://github.com/leanprover/lean4/tree/master/tests/playground/parser

It is easier to perform these changes with the new frontend disabled.
I will slowly re-active it as I apply the changes.

cc @kha
2019-06-05 15:26:43 -07:00
Sebastian Ullrich
040ec9767d fix(library/init/lean/parser/combinators): (x) -> e should not be a dependent function 2019-03-26 11:26:39 +01:00
Sebastian Ullrich
beec014890 feat(library/init/lean/{parser/term,expander}): remove (x : e) → f macro hack and replace with actual parser 2019-03-25 16:12:14 +01:00
Leonardo de Moura
930164b597 chore(library/init/lean/parser/term): remove hack used during conversion 2019-03-21 15:06:45 -07:00
Leonardo de Moura
2be87ecd92 chore(library/init): Bool.tt => Bool.true and Bool.ff => Bool.false 2019-03-21 15:06:44 -07:00
Leonardo de Moura
04e20623e6 chore(*): use lowercase dir names 2019-03-21 15:06:44 -07:00
Renamed from library/init/Lean/Parser/term.lean (Browse further)