Commit graph

927 commits

Author SHA1 Message Date
Leonardo de Moura
ee5ec98fa9 feat(library/init/lean/parser/parser): add symbolNoWs trailing parser 2019-07-05 16:22:36 -07:00
Leonardo de Moura
fa96fb8deb feat(library/init/lean/position): HasToString instance 2019-07-05 16:22:15 -07:00
Leonardo de Moura
113ab4824f feat(library/init/lean/syntax): add Syntax.getTailInfo 2019-07-05 16:21:51 -07:00
Leonardo de Moura
dca0ba60fa feat(library/init/lean/parser/parser): add fieldIdx parser
We should not use `numLit` for projections since it will parse
`p.1.2` as
```
Term.proj `p (numLit "1.2")
```
2019-07-05 15:07:51 -07:00
Leonardo de Moura
3285a9e77d chore(library/init): unnecessary parentheses 2019-07-05 13:23:19 -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
e3c75d2af6 fix(library/init/lean/parser/parser): position information for strLit, numLit, ident 2019-07-05 12:07:37 -07:00
Leonardo de Moura
24f9cd9564 chore(library/init/lean/parser/parser): minor 2019-07-05 11:23:45 -07:00
Leonardo de Moura
70fbf58c50 fix(library/init/lean/parser/parser): bug at identFnAux 2019-07-05 10:46:20 -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
ea6eee516b chore(frontends/lean): use => instead of := in match-expressions
Motivation: use same separator used in lambda expressions as in
other programming languages.
2019-07-04 11:38:38 -07:00
Leonardo de Moura
07cff06b6e chore(library): Π ==> 2019-07-02 17:35:15 -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
56007d7c97 feat(library/init/lean/parser/parser): display builtinParser name when updateTokens fails 2019-07-02 16:06:39 -07:00
Leonardo de Moura
92466272ed fix(library/init/lean/compiler/ir/emitcpp): incorrectly emitting unicode characters in the range [128, 255]
For example, "·" was being stored as `\xb7` which is not the valid UTF8.
2019-07-02 15:56:32 -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
6841e47aa4 chore(frontends/lean/builtin_exprs): remove support for (<infix>) and (<infix> <expr>) notations
In Lean 4, we will support the more general

`a + ·` ==> `fun x, a + x`
`· + b` ==> `fun x, x + b`
`· + ·` ==> `fun x y, x + y`
`f · y` ==> `fun x, f a y`
`g · · b` ==> `fun x y, g x y b`
2019-07-02 08:06:06 -07:00
Leonardo de Moura
ee2d3faa63 feat(library/init/lean/parser/parser): change optional p behavior
It ignores error only if `p` does not consume any input. This change
improves the quality of the error messages. The previous behavior can be
obtained by using `optional (try p)`.
2019-07-02 07:52:22 -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
13b5747713 fix(library/init/lean/parser/parser): prattParser 2019-07-01 16:00:58 -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
24647cb7cb fix(library/init/lean/parser/parser): better representation for many1 Syntax node 2019-06-30 09:02:06 -07:00
Leonardo de Moura
531ef5d700 feat(library/init/lean/parser): universe level parser and bug fixes 2019-06-30 09:02:06 -07:00
Leonardo de Moura
91e1d30cf8 feat(frontends/lean/builtin_exprs): use ; in do-notation 2019-06-27 18:00:43 -07:00
Leonardo de Moura
ab487ea4ac feat(frontends/lean): allow ; instead of in in let-decls 2019-06-27 17:12:03 -07:00
Leonardo de Moura
7049f4a889 feat(library/init/lean/class): register attributes and export functions 2019-06-27 13:27:13 -07:00
Leonardo de Moura
235b4c02c1 feat(library/init/lean/compiler/specialize): implement specExtension in Lean 2019-06-27 09:58:19 -07:00
Leonardo de Moura
4bc0346c17 chore(library/init/lean/compiler): specializeattrs.lean ==> specialize.lean 2019-06-27 09:38:21 -07:00
Leonardo de Moura
1a40a38bf1 feat(library/init/lean/class): add helper functions 2019-06-26 19:43:12 -07:00
Leonardo de Moura
14e6a62a19 feat(library/init/lean/class): class extension in Lean
TODO: declare attributes
2019-06-26 19:07:48 -07:00
Leonardo de Moura
f05df7c511 fix(library/init/lean/compiler/ir/simpcase): missing optimization 2019-06-26 19:07:07 -07:00
Leonardo de Moura
14f05d2001 feat(library/init/lean/compiler): register [implementedBy] attribute using new attribute manager 2019-06-26 15:55:51 -07:00
Leonardo de Moura
1f53c4fd33 feat(library/init/lean/eqncompiler): register [matchPattern] attribute using new attribute manager 2019-06-26 15:38:14 -07:00
Leonardo de Moura
3a1aff1687 feat(library/init/lean/compiler): register [specialize] and [nospecialize] attributes using new attribute manager 2019-06-26 15:08:12 -07:00
Leonardo de Moura
e6e71a1f79 chore(init/lean/compiler): inline.lean ==> inlineattrs.lean 2019-06-26 14:10:00 -07:00
Leonardo de Moura
105ca4f76b feat(library/init/lean/compiler/inline): use EnumAttributes to declare inlining attributes 2019-06-26 14:01:30 -07:00
Leonardo de Moura
e00dc873a8 chore(library/pattern_attribute): [pattern] ==> [matchPattern] 2019-06-26 11:26:49 -07:00
Leonardo de Moura
5cfdd2452a chore(library/init/lean/compiler/externattr): remove unnecessary [export] annotations 2019-06-26 11:06:38 -07:00
Leonardo de Moura
16d423dab6 feat(frontends/lean): switch to [extern] implemented in Lean
This commit also changes how we represent attribute parameters as
Syntax objects.
2019-06-26 10:57:33 -07:00
Leonardo de Moura
c7597b8975 fix(library/init/lean/syntax): typo at isNatLit 2019-06-26 10:48:47 -07:00
Leonardo de Moura
64ee4e01a8 refactor(library/init/lean/attributes): split getParam into getParam and afterSet 2019-06-26 10:09:57 -07:00
Leonardo de Moura
be6ca5ba30 feat(library/init/lean/compiler/externattr): @[extern] attribute in Lean 2019-06-26 08:42:57 -07:00
Leonardo de Moura
0e86ae7a8c feat(library/init/lean): projection info in Lean 2019-06-26 07:57:10 -07:00
Leonardo de Moura
7ca4607ef3 chore(library/init/lean): move name_mangling.lean to compiler directory 2019-06-26 07:05:23 -07:00
Leonardo de Moura
2c39ecdbff chore(library/init/lean/disjoint_set): remove dead code 2019-06-26 06:30:24 -07:00
Leonardo de Moura
5148497e8c feat(library/init/lean/compiler/externattr): add mkExternAttr skeleton 2019-06-25 13:16:11 -07:00