Leonardo de Moura
295cabed2e
chore(library/init): remove unnecessary notations
2019-07-11 10:27:16 -07:00
Leonardo de Moura
c00788a982
fix(library/init/lean/compiler/ir/emitcpp): header of big boxed functions
2019-07-08 21:52:01 -07:00
Leonardo de Moura
324a053f4c
fix(library/init/lean/compiler/ir/resetreuse): bug at Dmain
2019-07-08 20:37:54 -07:00
Leonardo de Moura
1a81d60820
chore(frontends/lean/parser): simplify binder notation
...
The `<ident> : <expr>` now requires explicit brackets.
2019-07-08 08:54:19 -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
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
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
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
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
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
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
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
7ca4607ef3
chore(library/init/lean): move name_mangling.lean to compiler directory
2019-06-26 07:05:23 -07:00
Leonardo de Moura
5148497e8c
feat(library/init/lean/compiler/externattr): add mkExternAttr skeleton
2019-06-25 13:16:11 -07:00
Leonardo de Moura
5188eb2d3b
feat(library/init/lean/compiler/externattr): decode [extern ...] parameters
2019-06-25 12:05:34 -07:00
Leonardo de Moura
aa111df0ec
feat(library/init/lean/syntax): add Syntax.isIdOrAtom
2019-06-25 11:20:31 -07:00
Leonardo de Moura
2e01ac508a
feat(library/init/lean/syntax): primitives for creating and testing string and nat literals
2019-06-25 10:39:23 -07:00
Leonardo de Moura
1ff6ee3155
feat(library/init/lean/attributes): allow getParam at ParametricAttribute registration to update environment
2019-06-25 09:15:55 -07:00
Leonardo de Moura
70a1589817
refactor(library/init/lean): move extern.lean to compiler subdirectory
2019-06-25 08:59:55 -07:00
Leonardo de Moura
45dc2cd49a
feat(library/init/lean/compiler): [export] attribute in Lean
2019-06-24 15:48:12 -07:00
Leonardo de Moura
94bca2b9d8
chore(library/init): mimize use of notations
2019-06-24 15:48:11 -07:00
Leonardo de Moura
dda0e38802
chore(library/init): avoid local notation
2019-06-24 15:48:11 -07:00
Leonardo de Moura
bc9e460f62
fix(library/init/lean/compiler/ir): collectUsedDecls must take initialization functions into account
...
Move builtin parser level to its own directory
2019-06-21 13:34:42 -07:00
Leonardo de Moura
0b99a18f97
chore(library): use >> as notation for andthen
...
We have other plans for `;`.
2019-06-20 09:54:53 -07:00
Leonardo de Moura
697f69020f
fix(library/init/lean/parser/parser): new registerBuiltinParserAttribute
...
It is still broken since we apply attributes before we compile code.
Recall that attributes such as `@[export]` and `@[extern]` must be applied before we
compile code.
On the other hand, any attribute `attrName`
```
@[attrName] def foo := ...
```
which creates auxiliary definitions that depend on `foo` must be applied
AFTER we generate code for `foo`. Otherwise, we will fail to compile the
auxiliary definition since we don't have code for `foo` yet.
I will fix the issue above by allowing attributes to specify when they
should be applied. I will start with only two options: before and after
code compilation. In the future, we may need more options (e.g., before
elaboration), but I don't see the need yet.
cc @kha
2019-06-19 09:52:56 -07:00
Leonardo de Moura
08cdb757b4
feat(library/init/lean/environment): add Environment.addAndCompile
...
To fix `BuiltinParserAttribute`, we need to be able to add auxiliary declarations programmatically.
2019-06-18 18:20:17 -07:00
Leonardo de Moura
0dfca42f6d
chore(library/init/lean/compiler/initattr): remove unnecessary @[export]
2019-06-18 16:15:48 -07:00
Leonardo de Moura
6219a2277a
fix(library/init/lean/compiler/initattr): getInitFnNameFor
2019-06-18 16:03:52 -07:00
Leonardo de Moura
696088cf2e
feat(library/init/lean/compiler/initattr): @[init] attribute in Lean
2019-06-18 16:03:52 -07:00
Leonardo de Moura
a03c236380
feat(library/init/lean/compiler/initattr): new @[init] attribute validation
2019-06-18 15:40:16 -07:00
Leonardo de Moura
91821529c0
feat(library/init/lean/compiler/initattr): register new @[init] attributre using new attribute manager
...
This is just the basic skeleton for testing
2019-06-18 15:20:17 -07:00
Leonardo de Moura
f176a7963c
feat(library/init/lean/compiler/ir/emitcpp): register arity 0 declarations
2019-06-07 17:15:16 -07:00
Leonardo de Moura
c3a7cc4617
feat(library/init/lean/compiler/ir/emitcpp): register functions
2019-06-07 15:34:55 -07:00
Leonardo de Moura
b292fc13cc
chore(library/init/lean/compiler/inline): export typo
2019-06-06 15:28:20 -07:00
Leonardo de Moura
9b457cc77c
feat(library/init/lean/compiler/inline): implement tester functions and export them
2019-06-06 15:07:08 -07:00
Leonardo de Moura
72290483e4
chore(library/init/lean/compiler): attributes.lean ==> inline.lean
2019-06-06 14:08:13 -07:00
Leonardo de Moura
e05cdc2b08
feat(library/init/lean/compiler): declare function inlining attributes in Lean
...
Remark: they are not active yet since we haven't removed the ones
defined in C++ yet.
2019-06-06 11:05:54 -07:00
Leonardo de Moura
89ab07a4b0
refactor(library/init/lean/environment): more flexible PersistentEnvExtensionState
...
The previous API was not flexible enough to implement the new
`AttributeManager` with all "bells and whistles" we want.
For example, the new `addImportedFn` field allows us to initialize
the state for the imported entries using a `Thunk`.
2019-06-04 16:35:21 -07:00
Leonardo de Moura
0a08569b46
feat(library/init/lean/environment): remove lazy, add addImported field to PersistentEnvExtension
...
It seems `lazy := false` is only going to be used in the attribute
manager. So, I remove it. I added a new field `addImported : Bool`
instead. An extension can specify whether `addEntryFn` is going to be
invoked or not for imported entries. `addImported := false` is useful for extensions such
as `protected`, and I will use it in the attribute manager too.
2019-06-03 16:45:27 -07:00
Leonardo de Moura
8d913e382d
feat(library/init/lean/compiler/constfolding): fold Nat.pow, UInt*.toNat and USize.toNat
2019-06-01 10:28:04 -07:00