-
Notifications
You must be signed in to change notification settings - Fork 591
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
[Haskell] Rewrite Syntax #2679
Merged
BenjaminSchaaf
merged 180 commits into
sublimehq:master
from
deathaxe:pr/haskell/rewrite-syntax
Feb 2, 2022
Merged
[Haskell] Rewrite Syntax #2679
Changes from 1 commit
Commits
Show all changes
180 commits
Select commit
Hold shift + click to select a range
f6e6c8d
[Haskell] Fix comments
deathaxe dc7b6da
[Haskell] Fix comments in strings
deathaxe 7ccb72c
[Haskell] Add meta.string
deathaxe 2a56101
[Haskell] Scope character literals
deathaxe 709f33d
[Haskell] Fix comments in imports
deathaxe 390ee8d
[Haskell] Fix illegal infix operator highlighting
deathaxe 4bf8b22
[Haskell] Allow space in infix operators
deathaxe 513e00b
[Haskell] Fix identifier patterns
deathaxe 2e4c0be
[Haskell] Fix arrow operator in class definition
deathaxe bc3ee6e
[Haskell] Create ident contexts
deathaxe e4e9ed5
[Haskell] Highlight C-style directive keywords
deathaxe 38bdd9c
[Haskell] Avoid capture groups
deathaxe 45c1bb5
[Haskell] Fix word break pattern
deathaxe df35af4
[Haskell] Tweak C-style directive keyword scope
deathaxe 044797e
[Haskell] Fix unit scope consistency
deathaxe 1ce1104
[Haskell] Fix test case
deathaxe 8b841d6
[Haskell] Add missing {{break}}
deathaxe 0babe57
[Haskell] Reorganize Comments
deathaxe b0eca6f
[Haskell] Reorganize preprocessor contexts
deathaxe 1fe8c90
[Haskell] Reorganize declaration contexts
deathaxe 78fd921
[Haskell] Tweak import identifier scopes
deathaxe f088fae
[Haskell] Reorganize export/import symbols
deathaxe 93d9847
[Haskell] Improve module declaration bailouts
deathaxe 3805d01
[Haskell] Reorganize type signatures context
deathaxe 70e438e
[Haskell] Reorganize groups and lists
deathaxe 06b5e30
[Haskell] Reorganize identifiers
deathaxe 8a7335e
[Haskell] Reorganize literals
deathaxe 26a367a
[Haskell] Reorganize keywords and operators
deathaxe 563aad6
[Haskell] Tweak reserved_id formatting
deathaxe f005107
[Haskell] Reorganize escape_chars variables
deathaxe 81b5f33
[Haskell] Rename statement and expression contexts
deathaxe bc4397d
[Haskell] Add statement terminators
deathaxe a9ddabb
[Haskell] Tweak import declarations
deathaxe f71e2f5
[Haskell] Move import declaration tests
deathaxe a7679ed
[Haskell] Scope import keywords `keyword.declaration.import`
deathaxe 2c4a6db
[Haskell] Opt-in to sublime-syntax version 2
deathaxe c147a0a
[Haskell] Replace pop: true by pop: 1
deathaxe 61f01b0
[Haskell] Add support for code blocks
deathaxe cda0a2c
[Haskell] Introduce else-pop context
deathaxe 5e2cff7
[Haskell] Fix floating point number scopes
deathaxe 4ba2b93
[Haskell] Fix derived statements
deathaxe 472b89a
[Haskell] Add preprocessor punctuation scopes
deathaxe a25e174
[Haskell] Refactor type signature contexts
deathaxe f0d9de2
[Haskell] Rename symbols sequence scope to tuple
deathaxe 2dc3ce3
[Haskell] Remove empty list special pattern
deathaxe f840f3b
[Haskell] Add type and newtype declaration statements
deathaxe c421583
[Haskell] Fix literal chars vs. operators
deathaxe 7477170
[Haskell] Tweak test case section headers
deathaxe ec6bdd9
[Haskell] Fix variable identifier
deathaxe fb0a700
[Haskell] Add some specification references
deathaxe 5fb982a
[Haskell] Fix list and tuple constructor highlighting
deathaxe 698812e
[Haskell] Highlight fully qualified identifiers
deathaxe 7387251
[Haskell] Fix exported module symbol
deathaxe 767ee05
[Haskell] Add expression type signatures
deathaxe c2e37b2
[Haskell] Fix test case indentation
deathaxe f7935fd
[Haskell] Fix default declaration statements
deathaxe 90f5a72
[Haskel] Fix deriving declaration statements
deathaxe 97fa8a0
[Haskell] Add some keyword boundary tests
deathaxe 00e6808
[Haskell] Add data declaration statements
deathaxe a6db194
[Haskell] Fix instance keyword scope
deathaxe 32c43a0
[Haskell] Reorganize identifier section
deathaxe 8cc9cca
[Haskell] Fix scope of where keyword
deathaxe 24c9cdd
[Haskell] Reorganize keywords
deathaxe 12c9510
[Haskell] Fix symbol and operator patterns
deathaxe dde2fc4
[Haskell] Fix empty and unicode character literals
deathaxe 5b59763
[Haskell] Reorganize newtype test cases
deathaxe d0d9e94
[Haskell] Improve class declaration
deathaxe da13ed3
[Haskell] Split import/export symbol lists
deathaxe 0923357
[Haskell] Remove where keyword from declaration scope
deathaxe 8174494
[Haskell] Tweak deriving contexts
deathaxe d59b3c3
[Haskell] Tweak block comment contexts
deathaxe 961e380
[Haskell] Scope builtin constants
deathaxe 98ef8e9
[Haskell] Improve preprocessor statements
deathaxe 0ea89c9
[Haskell] Add file extensions
deathaxe 58f51d6
[Haskell] Tweak function declaration
deathaxe f3e5aa9
[Haskell] Add instance declaration tests
deathaxe 16fabde
[Haskell] Fix type signatures
deathaxe 9cde06c
[Haskell] Improve default statement
deathaxe f528ad5
[Haskell] Add forall keyword highlighting
deathaxe 3324690
[Haskell] Rework Haskell Literate
deathaxe 3316d08
[Haskell] Improve type/newtype declarations
deathaxe 45b0b02
[Haskell] Add comment test case
deathaxe f1ecd86
[Haskell] Distinguish top-level declarations and statements
deathaxe 07b4fee
[Haskell] Add signature statements support
deathaxe 5aefbbf
[Haskell] Fix nested record field declarations
deathaxe 248fa1f
[Haskell] Remove ident-constants
deathaxe 6265cdc
[Haskell] Rename meta.name to variable.other
deathaxe 17027e0
[Haskell] Simplify `variable.other.generic-type` scope
deathaxe 223fd48
[Haskell] Fix comments in quoted strings
deathaxe d52aee6
[Haskell] Improve prelude types and variables
deathaxe b165519
[Haskell] Common module/import scopes
deathaxe d9cdfca
[Haskell] Add data family modifiers
deathaxe 216c5ba
[Haskell] Add foreign import/export statements
deathaxe 1ffff85
[Haskell] Restrict snippet scopes
deathaxe 1ccc027
[Haskell] Add class-block
deathaxe 7dd4d6c
[Haskell] Ensure reserved unicode operator scopes
deathaxe ff90c5e
[Haskell] Rework function declarations
deathaxe c2db046
[Haskell] Tweak type-content
deathaxe 2834555
[Haskell] Add extra bailouts to lists,groups,tuples
deathaxe 1fe1677
[Haskell] Simplify class declarations
deathaxe 8a2e904
[Haskell] Simplify data declarations
deathaxe 9547e81
[Haskell] Simplify derived() and via() statements
deathaxe 11bb4a3
[Haskell] Reorganize records contexts
deathaxe 0ee5f67
[Haskell] Simplify type declarations
deathaxe 6c452ec
[Haskell] Add tests to verify instance methods
deathaxe b336cfb
[Haskell] Distinguish type groups and type tuples
deathaxe 5e5eb0a
[Haskell] Simplify type signatures
deathaxe 0cd0335
[Haskell] Fix infix declarations
deathaxe 0318ada
[Haskell] Tweak quoted infix operators
deathaxe c6b1962
[Haskell] Add a sophisticated group test
deathaxe 7b16e70
[Haskell] Tweak module and import statements
deathaxe 2377fbe
[Haskell] Simplify quasi quotes
deathaxe 11a1de4
[Haskell] Rename type-content
deathaxe fd136b6
[Haskell] Rename variable-prefix from builtin_ to prelude_
deathaxe d41fffd
[Haskell] Merge sequence separator patterns
deathaxe 96f39e3
[Haskell] Add a note upon forall .
deathaxe c8ab692
[Haskell] Update Symbol Lists
deathaxe 8f0345a
[Haskell] Tidy up tmPreferences
deathaxe 7e67d13
[Haskell] Remove word separator settings
deathaxe 4b5c137
[Haskell] Fix module scope in export list
deathaxe f620c80
[Haskell] Tweak module declaration statement
deathaxe 4ab78dc
[Haskell] Scope Just/Left/Right as prelude type
deathaxe d065b66
[Haskell] Add some pattern/function binding tests
deathaxe cf8f67c
[Haskell] Add exported type test
deathaxe aa0890d
[Haskell] Limit constant scope in pragmas to OPTIONS
deathaxe 60f4683
[Haskell] Fix infix operators in parentheses
deathaxe 8395640
[Haskell] Add tests for `let` expressions
deathaxe 163d6a1
[Haskell] Add some real world function declaration tests
deathaxe 0c1f8c5
[Haskell] Highlight SPECIALIZE pragma values
deathaxe c793664
[Haskell] Scope exported symbols `entity.name.export`
deathaxe ffdfde9
[Haskell] Rework import statements
deathaxe 3c5e2ba
[Haskell] Add support for MagicHash
deathaxe 84d2566
[Haskell] Add operators to indexed reference list
deathaxe d182973
[Haskell] Add operator declarations to indexed symbol list
deathaxe a50a411
[Haskell] Tweak infix operators
deathaxe b79e737
[Haskell] Scope forall unicode keyword the same as its ascii counterpart
deathaxe c4c934c
[Haskell] Scope forall-expression terminator as punctuation
deathaxe 24a1674
[Haskell] Add exported operators to index
deathaxe 52d4e3b
[Haskell] Add missing builtin unboxed types
deathaxe 9f8db10
[Haskell] Add sql like list comprehension keywords
deathaxe 7d9bcd5
[Haskell] Add binary integer and hexadecimal float literals
deathaxe d67647d
[Haskell] Add support for underscore in numeric linterals
deathaxe 99f54a7
[Haskell] Add "Safe" pragma constant
deathaxe 35dc26b
[Haskell] Add safe imports
deathaxe 86ac6c5
[Haskell] Remove obsolete context
deathaxe 71ab1c5
[Haskell] Update pragma value highlighting
deathaxe a10d593
[Haskell] Add SPECIALIZE INLINE pragma support
deathaxe 3bc7535
[Haskell] Add SPECIALIZE instance pragma support
deathaxe 94f4931
[Haskell] Add COMPLETE pragma
deathaxe 06148ba
[Haskell] Add COLUMN pragma
deathaxe 8ea64da
[Haskell] Tweak symbol list and index definitions
deathaxe 55cdbf4
[Haskell] Tweak Pragma Directives
deathaxe d7e4862
[Haskell] Improve FFI capabilities
deathaxe cffa27d
[Haskell] Tweak specification comments
deathaxe cf5cfaa
[Haskell] Tweak prefix operators
deathaxe f6c2624
[Haskell] Tweak type definition identifier scopes
deathaxe 9deb528
[Haskell] Tweak data definition identifier scopes
deathaxe 411bed9
[Haskell] Fix data definition identifier context
deathaxe 7cb9118
[Haskell] Fix type definition identifier context
deathaxe 126e65b
[Haskell] Scope class/instance declaration identifiers
deathaxe 01624ba
[Haskell] Move tests to dedicated directory
deathaxe ed87ba6
[Haskell] Move `otherwise` to constants
deathaxe a464ec6
[Haskell] Scope fully qualified infix operators
deathaxe f16e3fc
[Haskell] Scope list and tuple constructors as constants
deathaxe 71c6f2e
[Haskell] Tweak scopes for empty tuples and lists
deathaxe a1af7c2
[Haskell] Scope :: as punctuation.separator.type
deathaxe c8c8a67
[Haskell] Scope => punctuation.separator.type.context
deathaxe 84e468d
[Haskell] Fix anonymous variables
deathaxe 5a24244
[Haskell] Fix lists vs. quasi-quotations
deathaxe 044d27a
[Haskell] Add "type family" support
deathaxe c1749cb
[Haskell] Fix identifiers directly after numbers
deathaxe f33ae52
[Haskell] Add GHC 9 LANGUAGE pragma values
deathaxe 7cd099f
[Haskell] Add profiling inline directives
deathaxe 1d64bac
[Haskell] Add more LANGUAGE flags
deathaxe ea2fce6
[Haskell] Add overloaded and typed quotations
deathaxe a5e05e9
[Haskell] Add first_line_match
deathaxe d0c5d31
[Haskell] Fix multi-line strings
deathaxe c6f01ca
[Haskell] Improve multi-line strings fix
deathaxe c4c0f53
Merge branch 'master' into pr/haskell/rewrite-syntax
deathaxe 4321f30
Merge branch 'master' into pr/haskell/rewrite-syntax
deathaxe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Haskell] Simplify quasi quotes
- Loading branch information
commit 2377fbecf2989046e8b53d79b97efb3becede473
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comma can also match in records, which are not sequences, but not a big issue imo.
Using a punctuation scope for guard pipes is an approach I can understand, but I would rather choose
keyword.control.conditional
, since it behaves like acase
in C-like languages.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The syntax doesn't push into those contexts to be able to distinguish that. It was just too error prone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think a single pipe character is valid anywhere else. Commas we can easily defer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are separators in mappings if I don't miss something. That's one major reason for the scope decision.
Packages/Haskell/tests/syntax_test_haskell.hs
Lines 1295 to 1344 in 01624ba
Otherwise they are separators of a list of guarded expressions
Packages/Haskell/tests/syntax_test_haskell.hs
Lines 2068 to 2085 in 01624ba
Erlang also has that concept of guarded clauses/expressions which I use
punctuation.separator
for, too, in order to scope the separator which is;
in that case. Erlang even calls it a list of guarded clauses. Hence my impression is that this concept works for Haskell, too.At least it helps to distinguish normal operators used in guard expressions from guard boundaries a bit better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, they are used for sum types …
Let's track these instances that require context-awareness in (a) separate issue(s).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also mentioned this in #2868. You may resolve the discussion if you only kept it open for tracking this.