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

Allow extra spaces between record field name and type signature (fixes #118) #126

Merged
merged 1 commit into from
Apr 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## x.x.x - unreleased

- Fix regression: allow extra spaces between record field and type signature
([#118](https://github.com/JustusAdam/language-haskell/issues/118))

## 3.0.0 - 26.04.2020

- Integrated several contributions from [@robrix](https://github.com/robrix)
Expand Down
2 changes: 1 addition & 1 deletion syntaxes/haskell.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ repository:
(?x)
([\p{Ll}_][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*)
(?:\s*,\s*([\p{Ll}_][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*))*
\s(::|∷)
\s+(::|∷)
end: ',|(?=})'
beginCaptures:
'1': {name: variable.other.definition.field.haskell}
Expand Down
11 changes: 6 additions & 5 deletions test/syntax-examples/test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,16 @@ then' = 0

data Data = Data { foo :: Int, bar :: Int }
data Data = Data {
foo :: Int, bar :: Int
foo :: Int, bar :: Int -- comment
}
data Data = Data {
foo :: Int,
bar :: Int
foo :: Int, -- comment1
bar :: Int -- comment2
}
data Data = Data {
foo :: Int
, bar :: Int
foos :: Int -- comment1
, bars :: Int -- comment2
, baz :: Int -- comment3
}

-- GADT's
Expand Down