haskell / haskell/cabal

Parsing: Negate the condition when `if` branch is empty.

Open
#6,189 0 comments 0 reactions 0 assignees View on GitHub
Cabal: parser type: discussion type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

I.e. parse

```cabal
if flag(some-condition)
buildable: True
else
buildable: False
```

as

```cabal
if !flag(some-condition)
buildable: False
```

And / Or: issue warning if this is the case, so `.cabal` file can be edited by author.

---

Motivation: is that the above would be pretty printed as

```cabal
if flag(some-condition)
else
buildable: False
```

which is ugly.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.