Skip to content

Commit

Permalink
[Haskell] Rewrite Haskell syntax (#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 #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 <nikos.baxevanis@gmail.com>

* [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 <nikos.baxevanis@gmail.com>

* [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 <nikos.baxevanis@gmail.com>
  • Loading branch information
FichteFoll and moodmosaic committed Jul 21, 2020
1 parent 3ee86e4 commit 3a5b387
Show file tree
Hide file tree
Showing 2 changed files with 449 additions and 130 deletions.

0 comments on commit 3a5b387

Please sign in to comment.