Skip to content

Commit

Permalink
Fixed deprecation pragma
Browse files Browse the repository at this point in the history
Closes #112
  • Loading branch information
JustusAdam committed Apr 21, 2020
1 parent 855fab4 commit 8b4b935
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Highlight `INLINEABLE` pragmas ([#107](https://github.com/JustusAdam/language-haskell/pull/107))
- Highlight `COLUMN` pragmas ([#107](https://github.com/JustusAdam/language-haskell/pull/107))
- Fixed highlighting for multi line type aliases ([#111](https://github.com/JustusAdam/language-haskell/issues/111))
- Fixed highlighting of string literals in deprecation pragmas ([#112](https://github.com/JustusAdam/language-haskell/issues/112))

## 2.7.0 - 29.12.2019

Expand Down
11 changes: 10 additions & 1 deletion syntaxes/haskell.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,21 @@ repository:
patterns:
- match: >-
(?x)
\b(LANGUAGE|OPTIONS_GHC|INCLUDE|WARNING|DEPRECATED
\b(LANGUAGE|OPTIONS_GHC|INCLUDE|WARNING
|MINIMAL|UNPACK|SPECIALISE|OVERLAPS|INCOHERENT
|NOUNPACK|SOURCE|OVERLAPPING|OVERLAPPABLE|INLINE
|NOINLINE|INLINE?ABLE|CONLIKE|LINE|COLUMN|RULES
|SPECIALIZE|COMPLETE)\b
name: keyword.other.preprocessor.haskell
- begin: '\b(DEPRECATED)\b'
beginCaptures:
'1': {name: keyword.other.preprocessor.haskell}
end: '(?=#-\})'
name: deprecated.pragma
applyEndPatternLast: 1
patterns:
- {include: '#string_literal'}

data_constructor:
match: >-
\b[\p{Lu}\p{Lt}][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*(?!\.)\b
Expand Down
3 changes: 3 additions & 0 deletions test/syntax-examples/test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ anotherFunc arg = do
; let thing = 5
; return 8
}

-- Tests the string literal in the deprecation pragma, should be the same as other string literals.
{-# DEPRECATED "Test string" #-}

data Handler a b c

Expand Down

0 comments on commit 8b4b935

Please sign in to comment.