Commit graph

9 commits

Author SHA1 Message Date
Leonardo de Moura
db9e390b4d chore: remove new_frontend from tests 2020-10-25 09:16:38 -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
c005a9375a chore: remove workarounds 2020-10-08 16:50:59 -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
4fae8588fd test: optional ';' 2020-09-28 17:11:00 -07:00
Leonardo de Moura
a0a724ddbd fix: tests and elabDo 2020-09-26 19:12:01 -07:00
Leonardo de Moura
5fa8d9105e feat: add if and for for do blocks 2020-09-26 18:03:53 -07:00
Leonardo de Moura
6a90fbf855 test: String interpolation
@Kha I wrote this extended test using the new frontend. The new
frontend worked great. I only had a minor issue with `#exit`.
The example uses `let rec`, parsers, macros, lift-method notation, etc.
It implements the new parser `strInterpolant p` for string
interpolation. The parser `p` is used to process the elements inside
`{...}`. Then, I use this parser to implement the macro `toString!`.
Example: `toString! "1+2 = {1+2}"` produces `"1+2 = 3"`.
Even the new "lift-method" notation works inside the string interpolant.
```lean
def g (x : Nat) : StateRefT Nat IO Nat := do
modify (· + x);
get

def ex : StateRefT Nat IO Unit := do
IO.println $ toString! ">> hello {(<- g 1)}";
IO.println $ toString! ">> world {(<- g 1)}";
pure ()
```
2020-09-20 18:11:19 -07:00