Can't handle INLINE pragma on the first line of a where clause #20
Labels
No Label
blocked: dependency
blocked: info-needed
bug
duplicate
enhancement
fixed in HEAD
help wanted
hs:arrows
hs:brackets
hs:classes
hs:comments
hs:do-notation
hs:guards
hs:lists
hs:operators
hs:patterns
hs:records
hs:types
invalid
language extension support
layouting
needs confirmation
priority: high
priority: low
question
revisit before next release
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: hexagoxel/brittany#20
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
This works fine:
This causes brittany to die with "ERROR: brittany pretty printer returned syntactically invalid result."
it boils down to this being a syntax error:
which I did not anticipate. Pragmas don't count as comments and affect the layouting-rule? Pragmas count as comments but still affect the layouting-rule? I'll have to consult the report for this,,
(The fact that the pragma is placed there in the output might be a minor error nonetheless, I'll have to look into this. Perhaps I can tweak the where-clause-layouting to get rid of this.)
(2010 report)
Well.. syntax error vs no syntax error does count as a change in semantics, doesn't it, heh.
Then it certainly seems like a bug in GHC that this is a syntax error;
should probably just be a warning like "Warning: incorrect indentation
invalidating INLINE pragma."
On Sun, Apr 9, 2017 at 5:58 PM Lennart Spitzner notifications@github.com
wrote:
for those curious, my current understanding regarding pragmas: they are like optional keywords. the compiler is free to interpret them either as comments (ignore them, effectively) or consider them like keywords including corresponding lexical/syntactical "powers". giving them a lexical look similar to comments has two advantages: 1) compiler implementors are free to ignore that part and have them treated as comments 2) adding new pragmas is much less of an issue than adding new keywords to the language.
this is not very clear in the 2010 report, but with this understanding the above error itself (from ghc) is valid.