lean4-htt/tests
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
..
bench fix: Task: make reference and -j0 semantics eager, simplify 2020-09-14 17:57:33 +02:00
compiler fix: Task: make reference and -j0 semantics eager, simplify 2020-09-14 17:57:33 +02:00
elabissues chore: fix syntax 2020-05-21 09:57:35 -07:00
ir chore(tests): fix do syntax in tests 2019-06-30 13:04:34 +02:00
lean test: String interpolation 2020-09-20 18:11:19 -07:00
playground test: final webserver demo 2020-06-25 10:48:38 +02:00
plugin chore: remove comment from Linter 2020-06-17 21:28:03 -07:00
.gitignore chore: move bin/ and .oleans into build directory 2020-05-14 14:47:54 +02:00
common.sh test: ignore \r when diffing 2020-09-15 09:32:00 -07:00