Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indented root layout not supported? #56

Open
postsolar opened this issue Mar 1, 2024 · 4 comments
Open

Indented root layout not supported? #56

postsolar opened this issue Mar 1, 2024 · 4 comments

Comments

@postsolar
Copy link

postsolar commented Mar 1, 2024

module M where

  i :: Int
  i = 1

purs-tidy check src/M.purs replies with

Some files have errors:

/home/me/purs-test/src/M.purs:
  [6:1] Unexpected end of file
@JordanMartinez
Copy link
Contributor

I'm pretty sure that's just invalid syntax. Top-level declarations cannot be indented.

@postsolar
Copy link
Author

@garyb
Copy link
Collaborator

garyb commented Mar 1, 2024

This syntax was definitely supported originally because we allowed multiple modules per file, so you'd have like

module X where

  def1 :: ...

module Y where

  def2 :: ...

so it may have been preserved since then in the main compiler.

@natefaubion
Copy link
Owner

I wouldn't recommend writing code this way as it's completely unnecessary (I personally think some kind of syntax error is appropriate), but if the main compiler supports it, we probably should as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants