Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
P
purty
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 23
    • Issues 23
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 2
    • Merge Requests 2
  • CI / CD
    • CI / CD
    • Pipelines
    • Schedules
  • Registry
    • Registry
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • Hardy Jones
  • purty
  • Issues
  • #58

Closed
Open
Opened Jun 22, 2018 by Liam Goodacre@LiamGoodacre
  • Report abuse
  • New issue
Report abuse New issue

Syntax error with `if` expression in `do`

When encountering an if expression, the following formatting is used:

★ purty <( echo "module X where foo = if true then 0 else 1" )
module X where

foo = if true then
        0
      else
        1

However the same formatting is used when in a do block, which is a syntax error:

★ purty <( echo "module X where foo = do if true then 0 else 1" )
module X where

foo = do
    if true then
      0
    else
      1

Compile error:

Unable to parse module:
  expecting indentation past column 5 or operator

Related issues

Assignee
Assign to
Release 2018-07-03
Milestone
Release 2018-07-03
Assign milestone
Time tracking
None
Due date
No due date
1
Labels
bug
Assign labels
  • View project labels
Reference: joneshf/purty#58