haskell / haskell/vscode-haskell-syntax-highlighting

Repeated Haskell-style comments in Happy quotations are treated as comments

Open
#207 3 comments 1 reaction 0 assignees View on GitHub
enhancement wontfix
Dominant language
Haskell
Stars
109
Forks
51
Avg merge
3d 8h
Merged PRs (30d)
2

Description

To take a few lines out of [GHC's `Parser.y`](https://github.com/ghc/ghc/blob/584cd5ae200866fbfb480fab9591f0acf94a8033/compiler/GHC/Parser.y#L623) (because it's where I'm facing this error), consider the following code:

```
'{-# INLINE' { L _ (ITinline_prag _ _ _) } -- INLINE or INLINABLE
'{-# SPECIALISE' { L _ (ITspec_prag _) }
'{-# SPECIALISE_INLINE' { L _ (ITspec_inline_prag _ _) }
```

While the syntax highlighting continues correctly for the line containing `'{-# INLINE'`, the subsequent opening comment is interpreted as an actual comment, rather than as the use of the syntax within a literal token, and leads to the rest of the file being treated as a comment.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with the quoted lines from GHC's Parser.y, especially the repeated Haskell-style comments inside the literal tokens. Start by examining how the VS Code Haskell syntax highlighting handles the quotation, and verify that the subsequent opening comment no longer causes the rest of the file to be treated as a comment.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell, vscode
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.