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

[Haskell] Rewrite Syntax #2679

Merged
merged 180 commits into from
Feb 2, 2022
Merged
Changes from all commits
Commits
Show all changes
180 commits
Select commit Hold shift + click to select a range
f6e6c8d
[Haskell] Fix comments
deathaxe Dec 22, 2020
dc7b6da
[Haskell] Fix comments in strings
deathaxe Dec 23, 2020
7ccb72c
[Haskell] Add meta.string
deathaxe Dec 23, 2020
2a56101
[Haskell] Scope character literals
deathaxe Dec 23, 2020
709f33d
[Haskell] Fix comments in imports
deathaxe Dec 23, 2020
390ee8d
[Haskell] Fix illegal infix operator highlighting
deathaxe Dec 23, 2020
4bf8b22
[Haskell] Allow space in infix operators
deathaxe Dec 23, 2020
513e00b
[Haskell] Fix identifier patterns
deathaxe Dec 23, 2020
2e4c0be
[Haskell] Fix arrow operator in class definition
deathaxe Dec 23, 2020
bc3ee6e
[Haskell] Create ident contexts
deathaxe Dec 23, 2020
e4e9ed5
[Haskell] Highlight C-style directive keywords
deathaxe Dec 23, 2020
38bdd9c
[Haskell] Avoid capture groups
deathaxe Dec 23, 2020
45c1bb5
[Haskell] Fix word break pattern
deathaxe Dec 23, 2020
df35af4
[Haskell] Tweak C-style directive keyword scope
deathaxe Dec 23, 2020
044797e
[Haskell] Fix unit scope consistency
deathaxe Dec 23, 2020
1ce1104
[Haskell] Fix test case
deathaxe Dec 23, 2020
8b841d6
[Haskell] Add missing {{break}}
deathaxe Dec 23, 2020
0babe57
[Haskell] Reorganize Comments
deathaxe Dec 24, 2020
b0eca6f
[Haskell] Reorganize preprocessor contexts
deathaxe Dec 24, 2020
1fe8c90
[Haskell] Reorganize declaration contexts
deathaxe Dec 24, 2020
78fd921
[Haskell] Tweak import identifier scopes
deathaxe Dec 24, 2020
f088fae
[Haskell] Reorganize export/import symbols
deathaxe Dec 24, 2020
93d9847
[Haskell] Improve module declaration bailouts
deathaxe Dec 24, 2020
3805d01
[Haskell] Reorganize type signatures context
deathaxe Dec 24, 2020
70e438e
[Haskell] Reorganize groups and lists
deathaxe Dec 24, 2020
06b5e30
[Haskell] Reorganize identifiers
deathaxe Dec 24, 2020
8a7335e
[Haskell] Reorganize literals
deathaxe Dec 24, 2020
26a367a
[Haskell] Reorganize keywords and operators
deathaxe Dec 24, 2020
563aad6
[Haskell] Tweak reserved_id formatting
deathaxe Dec 24, 2020
f005107
[Haskell] Reorganize escape_chars variables
deathaxe Dec 24, 2020
81b5f33
[Haskell] Rename statement and expression contexts
deathaxe Dec 24, 2020
bc4397d
[Haskell] Add statement terminators
deathaxe Dec 24, 2020
a9ddabb
[Haskell] Tweak import declarations
deathaxe Dec 24, 2020
f71e2f5
[Haskell] Move import declaration tests
deathaxe Dec 24, 2020
a7679ed
[Haskell] Scope import keywords `keyword.declaration.import`
deathaxe Dec 24, 2020
2c4a6db
[Haskell] Opt-in to sublime-syntax version 2
deathaxe Dec 24, 2020
c147a0a
[Haskell] Replace pop: true by pop: 1
deathaxe Dec 24, 2020
61f01b0
[Haskell] Add support for code blocks
deathaxe Dec 24, 2020
cda0a2c
[Haskell] Introduce else-pop context
deathaxe Dec 24, 2020
5e2cff7
[Haskell] Fix floating point number scopes
deathaxe Dec 24, 2020
4ba2b93
[Haskell] Fix derived statements
deathaxe Dec 24, 2020
472b89a
[Haskell] Add preprocessor punctuation scopes
deathaxe Dec 24, 2020
a25e174
[Haskell] Refactor type signature contexts
deathaxe Dec 24, 2020
f0d9de2
[Haskell] Rename symbols sequence scope to tuple
deathaxe Dec 24, 2020
2dc3ce3
[Haskell] Remove empty list special pattern
deathaxe Dec 24, 2020
f840f3b
[Haskell] Add type and newtype declaration statements
deathaxe Dec 24, 2020
c421583
[Haskell] Fix literal chars vs. operators
deathaxe Dec 25, 2020
7477170
[Haskell] Tweak test case section headers
deathaxe Dec 25, 2020
ec6bdd9
[Haskell] Fix variable identifier
deathaxe Dec 25, 2020
fb0a700
[Haskell] Add some specification references
deathaxe Dec 25, 2020
5fb982a
[Haskell] Fix list and tuple constructor highlighting
deathaxe Dec 25, 2020
698812e
[Haskell] Highlight fully qualified identifiers
deathaxe Dec 25, 2020
7387251
[Haskell] Fix exported module symbol
deathaxe Dec 25, 2020
767ee05
[Haskell] Add expression type signatures
deathaxe Dec 25, 2020
c2e37b2
[Haskell] Fix test case indentation
deathaxe Dec 25, 2020
f7935fd
[Haskell] Fix default declaration statements
deathaxe Dec 25, 2020
90f5a72
[Haskel] Fix deriving declaration statements
deathaxe Dec 25, 2020
97fa8a0
[Haskell] Add some keyword boundary tests
deathaxe Dec 25, 2020
00e6808
[Haskell] Add data declaration statements
deathaxe Dec 25, 2020
a6db194
[Haskell] Fix instance keyword scope
deathaxe Dec 25, 2020
32c43a0
[Haskell] Reorganize identifier section
deathaxe Dec 25, 2020
8cc9cca
[Haskell] Fix scope of where keyword
deathaxe Dec 25, 2020
24c9cdd
[Haskell] Reorganize keywords
deathaxe Dec 25, 2020
12c9510
[Haskell] Fix symbol and operator patterns
deathaxe Dec 26, 2020
dde2fc4
[Haskell] Fix empty and unicode character literals
deathaxe Dec 26, 2020
5b59763
[Haskell] Reorganize newtype test cases
deathaxe Dec 27, 2020
d0d9e94
[Haskell] Improve class declaration
deathaxe Dec 27, 2020
da13ed3
[Haskell] Split import/export symbol lists
deathaxe Dec 27, 2020
0923357
[Haskell] Remove where keyword from declaration scope
deathaxe Dec 27, 2020
8174494
[Haskell] Tweak deriving contexts
deathaxe Dec 27, 2020
d59b3c3
[Haskell] Tweak block comment contexts
deathaxe Dec 27, 2020
961e380
[Haskell] Scope builtin constants
deathaxe Dec 27, 2020
98ef8e9
[Haskell] Improve preprocessor statements
deathaxe Dec 27, 2020
0ea89c9
[Haskell] Add file extensions
deathaxe Dec 27, 2020
58f51d6
[Haskell] Tweak function declaration
deathaxe Dec 27, 2020
f3e5aa9
[Haskell] Add instance declaration tests
deathaxe Dec 27, 2020
16fabde
[Haskell] Fix type signatures
deathaxe Dec 27, 2020
9cde06c
[Haskell] Improve default statement
deathaxe Dec 27, 2020
f528ad5
[Haskell] Add forall keyword highlighting
deathaxe Dec 27, 2020
3324690
[Haskell] Rework Haskell Literate
deathaxe Dec 28, 2020
3316d08
[Haskell] Improve type/newtype declarations
deathaxe Dec 28, 2020
45b0b02
[Haskell] Add comment test case
deathaxe Dec 28, 2020
f1ecd86
[Haskell] Distinguish top-level declarations and statements
deathaxe Dec 28, 2020
07b4fee
[Haskell] Add signature statements support
deathaxe Dec 28, 2020
5aefbbf
[Haskell] Fix nested record field declarations
deathaxe Dec 28, 2020
248fa1f
[Haskell] Remove ident-constants
deathaxe Dec 28, 2020
6265cdc
[Haskell] Rename meta.name to variable.other
deathaxe Dec 28, 2020
17027e0
[Haskell] Simplify `variable.other.generic-type` scope
deathaxe Dec 29, 2020
223fd48
[Haskell] Fix comments in quoted strings
deathaxe Dec 28, 2020
d52aee6
[Haskell] Improve prelude types and variables
deathaxe Dec 29, 2020
b165519
[Haskell] Common module/import scopes
deathaxe Dec 29, 2020
d9cdfca
[Haskell] Add data family modifiers
deathaxe Dec 29, 2020
216c5ba
[Haskell] Add foreign import/export statements
deathaxe Dec 29, 2020
1ffff85
[Haskell] Restrict snippet scopes
deathaxe Dec 29, 2020
1ccc027
[Haskell] Add class-block
deathaxe Dec 29, 2020
7dd4d6c
[Haskell] Ensure reserved unicode operator scopes
deathaxe Dec 29, 2020
ff90c5e
[Haskell] Rework function declarations
deathaxe Dec 29, 2020
c2db046
[Haskell] Tweak type-content
deathaxe Dec 30, 2020
2834555
[Haskell] Add extra bailouts to lists,groups,tuples
deathaxe Dec 30, 2020
1fe1677
[Haskell] Simplify class declarations
deathaxe Dec 30, 2020
8a2e904
[Haskell] Simplify data declarations
deathaxe Dec 30, 2020
9547e81
[Haskell] Simplify derived() and via() statements
deathaxe Dec 30, 2020
11bb4a3
[Haskell] Reorganize records contexts
deathaxe Dec 30, 2020
0ee5f67
[Haskell] Simplify type declarations
deathaxe Dec 30, 2020
6c452ec
[Haskell] Add tests to verify instance methods
deathaxe Dec 30, 2020
b336cfb
[Haskell] Distinguish type groups and type tuples
deathaxe Dec 30, 2020
5e5eb0a
[Haskell] Simplify type signatures
deathaxe Dec 30, 2020
0cd0335
[Haskell] Fix infix declarations
deathaxe Dec 30, 2020
0318ada
[Haskell] Tweak quoted infix operators
deathaxe Dec 30, 2020
c6b1962
[Haskell] Add a sophisticated group test
deathaxe Dec 30, 2020
7b16e70
[Haskell] Tweak module and import statements
deathaxe Dec 30, 2020
2377fbe
[Haskell] Simplify quasi quotes
deathaxe Dec 30, 2020
11a1de4
[Haskell] Rename type-content
deathaxe Dec 30, 2020
fd136b6
[Haskell] Rename variable-prefix from builtin_ to prelude_
deathaxe Dec 30, 2020
d41fffd
[Haskell] Merge sequence separator patterns
deathaxe Dec 30, 2020
96f39e3
[Haskell] Add a note upon forall .
deathaxe Dec 30, 2020
c8ab692
[Haskell] Update Symbol Lists
deathaxe Dec 30, 2020
8f0345a
[Haskell] Tidy up tmPreferences
deathaxe Dec 30, 2020
7e67d13
[Haskell] Remove word separator settings
deathaxe Dec 31, 2020
4b5c137
[Haskell] Fix module scope in export list
deathaxe Dec 31, 2020
f620c80
[Haskell] Tweak module declaration statement
deathaxe Dec 31, 2020
4ab78dc
[Haskell] Scope Just/Left/Right as prelude type
deathaxe Dec 31, 2020
d065b66
[Haskell] Add some pattern/function binding tests
deathaxe Dec 31, 2020
cf8f67c
[Haskell] Add exported type test
deathaxe Dec 31, 2020
aa0890d
[Haskell] Limit constant scope in pragmas to OPTIONS
deathaxe Dec 31, 2020
60f4683
[Haskell] Fix infix operators in parentheses
deathaxe Dec 31, 2020
8395640
[Haskell] Add tests for `let` expressions
deathaxe Jan 1, 2021
163d6a1
[Haskell] Add some real world function declaration tests
deathaxe Jan 1, 2021
0c1f8c5
[Haskell] Highlight SPECIALIZE pragma values
deathaxe Jan 1, 2021
c793664
[Haskell] Scope exported symbols `entity.name.export`
deathaxe Jan 1, 2021
ffdfde9
[Haskell] Rework import statements
deathaxe Jan 1, 2021
3c5e2ba
[Haskell] Add support for MagicHash
deathaxe Jan 1, 2021
84d2566
[Haskell] Add operators to indexed reference list
deathaxe Jan 1, 2021
d182973
[Haskell] Add operator declarations to indexed symbol list
deathaxe Jan 1, 2021
a50a411
[Haskell] Tweak infix operators
deathaxe Jan 1, 2021
b79e737
[Haskell] Scope forall unicode keyword the same as its ascii counterpart
deathaxe Jan 1, 2021
c4c934c
[Haskell] Scope forall-expression terminator as punctuation
deathaxe Jan 1, 2021
24a1674
[Haskell] Add exported operators to index
deathaxe Jan 1, 2021
52d4e3b
[Haskell] Add missing builtin unboxed types
deathaxe Jan 1, 2021
9f8db10
[Haskell] Add sql like list comprehension keywords
deathaxe Jan 1, 2021
7d9bcd5
[Haskell] Add binary integer and hexadecimal float literals
deathaxe Jan 1, 2021
d67647d
[Haskell] Add support for underscore in numeric linterals
deathaxe Jan 1, 2021
99f54a7
[Haskell] Add "Safe" pragma constant
deathaxe Jan 1, 2021
35dc26b
[Haskell] Add safe imports
deathaxe Jan 1, 2021
86ac6c5
[Haskell] Remove obsolete context
deathaxe Jan 1, 2021
71ab1c5
[Haskell] Update pragma value highlighting
deathaxe Jan 1, 2021
a10d593
[Haskell] Add SPECIALIZE INLINE pragma support
deathaxe Jan 1, 2021
3bc7535
[Haskell] Add SPECIALIZE instance pragma support
deathaxe Jan 1, 2021
94f4931
[Haskell] Add COMPLETE pragma
deathaxe Jan 1, 2021
06148ba
[Haskell] Add COLUMN pragma
deathaxe Jan 1, 2021
8ea64da
[Haskell] Tweak symbol list and index definitions
deathaxe Jan 2, 2021
55cdbf4
[Haskell] Tweak Pragma Directives
deathaxe Jan 2, 2021
d7e4862
[Haskell] Improve FFI capabilities
deathaxe Jan 2, 2021
cffa27d
[Haskell] Tweak specification comments
deathaxe Jan 2, 2021
cf5cfaa
[Haskell] Tweak prefix operators
deathaxe Jan 2, 2021
f6c2624
[Haskell] Tweak type definition identifier scopes
deathaxe Jan 2, 2021
9deb528
[Haskell] Tweak data definition identifier scopes
deathaxe Jan 2, 2021
411bed9
[Haskell] Fix data definition identifier context
deathaxe Jan 2, 2021
7cb9118
[Haskell] Fix type definition identifier context
deathaxe Jan 2, 2021
126e65b
[Haskell] Scope class/instance declaration identifiers
deathaxe Jan 2, 2021
01624ba
[Haskell] Move tests to dedicated directory
deathaxe Jan 11, 2021
ed87ba6
[Haskell] Move `otherwise` to constants
deathaxe Jan 29, 2021
a464ec6
[Haskell] Scope fully qualified infix operators
deathaxe Jan 29, 2021
f16e3fc
[Haskell] Scope list and tuple constructors as constants
deathaxe Jan 30, 2021
71c6f2e
[Haskell] Tweak scopes for empty tuples and lists
deathaxe Feb 6, 2021
a1af7c2
[Haskell] Scope :: as punctuation.separator.type
deathaxe Feb 6, 2021
c8c8a67
[Haskell] Scope => punctuation.separator.type.context
deathaxe Feb 6, 2021
84e468d
[Haskell] Fix anonymous variables
deathaxe Jun 11, 2021
5a24244
[Haskell] Fix lists vs. quasi-quotations
deathaxe Jun 11, 2021
044d27a
[Haskell] Add "type family" support
deathaxe Jun 11, 2021
c1749cb
[Haskell] Fix identifiers directly after numbers
deathaxe Jun 12, 2021
f33ae52
[Haskell] Add GHC 9 LANGUAGE pragma values
deathaxe Jun 12, 2021
7cd099f
[Haskell] Add profiling inline directives
deathaxe Jun 13, 2021
1d64bac
[Haskell] Add more LANGUAGE flags
deathaxe Jun 13, 2021
ea2fce6
[Haskell] Add overloaded and typed quotations
deathaxe Jun 13, 2021
a5e05e9
[Haskell] Add first_line_match
deathaxe Jun 15, 2021
d0c5d31
[Haskell] Fix multi-line strings
deathaxe Jul 28, 2021
c6f01ca
[Haskell] Improve multi-line strings fix
deathaxe Jul 30, 2021
c4c0f53
Merge branch 'master' into pr/haskell/rewrite-syntax
deathaxe Aug 19, 2021
4321f30
Merge branch 'master' into pr/haskell/rewrite-syntax
deathaxe Oct 29, 2021
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
2 changes: 0 additions & 2 deletions Haskell/Comments.tmPreferences
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
<string>Comments</string>
<key>scope</key>
<string>source.haskell</string>
<key>settings</key>
88 changes: 88 additions & 0 deletions Haskell/Default.sublime-keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
[
//
// BLOCK COMMENTS
//

// Expand {-|-} to {- | -} when space is pressed
{ "keys": [" "], "command": "insert_snippet", "args": {"contents": " $0 "}, "context":
[
{ "key": "setting.auto_match_enabled", "operand": true },
{ "key": "selector", "operand": "source.haskell" },
{ "key": "selection_empty", "operand": true, "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "{-$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^-}", "match_all": true }
]
},
// Collapse {- | -} to {-|-} when backspace is pressed
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
[
{ "key": "setting.auto_match_enabled", "operand": true },
{ "key": "selector", "operand": "source.haskell" },
{ "key": "selection_empty", "operand": true, "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "{-\\s$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\s-}", "match_all": true }
]
},
// Collapse {-|-} to {|} when backspace is pressed
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
[
{ "key": "setting.auto_match_enabled", "operand": true },
{ "key": "selector", "operand": "source.haskell" },
{ "key": "selection_empty", "operand": true, "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "{-$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^-}", "match_all": true }
]
},

//
// PREPROCESSOR PRAGMA
//

// Auto-pair hash tags: {-# | #-}
{ "keys": ["#"], "command": "insert_snippet", "args": {"contents": "# $0 #"}, "context":
[
{ "key": "setting.auto_match_enabled", "operand": true },
{ "key": "selector", "operand": "source.haskell" },
{ "key": "selection_empty", "operand": true, "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "{-$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^-}", "match_all": true }
]
},
{ "keys": ["#"], "command": "insert_snippet", "args": {"contents": "# ${0:$SELECTION} #"}, "context":
[
{ "key": "setting.auto_match_enabled", "operand": true },
{ "key": "selector", "operand": "source.haskell comment.block" },
{ "key": "selection_empty", "operand": false, "match_all": true }
]
},
// Expand {-#|#-} to {-# | #-} when space is pressed
{ "keys": [" "], "command": "insert_snippet", "args": {"contents": " $0 "}, "context":
[
{ "key": "setting.auto_match_enabled", "operand": true },
{ "key": "selector", "operand": "source.haskell" },
{ "key": "selection_empty", "operand": true, "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "{-#$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^#-}", "match_all": true }
]
},
// Collapse {-# | #-} to {-#|#-} when backspace is pressed
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
[
{ "key": "setting.auto_match_enabled", "operand": true },
{ "key": "selector", "operand": "source.haskell" },
{ "key": "selection_empty", "operand": true, "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "{-#\\s$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\s#-}", "match_all": true }
]
},
// Collapse {-#|#-} to {-|-} when backspace is pressed
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
[
{ "key": "setting.auto_match_enabled", "operand": true },
{ "key": "selector", "operand": "source.haskell" },
{ "key": "selection_empty", "operand": true, "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "{-#$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^#-}", "match_all": true }
]
}
]
1,797 changes: 1,443 additions & 354 deletions Haskell/Haskell.sublime-syntax

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
<string>Indent Patterns</string>
<key>scope</key>
<string>source.haskell</string>
<key>settings</key>
15 changes: 15 additions & 0 deletions Haskell/Indexed Reference List.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>scope</key>
<string>
source.haskell keyword.operator - meta.function.identifier,
source.haskell variable.other
</string>
<key>settings</key>
<dict>
<key>showInIndexedReferenceList</key>
<string>1</string>
</dict>
</dict>
</plist>
15 changes: 15 additions & 0 deletions Haskell/Indexed Symbol List.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>scope</key>
<string>
source.haskell entity.name.type,
source.haskell meta.function.identifier meta.prefix keyword.operator
</string>
<key>settings</key>
<dict>
<key>showInIndexedSymbolList</key>
<string>1</string>
</dict>
</dict>
</plist>
55 changes: 19 additions & 36 deletions Haskell/Literate Haskell.sublime-syntax
Original file line number Diff line number Diff line change
@@ -1,50 +1,33 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
# https://www.sublimetext.com/docs/syntax.html
name: Literate Haskell
scope: text.tex.latex.haskell

extends: Packages/LaTeX/LaTeX.sublime-syntax

file_extensions:
- lhs
scope: text.tex.latex.haskell
contexts:
prototype:
- include: scope:text.tex.latex#comments

main:
- include: scope:text.tex.latex#unique-latex
- include: scope:text.tex.latex#packages
contexts:
plain-tex:
- meta_prepend: true
- include: haskell-code
- include: scope:text.tex.latex#plain-tex
- include: scope:text.tex.latex#begin-end-commands
- include: scope:text.tex.latex#general-commands
- include: global-braces

global-braces:
- match: '\{'
scope: punctuation.definition.group.brace.begin.latex
push:
- meta_scope: meta.group.brace.latex
- match: '\}'
scope: punctuation.definition.group.brace.end.latex
pop: true
- include: main

haskell-code:
- match: '(?:\s*)((\\)begin)(\{)(code)(\})'
- match: ((\\)begin)(\{)(code)(\})
captures:
1: support.function.be.latex
1: support.function.begin.latex keyword.control.block.begin.latex
2: punctuation.definition.backslash.latex
3: punctuation.definition.group.brace.begin.latex
4: variable.parameter.function.latex
5: punctuation.definition.group.brace.end.latex
embed: scope:source.haskell
embed_scope: source.haskell.embedded.latex
escape: ((\\)end)(\{)(code)(\})
escape_captures:
1: support.function.end.latex keyword.control.block.end.latex
2: punctuation.definition.backslash.latex
3: punctuation.definition.group.brace.begin.latex
4: variable.parameter.function.latex
5: punctuation.definition.group.brace.end.latex
push:
- meta_scope: meta.function.embedded.haskell.latex
- meta_content_scope: source.haskell.embedded.latex
- match: '((\\)end)(\{)(code)(\})'
captures:
1: support.function.be.latex
2: punctuation.definition.backslash.latex
3: punctuation.definition.group.brace.begin.latex
4: variable.parameter.function.latex
5: punctuation.definition.group.brace.end.latex
pop: true
- include: scope:source.haskell
2 changes: 1 addition & 1 deletion Haskell/Snippets/Case.sublime-snippet
Original file line number Diff line number Diff line change
@@ -2,6 +2,6 @@
<content><![CDATA[case ${1:a} of ${2:True} -> ${3:$1}
${1/./ /g} ${4:otherwise} -> ${0:$1}]]></content>
<tabTrigger>case</tabTrigger>
<scope>source.haskell</scope>
<scope>source.haskell - comment - string</scope>
<description>Case</description>
</snippet>
2 changes: 1 addition & 1 deletion Haskell/Snippets/Instance.sublime-snippet
Original file line number Diff line number Diff line change
@@ -2,6 +2,6 @@
<content><![CDATA[instance ${1:Class} ${2:Data} where
${3:func} = $0]]></content>
<tabTrigger>instance</tabTrigger>
<scope>source.haskell</scope>
<scope>source.haskell - comment - string - meta.declaration</scope>
<description>Instance</description>
</snippet>
2 changes: 1 addition & 1 deletion Haskell/Snippets/Lambda.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[\\${1:t} -> ${0:f t}]]></content>
<tabTrigger>\</tabTrigger>
<scope>source.haskell</scope>
<scope>source.haskell - comment - string</scope>
<description>\t -&gt; f t</description>
</snippet>
2 changes: 1 addition & 1 deletion Haskell/Snippets/Main.sublime-snippet
Original file line number Diff line number Diff line change
@@ -3,6 +3,6 @@
main = ${1:putStrLn "Hello World"}]]></content>
<tabTrigger>main</tabTrigger>
<scope>source.haskell</scope>
<scope>source.haskell - comment - string - meta.declaration</scope>
<description>Main</description>
</snippet>
2 changes: 1 addition & 1 deletion Haskell/Snippets/module.sublime-snippet
Original file line number Diff line number Diff line change
@@ -3,6 +3,6 @@
${2:main = ${3:putStrLn "Hello World"}}]]></content>
<tabTrigger>mod</tabTrigger>
<scope>source.haskell</scope>
<scope>source.haskell - comment - string - meta.block - meta.declaration</scope>
<description>Module</description>
</snippet>
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
<string>Symbol List</string>
<key>scope</key>
<string>source.haskell entity.name.function - entity.name.function.infix</string>
<string>source.haskell entity.name.export</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
12 changes: 12 additions & 0 deletions Haskell/Symbol List - Imports.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>scope</key>
<string>source.haskell entity.name.import</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
<string>1</string>
</dict>
</dict>
</plist>
12 changes: 12 additions & 0 deletions Haskell/Symbol List - Operators.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>scope</key>
<string>source.haskell meta.function.identifier meta.prefix keyword.operator</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
<string>1</string>
</dict>
</dict>
</plist>
12 changes: 12 additions & 0 deletions Haskell/Symbol List - Types.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>scope</key>
<string>source.haskell entity.name.type</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
<string>1</string>
</dict>
</dict>
</plist>
382 changes: 0 additions & 382 deletions Haskell/syntax_test_haskell.hs

This file was deleted.

4,209 changes: 4,209 additions & 0 deletions Haskell/tests/syntax_test_haskell.hs

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions Haskell/tests/syntax_test_literate.lhs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
% SYNTAX TEST "Packages/Haskell/Literate Haskell.sublime-syntax"

\begin{code}
% ^^^^^^^^^^^^^ - source.haskell
% ^ source.haskell.embedded.latex
% ^ punctuation.definition.backslash.latex
% ^^^^^^ support.function.begin.latex keyword.control.block.begin.latex
% ^ punctuation.definition.group.brace.begin.latex
% ^^^^ variable.parameter.function.latex
% ^ punctuation.definition.group.brace.end.latex

{- comment -}
% ^^^^^^^^^^^^^ source.haskell.embedded.latex comment.block.haskell

{-# LANGUAGE EmptyCase #-}
% ^^^^^^^^^^^^^^^^^^^^^^^^^^ source.haskell.embedded.latex
% ^^^^^^^^^^^^ meta.preprocessor.pragma.directive.haskell
% ^^^^^^^^^^^ meta.preprocessor.pragma.value.language.haskell
% ^^^ meta.preprocessor.pragma.value.haskell

\end{code}
% ^ source.haskell.embedded.latex
% ^^^^^^^^^^^ - source.haskell
% ^ punctuation.definition.backslash.latex
% ^^^^ support.function.end.latex keyword.control.block.end.latex
% ^ punctuation.definition.group.brace.begin.latex
% ^^^^ variable.parameter.function.latex
% ^ punctuation.definition.group.brace.end.latex