Indentation of case-of when not in indentation-sensitive block #232

Open
opened 2019-06-05 21:16:23 +02:00 by lspitzner · 0 comments
lspitzner commented 2019-06-05 21:16:23 +02:00 (Migrated from github.com)

from the current test-cases:

#test nonempty-case-long
func =
  case
      lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
        lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
    of
      False -> False
      True  -> True

#test nonempty-case-long-do
func = do
  case
      lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
        lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
    of
      False -> False
      True  -> True

For do we obviously need this indentation behaviour, otherwise syntax error. But for contexts where we are allowed to "stay on the current column", this would be nicer:

func =
  case
    lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
      lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
  of
    False -> False
    True  -> True

unfortunately, afaict, this is a problem in the DSL implementation, not in the layouter. Will involve some digging.

from the current test-cases: ~~~~ #test nonempty-case-long func = case lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd of False -> False True -> True #test nonempty-case-long-do func = do case lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd of False -> False True -> True ~~~~ For `do` we obviously need this indentation behaviour, otherwise syntax error. But for contexts where we are allowed to "stay on the current column", this would be nicer: ~~~~ func = case lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd of False -> False True -> True ~~~~ unfortunately, afaict, this is a problem in the DSL implementation, not in the layouter. Will involve some digging.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: hexagoxel/brittany#232
There is no content yet.