Skip to content

Commit

Permalink
[Haskell] Rewrite Haskell syntax (sublimehq#2225)
Browse files Browse the repository at this point in the history
* [Haskell] Rewrite operator matching

- Use variables
- Highlight '*' (and combinations) as operator
- Add punctuation scope to infix notation
- Scope non-infix notation as `keyword.operator`

* [Haskell] Update keyword matching

- Add proper scopes to control keywords
- Add proper scopes to declarations
- Use proper scope names for entities in declarations

* [Haskell] Restructure with contexts

* [Haskell] Remove usages of double quoted scalars

* [Haskell] Simplify string matches

Also highlight superfluous characters.

* [Haskell] Reduce max line length

* [Haskell] Match groups

* [Haskell] Adjust scopes for imports

Not final due to sublimehq#1842 being
unresolved, but still an improvement.

* [Haskell] Match lists

* [Haskell] Correctly match idents with trailing '

* [Haskell] More gracious infix operator matching

* [Haskell] Adjust keyword scopes to recent standards

* [Haskell] match OPTIONS_HADDOCK

Same as https://github.com/sublimehq/Packages/pull/2270/files

* [Haskell] match deriving (..) via (..)

Same as https://github.com/sublimehq/Packages/pull/2271/files

* [Haskell] match @ and # in keyword.operator.haskell

Same as
- https://github.com/sublimehq/Packages/pull/2272/files
- https://github.com/sublimehq/Packages/pull/2273/files


Co-Authored-By: Nikos Baxevanis <[email protected]>

* [Haskell] match deriving instance (..)

* [Haskell] Match functions from the prelude

Based on https://github.com/atom-haskell/language-haskell/blob/e036e449909816e616b880157e2703e70fc9b5df/grammars/haskell.cson#L1306-L1307

Co-Authored-By: Nikos Baxevanis <[email protected]>

* [Haskell] Add tests for `via` derives

* [Haskell] match deriving instance (..) without breaking data deriving

This fixes a bug introduced via 0d36dd1

Co-authored-by: Nikos Baxevanis <[email protected]>
  • Loading branch information
2 people authored and mitranim committed Mar 20, 2022
1 parent 02e8bce commit cceedd7
Show file tree
Hide file tree
Showing 2 changed files with 449 additions and 130 deletions.
Loading

0 comments on commit cceedd7

Please sign in to comment.