Commit graph

8 commits

Author SHA1 Message Date
Kyle Miller
d39b0415f0
feat: enable pp.fieldNotation.generalized globally (#3744)
Sets the default value to `pp.fieldNotation.generalized` to `true`.
Updates tests, and fixes some minor flaws in the implementation of the
generalized field notation pretty printer.

Now generalized field notation won't be used for any function that has a
`motive` argument. This is intended to prevent recursors from pretty
printing using it as (1) recursors are more like control flow structures
than actual functions and (2) generalized field notation tends to cause
elaboration problems for recursors.

Note: be sure functions that have an `@[app_unexpander]` use
`@[pp_nodot]` if applicable. For example, `List.toArray` needs
`@[pp_nodot]` to ensure the unexpander prints it using `#[...]`
notation.
2024-03-23 02:38:09 +00:00
Gabriel Ebner
230d6d2cf5 fix: use group for if-then-else 2021-12-15 11:42:38 +00:00
Gabriel Ebner
b905824024 chore: fix tests 2021-12-15 11:42:38 +00:00
Sebastian Ullrich
1dfacb5f84 fix: parenthesizer: respect lhsPrec
Fixes #595
2021-08-03 15:22:08 +02:00
Daniel Selsam
c3d62c1076 chore: patch tests for pp.analyze default 2021-08-03 09:13:18 +02:00
Leonardo de Moura
769e3a9082 chore: fix test 2021-02-28 16:38:04 -08:00
Leonardo de Moura
ac51d3e621 feat: eager coe expansion 2021-02-14 11:34:08 -08:00
Leonardo de Moura
87207030ce test: pretty printing if-then-else
@Kha We will probably have to write a handwritten formatter in the
future. The new test shows some limitations with `do`, `else if`, ...
where we want the output
```
      if x == 0 then do
        IO.println "foo"
        IO.println "zero"
      else if x % 2 == 0 then do
        IO.println x
        IO.println "even"
      else do
        IO.println x
        IO.println "odd"
```
2020-12-24 08:40:30 -08:00