Skip to content

Commit

Permalink
[Haskell] Fix multi-line strings
Browse files Browse the repository at this point in the history
Fixes #2918
  • Loading branch information
deathaxe committed Jul 28, 2021
1 parent a5e05e9 commit d0c5d31
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Haskell/Haskell.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,18 @@ contexts:
3: constant.character.escape.octal.haskell
4: constant.character.escape.hexadecimal.haskell
5: constant.character.escape.control.haskell
- match: (\\)\s*$
captures:
1: punctuation.separator.continuation.haskell
push: linteral-string-continuation

linteral-string-continuation:
- meta_include_prototype: false
- match: \\
scope: punctuation.separator.continuation.haskell
pop: 1
- match: (?=")
pop: 1

###[ KEYWORDS AND OPERATORS ]##################################################

Expand Down
8 changes: 8 additions & 0 deletions Haskell/tests/syntax_test_haskell.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3859,6 +3859,14 @@ main = do
-- ^ punctuation.definition.string.end.haskell
-- ^ keyword.operator.haskell

"This is a\
-- ^^^^^^^^^^^^ meta.string.haskell string.quoted.double.haskell
-- ^ punctuation.separator.continuation.haskell
\multi-line string literal\
\example"
-- ^^^^^^^^^ meta.string.haskell string.quoted.double.haskell
-- ^ punctuation.separator.continuation.haskell
-- ^ punctuation.definition.string.end.haskell

-- [ INFIX OPERATORS ] --------------------------------------------------------

Expand Down

0 comments on commit d0c5d31

Please sign in to comment.