Leonardo de Moura
f80345a6d4
chore: move tests to new frontend
2020-10-10 07:41:04 -07:00
Leonardo de Moura
fb2fea2744
fix: explicit syntax kind in macro_rules
2020-10-10 06:42:45 -07:00
Leonardo de Moura
6a808540d5
chore: remove macro println!
2020-10-09 20:53:44 -07:00
Leonardo de Moura
9538772c1c
chore: do not use string interpolation by default at dbgTrace!
...
It is nice to be able to write `dbgTrace! x` instead of `dbgTrace! "{x}"`
2020-10-09 20:49:39 -07:00
Leonardo de Moura
be252743b3
feat: add string interpolation for MessageData
2020-10-09 20:43:26 -07:00
Leonardo de Moura
b4ef8de1a5
test: new frontend tests
2020-10-09 18:21:45 -07:00
Leonardo de Moura
bca81714fe
feat: println! and dbgTrace! macros with string interpolation
2020-10-09 17:19:04 -07:00
Leonardo de Moura
ef27af9cf8
test: string interpolation
2020-10-09 17:02:12 -07:00
Leonardo de Moura
51dc10dd93
feat: array slicing notation
2020-10-09 16:40:18 -07:00
Leonardo de Moura
5a40d9eb13
feat: add Subarray
2020-10-09 16:06:24 -07:00
Leonardo de Moura
749e2063cf
feat: add interpolated string for toString
2020-10-09 14:38:24 -07:00
Leonardo de Moura
6020e6682a
feat: process interpolatedStr in the elaborator
2020-10-09 14:18:45 -07:00
Leonardo de Moura
70ec458fde
test: new frontend
2020-10-09 13:20:04 -07:00
Leonardo de Moura
650bd95ab9
feat: add efficient Array.forIn
2020-10-09 13:07:20 -07:00
Leonardo de Moura
0b81ffb569
refactor: factor out nested do term support and document code
...
We currently use the nested `do` terms for two combinators: `catch`
and `finally`. We may want to support more in the future.
2020-10-09 11:59:14 -07:00
Leonardo de Moura
f6fffc9532
test: monad stack with multiple ExceptT
...
cc @Kha :)
2020-10-08 19:53:12 -07:00
Leonardo de Moura
8a6cb1842f
feat: expand doTry
...
@Kha I did not implement support for reassignments and `continue`,
`break`, `return` inside the `finally` clause. It is doable, but it
feels like unnecessary complexity. We currently don't have any
instance in our code base where this would be useful.
2020-10-08 19:39:36 -07:00
Leonardo de Moura
c005a9375a
chore: remove workarounds
2020-10-08 16:50:59 -07:00
Leonardo de Moura
a31595bda5
feat: add doElem.quot elaboration function
2020-10-08 13:50:25 -07:00
Leonardo de Moura
a3a5190004
feat: expand doElem macros
2020-10-08 13:42:56 -07:00
Leonardo de Moura
608de7b592
feat: expand doReassignArrow
2020-10-08 13:31:27 -07:00
Leonardo de Moura
3694936b7d
test: doHave test
2020-10-08 12:11:07 -07:00
Leonardo de Moura
09dcf718c1
feat: expand doHave
2020-10-08 11:56:03 -07:00
Leonardo de Moura
d7ec398b28
test: new do notation
2020-10-07 17:55:38 -07:00
Leonardo de Moura
91aaab9e0d
fix: error message location
2020-10-07 17:43:23 -07:00
Leonardo de Moura
d9d8e95987
feat: elaborate doElems at doLetArrow
...
@Kha The Rust `let+return` example works in Lean too :)
The Rust function
```rust
fn f (x : i32) -> i32 {
let y = if x == 0 { println!("x is zero"); return 100 } else { x + 1 };
println!("y: {}", y)
y
}
```
The Lean version is
```lean
def f (x : Nat) : IO Nat := do
let y ← if x == 0 then IO.println "x is zero"; return 100 else pure (x + 1)
IO.println ("y: " ++ toString y)
return y
```
The main missing feature now is the `try-catch-finally` `do` element.
2020-10-07 17:30:25 -07:00
Leonardo de Moura
ac07999e95
chore: cleanup do expander, and make sure it can handle the "easy" doLetArrows
2020-10-07 17:00:07 -07:00
Leonardo de Moura
5b76155318
feat: new return semantics
...
`return e` is not equivalent to `pure e` anymore.
Now, `return e` means "return value `e` as the result of the root `do` block".
2020-10-07 14:07:58 -07:00
Leonardo de Moura
e70dd03340
chore: remove forInMap
2020-10-07 10:01:04 -07:00
Leonardo de Moura
ac1c0714a1
fix: expand macros in patterns before retrieving pattern variables
2020-10-07 09:15:05 -07:00
Sebastian Ullrich
be7a3b76eb
feat: Format.fill
2020-10-07 15:30:36 +02:00
Sebastian Ullrich
df16221013
fix: Format.be: properly re-evaluate flattening after hard line break
2020-10-07 11:03:44 +02:00
Sebastian Ullrich
f0dad079ad
fix: checkWsBefore.formatter
2020-10-07 10:01:17 +02:00
Sebastian Ullrich
064c9b2e0b
chore: binder spacing
2020-10-07 09:46:47 +02:00
Sebastian Ullrich
6c25717377
test: can finally reparse pretty-printed Core.lean
2020-10-07 09:46:47 +02:00
Sebastian Ullrich
3030c1ef7a
fix: Format.merge
2020-10-07 09:44:04 +02:00
Sebastian Ullrich
5d76a981b0
chore: adjust pp spacing
2020-10-07 09:44:04 +02:00
Sebastian Ullrich
c3ebb6ad1f
fix: Format.group ignored preceding content on line
2020-10-07 09:43:05 +02:00
Leonardo de Moura
294a750110
feat: expand doMatch
2020-10-06 19:07:47 -07:00
Leonardo de Moura
f4ccb78014
feat: improve tryPureCoe? and document its limitations
2020-10-06 17:41:45 -07:00
Leonardo de Moura
608ae62aef
chore: use pure
...
We are planning to change the meaning of `return`
2020-10-06 15:53:53 -07:00
Leonardo de Moura
cda4de474b
fix: weird error message in do notation
...
cc @Kha
2020-10-06 15:12:55 -07:00
Leonardo de Moura
db1b110f7e
fix: use let* to avoid bad error messages in do notation
...
cc @Kha
2020-10-06 15:01:05 -07:00
Leonardo de Moura
82dad3c86f
feat: add Code.returnAction
2020-10-06 13:19:55 -07:00
Leonardo de Moura
5110b1212d
test: do notation error messages
2020-10-06 11:35:44 -07:00
Leonardo de Moura
13591e59d5
chore: improve regular 'for' error message
2020-10-06 11:30:14 -07:00
Leonardo de Moura
760b658d19
chore: suppress extraMsg in type mismatch errors
2020-10-06 10:58:50 -07:00
Leonardo de Moura
0ce6ac4267
chore: fix error messages
2020-10-06 10:52:04 -07:00
Leonardo de Moura
7f5b454382
chore: improve for type mismatch error message
2020-10-06 10:50:03 -07:00
Leonardo de Moura
5cabc917f5
chore: improve error message
2020-10-06 10:45:12 -07:00