diff --git a/Haskell/Comments.tmPreferences b/Haskell/Comments.tmPreferences index f73f94787d8..0d90aec7804 100644 --- a/Haskell/Comments.tmPreferences +++ b/Haskell/Comments.tmPreferences @@ -1,8 +1,6 @@ - name - Comments scope source.haskell settings diff --git a/Haskell/Default.sublime-keymap b/Haskell/Default.sublime-keymap new file mode 100644 index 00000000000..809a7894a3f --- /dev/null +++ b/Haskell/Default.sublime-keymap @@ -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 } + ] + } +] \ No newline at end of file diff --git a/Haskell/Haskell.sublime-syntax b/Haskell/Haskell.sublime-syntax index 07be4fda384..b06b26ba94a 100644 --- a/Haskell/Haskell.sublime-syntax +++ b/Haskell/Haskell.sublime-syntax @@ -1,11 +1,16 @@ %YAML 1.2 --- -# http://www.sublimetext.com/docs/3/syntax.html +# https://ghc.gitlab.haskell.org/ghc/doc/users_guide +# https://www.haskell.org/onlinereport/haskell2010 +# https://www.sublimetext.com/docs/syntax.html name: Haskell scope: source.haskell +version: 2 file_extensions: - hs + - hs-boot + - hsig first_line_match: |- (?xi: @@ -13,402 +18,1486 @@ first_line_match: |- | ^ \s* -- .*? -\*- .*? \bhaskell\b .*? -\*- # editorconfig ) +############################################################################### + variables: - # In case this regex seems overly general, - # note that Haskell permits the definition of new operators - # which can be nearly any string of punctuation characters, - # such as $%^&*. - operator_char: '[*|!%&$@#?~+:\-.=\\]' - operator_infix: '{{operator_char}}+' - operator_parens: '(?:{{operator_infix}}|,+)' - module_name: (?:[A-Z][A-Za-z._']*) + # 2.2 Lexical Program Structure + # https://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-160002.2 + special: '[(),;\[\]`{}]' + symbol: '[\p{S}\p{P}&&[^_"''{{special}}]]' + ascii_symbol: '[!#$%&⋆+./<=>?@\\\^|\-~:]' + unicode_symbol: '[[:punct:]&&[^:ascii:]]' + + # 2.3 Comments + # https://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-170002.3 + no_comment_ahead: '(?!{{comment_begin}})' + comment_ahead: '(?={{comment_begin}})' + comment_begin: '--+(?:{{comment_first_char}}|$)' + comment_first_char: '[\s\w"''{{special}}]' + + # 2.4 Identifiers and Operators + # https://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-180002.4 + id: (?:(?!{{reserved_id}})[\w']*(#)*) + con_id: (?:[[:upper:]][\w']*(#)*) + var_id: (?:(?!{{reserved_id}})[[:lower:]_][\w']*(#)*) + reserved_id: |- + (?x: + _ | case | class | data | default | deriving | do | else | family | forall + | foreign | if | import | in | infix | infixl | infixr | instance | let | mdo + | module | newtype | of | proc | rec | signature | then | type | via | where + ){{break}} + break: (?![\w'#]) + + # GHC 6.9.5 Numeric underscores + # https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/numeric_underscores.html + bin_digit: '[01_]' + dec_digit: '[\d_]' + hex_digit: '[\h_]' + oct_digit: '[0-7_]' + dec_exponent: (?:[eE][-+]?\d+) + hex_exponent: (?:[pP][-+]?\d+) + + # In case this regex seems overly general, note that Haskell permits + # the definition of new operators which can be nearly any string + # of punctuation characters, such as $%^&*. + operator_symbol: (?:{{symbol}}+) + operator_parens: (?:{{no_comment_ahead}}{{operator_symbol}}) + + operator_double_colon: (?:::|∷) + operator_big_arrow: (?:=>|⇒) + operator_left_arrow: (?:<-|←) + operator_right_arrow: (?:->|→) + + consym: (?:[:]{{varsym}}) + varsym: (?:[{{symbol}}&&[^:]]{{symbol}}*) + + # 2.6 Character and String Literals + # https://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-200002.6 escape_chars: |- - (?x:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI - |DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL - |[abfnrtv\\\"'\&]) + (?x: + NUL | SOH | STX | ETX | EOT | ENQ | ACK | BEL | BS | HT | LF | VT | FF + | CR | SO | SI | DLE | DC1 | DC2 | DC3 | DC4 | NAK | SYN | ETB | CAN | EM + | SUB | ESC | FS | GS | RS | US | SP | DEL + | [abfnrtv\\\"'\&] + ) escape_sequence: |- (?x: - (\\{{escape_chars}}) # Escapes + (\\{{escape_chars}}) # Escapes | (\\[0-9]+) # Decimal Escapes | (\\o[0-7]+) # Octal Escapes | (\\x[0-9A-Fa-f]+) # Hexadecimal Escapes | (\^[A-Z@\[\]\\\^_]) # Control Chars ) + # GHC 6.20 Pragmas + pragma_directives: |- + (?x: + # https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/pragmas.html + LANGUAGE | OPTIONS_GHC | OPTIONS_HADDOCK | INCLUDE | WARNING | DEPRECATED + | MINIMAL | INLINE | NOINLINE | INLINABLE | CONLIKE | LINE | COLUMN | RULES + | SPECIALIZE | UNPACK | NOUNPACK | SOURCE | COMPLETE | OVERLAPPING + | OVERLAPPABLE | OVERLAPS | INCOHERENT | CTYPE + # https://ghc.gitlab.haskell.org/ghc/doc/users_guide/profiling.html + | CORE | GENERATED | SCC + ){{break}} + + # https://wiki.haskell.org/Language_extensions + # https://github.com/JustusAdam/language-haskell + pragma_deprecated_constants: |- + (?:No)?(?x: + AutoDeriveTypeable | DatatypeContexts | DoRec | IncoherentInstances + | MonadFailDesugaring | MonoPatBinds | NullaryTypeClasses + | OverlappingInstances | PatternSignatures | RecordPuns | RelaxedPolyRec + ){{break}} + + # https://wiki.haskell.org/Language_extensions + # https://github.com/JustusAdam/language-haskell + pragma_extension_constants: |- + (?:No)?(?x: + AllowAmbiguousTypes | AlternativeLayoutRule + | AlternativeLayoutRuleTransitional | Arrows | BangPatterns | BinaryLiterals + | CApiFFI | CPP | CUSKs | ConstrainedClassMethods | ConstraintKinds + | DataKinds | DefaultSignatures | DeriveAnyClass | DeriveDataTypeable + | DeriveFoldable | DeriveFunctor | DeriveGeneric | DeriveLift + | DeriveTraversable | DerivingStrategies | DerivingVia + | DisambiguateRecordFields | DoAndIfThenElse | BlockArguments + | DuplicateRecordFields | EmptyCase | EmptyDataDecls | EmptyDataDeriving + | ExistentialQuantification | ExplicitForAll | ExplicitNamespaces + | ExtendedDefaultRules | FlexibleContexts | FlexibleInstances + | ForeignFunctionInterface | FunctionalDependencies | GADTSyntax | GADTs + | GHCForeignImportPrim | Generali(?:s | z)edNewtypeDeriving | ImplicitParams + | ImplicitPrelude | ImportQualifiedPost | ImpredicativeTypes + | TypeFamilyDependencies | InstanceSigs | ApplicativeDo | InterruptibleFFI + | JavaScriptFFI | KindSignatures | LambdaCase | LexicalNegation + | LiberalTypeSynonyms | LinearTypes | MagicHash | MonadComprehensions + | MonoLocalBinds | MonomorphismRestriction | MultiParamTypeClasses + | MultiWayIf | NumericUnderscores | NPlusKPatterns | NamedFieldPuns + | NamedWildCards | NegativeLiterals | HexFloatLiterals + | NondecreasingIndentation | NumDecimals | OverloadedLabels | OverloadedLists + | OverloadedStrings | PackageImports | ParallelArrays | ParallelListComp + | PartialTypeSignatures | PatternGuards | PatternSynonyms | PolyKinds + | PolymorphicComponents | QuantifiedConstraints | PostfixOperators + | QualifiedDo | QuasiQuotes | Rank2Types | RankNTypes | RebindableSyntax + | RecordWildCards | RecursiveDo | RelaxedLayout | RoleAnnotations | Safe + | ScopedTypeVariables | StandaloneDeriving | StarIsType | StaticPointers + | Strict | StrictData | TemplateHaskell | TemplateHaskellQuotes + | StandaloneKindSignatures | TraditionalRecordSyntax | TransformListComp + | Trustworthy | TupleSections | TypeApplications | TypeInType | TypeFamilies + | TypeOperators | TypeSynonymInstances | UnboxedTuples | UnboxedSums + | UndecidableInstances | UndecidableSuperClasses | UnicodeSyntax + | UnliftedFFITypes | UnliftedNewtypes | Unsafe | ViewPatterns + | Haskell98 | Haskell2010 + ){{break}} + + prelude_classes: |- + (?x: + # 9 Standard Prelude + Applicative | Bounded | Enum | Eq | Floating | Foldableble | Fractional + | Functor | Integral | Monad | Monadoid | Num | Ord | Rational | Read + | Real | RealFloat | RealFrac | Show | Traversable + ){{break}} + + prelude_constants: |- + (?x: otherwise | Nothing | True | False | LT | EQ | GT ){{break}} + + prelude_types: |- + (?x: + # 9 Standard Prelude + Bool | Char | Double | Either | FilePath | Float | Integer | IO | IOError + | Maybe | Just | Left | Ordering | ReadS | Right | ShowS | String + # 24 Foreign + # https://www.haskell.org/onlinereport/haskell2010/haskellch24.html#x32-26200024 + | Int | Int8 | Int16 | Int32 | Int64 | Word | Word8 | Word16 | Word32 | Word64 + | Ptr | FunPtr | StablePtr + ){{break}} + + prelude_functions: |- + (?x: + abs | acos | acosh | all | and | any | appendFile | asTypeOf | asin + | asinh | atan | atan2 | atanh | break | ceiling | compare | concat + | concatMap | const | cos | cosh | curry | cycle | decodeFloat | div + | divMod | drop | dropWhile | either | elem | encodeFloat | enumFrom + | enumFromThen | enumFromThenTo | enumFromTo | error | errorWithoutStackTrace + | even | exp | exponent | fail | filter | flip | floatDigits | floatRadix + | floatRange | floor | fmap | foldMap | foldl | foldl1 | foldr | foldr1 + | fromEnum | fromInteger | fromIntegral | fromRational | fst | gcd | getChar + | getContents | getLine | head | id | init | interact | ioError + | isDenormalized | isIEEE | isInfinite | isNaN | isNegativeZero | iterate + | last | lcm | length | lex | lines | log | logBase | lookup | map | mapM + | mapM_ | mappend | max | maxBound | maximum | maybe | mconcat | mempty + | min | minBound | minimum | mod | negate | not | notElem | null | odd | or + | pi | pred | print | product | properFraction | pure | putChar + | putStr | putStrLn | quot | quotRem | read | readFile | readIO | readList + | readLn | readParen | reads | readsPrec | realToFrac | recip | rem | repeat + | replicate | return | reverse | round | scaleFloat | scanl | scanl1 | scanr + | scanr1 | seq | sequence | sequenceA | sequence_ | show | showChar + | showList | showParen | showString | shows | showsPrec | significand + | signum | sin | sinh | snd | span | splitAt | sqrt | subtract | succ | sum + | tail | take | takeWhile | tan | tanh | toEnum | toInteger | toRational + | traverse | truncate | uncurry | undefined | unlines | until | unwords + | unzip | unzip3 | userError | words | writeFile | zip | zip3 | zipWith + | zipWith3 + ){{break}} + + unboxed_types: |- + (?x: + # GHC 6.2.2 The magic hash + # https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/magic_hash.html + Addr | Array | Char | Double | Float | Int | Word + # GHC 6.17.2.1 Unlifted FFI Types + # https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/ffi.html + | ArrayArray | ByteArray | SmallArray | StablePtr + | Mutable (?: ArrayArray | ByteArray | SmallArray) + )(#){{break}} + +############################################################################### + contexts: prototype: - - include: comment - - include: preprocessor - + - include: comments + - include: preprocessor-pragmas + - include: preprocessor-directives + main: - - include: statement - - include: expression - - statement: - - include: declaration - - include: import - - expression: - - include: keyword - - include: operator - - include: constant - - include: string - - include: splice - - include: group - - include: list - - include: ident - - match: ',' - scope: punctuation.separator.comma.haskell + - include: modules + - include: declarations + - include: statements + - include: expressions - group: + declarations: + - include: classes + - include: instances + - include: datas + - include: foreigns + - include: imports + - include: newtypes + - include: types + - include: functions + + statements: + - include: blocks + - include: defaults + - include: deriving + - include: statement-terminators + + expressions: + - include: literal-chars + - include: literal-strings + - include: literal-numbers + - include: type-forall + - include: operators + - include: brackets + - include: parens + - include: keywords + - include: ident-anonymous + - include: ident-namespaces + - include: ident-builtin-functions + - include: ident-types + - include: ident-variables + +###[ COMMENTS ]################################################################ + + comments: + # 2.3 Comments + # https://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-170002.3 + - include: line-comments + - include: block-comments + + block-comments: + - match: \{-(?!#) + scope: punctuation.definition.comment.begin.haskell + push: block-comment-body + + block-comment-body: + - meta_include_prototype: false + - meta_scope: comment.block.haskell + - match: -\} + scope: punctuation.definition.comment.end.haskell + pop: 1 + - match: \{-# + push: block-comment-nested-body + - include: block-comments + + block-comment-nested-body: + - meta_include_prototype: false + - match: -\} + pop: 1 + - include: block-comments + + line-comments: + - match: (--+)(?:{{comment_first_char}}.*)?$\n? + scope: comment.line.double-dash.haskell + captures: + 1: punctuation.definition.comment.haskell + +###[ PREPROCESSOR ]############################################################ + + preprocessor-directives: + # In addition to Haskell's "native" syntax, + # GHC permits the C preprocessor to be run on a source file. + - match: ^\s*((#)\s*\w+) + scope: meta.preprocessor.c + captures: + 1: keyword.directive.other.c + 2: punctuation.definition.preprocessor.c + + preprocessor-pragmas: + # GHC 6.20 Pragmas + # https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/pragmas.html + - match: \{-# + scope: punctuation.section.preprocessor.begin.haskell + push: preprocessor-pragma-body + + preprocessor-pragma-body: + - meta_include_prototype: false + - meta_scope: meta.preprocessor.pragma.directive.haskell + - include: comments + # known directives + - match: LANGUAGE{{break}} + scope: keyword.directive.language.haskell + set: preprocessor-pragma-language-value + - match: (?:OPTIONS_GHC|OPTIONS_HADDOCK){{break}} + scope: keyword.directive.options.haskell + set: preprocessor-pragma-options-value + - match: (?:COMPLETE|INLINE|INLINABLE|MINIMAL|NOINLINE){{break}} + scope: + meta.preprocessor.pragma.directive.haskell + keyword.directive.builtin.haskell + embed: preprocessor-pragma-signature-value + pop: 1 + escape: '#-\}' + escape_captures: + 0: meta.preprocessor.pragma.value.haskell + punctuation.section.preprocessor.end.haskell + - match: (SPECIALIZE)(?:\s+(?:(INLINE|NOINLINE)|(instance)))?{{break}} + scope: meta.preprocessor.pragma.directive.haskell + captures: + 1: keyword.directive.builtin.haskell + 2: keyword.directive.builtin.haskell + 3: keyword.declaration.instance.haskell + embed: preprocessor-pragma-signature-value + pop: 1 + escape: '#-\}' + escape_captures: + 0: meta.preprocessor.pragma.value.haskell + punctuation.section.preprocessor.end.haskell + - match: '{{pragma_directives}}' + scope: keyword.directive.builtin.haskell + set: preprocessor-pragma-other-value + # maybe incomplete directive + # maintain meta scope to support completions + - match: \p{Lu}+|(?=\S) + set: preprocessor-pragma-other-value + + preprocessor-pragma-language-value: + - meta_include_prototype: false + - meta_content_scope: meta.preprocessor.pragma.value.language.haskell + - include: preprocessor-pragma-common + - match: '{{pragma_extension_constants}}' + scope: constant.language.extension.haskell + - match: '{{pragma_deprecated_constants}}' + scope: constant.language.extension.haskell invalid.deprecated.haskell + + preprocessor-pragma-options-value: + - meta_include_prototype: false + - meta_content_scope: meta.preprocessor.pragma.value.options.haskell + - include: preprocessor-pragma-common + - match: (-*)[-\w]+ + scope: constant.other.pragma.haskell + captures: + 1: punctuation.definition.constant.haskell + + preprocessor-pragma-signature-value: + - meta_include_prototype: false + - meta_content_scope: meta.preprocessor.pragma.value.signature.haskell + - include: comments + - include: sequence-separators + - include: functions + - include: type-expressions + + preprocessor-pragma-other-value: + - meta_include_prototype: false + - meta_content_scope: meta.preprocessor.pragma.value.other.haskell + - include: preprocessor-pragma-common + - include: literal-numbers + - include: literal-strings + + preprocessor-pragma-common: + - match: '#-\}' + scope: + meta.preprocessor.pragma.value.haskell + punctuation.section.preprocessor.end.haskell + pop: 1 + - include: comments + - include: sequence-separators + +###[ MODULE DECLARATIONS ]##################################################### + + modules: + # 5.1 Module Structure + # https://www.haskell.org/onlinereport/haskell2010/haskellch5.html#x11-990005.1 + - match: module{{break}} + scope: + meta.declaration.module.haskell + keyword.declaration.namespace.haskell + push: + - module-where + - module-export + - module-name + # https://wiki.haskell.org/Module_signature + - match: signature{{break}} + scope: + meta.declaration.signature.haskell + keyword.declaration.namespace.haskell + push: + - signature-where + - module-export + - module-name + + module-name: + - include: ident-namespaces + - include: ident-module + - include: else-pop + + module-export: - match: \( - scope: punctuation.section.group.begin.haskell + scope: punctuation.section.sequence.begin.haskell + set: module-export-body + - include: else-pop + + module-export-body: + - meta_scope: meta.sequence.tuple.haskell + - include: tuple-end + - include: range-tuples + - include: prefix-parens-operators + - include: sequence-separators + - include: ident-namespaces + - match: \( + scope: punctuation.section.sequence.begin.haskell + push: module-export-body + - match: module{{break}} + scope: keyword.declaration.namespace.haskell + # class / constructor / data / module / type + - match: '{{con_id}}' + scope: entity.name.export.haskell + captures: + 1: storage.modifier.unboxed.haskell + # function / pattern / variable + - match: '{{var_id}}' + scope: entity.name.export.haskell + captures: + 1: storage.modifier.unboxed.haskell + - include: else-pop + + signature-where: + - meta_content_scope: meta.declaration.signature.haskell + - include: module-where + + module-where: + - meta_content_scope: meta.declaration.module.haskell + - match: where{{break}} + scope: keyword.control.context.haskell + set: module-block + - include: else-pop + + module-block: + # The module body may be wrapped into braces, which still needs to be + # handled as top-level block containing top-level declarations. + - match: \{ + scope: punctuation.section.block.begin.haskell + set: module-block-body + - include: else-pop + + module-block-body: + - meta_scope: meta.block.haskell + - include: block-end + - include: declarations + - include: statements + - include: expressions + +###[ IMPORT DECLARATIONS ]##################################################### + + imports: + # 5.3 Import Declarations + # https://www.haskell.org/onlinereport/haskell2010/haskellch5.html#x11-1010005.3 + # GHC 6.18.3 Safe Imports + # https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/safe_haskell.html#safe-imports + - match: import{{break}} + scope: meta.import.haskell keyword.declaration.import.haskell push: - - meta_scope: meta.group.haskell - - match: \) - scope: punctuation.section.group.end.haskell - pop: true - - include: expression + - import-filter + - import-module + + import-module: + - meta_content_scope: meta.import.module.haskell + - match: as{{break}} + scope: keyword.declaration.import.as.haskell + set: import-alias + - match: (?:qualified|hiding|safe){{break}} + scope: storage.modifier.import.haskell + - match: ({{con_id}})(\.)? + captures: + 1: variable.namespace.haskell + 2: storage.modifier.haskell + 3: punctuation.accessor.dot.haskell + - include: else-pop + + import-alias: + - meta_scope: meta.import.alias.haskell + - include: ident-namespaces + - match: '{{con_id}}' + scope: entity.name.import.namespace.haskell + captures: + 1: storage.modifier.unboxed.haskell + pop: 1 + - include: else-pop + + import-filter: + - match: \( + scope: punctuation.section.sequence.begin.haskell + set: import-filter-body + - include: else-pop + + import-filter-body: + - meta_scope: meta.import.filter.haskell meta.sequence.tuple.haskell + - include: import-tuple-body + + import-tuple-body: + - meta_scope: meta.sequence.tuple.haskell + - include: tuple-end + - include: range-tuples + - include: prefix-parens-operators + - include: sequence-separators + - match: \( + scope: punctuation.section.sequence.begin.haskell + push: import-tuple-body + - match: \. + scope: invalid.illegal.accessor.haskell + - match: module{{break}} + scope: invalid.illegal.unexpected-keyword.haskell + # class / constructor / data / module / type + - match: '{{con_id}}' + scope: entity.name.import.haskell + captures: + 1: storage.modifier.unboxed.haskell + # function / pattern / variable + - match: '{{var_id}}' + scope: entity.name.import.haskell + captures: + 1: storage.modifier.unboxed.haskell + - include: else-pop + +###[ FOREIGN DECLARATIONS ]#################################################### + + foreigns: + # 8.4 Foreign Declarations + # https://www.haskell.org/onlinereport/haskell2010/haskellch8.html#x15-1490008 + # GHC 6.17 Foreign function interface (FFI) + # https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/ffi.html + - match: foreign{{break}} + scope: storage.modifier.foreign.haskell + branch_point: foreign + branch: + - foreign-import + - foreign-export + + foreign-import: + # 8.4.3 Import Declarations + - meta_scope: meta.declaration.foreign.import.haskell + - match: export{{break}} + fail: foreign + - match: import{{break}} + scope: keyword.declaration.import.haskell + - match: (?:interruptible|unsafe|safe){{break}} + scope: storage.modifier.import.haskell + - include: foreign-common + + foreign-export: + # 8.4.4 Export Declarations + - meta_scope: meta.declaration.foreign.export.haskell + - match: export{{break}} + scope: keyword.declaration.export.haskell + - match: (?:interruptible|unsafe|safe){{break}} + scope: invalid.illegal.unexpected-keyword.haskell + - include: foreign-common + + foreign-common: + - include: literal-strings + - include: prefix-parens-operators + - match: (?:capi|ccall|cplusplus|dotnet|jvm|stdcall){{break}} + scope: constant.language.convention.haskell + - match: '{{var_id}}' + scope: entity.name.function.haskell + captures: + 1: storage.modifier.unboxed.haskell + - include: else-pop + +###[ CLASS DECLARATIONS ]###################################################### + + classes: + # 4.3.1 Class Declarations + # https://www.haskell.org/onlinereport/haskell2010/haskellch4.html#x10-750004.3 + - match: class{{break}} + scope: + meta.declaration.class.haskell + keyword.declaration.class.haskell + branch_point: class-declaration + branch: + - class-signature + - class-context + + class-context: + - meta_content_scope: meta.declaration.class.context.haskell + - match: '{{operator_big_arrow}}' + scope: + meta.declaration.class.haskell + punctuation.separator.type.context.haskell + set: class-signature + - include: type-expressions + + class-signature: + - meta_include_prototype: false + - match: '' + set: + - class-args + - class-name + + class-name: + - include: ident-namespaces + - match: '{{con_id}}' + scope: entity.name.class.haskell + captures: + 1: storage.modifier.unboxed.haskell + pop: 1 + - include: else-pop + + class-args: + - meta_content_scope: meta.declaration.class.haskell + - match: (?={{operator_big_arrow}}) + fail: class-declaration + - include: class-type + + class-type: + - match: where{{break}} + scope: keyword.control.context.haskell + set: class-block + - include: type-expressions + - include: else-pop + + class-block: + - match: \{ + scope: punctuation.section.block.begin.haskell + set: class-block-body + - include: else-pop + + class-block-body: + - meta_scope: meta.block.haskell + - include: block-end + - include: functions + - include: statements + - include: expressions + +###[ INSTANCE DECLARATIONS ]################################################### + + instances: + # 4.3.2 Instance Declarations + # https://www.haskell.org/onlinereport/haskell2010/haskellch4.html#x10-750004.3 + - match: instance{{break}} + scope: + meta.declaration.instance.haskell + keyword.declaration.instance.haskell + branch_point: instance-declaration + branch: + - instance-signature + - instance-context + + instance-context: + - meta_content_scope: meta.declaration.instance.context.haskell + - match: '{{operator_big_arrow}}' + scope: + meta.declaration.instance.haskell + punctuation.separator.type.context.haskell + set: instance-signature + - include: type-expressions + + instance-signature: + - meta_include_prototype: false + - match: '' + set: + - instance-args + - class-name + + instance-args: + - meta_content_scope: meta.declaration.instance.haskell + - match: (?={{operator_big_arrow}}) + fail: instance-declaration + - include: class-type + +###[ DATA DECLARATIONS ]####################################################### + + datas: + # 4.2.1 Algebraic Datatype Declarations + # https://www.haskell.org/onlinereport/haskell2010/haskellch4.html#x10-680004.2 + - match: (data)(?:\s+(family|instance))?{{break}} + scope: meta.declaration.data.haskell + captures: + 1: keyword.declaration.data.haskell + 2: storage.modifier.family.haskell + branch_point: data-declaration + branch: + - data-signature + - data-context + + data-context: + - meta_content_scope: meta.declaration.data.context.haskell + - match: '{{operator_big_arrow}}' + scope: + meta.declaration.data.haskell + punctuation.separator.type.context.haskell + set: data-signature + - include: type-expressions + + data-signature: + - meta_include_prototype: false + - match: '' + set: + - data-args + - type-name + + data-args: + - meta_content_scope: meta.declaration.data.haskell + - match: (?={{operator_big_arrow}}) + fail: data-declaration + - include: type-expressions + - include: else-pop + +###[ DEFAULT DECLARATIONS ]#################################################### + + defaults: + # 4.3.4 Ambiguous Types, and Defaults for Overloaded Numeric Operations + # https://www.haskell.org/onlinereport/haskell2010/haskellch4.html#x10-750004.3 + - match: default{{break}} + scope: storage.modifier.haskell + push: + - default-meta + - default-body + + default-meta: + - meta_include_prototype: false + - meta_scope: meta.declaration.default.haskell + - include: immediatelly-pop + + default-body: + - match: \( + scope: punctuation.section.sequence.begin.haskell + set: type-tuple-body + - include: else-pop + +###[ DERIVING DECLARATIONS ]################################################### + + deriving: + # 4.3.3 Derived Instances + # https://www.haskell.org/onlinereport/haskell2010/haskellch4.html#x10-750004.3 + - match: (?:deriving|via){{break}} + scope: storage.modifier.haskell + push: + - deriving-meta + - deriving-body + + deriving-meta: + - meta_include_prototype: false + - meta_scope: meta.declaration.deriving.haskell + - include: immediatelly-pop + + deriving-body: + - match: \( + scope: punctuation.section.sequence.begin.haskell + set: deriving-tuple-body + - include: ident-namespaces + - include: ident-type + - include: else-pop + + deriving-tuple-body: + - meta_scope: meta.sequence.tuple.haskell + - include: tuple-end + - include: sequence-separators + - include: ident-namespaces + - include: ident-types + - include: else-pop + +###[ FUNCTION DECLARATIONS ]################################################### + + functions: + - match: (?={{var_id}}|\(\s*{{operator_parens}}\s*\)) + branch_point: functions + branch: + - variable-name + - function-name + + function-name: + - meta_content_scope: meta.function.identifier.haskell + - match: '{{operator_double_colon}}' + scope: punctuation.separator.type.haskell + pop: 1 + - match: '{{var_id}}' + scope: entity.name.function.haskell + captures: + 1: storage.modifier.unboxed.haskell + - include: prefix-parens-operators + - include: sequence-separators + + variable-name: + - match: (\()\s*({{operator_parens}})\s*(\)) + scope: meta.prefix.haskell + captures: + 1: punctuation.definition.prefix.begin.haskell + 2: keyword.operator.haskell + 3: punctuation.definition.prefix.end.haskell + push: variable-name-end + - match: '{{prelude_constants}}' + scope: support.constant.prelude.haskell + push: variable-name-end + - match: '{{prelude_functions}}' + scope: support.function.prelude.haskell + push: variable-name-end + - match: _\b + scope: variable.language.anonymous.haskell + captures: + 1: storage.modifier.unboxed.haskell + push: variable-name-end + - match: '{{var_id}}' + scope: variable.other.haskell + captures: + 1: storage.modifier.unboxed.haskell + push: variable-name-end + - include: sequence-separators + - include: else-pop + + variable-name-end: + - match: (?={{operator_double_colon}}) + fail: functions + - match: (?=,) + pop: 1 + - match: (?=\S) + pop: 2 + +###[ NEWTYPE DECLARATIONS ]#################################################### + + newtypes: + - match: newtype{{break}} + scope: + meta.declaration.newtype.haskell + keyword.declaration.newtype.haskell + branch_point: newtype-declaration + branch: + - newtype-signature + - newtype-context + + newtype-context: + - meta_content_scope: meta.declaration.newtype.context.haskell + - match: '{{operator_big_arrow}}' + scope: + meta.declaration.newtype.haskell + punctuation.separator.type.context.haskell + set: newtype-signature + - include: type-expressions + + newtype-signature: + - meta_include_prototype: false + - match: '' + set: + - newtype-args + - type-name + + newtype-args: + - meta_content_scope: meta.declaration.newtype.haskell + - match: (?={{operator_big_arrow}}) + fail: newtype-declaration + - include: type-expressions + - include: else-pop + +###[ TYPE DECLARATIONS ]####################################################### + + types: + # https://wiki.haskell.org/GHC/Type_families + - match: (type)(?:\s+(family))?{{break}} + scope: meta.declaration.type.haskell + captures: + 1: keyword.declaration.type.haskell + 2: storage.modifier.family.haskell + branch_point: type-declaration + branch: + - type-signature + - type-context + + type-context: + - meta_content_scope: meta.declaration.type.context.haskell + - match: '{{operator_big_arrow}}' + scope: + meta.declaration.type.haskell + punctuation.separator.type.context.haskell + set: type-signature + - include: type-expressions + + type-signature: + - meta_include_prototype: false + - match: '' + set: + - type-args + - type-name + + type-name: + - include: ident-namespaces + - match: '{{con_id}}' + scope: entity.name.type.haskell + captures: + 1: storage.modifier.unboxed.haskell + pop: 1 + - include: else-pop + + type-args: + - meta_content_scope: meta.declaration.type.haskell + - match: (?={{operator_big_arrow}}) + fail: type-declaration + - include: type-expressions + - include: else-pop + +###[ TYPE EXPRESSIONS ]######################################################## + + type-expressions: + - include: big-arrow-operators + - include: right-arrow-operators + - include: type-lists + - include: type-parens + - include: type-forall + - include: ident-anonymous + - include: ident-namespaces + - include: ident-types + - include: ident-variables + + type-forall: + - match: forall{{break}}|∀(?!{{symbol}}) + scope: keyword.control.forall.haskell + push: type-forall-body + + type-forall-body: + # Note: This is the only situation a dot is allowed within type expressions. + - match: \. + scope: punctuation.separator.sequence.haskell + pop: 1 + - include: ident-anonymous + - include: ident-variables + - include: else-pop + + type-lists: + - include: empty-lists + - match: \[ + scope: punctuation.section.sequence.begin.haskell + push: type-list-body + + type-list-body: + - meta_scope: meta.sequence.list.haskell + - include: list-end + - include: sequence-separators + - include: type-expressions + - include: else-pop + + type-parens: + # 4.1.3 Syntax of Class Assertions and Contexts + # https://www.haskell.org/onlinereport/haskell2010/haskellch4.html#x10-630004.1 + - include: empty-tuples + - include: prefix-parens-operators + - match: (?=\() + branch_point: type-parens + branch: + - type-group + - type-tuple + + type-group: + - match: \( + scope: punctuation.section.group.begin.haskell + set: type-group-body + + type-group-body: + - meta_scope: meta.group.haskell + - match: ',|:(?!{{symbol}})' + fail: type-parens + - include: group-end + - include: type-expressions + - include: else-pop + + type-tuple: + - match: \( + scope: punctuation.section.sequence.begin.haskell + set: type-tuple-body + + type-tuple-body: + - meta_scope: meta.sequence.tuple.haskell + - include: tuple-end + - include: sequence-separators + - include: type-expressions + - include: else-pop + +###[ BRACES ]################################################################## + + blocks: + # 2.7 Layout + # https://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-210002.7 + - match: \{ + scope: punctuation.section.block.begin.haskell + push: block-body + + block-end: + - match: \} + scope: punctuation.section.block.end.haskell + pop: 1 + + block-body: + - meta_scope: meta.block.haskell + - include: block-end + - include: statements + - include: expressions + - include: else-pop + + records: + - match: \{ + scope: punctuation.section.block.begin.haskell + push: record-body + + record-body: + - meta_scope: meta.block.haskell + - include: block-end + - include: expressions + - include: else-pop + +###[ BRACKETS ]################################################################ + + brackets: + - include: typed-quotes + - include: overloaded-quotes + - include: empty-lists + - match: (?=\[) + branch_point: list-or-quasiquote + branch: + - list + - quasi-quote + + empty-lists: + - match: (\[)(\]) + captures: + 0: meta.sequence.list.empty.haskell + 1: punctuation.section.sequence.begin.haskell + 2: punctuation.section.sequence.end.haskell list: + # 3.7 Lists + # https://www.haskell.org/onlinereport/haskell2010/haskellch3.html#x8-340003.7 - match: \[ scope: punctuation.section.sequence.begin.haskell - push: - - meta_scope: meta.sequence.haskell - - match: \] - scope: punctuation.section.sequence.end.haskell - pop: true - - match: ',' - scope: punctuation.separator.sequence.haskell - - include: expression - - constant: - - match: \(\) - scope: constant.language.unit.haskell - - match: '\[\]' - scope: constant.language.empty-list.haskell - - include: number - - match: '\b[A-Z]\w*\b' - scope: constant.other.haskell - - number: - - match: \b(0[oO])([0-7]+)\b + set: list-body + + list-body: + - meta_scope: meta.sequence.list.haskell + - include: list-fail + - include: list-end + - include: list-keywords + - include: records + - include: expressions + - include: else-pop + + list-end: + - match: \] + scope: punctuation.section.sequence.end.haskell + pop: 1 + + list-fail: + - match: \|\] + fail: list-or-quasiquote + + list-keywords: + # 6.2.7. Generalised (SQL-like) List Comprehensions + # https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/generalised_list_comprehensions.html + - match: (?:group|by|using){{break}} + scope: keyword.control.list.haskell + + quasi-quote: + # https://wiki.haskell.org/Quasiquotation + - match: \[ + scope: meta.quoted.quasi.haskell punctuation.section.quoted.begin.haskell + set: quasi-quote-name + + quasi-quote-name: + - meta_content_scope: meta.quoted.quasi.haskell + - match: \| + scope: meta.quoted.quasi.haskell punctuation.section.quoted.haskell + set: quasi-quote-body + - match: '[\w'']+' + scope: variable.function.quasi-quoter.haskell + - include: quasi-quote-end + + quasi-quote-body: + - meta_content_scope: meta.quoted.quasi.haskell meta.string.haskell string.unquoted.haskell + - include: quasi-quote-end + + quasi-quote-end: + - match: \|\] + scope: meta.quoted.quasi.haskell punctuation.section.quoted.end.haskell + pop: 1 + + overloaded-quotes: + # https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0246-overloaded-bracket.rst + - match: \[\| + scope: punctuation.section.quoted.begin.haskell + push: overloaded-quote-body + + overloaded-quote-body: + - meta_scope: meta.quoted.overloaded.haskell + - match: \|\] + scope: punctuation.section.quoted.end.haskell + pop: 1 + - include: expressions + + typed-quotes: + # https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0246-overloaded-bracket.rst + - match: \[\|\|(?!\]) + scope: punctuation.section.quoted.begin.haskell + push: typed-quote-body + + typed-quote-body: + - meta_scope: meta.quoted.typed.haskell + - match: \|\|\] + scope: punctuation.section.quoted.end.haskell + pop: 1 + - include: expressions + +###[ PARENTHESES ]############################################################# + + parens: + # 3.8 Tuples + # https://www.haskell.org/onlinereport/haskell2010/haskellch3.html#x8-360003.8 + - include: empty-tuples + - include: unboxed-tuples + - include: prefix-parens-operators + - match: (?=\() + branch_point: parens + branch: + - group + - tuple + + group: + - match: \( + scope: punctuation.section.group.begin.haskell + set: group-body + + group-end: + - match: \) + scope: punctuation.section.group.end.haskell + pop: 1 + + group-body: + - meta_scope: meta.group.haskell + - match: ',|:(?!{{symbol}})' + fail: parens + - include: group-end + - include: records + - include: expressions + - include: else-pop + + tuple: + - match: \( + scope: punctuation.section.sequence.begin.haskell + set: tuple-body + + tuple-end: + - match: \) + scope: punctuation.section.sequence.end.haskell + pop: 1 + + tuple-body: + - meta_scope: meta.sequence.tuple.haskell + - include: tuple-end + - include: records + - include: expressions + - include: else-pop + + empty-tuples: + # 6.1.5 Unit Data Type + # https://www.haskell.org/onlinereport/haskell2010/haskellch6.html#x13-1200006.1.5 + - match: (\()(\)) + scope: meta.sequence.tuple.empty.haskell + captures: + 1: punctuation.section.sequence.begin.haskell + 2: punctuation.section.sequence.end.haskell + + range-tuples: + - match: (\()\s*(\.\.)\s*(\)) + scope: meta.sequence.tuple.haskell + captures: + 1: punctuation.section.sequence.begin.haskell + 2: keyword.operator.haskell + 3: punctuation.section.sequence.end.haskell + + unboxed-tuples: + # GHC 6.16.3 Unboxed tuples + # https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/primitives.html#unboxed-tuples + - match: (\()(#) + captures: + 1: punctuation.section.sequence.begin.haskell + 2: storage.modifier.unboxed.haskell + push: unboxed-tuple-body + + unboxed-tuple-body: + - meta_scope: meta.sequence.tuple.haskell + - match: (#)(\)) + captures: + 1: storage.modifier.unboxed.haskell + 2: punctuation.section.sequence.end.haskell + pop: 1 + - include: records + - include: expressions + - include: else-pop + +###[ IDENTIFIERS ]############################################################# + + ident-anonymous: + - match: _\b + scope: variable.language.anonymous.haskell + captures: + 1: storage.modifier.unboxed.haskell + + ident-builtin-classes: + # Prelude Class Types + - match: '{{prelude_classes}}' + scope: support.class.prelude.haskell + + ident-builtin-types: + # Prelude Data Types of special meaning + - match: '{{prelude_constants}}' + scope: support.constant.prelude.haskell + # Prelude Data Types + - match: '{{prelude_types}}' + scope: support.type.prelude.haskell + # Unboxed Data Types + - match: '{{unboxed_types}}' + scope: support.type.unboxed.haskell + captures: + 1: storage.modifier.unboxed.haskell + + ident-builtin-functions: + - match: '{{prelude_functions}}' + scope: support.function.prelude.haskell + + ident-namespaces: + - match: ({{con_id}})(\.) + captures: + 1: variable.namespace.haskell + 2: storage.modifier.haskell + 3: punctuation.accessor.dot.haskell + + ident-module: + - match: '{{con_id}}' + scope: entity.name.namespace.haskell + captures: + 1: storage.modifier.unboxed.haskell + pop: 1 + + ident-types: + - include: ident-builtin-classes + - include: ident-builtin-types + - match: '{{con_id}}' + scope: storage.type.haskell + captures: + 1: storage.modifier.unboxed.haskell + + ident-type: + - match: '{{prelude_classes}}' + scope: support.class.prelude.haskell + pop: 1 + - match: '{{prelude_types}}' + scope: support.type.prelude.haskell + pop: 1 + - match: '{{unboxed_types}}' + scope: support.type.unboxed.haskell + pop: 1 + captures: + 1: storage.modifier.unboxed.haskell + - match: '{{con_id}}' + scope: storage.type.haskell + captures: + 1: storage.modifier.unboxed.haskell + pop: 1 + + ident-variables: + - match: '{{var_id}}' + scope: variable.other.haskell + captures: + 1: storage.modifier.unboxed.haskell + +###[ LITERALS ]################################################################ + + literal-numbers: + # 2.5 Decimal floating point literals + # https://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-190002.5 + - match: (\d{{dec_digit}}*(?:(\.){{dec_digit}}+{{dec_exponent}}?|{{dec_exponent}}))(#*) + scope: meta.number.float.decimal.haskell + captures: + 1: constant.numeric.value.haskell + 2: punctuation.separator.decimal.haskell + 3: constant.numeric.suffix.haskell + # GHC 6.9.3 Hexadecimal floating point literals + # https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/hex_float_literals.html + - match: (0[xX])({{hex_digit}}+(\.){{hex_digit}}+{{hex_exponent}}?)(#*) + scope: meta.number.float.hexadecimal.haskell + captures: + 1: constant.numeric.base.haskell + 2: constant.numeric.value.haskell + 3: punctuation.separator.decimal.haskell + 4: constant.numeric.suffix.haskell + # GHC 6.9.2 Binary integer literals + # https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/binary_literals.html + - match: (0[bB])({{bin_digit}}+)(#*) + scope: meta.number.integer.binary.haskell + captures: + 1: constant.numeric.base.haskell + 2: constant.numeric.value.haskell + 3: constant.numeric.suffix.haskell + # 2.5 Numeric Literals + # https://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-190002.5 + - match: (0[oO])({{oct_digit}}+)(#*) scope: meta.number.integer.octal.haskell captures: 1: constant.numeric.base.haskell 2: constant.numeric.value.haskell - - match: \b(0[xX])(\h+)\b + 3: constant.numeric.suffix.haskell + - match: (0[xX])({{hex_digit}}+)(#*) scope: meta.number.integer.hexadecimal.haskell captures: 1: constant.numeric.base.haskell 2: constant.numeric.value.haskell - - match: \b\d+\b - scope: meta.number.integer.decimal.haskell constant.numeric.value.haskell + 3: constant.numeric.suffix.haskell + - match: (\d{{dec_digit}}*)(#*) + scope: meta.number.integer.decimal.haskell + captures: + 1: constant.numeric.value.haskell + 2: constant.numeric.suffix.haskell - declaration: - - match: \bmodule\b - scope: keyword.declaration.namespace.haskell - push: - - meta_scope: meta.declaration.module.haskell - - match: \bwhere\b - scope: keyword.control.context.haskell - pop: true - - match: \b{{module_name}}\b - scope: entity.name.namespace.haskell - - include: module_exports - - match: \bclass\b - scope: keyword.declaration.class.haskell - push: - - meta_scope: meta.declaration.class.haskell - - match: \bwhere\b - scope: keyword.control.context.haskell - pop: true - - match: |- - \b(?x:Monad|Monadoid|Functor|Applicative|Foldableble|Traversable - |Eq|Ord|Read|Show|Num|Fractional|Rational|Enum|Bounded - |Real|RealFrac|RealFloat|Integral|Floating)\b - scope: support.class.prelude.haskell - - match: '[A-Z][A-Za-z_'']*' - scope: entity.other.inherited-class.haskell - - match: '\b[a-z][a-zA-Z0-9_'']*\b' - scope: variable.other.generic-type.haskell - - match: \binstance\b - scope: keyword.declaration.haskell - push: - - meta_scope: meta.declaration.instance.haskell - - match: \bwhere\b|$ - scope: keyword.control.context.haskell - pop: true - - include: type_signature - - match: '^(\s*)([a-z_][a-zA-Z0-9_'']*|\(({{operator_parens}})\))\s*(::|∷)' - captures: - 2: entity.name.function.haskell - 3: keyword.operator.infix.haskell - 4: keyword.other.double-colon.haskell - push: - - meta_scope: meta.function.type-declaration.haskell - - match: ^(?!\s*(?:--|{-|$)|\1\s) - pop: true - - include: type_signature - - match: (deriving|via)\s*\( + literal-chars: + # 2.6 Character and String Literals + # https://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-200002.6 + - match: (')(?:([ [\S&&[^\\'']]])|{{escape_sequence}})?(?:(')(#*)|{{comment_ahead}}) + scope: meta.string.haskell string.quoted.single.haskell captures: - 1: keyword.other.haskell - push: - - meta_scope: meta.deriving.haskell - - match: \) - pop: true - - match: '\b[A-Z][a-zA-Z_'']*' - scope: entity.other.inherited-class.haskell + 1: punctuation.definition.string.begin.haskell + 2: constant.character.literal.haskell + 3: constant.character.escape.haskell + 4: constant.character.escape.decimal.haskell + 5: constant.character.escape.octal.haskell + 6: constant.character.escape.hexadecimal.haskell + 7: constant.character.escape.control.haskell + 8: punctuation.definition.string.end.haskell + 9: storage.modifier.unboxed.haskell + literal-strings: + # 2.6 Character and String Literals + # https://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-200002.6 + - match: \" + scope: punctuation.definition.string.begin.haskell + push: literal-string-body - import: - - match: \bimport\b - scope: keyword.control.import.haskell - push: - - meta_scope: meta.import.haskell - - match: ($|;) - pop: true - - match: (qualified|as|hiding) - scope: keyword.control.import.haskell - - include: module_name - - include: module_exports - - keyword: - - match: \b(?:do|in)\b + literal-string-body: + - meta_include_prototype: false + - meta_scope: meta.string.haskell string.quoted.double.haskell + - match: (\")(#*)|$ + captures: + 1: punctuation.definition.string.end.haskell + 2: storage.modifier.unboxed.haskell + pop: 1 + - match: '{{escape_sequence}}' + captures: + 1: constant.character.escape.haskell + 2: constant.character.escape.decimal.haskell + 3: constant.character.escape.octal.haskell + 4: constant.character.escape.hexadecimal.haskell + 5: constant.character.escape.control.haskell + - match: (\\)\s*$ + captures: + 1: punctuation.definition.continuation.begin.haskell + push: linteral-string-continuation + + linteral-string-continuation: + - clear_scopes: 2 + - meta_scope: meta.string.continuation.haskell + - meta_include_prototype: false + - match: \\ + scope: punctuation.definition.continuation.end.haskell + pop: 1 + - match: \" + scope: invalid.illegal.expect-continuation-end.haskell + pop: 2 + - match: \S + scope: invalid.illegal.expect-continuation-end.haskell + pop: 1 + +###[ KEYWORDS AND OPERATORS ]################################################## + + keywords: + - match: (?:mdo|do|in|rec|where){{break}} scope: keyword.control.context.haskell - - match: \b(?:newtype|type)\b - scope: keyword.declaration.type.haskell - - match: \b(?:data)\b - scope: keyword.declaration.data.haskell - - match: \b(?:deriving)\b - scope: keyword.declaration.data.haskell - - match: \b(?:case|of)\b + - match: (?:case|of){{break}} scope: keyword.control.conditional.select.haskell # the construct is commonly called "select" - - match: \b(?:let|where)\b + - match: if{{break}} + scope: keyword.control.conditional.if.haskell + - match: then{{break}} + scope: keyword.control.conditional.then.haskell + - match: else{{break}} + scope: keyword.control.conditional.else.haskell + - match: let{{break}} scope: keyword.declaration.variable.haskell - - match: \breturn\b - scope: keyword.control.flow.return.haskell - - match: \b(?:default|otherwise)\b - scope: keyword.other.haskell - - match: \b(?:(if)|(then)|(else))\b - captures: - 1: keyword.control.conditional.if.haskell - 2: keyword.control.conditional.then.haskell - 3: keyword.control.conditional.else.haskell - - operator: - - match: (`)[a-zA-Z_'.\d]+(`) - # Haskell allows any ordinary function application (elem 4 [1..10]) - # to be rewritten as an infix expression (4 `elem` [1..10])." - scope: keyword.operator.function.infix.haskell - captures: - 1: punctuation.definition.function.begin.haskell - 2: punctuation.definition.function.end.haskell - - match: '\binfix[lr]?\b' + - match: proc{{break}} + scope: keyword.declaration.function.haskell + # 4.4.2 Fixity Declarations + - match: infix[lr]?{{break}} + scope: keyword.declaration.fixity.haskell + + operators: + - include: sequence-separators + - include: big-arrow-operators + - include: left-arrow-operators + - include: right-arrow-operators + - include: prefix-parens-operators + - include: infix-quoted-operators + # Match all not otherwise matched single quotes as promoition operator + # Note: Found in real world code but not in specs so far. + - match: \' scope: keyword.operator.haskell - - match: \b(\d+)(?:(\.)(\d+)([eE][-+]?\d+)?|([eE][-+]?\d+))\b - scope: meta.number.float.decimal.haskell - captures: - 1: constant.numeric.value.haskell - 2: punctuation.separator.decimal.haskell - 3: constant.numeric.value.haskell - 4: constant.numeric.value.exponent.haskell - 5: constant.numeric.value.exponent.haskell - - match: '{{operator_infix}}' + - match: '{{operator_double_colon}}' + scope: punctuation.separator.type.haskell + - match: '{{operator_symbol}}' scope: keyword.operator.haskell - - include: operator_paren - operator_paren: - - match: \(({{operator_parens}})\) - scope: variable.function.infix.haskell + big-arrow-operators: + - match: '{{operator_big_arrow}}' + scope: punctuation.separator.type.context.haskell + + left-arrow-operators: + - match: '{{operator_left_arrow}}' + scope: keyword.operator.arrow.haskell + + right-arrow-operators: + - match: '{{operator_right_arrow}}' + scope: keyword.operator.arrow.haskell + + prefix-parens-operators: + - match: (\()\s*({{operator_parens}})\s*(\)) + scope: meta.prefix.haskell captures: - 1: keyword.operator.haskell + 1: punctuation.definition.prefix.begin.haskell + 2: keyword.operator.haskell + 3: punctuation.definition.prefix.end.haskell - preprocessor: - # In addition to Haskell's "native" syntax, - # GHC permits the C preprocessor to be run on a source file. - - match: ^\s*(#)\s*\w+ - scope: meta.preprocessor.c + infix-quoted-operators: + - match: (?=\`) + branch_point: infix-quoted-operators + branch: + - infix-quoded-operators-begin + - immediatelly-pop + + infix-quoded-operators-begin: + - match: (\`)\s* captures: - 1: punctuation.definition.preprocessor.c - - include: pragma + 1: punctuation.definition.infix.begin.haskell + set: infix-quoded-operators-body - string: - - match: '"' - scope: punctuation.definition.string.begin.haskell - push: - - meta_include_prototype: false - - meta_scope: string.quoted.double.haskell - - match: $|" - scope: punctuation.definition.string.end.haskell - pop: true - - match: '{{escape_sequence}}' - captures: - 1: constant.character.escape.haskell - 2: constant.character.escape.decimal.haskell - 3: constant.character.escape.octal.haskell - 4: constant.character.escape.hexadecimal.haskell - 5: constant.character.escape.control.haskell - - match: |- - (?x) - (') - (?: - [\ -\[\]-~] # Basic Char - | {{escape_sequence}} # Escapes - ) - ([^']*) - (') - scope: string.quoted.single.haskell + infix-quoded-operators-body: + - meta_scope: meta.infix.haskell + - match: \s*(\`) captures: - 1: punctuation.definition.string.begin.haskell - 2: constant.character.escape.haskell - 3: constant.character.escape.decimal.haskell - 4: constant.character.escape.octal.haskell - 5: constant.character.escape.hexadecimal.haskell - 6: constant.character.escape.control.haskell - 7: invalid.illegal.expected-closing-quotation.haskell - 8: punctuation.definition.string.end.haskell + 1: punctuation.definition.infix.end.haskell + pop: 1 + - include: ident-namespaces + - match: '{{id}}' + scope: keyword.operator.function.infix.haskell + captures: + 1: storage.modifier.unboxed.haskell + - match: '' + fail: infix-quoted-operators - splice: - - match: '\[(?:|e|d|t|p)\|' - comment: Points out splices in ast quotes - scope: keyword.other.quasibracket.haskell - push: - - meta_scope: meta.other.quasiquote.haskell - - match: '(.*)(\|\])' - captures: - 1: string.quasiquoted.haskell - 2: keyword.other.quasibracket.haskell - pop: true - - match: \$\( - scope: keyword.other.splice.haskell - - match: \$ - scope: string.quasiquoted.haskell - - match: '[^$]*' - scope: string.quasiquoted.haskell - - match: \$\( - comment: Highlight the beginning of a splice. - scope: keyword.other.splice.haskell - - match: '\[[a-zA-Z0-9_'']*\|' - scope: keyword.other.quasibracket.haskell - push: - - meta_scope: meta.other.quasiquote.haskell - - match: '(.*)(\|\])' - captures: - 1: string.quasiquoted.haskell - 2: keyword.other.quasibracket.haskell - pop: true - - match: .* - scope: string.quasiquoted.haskell - - ident: - - match: |- - (?x) \b - (abs|acos|acosh|all|and|any|appendFile|asTypeOf|asin|asinh|atan|atan2|atanh - |break - |ceiling|compare|concat|concatMap|const|cos|cosh|curry|cycle - |decodeFloat|div|divMod|drop|dropWhile - |either|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error - |errorWithoutStackTrace|even|exp|exponent - |fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldMap|foldl|foldl1|foldr - |foldr1|fromEnum|fromInteger|fromIntegral|fromRational|fst - |gcd|getChar|getContents|getLine - |head - |id|init|interact|ioError|isDenormalized|isIEEE|isInfinite|isNaN|isNegativeZero|iterate - |last|lcm|length|lex|lines|log|logBase|lookup - |map|mapM|mapM_|mappend|max|maxBound|maximum|maybe|mconcat|mempty|min|minBound|minimum|mod - |negate|not|notElem|null - |odd|or|otherwise - |pi|pred|print|product|properFraction|pure|putChar|putStr|putStrLn - |quot|quotRem|read - |readFile|readIO|readList|readLn|readParen|reads|readsPrec|realToFrac|recip|rem|repeat - |replicate|return|reverse|round|scaleFloat - |scanl|scanl1|scanr|scanr1|seq|sequence|sequenceA|sequence_|show|showChar|showList - |showParen|showString|shows|showsPrec|significand|signum|sin|sinh|snd|span|splitAt|sqrt - |subtract|succ|sum|tail - |take|takeWhile|tan|tanh|toEnum|toInteger|toRational|traverse|truncate|uncurry - |undefined|unlines|until|unwords|unzip|unzip3|userError|words - |writeFile - |zip|zip3|zipWith|zipWith3 - ) \b - scope: support.function.prelude.haskell - - match: '[[:lower:]][^\s{{operator_char}}),\]{}]+' - scope: meta.name.haskell - - comment: - # As of build 4079 the [:punct:] class is missing some ASCII chars that - # Unicode considers part of the Symbol category. - - match: '--+(?![[:punct:]!-/:-@\[-`{-~])' - scope: punctuation.definition.comment.haskell - push: - - meta_scope: comment.line.double-dash.haskell - - match: $\n? - pop: true - - include: block_comment + statement-terminators: + # Depending on layout, semicolon may be needed to terminate statements. + # https://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-210002.7 + - match: ';' + scope: punctuation.terminator.statement.haskell - block_comment: - - match: '\{-(?!#)' - scope: punctuation.definition.comment.begin.haskell - push: - - meta_scope: comment.block.haskell - - match: '\{-#' - push: - - match: '-\}' - pop: true - - include: block_comment - - include: block_comment - - match: '-\}' - scope: punctuation.definition.comment.end.haskell - pop: true - - module_exports: - - match: \( - scope: punctuation.section.group.begin.haskell - push: - - meta_scope: meta.declaration.exports.haskell - - match: \) - scope: punctuation.section.group.end.haskell - pop: true - - match: '\b[a-z][a-zA-Z_''0-9]*' - scope: variable.function.haskell - - match: '\b[A-Z][A-Za-z_''0-9]*' - scope: storage.type.haskell - - match: ',' - scope: punctuation.separator.comma.haskell - - include: operator_paren - - match: \(.*?\) - comment: So named because I don't know what to call this. - scope: meta.other.unknown.haskell - - module_name: - - match: '\b{{module_name}}\b' - scope: support.other.module.haskell - - type_signature: - - include: pragma - - match: '(?:->|→)' - scope: keyword.other.arrow.haskell - - match: '(?:=>|⇒)' - scope: keyword.other.big-arrow.haskell - - match: '\b[a-z][a-zA-Z0-9_'']*\b' - scope: variable.other.generic-type.haskell - - match: '\b[A-Z][a-zA-Z0-9_'']*\b' - scope: storage.type.haskell - - match: \(\) - scope: support.constant.unit.haskell + sequence-separators: + - match: ',|\|(?!\|)' + scope: punctuation.separator.sequence.haskell - pragma: - - match: '\{-#' - push: - - meta_scope: meta.preprocessor.haskell - - match: '#-\}' - pop: true - - match: |- - \b(?x: - LANGUAGE|OPTIONS_GHC|OPTIONS_HADDOCK|INCLUDE|WARNING|DEPRECATED|MINIMAL - |UNPACK|NOUNPACK|SOURCE|OVERLAPPING|OVERLAPPABLE|OVERLAPS - |INCOHERENT|INLINE|NOINLINE|INLINABLE|CONLIKE|LINE|RULES - |SPECIALIZE|SPECIALISE - )\b - # https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#pragmas - scope: keyword.other.preprocessor.haskell +###[ PROTOTYPES ]############################################################## + + else-pop: + - match: (?=\S) + pop: 1 + + immediatelly-pop: + - match: '' + pop: 1 diff --git a/Haskell/Indent Patterns.tmPreferences b/Haskell/Indentation Rules.tmPreferences similarity index 86% rename from Haskell/Indent Patterns.tmPreferences rename to Haskell/Indentation Rules.tmPreferences index cefcfb85cc9..02151c13553 100644 --- a/Haskell/Indent Patterns.tmPreferences +++ b/Haskell/Indentation Rules.tmPreferences @@ -1,8 +1,6 @@ - name - Indent Patterns scope source.haskell settings diff --git a/Haskell/Indexed Reference List.tmPreferences b/Haskell/Indexed Reference List.tmPreferences new file mode 100644 index 00000000000..fd8bea0c984 --- /dev/null +++ b/Haskell/Indexed Reference List.tmPreferences @@ -0,0 +1,15 @@ + + + + scope + + source.haskell keyword.operator - meta.function.identifier, + source.haskell variable.other + + settings + + showInIndexedReferenceList + 1 + + + diff --git a/Haskell/Indexed Symbol List.tmPreferences b/Haskell/Indexed Symbol List.tmPreferences new file mode 100644 index 00000000000..ad8290889fc --- /dev/null +++ b/Haskell/Indexed Symbol List.tmPreferences @@ -0,0 +1,15 @@ + + + + scope + + source.haskell entity.name.type, + source.haskell meta.function.identifier meta.prefix keyword.operator + + settings + + showInIndexedSymbolList + 1 + + + diff --git a/Haskell/Literate Haskell.sublime-syntax b/Haskell/Literate Haskell.sublime-syntax index 482ba775a27..1c993ebdc8f 100644 --- a/Haskell/Literate Haskell.sublime-syntax +++ b/Haskell/Literate Haskell.sublime-syntax @@ -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 diff --git a/Haskell/Snippets/Case.sublime-snippet b/Haskell/Snippets/Case.sublime-snippet index 542f43961b0..ccfc87a3c87 100644 --- a/Haskell/Snippets/Case.sublime-snippet +++ b/Haskell/Snippets/Case.sublime-snippet @@ -2,6 +2,6 @@ ${3:$1} ${1/./ /g} ${4:otherwise} -> ${0:$1}]]> case - source.haskell + source.haskell - comment - string Case diff --git a/Haskell/Snippets/Instance.sublime-snippet b/Haskell/Snippets/Instance.sublime-snippet index 939fe479adb..d5de6173e0d 100644 --- a/Haskell/Snippets/Instance.sublime-snippet +++ b/Haskell/Snippets/Instance.sublime-snippet @@ -2,6 +2,6 @@ instance - source.haskell + source.haskell - comment - string - meta.declaration Instance diff --git a/Haskell/Snippets/Lambda.sublime-snippet b/Haskell/Snippets/Lambda.sublime-snippet index e8dd0b7a127..e1b5b25b906 100644 --- a/Haskell/Snippets/Lambda.sublime-snippet +++ b/Haskell/Snippets/Lambda.sublime-snippet @@ -1,6 +1,6 @@ ${0:f t}]]> \ - source.haskell + source.haskell - comment - string \t -> f t diff --git a/Haskell/Snippets/Main.sublime-snippet b/Haskell/Snippets/Main.sublime-snippet index 8aabb680671..c8dd39870ec 100644 --- a/Haskell/Snippets/Main.sublime-snippet +++ b/Haskell/Snippets/Main.sublime-snippet @@ -3,6 +3,6 @@ main = ${1:putStrLn "Hello World"}]]> main - source.haskell + source.haskell - comment - string - meta.declaration Main diff --git a/Haskell/Snippets/module.sublime-snippet b/Haskell/Snippets/module.sublime-snippet index 06feabb7c7b..faf61ff5e27 100644 --- a/Haskell/Snippets/module.sublime-snippet +++ b/Haskell/Snippets/module.sublime-snippet @@ -3,6 +3,6 @@ ${2:main = ${3:putStrLn "Hello World"}}]]> mod - source.haskell + source.haskell - comment - string - meta.block - meta.declaration Module diff --git a/Haskell/Symbol List.tmPreferences b/Haskell/Symbol List - Exports.tmPreferences similarity index 59% rename from Haskell/Symbol List.tmPreferences rename to Haskell/Symbol List - Exports.tmPreferences index f4f8e959663..19a6682c8c4 100644 --- a/Haskell/Symbol List.tmPreferences +++ b/Haskell/Symbol List - Exports.tmPreferences @@ -1,10 +1,8 @@ - name - Symbol List scope - source.haskell entity.name.function - entity.name.function.infix + source.haskell entity.name.export settings showInSymbolList diff --git a/Haskell/Symbol List - Imports.tmPreferences b/Haskell/Symbol List - Imports.tmPreferences new file mode 100644 index 00000000000..4bc56113857 --- /dev/null +++ b/Haskell/Symbol List - Imports.tmPreferences @@ -0,0 +1,12 @@ + + + + scope + source.haskell entity.name.import + settings + + showInSymbolList + 1 + + + diff --git a/Haskell/Symbol List - Operators.tmPreferences b/Haskell/Symbol List - Operators.tmPreferences new file mode 100644 index 00000000000..1be1f355a32 --- /dev/null +++ b/Haskell/Symbol List - Operators.tmPreferences @@ -0,0 +1,12 @@ + + + + scope + source.haskell meta.function.identifier meta.prefix keyword.operator + settings + + showInSymbolList + 1 + + + diff --git a/Haskell/Symbol List - Types.tmPreferences b/Haskell/Symbol List - Types.tmPreferences new file mode 100644 index 00000000000..826187468c6 --- /dev/null +++ b/Haskell/Symbol List - Types.tmPreferences @@ -0,0 +1,12 @@ + + + + scope + source.haskell entity.name.type + settings + + showInSymbolList + 1 + + + diff --git a/Haskell/syntax_test_haskell.hs b/Haskell/syntax_test_haskell.hs deleted file mode 100644 index 81ebf1bf7d9..00000000000 --- a/Haskell/syntax_test_haskell.hs +++ /dev/null @@ -1,382 +0,0 @@ --- SYNTAX TEST "Packages/Haskell/Haskell.sublime-syntax" - -23*36 -- single line comment --- ^^ punctuation.definition.comment.haskell --- ^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-dash.haskell -23*36 --------------------------------------------------- single line comment --- ^ - comment - punctuation --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-dash.haskell punctuation.definition.comment.haskell -23*36 --- <- - comment.line.double-dash.haskell - - {- block comment -} 23*36 --- ^^ punctuation.definition.comment.begin.haskell --- ^^^^^^^^^^^^^^^^^^^ comment.block.haskell --- ^^ punctuation.definition.comment.end.haskell --- ^ - comment.block.haskell - - {- {-# #-} -} 23*36 --- ^^ punctuation.definition.comment.begin.haskell --- ^^^^^^^^^^^^^ comment.block.haskell - meta.preprocessor.haskell --- ^^ punctuation.definition.comment.end.haskell --- ^ - comment.block.haskell - - {- {- #-} -} 23*36 --- ^^ punctuation.definition.comment.begin.haskell --- ^^^^^^^^^^^^ comment.block.haskell --- ^^ punctuation.definition.comment.end.haskell --- ^ - comment.block.haskell - - {- {- -} -} 23*36 --- ^^ punctuation.definition.comment.begin.haskell --- ^^^^^^^^^^^ comment.block.haskell --- ^^ punctuation.definition.comment.end.haskell --- ^ - comment.block.haskell - - {- {-# -} -} 23*36 --- ^^ punctuation.definition.comment.begin.haskell --- ^^^^^^^^^^^^ comment.block.haskell - meta.preprocessor.haskell --- ^^ punctuation.definition.comment.end.haskell --- ^ - comment.block.haskell - - {- {-# {- test -} -} -} 23*36 --- ^^ punctuation.definition.comment.begin.haskell --- ^^^^^^^^^^^^^^^^^^^^^^^ comment.block.haskell - meta.preprocessor.haskell --- ^^ punctuation.definition.comment.end.haskell --- ^ - comment.block.haskell - ---DECLARATIONS - - module Name where --- ^^^^^^^^^^^^^^^^^ meta.declaration.module.haskell --- ^^^^^^ keyword.declaration.namespace.haskell --- ^^^^ entity.name.namespace.haskell --- ^^^^^ keyword.control.context.haskell - - class (Functor t, Foldable t) => Traversable t where --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.class.haskell --- ^^^^^ keyword.declaration.class.haskell --- ^^^^^ keyword.control.context.haskell - {-# MINIMAL traverse | sequenceA LANGUAGE #-} --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.preprocessor.haskell --- ^ - meta.preprocessor.haskell --- ^^^^^^^ keyword.other.preprocessor.haskell - - {-# OPTIONS_HADDOCK not-home #-} --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.preprocessor.haskell --- ^ - meta.preprocessor.haskell --- ^^^^^^^^^^^^^^^ keyword.other.preprocessor.haskell - --- | Map each element of a structure to an action, --- evaluate these actions from left to right, and --- collect the results. For a version that ignores --- the results see 'Data.Foldable.traverse_'. --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-dash.haskell - - data Record = - Record { - recordInt :: Int - , recordString :: String - , recordDouble :: Double - , recordRational :: Rational - } deriving (Eq, Ord, Generic) --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.deriving.haskell - deriving (Read, Show) via (Quiet Record) --- ^^^ keyword.other.haskell --- ^^^^^^^^^^^^^^^^^^ meta.deriving.haskell --- ^^^^^ entity.other.inherited-class.haskell --- ^ - entity --- ^^^^^^ entity.other.inherited-class.haskell - - traverse :: Applicative f => --- ^^^^^^^^ entity.name.function.haskell --- ^^ keyword.other.double-colon.haskell --- ^^^^^^^^^^^ storage.type.haskell --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.type-declaration.haskell --- ^^ keyword.other.big-arrow.haskell - (a -> f b) --- ^^^^^^^^^^^^ meta.function.type-declaration.haskell --- ^^ keyword.other.arrow.haskell - -> t a --- ^^^^^^^^ meta.function.type-declaration.haskell --- ^^ keyword.other.arrow.haskell - -> f (t b) --- ^^^^^^^^^^^^ meta.function.type-declaration.haskell --- ^^ keyword.other.arrow.haskell - traverse f = sequenceA . fmap f --- ^ keyword.operator.haskell --- ^ keyword.operator.haskell - --- | Evaluate each action in the structure from --- left to right, and collect the results. --- For a version that ignores the results see --- 'Data.Foldable.sequenceA_'. - sequenceA ∷ Applicative f ⇒ t (f a) → f (t a) --- ^^^^^^^^^ entity.name.function.haskell --- ^ keyword.other.double-colon.haskell --- ^^^^^^^^^^^ storage.type.haskell --- ^ keyword.other.big-arrow.haskell --- ^ keyword.other.arrow.haskell - sequenceA = traverse id --- ^ keyword.operator.haskell - - --- INFIX OPERATORS - - a a = (+) a 2 --- ^ keyword.operator.haskell --- ^^^ variable.function.infix.haskell --- ^ keyword.operator.haskell --- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell - a a = (-) a 2 --- ^ keyword.operator.haskell --- ^^^ variable.function.infix.haskell --- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell - a a = (*) a 2 --- ^ keyword.operator.haskell --- ^^^ variable.function.infix.haskell --- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell - a a = (/) a 2 --- ^ keyword.operator.haskell --- ^^^ variable.function.infix.haskell --- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell - - - a `member` x --- ^^^^^^^^ keyword.operator.function.infix.haskell --- ^ punctuation.definition.function.begin.haskell --- ^ punctuation.definition.function.end.haskell - a `P.atan2` x --- ^^^^^^^^^ keyword.operator.function.infix.haskell --- ^ punctuation.definition.function.begin.haskell --- ^ punctuation.definition.function.end.haskell - - --- Tests for #1320, #1880. - - class TooMany a where - tooMany :: a -> Bool --- ^^^^^^^^^^^^^^^^^^^^^^ meta.function.type-declaration.haskell - tooManyToo :: --- ^^^^^^^^^^^^^^^ meta.function.type-declaration.haskell - a -> Bool --- ^^^^^^^^^^^^^ meta.function.type-declaration.haskell - - instance TooMany Int where --- ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.instance.haskell --- ^^^^^^^^ keyword.declaration..haskell --- ^^^^^ keyword.control.context.haskell - tooMany n = n > 42 - - foldBoolGuard :: a -> a -> Bool -> a --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.type-declaration.haskell - foldBoolGuard x y z --- ^^^^^^^^^^^^^^^^^^^ source.haskell - | z = y --- ^ keyword.operator.haskell - | otherwise = x - - countTheBeforeVowel :: String - -- This comment should not interrupt the type signature. - - -- The blank line above should not interrupt the type signature. - - {- - This multiline comment should - not interrupt the type signature. - -} - - -> Integer --- ^^^^^^^^^^^^ meta.function.type-declaration.haskell - countTheBeforeVowel = undefined - - ---IDENTS - - genericIdent --- ^ meta.name.haskell - map (flip (/)) [1..] --- ^^^ support.function.prelude.haskell --- ^^^^ meta.group.haskell support.function.prelude.haskell - - ---KEYWORDS - -import qualified Data.Vector.Mutable as MutableVector --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.import.haskell --- ^^^ keyword.control.import.haskell --- ^^^^^^^^^ keyword.control.import.haskell --- ^^^^^^^^^^^^^^^^^^^ support.other.module.haskell --- ^^ keyword.control.import.haskell --- ^^^^^^^^^^^^^ support.other.module.haskell -import Data.List.Split (splitOn) --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.import.haskell --- ^^^ keyword.control.import.haskell --- ^^^^^^^^^^^^^^^ support.other.module.haskell --- ^^^^^^^^^ meta.declaration.exports.haskell --- ^ punctuation.section.group.begin.haskell --- ^^^^^^^ variable.function.haskell --- ^ punctuation.section.group.end.haskell - - deriving instance FromJSON Amount --- ^^^^^^^^ keyword.declaration.data.haskell - deriving instance FromJSON Ask --- ^^^^^^^^ meta.declaration.instance.haskell keyword.declaration.haskell - -test = --- ^ keyword.operator.haskell - let x = 2 in x * y --- ^^^ keyword.declaration.variable.haskell --- ^^ keyword.control.context.haskell - where --- ^^^^^ keyword.declaration.variable.haskell - y = 1 --- ^ keyword.operator.haskell - -test a = case a of --- ^^^^ keyword.control.conditional.select.haskell --- ^^ keyword.control.conditional.select.haskell - Nothing -> 0 - Just n -> if n > 0 --- ^^ keyword.control.conditional.if.haskell - then n --- ^^^^ keyword.control.conditional.then.haskell - else 0 --- ^^^^ keyword.control.conditional.else.haskell - -main = do --- ^^ keyword.control.context.haskell - return () --- ^^^^^^ keyword.control.flow.return.haskell - ---MISC - - (group) --- ^^^^^^^ meta.group.haskell --- ^ punctuation.section.group.begin.haskell --- ^ punctuation.section.group.end.haskell - - [1,2] --- ^^^^^ meta.sequence.haskell --- ^ punctuation.section.sequence.begin.haskell --- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell --- ^ punctuation.separator.sequence.haskell --- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell --- ^ punctuation.section.sequence.end.haskell - - ---NUMBERS - - 0 --- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell - - 1234567890 --- ^^^^^^^^^^ meta.number.integer.decimal.haskell constant.numeric.value.haskell - - 0o1234567 --- ^^^^^^^^^ meta.number.integer.octal.haskell --- ^^ constant.numeric.base.haskell --- ^^^^^^^ constant.numeric.value.haskell - - 1. --- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell --- ^ keyword.operator.haskell - - .2 --- ^ keyword.operator.haskell --- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell - - 12.345 --- ^^^^^^ meta.number.float.decimal.haskell --- ^^ constant.numeric.value.haskell --- ^ punctuation.separator.decimal --- ^^^ constant.numeric.value.haskell - - 1e10 --- ^^^^ meta.number.float.decimal.haskell --- ^ constant.numeric.value.haskell --- ^^^ constant.numeric.value.exponent.haskell - - 0.5e+0 --- ^^^^^^ meta.number.float.decimal.haskell --- ^ constant.numeric.value.haskell --- ^ punctuation.separator.decimal.haskell --- ^ constant.numeric.value.haskell --- ^^^ constant.numeric.value.exponent.haskell - - 9e-1 --- ^^^^ meta.number.float.decimal.haskell --- ^ constant.numeric.value.haskell --- ^^^ constant.numeric.value.exponent.haskell - - 0x0 --- ^^^ meta.number.integer.hexadecimal.haskell --- ^^ constant.numeric.base.haskell - - 0XdeafBEEF42 --- ^^^^^^^^^^^^ meta.number.integer.hexadecimal.haskell --- ^^ constant.numeric.base.haskell --- ^^^^^^^^^^ constant.numeric.value.haskell - ---STRINGS - - - 'ab' --- ^^^^ string.quoted.single.haskell --- ^ punctuation.definition.string.begin.haskell --- ^ invalid.illegal.expected-closing-quotation.haskell --- ^ punctuation.definition.string.end.haskell - - '\129x' --- ^^^^ string.quoted.single.haskell --- ^^^^ constant.character.escape.decimal.haskell --- ^ invalid.illegal.expected-closing-quotation.haskell --- ^ punctuation.definition.string.end.haskell - - "\o129x\NUL" --- ^^^^^^^^^^^^ string.quoted.double.haskell --- ^^^^ constant.character.escape.octal.haskell --- ^ - constant --- ^ punctuation.definition.string.end.haskell --- ^^^^ constant.character.escape.haskell - - a' = b' --- ^^ meta.name.haskell - string - - --- Infix operators in context - - data Outrageous = - Flipper Record - | Int :! Int - | Double :@ Double --- ^ keyword.operator.haskell - | Int `Quux` Double - | String :# Record --- ^ keyword.operator.haskell - | Simple :$ Outrageous - | DontDoThis { outrageousInt :: Int, outrageousString :: String } - deriving (Eq, Ord, Generic) - deriving (Read, Show) via (Quiet Outrageous) - - genOutrageous :: Gen Outrageous - genOutrageous = - Gen.recursive Gen.choice [ - Flipper <$> genRecord - , (:!) <$> genInt <*> genInt - , (:@) <$> genDouble <*> genDouble --- ^^ meta.sequence.haskell variable.function.infix.haskell keyword.operator.haskell - , Quux <$> genInt <*> genDouble - , (:#) <$> genString <*> genRecord --- ^^ meta.sequence.haskell variable.function.infix.haskell keyword.operator.haskell - , DontDoThis <$> genInt <*> genString - ] [ - Gen.subtermM genOutrageous (\x -> (:$) <$> genSimple <*> pure x) - ] - -myManageHook = composeAll - [ isDialog --> doFullFloat --- ^^^ keyword.operator - , return True --> doShift "1" --- ^^^ keyword.operator - ] diff --git a/Haskell/tests/syntax_test_haskell.hs b/Haskell/tests/syntax_test_haskell.hs new file mode 100644 index 00000000000..cb5859ccc4a --- /dev/null +++ b/Haskell/tests/syntax_test_haskell.hs @@ -0,0 +1,4209 @@ +-- SYNTAX TEST "Packages/Haskell/Haskell.sublime-syntax" + +-- [ COMMENTS ] --------------------------------------------------------------- + +23*36 -- single line comment +-- ^^ punctuation.definition.comment.haskell +-- ^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-dash.haskell +23*36 --------------------------------------------------- single line comment +-- ^ - comment - punctuation +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-dash.haskell punctuation.definition.comment.haskell +-- ^^^^^^^^^^^^^^^^^^^^ comment.line.double-dash.haskell - punctuation +23*36 +-- <- - comment.line.double-dash.haskell + + {- block comment -} 23*36 +-- ^^ punctuation.definition.comment.begin.haskell +-- ^^^^^^^^^^^^^^^^^^^ comment.block.haskell +-- ^^ punctuation.definition.comment.end.haskell +-- ^ - comment.block.haskell + + {- {-# #-} -} 23*36 +-- ^^ punctuation.definition.comment.begin.haskell +-- ^^^^^^^^^^^^^ comment.block.haskell - meta.preprocessor.haskell +-- ^^^^^^^ - meta.preprocessor +-- ^^ punctuation.definition.comment.end.haskell +-- ^ - comment.block.haskell + + {- {- #-} -} 23*36 +-- ^^ punctuation.definition.comment.begin.haskell +-- ^^^^^^^^^^^^ comment.block.haskell +-- ^^ punctuation.definition.comment.end.haskell +-- ^ - comment.block.haskell + + {- {- -} -} 23*36 +-- ^^ punctuation.definition.comment.begin.haskell +-- ^^^^^^^^^^^ comment.block.haskell +-- ^^ punctuation.definition.comment.end.haskell +-- ^ - comment.block.haskell + + {- {-# -} -} 23*36 +-- ^^ punctuation.definition.comment.begin.haskell +-- ^^^^^^^^^^^^ comment.block.haskell - meta.preprocessor.haskell +-- ^^ punctuation.definition.comment.end.haskell +-- ^ - comment.block.haskell + + {- {-# {- test -} -} -} 23*36 +-- ^^ punctuation.definition.comment.begin.haskell +-- ^^^^^^^^^^^^^^^^^^^^^^^ comment.block.haskell - meta.preprocessor.haskell +-- ^^ punctuation.definition.comment.end.haskell +-- ^ - comment.block.haskell + + +-- [ COMMENTS STARTING WITH SPECIAL SYMBOL CHARS ] ---------------------------- + + -- +-- ^^^ comment + --_ +-- ^^^ comment + --" +-- ^^^ comment + --' +-- ^^^ comment + --( +-- ^^^ comment + --) +-- ^^^ comment + --, +-- ^^^ comment + --- +-- ^^^ comment + --; +-- ^^^ comment + --[ +-- ^^^ comment + --] +-- ^^^ comment + --` +-- ^^^ comment + --{ +-- ^^^ comment + --} +-- ^^^ comment + + +-- [ NO COMMENTS ] ------------------------------------------------------------ + + --! +-- ^^^ - comment + --# +-- ^^^ - comment + --$ +-- ^^^ - comment + --% +-- ^^^ - comment + --& +-- ^^^ - comment + --* +-- ^^^ - comment + --+ +-- ^^^ - comment + --. +-- ^^^ - comment + --/ +-- ^^^ - comment + --< +-- ^^^ - comment + --= +-- ^^^ - comment + --> +-- ^^^ - comment + --? +-- ^^^ - comment + --\ +-- ^^^ - comment + --^ +-- ^^^ - comment + --| +-- ^^^ - comment + --~ +-- ^^^ - comment + --: +-- ^^^ - comment + + +-- [ PREPROCESSOR ] ----------------------------------------------------------- + + + {-# INLINABLE unless #-} +-- ^^^^^^^^^^^^^ meta.preprocessor.pragma.directive.haskell +-- ^^^^^^^^ meta.preprocessor.pragma.value.signature.haskell +-- ^^^ meta.preprocessor.pragma.value.haskell +-- ^ - meta.preprocessor.haskell + + {-# MINIMAL traverse | sequenceA LANGUAGE #-} +-- ^^^^^^^^^^^ meta.preprocessor.pragma.directive.haskell +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.preprocessor.pragma.value.signature.haskell +-- ^^^ meta.preprocessor.pragma.value.haskell +-- ^ - meta.preprocessor.haskell +-- ^^^ punctuation.section.preprocessor.begin.haskell +-- ^^^^^^^ keyword.directive.builtin.haskell +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - keyword +-- ^ punctuation.separator.sequence.haskell +-- ^^^ punctuation.section.preprocessor.end.haskell + + {-# LANGUAGE +-- ^^^^^^^^^^^^ meta.preprocessor.pragma.directive.haskell +-- ^ meta.preprocessor.pragma.value.language.haskell +-- ^^^ punctuation.section.preprocessor.begin.haskell +-- ^^^^^^^^ keyword.directive.language.haskell + -- Type level programming +-- ^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-dash.haskell + DataKinds, PolyKinds, +-- ^^^^^^^^^^^^^^^^^^^^^^ meta.preprocessor.pragma.value.language.haskell +-- ^^^^^^^^^ constant.language.extension.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^^ constant.language.extension.haskell +-- ^ punctuation.separator.sequence.haskell + -- Generics +-- ^^^^^^^^^^^ comment.line.double-dash.haskell + DeriveGeneric, DeriveAnyClass, DerivingVia +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.preprocessor.pragma.value.language.haskell +-- ^^^^^^^^^^^^^ constant.language.extension.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^^^^^^^ constant.language.extension.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^^^^ constant.language.extension.haskell + {- Type applications -} +-- ^^^^^^^^^^^^^^^^^^^^^^^ comment.block.haskell + , TypeApplications, AllowAmbiguousTypes +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.preprocessor.pragma.value.language.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^^^^^^^^^ constant.language.extension.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^^^^^^^^^^^^ constant.language.extension.haskell + {- New in GHC 9 -} + , QualifiedDo, LinearTypes +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.preprocessor.pragma.value.language.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^^^^ constant.language.extension.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^^^^ constant.language.extension.haskell + #-} +-- ^^^ meta.preprocessor.pragma.value.haskell punctuation.section.preprocessor.end.haskell + + {-# LINE 42 "Foo.vhs" #-} +-- ^^^^^^^^ meta.preprocessor.pragma.directive.haskell +-- ^^^^^^^^^^^^^^ meta.preprocessor.pragma.value.other.haskell +-- ^^^ meta.preprocessor.pragma.value.haskell +-- ^^^ punctuation.section.preprocessor.begin.haskell +-- ^^^^ keyword.directive.builtin.haskell +-- ^^ constant.numeric.value.haskell +-- ^^^^^^^^^ meta.string.haskell string.quoted.double.haskell +-- ^^^ punctuation.section.preprocessor.end.haskell + + {-# OPTIONS_GHC -Drelease #-} +-- ^^^^^^^^^^^^^^^ meta.preprocessor.pragma.directive.haskell +-- ^^^^^^^^^^^ meta.preprocessor.pragma.value.options.haskell +-- ^^^ meta.preprocessor.pragma.value.haskell +-- ^ - meta.preprocessor.haskell +-- ^^^ punctuation.section.preprocessor.begin.haskell +-- ^^^^^^^^^^^ keyword.directive.options.haskell +-- ^^^^^^^^^ constant.other.pragma.haskell +-- ^ punctuation.definition.constant.haskell +-- ^^^ punctuation.section.preprocessor.end.haskell + + {-# OPTIONS_HADDOCK not-home #-} +-- ^^^^^^^^^^^^^^^^^^^ meta.preprocessor.pragma.directive.haskell +-- ^^^^^^^^^^ meta.preprocessor.pragma.value.options.haskell +-- ^^^ meta.preprocessor.pragma.value.haskell +-- ^ - meta.preprocessor.haskell +-- ^^^ punctuation.section.preprocessor.begin.haskell +-- ^^^^^^^^^^^^^^^ keyword.directive.options.haskell +-- ^^^^^^^^ constant.other.pragma.haskell +-- ^^^ punctuation.section.preprocessor.end.haskell + + {-# SPECIALIZE INLINE unless :: Bool -> IO () -> IO () #-} +-- ^^^^^^^^^^^^^^^^^^^^^ meta.preprocessor.pragma.directive.haskell +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.preprocessor.pragma.value.signature.haskell +-- ^^^ meta.preprocessor.pragma.value.haskell +-- ^^^ punctuation.section.preprocessor.begin.haskell +-- ^^^^^^^^^^ keyword.directive.builtin.haskell +-- ^^^^^^ keyword.directive.builtin.haskell +-- ^^^^^^ entity.name.function.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^^ support.type.prelude.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^ support.type.prelude.haskell +-- ^^^ punctuation.section.preprocessor.end.haskell + + {-# SPECIALIZE instance Eq (Foo [(Int, Bar)]) #-} +-- ^^^^^^^^^^^^^^^^^^^^^^^ meta.preprocessor.pragma.directive.haskell +-- ^^^^^^^^^^^^^^^^^^^^^^^ meta.preprocessor.pragma.value.signature.haskell +-- ^^^ meta.preprocessor.pragma.value.haskell +-- ^^^ punctuation.section.preprocessor.begin.haskell +-- ^^^^^^^^^^ keyword.directive.builtin.haskell +-- ^^^^^^^^ keyword.declaration.instance.haskell +-- ^^^ punctuation.section.preprocessor.end.haskell + + {-# WARNING "Not supported" #-} +-- ^^^^^^^^^^^ meta.preprocessor.pragma.directive.haskell +-- ^^^^^^^^^^^^^^^^^ meta.preprocessor.pragma.value.other.haskell +-- ^^^ meta.preprocessor.pragma.value.haskell +-- ^ - meta.preprocessor.haskell +-- ^^^ punctuation.section.preprocessor.begin.haskell +-- ^^^^^^^ keyword.directive.builtin.haskell +-- ^^^^^^^^^^^^^^^ meta.string.haskell string.quoted.double.haskell +-- ^^^ punctuation.section.preprocessor.end.haskell + + module Wibble {-# DEPRECATED "Use Wobble instead" #-} where +-- ^^^^^^^^^^^^^^ meta.declaration.module.haskell meta.preprocessor.pragma.directive.haskell +-- ^^^^^^^^^^^^^^^^^^^^^ meta.declaration.module.haskell meta.preprocessor.pragma.value.other.haskell +-- ^^^ meta.declaration.module.haskell meta.preprocessor.pragma.value.haskell +-- ^^^ punctuation.section.preprocessor.begin.haskell +-- ^^^^^^^^^^ keyword.directive.builtin.haskell +-- ^^^^^^^^^^^^^^^^^^^^ string.quoted.double.haskell +-- ^^^ punctuation.section.preprocessor.end.haskell + + (res, ts) <- withRaw $ + {-# SCC attrParser #-} (AddAttributes <$> attrParser) +-- ^^^^^^^ meta.preprocessor.pragma.directive.haskell +-- ^^^^^^^^^^^ meta.preprocessor.pragma.value.other.haskell +-- ^^^ meta.preprocessor.pragma.value.haskell +-- ^^^ punctuation.section.preprocessor.begin.haskell +-- ^^^ keyword.directive.builtin.haskell +-- ^^^ punctuation.section.preprocessor.end.haskell +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.group.haskell +-- ^ punctuation.section.group.begin.haskell +-- ^^^^^^^^^^^^^ storage.type.haskell +-- ^^^ keyword.operator.haskell +-- ^^^^^^^^^^ variable.other.haskell +-- ^ punctuation.section.group.end.haskell + + + #if 0 +-- ^^^ meta.preprocessor.c +-- ^ punctuation.definition.preprocessor.c +-- ^^^ keyword.directive.other.c + + #endif +-- ^^^^^^ meta.preprocessor.c +-- ^ punctuation.definition.preprocessor.c +-- ^^^^^^ keyword.directive.other.c + + +-- [ MODULE DECLARATIONS ] ---------------------------------------------------- + + 'module +-- ^ keyword.operator.haskell +-- ^^^^^^ keyword.declaration.namespace.haskell + + module' +-- ^^^^^^^ - keyword + + module +-- ^^^^^^^ meta.declaration.module.haskell +-- ^^^^^^ keyword.declaration.namespace.haskell + + module Name +-- ^^^^^^^^^^^^ meta.declaration.module.haskell +-- ^^^^^^ keyword.declaration.namespace.haskell +-- ^^^^ entity.name.namespace.haskell + + module Name where +-- ^^^^^^^^^^^^ meta.declaration.module.haskell +-- ^^^^^ - meta.declaration.module +-- ^^^^^^ keyword.declaration.namespace.haskell +-- ^^^^ entity.name.namespace.haskell +-- ^^^^^ keyword.control.context.haskell + + module () +-- ^^^^^^^ meta.declaration.module.haskell - meta.sequence +-- ^^ meta.declaration.module.haskell meta.sequence.tuple.haskell +-- ^^^^^^ keyword.declaration.namespace.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell + + module Name () +-- ^^^^^^^^^^^^ meta.declaration.module.haskell - meta.sequence +-- ^^ meta.declaration.module.haskell meta.sequence.tuple.haskell +-- ^^^^^^ keyword.declaration.namespace.haskell +-- ^^^^ entity.name.namespace.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell + + module Name () where +-- ^^^^^^^^^^^^ meta.declaration.module.haskell - meta.sequence +-- ^^ meta.declaration.module.haskell meta.sequence.tuple.haskell +-- ^ meta.declaration.module.haskell - meta.sequence +-- ^^^^^^ - meta.declaration.module +-- ^^^^^^ keyword.declaration.namespace.haskell +-- ^^^^ entity.name.namespace.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^^^^^ keyword.control.context.haskell + + module Ns.Name (sym1, Sym2, sym2#, Sym3#, (<:>)) where { import Ns.Other; import Ns.Other2 } +-- ^^^^^^^^^^^^^^^ meta.declaration.module.haskell - meta.sequence +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.module.haskell meta.sequence.tuple.haskell - meta.prefix +-- ^^^^^ meta.declaration.module.haskell meta.sequence.tuple.haskell meta.prefix.haskell +-- ^ meta.declaration.module.haskell meta.sequence.tuple.haskell - meta.prefix +-- ^ meta.declaration.module.haskell - meta.sequence +-- ^^^^^ - meta.declaration.module - meta.block - meta.sequence +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.block.haskell - meta.declaration.module +-- ^ - meta.block +-- ^^^^^^ keyword.declaration.namespace.haskell +-- ^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^ entity.name.namespace.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^ entity.name.export.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^ entity.name.export.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^ entity.name.export.haskell +-- ^ storage.modifier.unboxed.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^ entity.name.export.haskell +-- ^ storage.modifier.unboxed.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ punctuation.definition.prefix.begin.haskell +-- ^^^ keyword.operator.haskell +-- ^ punctuation.definition.prefix.end.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^^^^^ keyword.control.context.haskell +-- ^ punctuation.section.block.begin.haskell +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.terminator.statement.haskell +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ variable.namespace.haskell +-- ^ punctuation.section.block.end.haskell + + module Name (module Other.Module) where { import Other.Module } +-- ^^^^^^^^^^^^ meta.declaration.module.haskell - meta.sequence +-- ^^^^^^^^^^^^^^^^^^^^^ meta.declaration.module.haskell meta.sequence.tuple.haskell +-- ^ meta.declaration.module.haskell - meta.sequence +-- ^^^^^^ - meta.declaration - meta.block - meta.sequence +-- ^^ meta.block.haskell - meta.import +-- ^^^^^^ meta.block.haskell meta.import.haskell +-- ^^^^^^^^^^^^^^ meta.block.haskell meta.import.module.haskell +-- ^ meta.block.haskell - meta.import +-- ^ - meta.declaration - meta.block +-- ^^^^^^ keyword.declaration.namespace.haskell +-- ^^^^ entity.name.namespace.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^^^ keyword.declaration.namespace.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.export.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^^^^^ keyword.control.context.haskell +-- ^ punctuation.section.block.begin.haskell +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ variable.namespace.haskell +-- ^ punctuation.section.block.end.haskell + + +-- [ MODULE SIGNATURE DECLARATIONS ] ------------------------------------------ + + 'signature +-- ^ keyword.operator.haskell +-- ^^^^^^^^^ keyword.declaration.namespace.haskell + + signature' +-- ^^^^^^^^^^ - keyword + + signature +-- ^^^^^^^^^^ meta.declaration.signature.haskell +-- ^^^^^^^^^ keyword.declaration.namespace.haskell + + signature Name +-- ^^^^^^^^^^^^^^^ meta.declaration.signature.haskell +-- ^^^^^^^^^ keyword.declaration.namespace.haskell +-- ^^^^ entity.name.namespace.haskell + + signature Name where +-- ^^^^^^^^^^^^^^^ meta.declaration.signature.haskell +-- ^^^^^ - meta.declaration.signature +-- ^^^^^^^^^ keyword.declaration.namespace.haskell +-- ^^^^ entity.name.namespace.haskell +-- ^^^^^ keyword.control.context.haskell + + signature () +-- ^^^^^^^^^^ meta.declaration.signature.haskell - meta.sequence +-- ^^ meta.declaration.signature.haskell meta.sequence.tuple.haskell +-- ^^^^^^^^^ keyword.declaration.namespace.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell + + signature Name () +-- ^^^^^^^^^^^^^^^ meta.declaration.signature.haskell - meta.sequence +-- ^^ meta.declaration.signature.haskell meta.sequence.tuple.haskell +-- ^^^^^^^^^ keyword.declaration.namespace.haskell +-- ^^^^ entity.name.namespace.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell + + signature Name () where +-- ^^^^^^^^^^^^^^^ meta.declaration.signature.haskell - meta.sequence +-- ^^ meta.declaration.signature.haskell meta.sequence.tuple.haskell +-- ^ meta.declaration.signature.haskell - meta.sequence +-- ^^^^^^ - meta.declaration.signature +-- ^^^^^^^^^ keyword.declaration.namespace.haskell +-- ^^^^ entity.name.namespace.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^^^^^ keyword.control.context.haskell + + signature Ns.Name (sym1, Sym2, sym2#, Sym3#) where { import Ns.Other; import Ns.Other2 } +-- ^^^^^^^^^^^^^^^^^^ meta.declaration.signature.haskell - meta.sequence +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.signature.haskell meta.sequence.tuple.haskell +-- ^ meta.declaration.signature.haskell - meta.sequence +-- ^^^^^ - meta.declaration.signature - meta.block - meta.sequence +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.block.haskell - meta.declaration.signature +-- ^ - meta.block +-- ^^^^^^^^^ keyword.declaration.namespace.haskell +-- ^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^ entity.name.namespace.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^ entity.name.export.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^ entity.name.export.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^ entity.name.export.haskell +-- ^ storage.modifier.unboxed.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^ entity.name.export.haskell +-- ^ storage.modifier.unboxed.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^^^^^ keyword.control.context.haskell +-- ^ punctuation.section.block.begin.haskell +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.terminator.statement.haskell +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ variable.namespace.haskell +-- ^ punctuation.section.block.end.haskell + + signature Name (module Other.Module) where { import Other.Module } +-- ^^^^^^^^^^^^^^^ meta.declaration.signature.haskell - meta.sequence +-- ^^^^^^^^^^^^^^^^^^^^^ meta.declaration.signature.haskell meta.sequence.tuple.haskell +-- ^ meta.declaration.signature.haskell - meta.sequence +-- ^^^^^^ - meta.declaration - meta.block - meta.sequence +-- ^^ meta.block.haskell - meta.import +-- ^^^^^^ meta.block.haskell meta.import.haskell +-- ^^^^^^^^^^^^^^ meta.block.haskell meta.import.module.haskell +-- ^ meta.block.haskell - meta.import +-- ^ - meta.declaration - meta.block +-- ^^^^^^^^^ keyword.declaration.namespace.haskell +-- ^^^^ entity.name.namespace.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^^^ keyword.declaration.namespace.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.export.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^^^^^ keyword.control.context.haskell +-- ^ punctuation.section.block.begin.haskell +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ variable.namespace.haskell +-- ^ punctuation.section.block.end.haskell + +-- [ IMPORT DECLARATIONS ] ---------------------------------------------------- + + 'import +-- ^ keyword.operator.haskell +-- ^^^^^^ keyword.declaration.import.haskell + + import' +-- ^^^^^^^ - keyword + + import import +-- ^ - meta.import +-- ^^^^^^ meta.import.haskell keyword.declaration.import.haskell +-- ^ meta.import.module.haskell - keyword +-- ^^^^^^ meta.import.haskell keyword.declaration.import.haskell +-- ^ meta.import.module.haskell - keyword + + import ; import +-- ^^^^^^ meta.import.haskell +-- ^ meta.import.module.haskell +-- ^^ - meta.import +-- ^^^^^^ meta.import.haskell +-- ^ meta.import.module.haskell +-- ^^^^^^ keyword.declaration.import.haskell +-- ^ punctuation.terminator.statement.haskell +-- ^^^^^^ meta.import.haskell keyword.declaration.import.haskell + + import safe qualified Data.Vector.Mutable as MutableVector +-- ^^^^^^ meta.import.haskell +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.import.module.haskell +-- ^^^^^^^^^^^^^^^^ meta.import.alias.haskell +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^^^ storage.modifier.import.haskell +-- ^^^^^^^^^ storage.modifier.import.haskell +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^^^^ variable.namespace.haskell - punctuation +-- ^^ keyword.declaration.import.as.haskell +-- ^^^^^^^^^^^^^ entity.name.import.namespace.haskell + + import +-- ^^^^^^ meta.import.haskell keyword.declaration.import.haskell +-- ^ meta.import.module.haskell - keyword + qualified +-- ^^^^^^^^^^ meta.import.module.haskell +-- ^^^^^^^^^ storage.modifier.import.haskell + Data.Vector.Mutable +-- ^^^^^^^^^^^^^^^^^^^^ meta.import.module.haskell +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^^^^ variable.namespace.haskell - punctuation + as +-- ^^^ meta.import.alias.haskell +-- ^^ keyword.declaration.import.as.haskell + MutableVector +-- ^^^^^^^^^^^^^ meta.import.alias.haskell entity.name.import.namespace.haskell +-- ^ - meta.import - entity + + import Mod1.Mod2.Module (funcName, unboxed#, Type#) +-- ^^^^^^ meta.import.haskell - meta.sequence +-- ^^^^^^^^^^^^^^^^^^ meta.import.module.haskell - meta.sequence +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.import.filter.haskell meta.sequence.tuple.haskell +-- ^ - meta.import +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^^^ variable.namespace.haskell - punctuation +-- ^^^^^^^^^^ meta.sequence.tuple.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^^^^^ entity.name.import.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^ entity.name.import.haskell +-- ^ storage.modifier.unboxed.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^ entity.name.import.haskell +-- ^ storage.modifier.unboxed.haskell +-- ^ punctuation.section.sequence.end.haskell + + import Mod1.Mod2.Module (ClassName(..)) +-- ^^^^^^ meta.import.haskell - meta.sequence +-- ^^^^^^^^^^^^^^^^^^ meta.import.module.haskell - meta.sequence +-- ^^^^^^^^^^ meta.import.filter.haskell meta.sequence.tuple.haskell - meta.sequence meta.sequence +-- ^^^^ meta.import.filter.haskell meta.sequence.tuple.haskell meta.sequence.tuple.haskell +-- ^ meta.import.filter.haskell meta.sequence.tuple.haskell - meta.sequence meta.sequence +-- ^ - meta.import +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^^^^^^ entity.name.import.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^ keyword.operator.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^ punctuation.section.sequence.end.haskell + + import Mod1.Mod2.Module (ClassName (SubClass), funcName) +-- ^^^^^^ meta.import.haskell - meta.sequence +-- ^^^^^^^^^^^^^^^^^^ meta.import.module.haskell - meta.sequence +-- ^^^^^^^^^^^ meta.import.filter.haskell meta.sequence.tuple.haskell - meta.sequence meta.sequence +-- ^^^^^^^^^^ meta.import.filter.haskell meta.sequence.tuple.haskell meta.sequence.tuple.haskell +-- ^^^^^^^^^^^ meta.import.filter.haskell meta.sequence.tuple.haskell - meta.sequence meta.sequence +-- ^ - meta.import +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^^^^^^ entity.name.import.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^^^^^ entity.name.import.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^ entity.name.import.haskell +-- ^ punctuation.section.sequence.end.haskell + + import Mod1.Mod2.Module (ClassName (memberName), funcName) +-- ^^^^^^ meta.import.haskell - meta.sequence +-- ^^^^^^^^^^^^^^^^^^ meta.import.module.haskell - meta.sequence +-- ^^^^^^^^^^^ meta.import.filter.haskell meta.sequence.tuple.haskell - meta.sequence meta.sequence +-- ^^^^^^^^^^^^ meta.import.filter.haskell meta.sequence.tuple.haskell meta.sequence.tuple.haskell +-- ^^^^^^^^^^^ meta.import.filter.haskell meta.sequence.tuple.haskell - meta.sequence meta.sequence +-- ^ - meta.import +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^^^^^^ entity.name.import.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^^^^^^^ entity.name.import.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^ entity.name.import.haskell +-- ^ punctuation.section.sequence.end.haskell + + import Mod1.Mod2.Module (ClassName (SubClass, memberName), funcName) +-- ^^^^^^ meta.import.haskell - meta.sequence +-- ^^^^^^^^^^^^^^^^^^ meta.import.module.haskell - meta.sequence +-- ^^^^^^^^^^^ meta.import.filter.haskell meta.sequence.tuple.haskell - meta.sequence meta.sequence +-- ^^^^^^^^^^^^^^^^^^^^^^ meta.import.filter.haskell meta.sequence.tuple.haskell meta.sequence.tuple.haskell +-- ^^^^^^^^^^^ meta.import.filter.haskell meta.sequence.tuple.haskell - meta.sequence meta.sequence +-- ^ - meta.import +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^^^^^^ entity.name.import.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^^^^^ entity.name.import.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^^^ entity.name.import.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^ entity.name.import.haskell +-- ^ punctuation.section.sequence.end.haskell + + import Mod1.Mod2.Module ((), (<.>), fun1, fun2, +-- ^^^^^^ meta.import.haskell - meta.sequence +-- ^^^^^^^^^^^^^^^^^^ meta.import.module.haskell - meta.sequence +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.import.filter.haskell meta.sequence.tuple.haskell - meta.sequence meta.sequence +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^^ meta.prefix.haskell +-- ^ punctuation.definition.prefix.begin.haskell +-- ^^^ keyword.operator.haskell +-- ^ punctuation.definition.prefix.end.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^ meta.prefix.haskell +-- ^ punctuation.definition.prefix.begin.haskell +-- ^^^ keyword.operator.haskell +-- ^ punctuation.definition.prefix.end.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^ entity.name.import.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^ entity.name.import.haskell +-- ^ punctuation.separator.sequence.haskell + fun3, fun4) +-- ^^^^^^^^^^^ meta.import.filter.haskell meta.sequence.tuple.haskell +-- ^ - meta.import +-- ^^^^ entity.name.import.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^ entity.name.import.haskell +-- ^ punctuation.section.sequence.end.haskell + + import Mod1.Mod2.Module (()) +-- ^^^^^^ meta.import.haskell - meta.sequence +-- ^^^^^^^^^^^^^^^^^^ meta.import.module.haskell - meta.sequence +-- ^ meta.import.filter.haskell meta.sequence.tuple.haskell - meta.sequence meta.sequence +-- ^^ meta.import.filter.haskell meta.sequence.tuple.haskell meta.sequence.tuple.haskell +-- ^ meta.import.filter.haskell meta.sequence.tuple.haskell - meta.sequence meta.sequence +-- ^ - meta.import +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^^^ variable.namespace.haskell - punctuation +-- ^^^^ meta.sequence.tuple.haskell +-- ^^ punctuation.section.sequence.begin.haskell +-- ^^ punctuation.section.sequence.end.haskell + + import Mod1.Mod2.Module (-- +-- ^^^^^^ meta.import.haskell +-- ^^^^^^^^^^^^^^^^^^ meta.import.module.haskell +-- ^^^^ meta.import.filter.haskell meta.sequence.tuple.haskell +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^^^ variable.namespace.haskell - punctuation +-- ^^^^^ meta.sequence.tuple.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^ comment.line.double-dash.haskell +-- ^^ punctuation.definition.comment.haskell + ) +-- ^ punctuation.section.sequence.end.haskell + + import Mod1.Mod2.Module (--) +-- ^^^^^^ meta.import.haskell +-- ^^^^^^^^^^^^^^^^^^ meta.import.module.haskell +-- ^^^^^ meta.import.filter.haskell meta.sequence.tuple.haskell +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^^^ variable.namespace.haskell - punctuation +-- ^^^^^ meta.sequence.tuple.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^ comment.line.double-dash.haskell +-- ^^ punctuation.definition.comment.haskell + ) +-- ^ punctuation.section.sequence.end.haskell + + import Mod1.Mod2.Module ((--)) +-- ^^^^^^ meta.import.haskell +-- ^^^^^^^^^^^^^^^^^^ meta.import.module.haskell +-- ^^^^^^^ meta.import.filter.haskell meta.sequence.tuple.haskell +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^^^ variable.namespace.haskell - punctuation +-- ^^^^^^^ meta.sequence.tuple.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^^ comment.line.double-dash.haskell +-- ^^ punctuation.definition.comment.haskell + ) +-- ^ punctuation.section.sequence.end.haskell + + import Mod1.Mod2.Module ((--]) +-- ^^^^^^ meta.import.haskell +-- ^^^^^^^^^^^^^^^^^^ meta.import.module.haskell +-- ^^^^^^^ meta.import.filter.haskell meta.sequence.tuple.haskell +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^^^ variable.namespace.haskell - punctuation +-- ^^^^^^^ meta.sequence.tuple.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^^ comment.line.double-dash.haskell +-- ^^ punctuation.definition.comment.haskell + ) +-- ^ punctuation.section.sequence.end.haskell + + import Mod1.Mod2.Module ((--") +-- ^^^^^^ meta.import.haskell +-- ^^^^^^^^^^^^^^^^^^ meta.import.module.haskell +-- ^^^^^^^ meta.import.filter.haskell meta.sequence.tuple.haskell +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^ variable.namespace.haskell - punctuation +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^^^^^ variable.namespace.haskell - punctuation +-- ^^^^^^^ meta.sequence.tuple.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^^ comment.line.double-dash.haskell +-- ^^ punctuation.definition.comment.haskell + ) +-- ^ punctuation.section.sequence.end.haskell + + +-- [ FOREIGN EXPORT DECLARATIONS ]--------------------------------------------- + + foreign export +-- ^^^^^^^^^^^^^^^ meta.declaration.foreign.export.haskell +-- ^^^^^^^ storage.modifier.foreign.haskell +-- ^^^^^^ keyword.declaration.export.haskell + + foreign export ccall +-- ^^^^^^^^^^^^^^^^^^^^^ meta.declaration.foreign.export.haskell +-- ^^^^^^^ storage.modifier.foreign.haskell +-- ^^^^^^ keyword.declaration.export.haskell +-- ^^^^^ constant.language.convention.haskell + + foreign export ccall triple :: Int -> Int +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.foreign.export.haskell +-- ^^^^^^^ storage.modifier.foreign.haskell +-- ^^^^^^ keyword.declaration.export.haskell +-- ^^^^^ constant.language.convention.haskell +-- ^^^^^^ entity.name.function.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^ support.type.prelude.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^ support.type.prelude.haskell + + foreign +-- ^^^^^^^^ meta.declaration.foreign.export.haskell +-- ^^^^^^^ storage.modifier.foreign.haskell + export +-- ^^^^^^^^ meta.declaration.foreign.export.haskell +-- ^^^^^^ keyword.declaration.export.haskell + ccall +-- ^^^^^^^ meta.declaration.foreign.export.haskell +-- ^^^^^ constant.language.convention.haskell + safe +-- ^^^^^^ meta.declaration.foreign.export.haskell +-- ^^^^ invalid.illegal.unexpected-keyword.haskell + triple +-- ^^^^^^^^ meta.declaration.foreign.export.haskell +-- ^^^^^^ entity.name.function.haskell + :: Int -> Int +-- ^ meta.declaration.foreign.export.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^ support.type.prelude.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^ support.type.prelude.haskell + + foreign export ccall triple# :: Int -> Int +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.foreign.export.haskell +-- ^^^^^^^ storage.modifier.foreign.haskell +-- ^^^^^^ keyword.declaration.export.haskell +-- ^^^^^ constant.language.convention.haskell +-- ^^^^^^^ entity.name.function.haskell +-- ^ storage.modifier.unboxed.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^ support.type.prelude.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^ support.type.prelude.haskell + + foreign export ccall "addInt" (+) :: Int->Int->Int +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.foreign.export.haskell +-- ^^^^^^^ storage.modifier.foreign.haskell +-- ^^^^^^ keyword.declaration.export.haskell +-- ^^^^^ constant.language.convention.haskell +-- ^^^^^^^^ meta.string.haskell string.quoted.double.haskell +-- ^^^ meta.prefix.haskell +-- ^ punctuation.definition.prefix.begin.haskell +-- ^ keyword.operator.haskell +-- ^ punctuation.definition.prefix.end.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^ support.type.prelude.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^ support.type.prelude.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^ support.type.prelude.haskell + + +-- [ FOREIGN IMPORT DECLARATIONS ]--------------------------------------------- + + foreign +-- ^^^^^^^^ meta.declaration.foreign.import.haskell +-- ^^^^^^^ storage.modifier.foreign.haskell + + foreign import +-- ^^^^^^^^^^^^^^^ meta.declaration.foreign.import.haskell +-- ^^^^^^^ storage.modifier.foreign.haskell +-- ^^^^^^ keyword.declaration.import.haskell + + foreign import ccall +-- ^^^^^^^^^^^^^^^^^^^^^ meta.declaration.foreign.import.haskell +-- ^^^^^^^ storage.modifier.foreign.haskell +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^^^^ constant.language.convention.haskell + + foreign import ccall "exp" +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.foreign.import.haskell +-- ^^^^^^^ storage.modifier.foreign.haskell +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^^^^ constant.language.convention.haskell +-- ^^^^^ meta.string.haskell string.quoted.double.haskell +-- + + foreign import ccall "exp" c_exp :: Double -> Double +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.foreign.import.haskell +-- ^^^^^^^ storage.modifier.foreign.haskell +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^^^^ constant.language.convention.haskell +-- ^^^^^ meta.string.haskell string.quoted.double.haskell +-- ^^^^^ entity.name.function.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^^^^ support.type.prelude.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^^^^ support.type.prelude.haskell + + foreign import dotnet safe "func" func# :: String -> Bool +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.foreign.import.haskell +-- ^^^^^^^ storage.modifier.foreign.haskell +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^^^^^ constant.language.convention.haskell +-- ^^^^ storage.modifier.import.haskell +-- ^^^^^^ meta.string.haskell string.quoted.double.haskell +-- ^^^^^ entity.name.function.haskell +-- ^ storage.modifier.unboxed.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^^^^ support.type.prelude.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^^ support.type.prelude.haskell + + foreign import ccall "addInt" (+) :: Int->Int->Int +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.foreign.import.haskell +-- ^^^^^^^ storage.modifier.foreign.haskell +-- ^^^^^^ keyword.declaration.import.haskell +-- ^^^^^ constant.language.convention.haskell +-- ^^^^^^^^ meta.string.haskell string.quoted.double.haskell +-- ^^^ meta.prefix.haskell +-- ^ punctuation.definition.prefix.begin.haskell +-- ^ keyword.operator.haskell +-- ^ punctuation.definition.prefix.end.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^ support.type.prelude.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^ support.type.prelude.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^ support.type.prelude.haskell + + +-- [ CLASS DECLARATIONS ] ----------------------------------------------------- + + 'class +-- ^ keyword.operator.haskell +-- ^^^^^ keyword.declaration.class.haskell + + class' +-- ^^^^^^ - keyword + + class +-- ^^^^^^ meta.declaration.class.haskell +-- ^^^^^ keyword.declaration.class.haskell + + class => +-- ^^^^^ meta.declaration.class.haskell +-- ^ meta.declaration.class.context.haskell +-- ^^^ meta.declaration.class.haskell +-- ^^^^^ keyword.declaration.class.haskell +-- ^^ punctuation.separator.type.context.haskell + + class QTyCls tyVar +-- ^^^^^^^^^^^^^^^^^^^ meta.declaration.class.haskell +-- ^^^^^ keyword.declaration.class.haskell +-- ^^^^^^ entity.name.class.haskell +-- ^^^^^ variable.other.haskell + + class QTyCls# tyVar# +-- ^^^^^^^^^^^^^^^^^^^^^ meta.declaration.class.haskell +-- ^^^^^ keyword.declaration.class.haskell +-- ^^^^^^^ entity.name.class.haskell +-- ^ storage.modifier.unboxed.haskell +-- ^^^^^^ variable.other.haskell +-- ^ storage.modifier.unboxed.haskell + + class ModId.QTyCls tyVar1 tyVar2, ident +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.class.haskell +-- ^^^^^^^ - meta.declaration +-- ^^^^^ keyword.declaration.class.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.class.haskell +-- ^^^^^^ variable.other.haskell +-- ^^^^^^ variable.other.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^ variable.other.haskell + + class ModId.QTyCls tyVar1 tyVar2 => +-- ^^^^^ meta.declaration.class.haskell +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.class.context.haskell +-- ^^^ meta.declaration.class.haskell +-- ^^^^^ keyword.declaration.class.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ storage.type.haskell +-- ^^^^^^ variable.other.haskell +-- ^^^^^^ variable.other.haskell +-- ^^ punctuation.separator.type.context.haskell + + class ModId.QTyCls (tyVar1 tyVar2#) => +-- ^^^^^ meta.declaration.class.haskell +-- ^^^^^^^^^^^^^^ meta.declaration.class.context.haskell - meta.group +-- ^^^^^^^^^^^^^^^^ meta.declaration.class.context.haskell meta.group.haskell +-- ^ meta.declaration.class.context.haskell - meta.group +-- ^^^ meta.declaration.class.haskell - meta.group +-- ^^^^^ keyword.declaration.class.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ storage.type.haskell +-- ^ punctuation.section.group.begin.haskell +-- ^^^^^^ variable.other.haskell +-- ^^^^^^^ variable.other.haskell +-- ^ storage.modifier.unboxed.haskell +-- ^ punctuation.section.group.end.haskell +-- ^^ punctuation.separator.type.context.haskell + + class ModId.QTyCls (tyVar1 tyVar2 => ) +-- ^^^^^^^^^^^^^^^^^^^ meta.declaration.class.haskell - meta.group +-- ^^^^^^^^^^^^^^^^^^^^ meta.declaration.class.haskell meta.group.haskell +-- ^^^^^ keyword.declaration.class.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.class.haskell +-- ^ punctuation.section.group.begin.haskell +-- ^^^^^^ variable.other.haskell +-- ^^^^^^ variable.other.haskell +-- ^^ punctuation.separator.type.context.haskell +-- ^ punctuation.section.group.end.haskell + + class ModId.QTyCls tyVar1 tyVar2 => Traversable t +-- ^^^^^ meta.declaration.class.haskell +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.class.context.haskell +-- ^^^^^^^^^^^^^^^^^ meta.declaration.class.haskell +-- ^^^^^ keyword.declaration.class.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ storage.type.haskell +-- ^^^^^^ variable.other.haskell +-- ^^^^^^ variable.other.haskell +-- ^^ punctuation.separator.type.context.haskell +-- ^^^^^^^^^^^ entity.name.class.haskell +-- ^ variable.other.haskell + + class () => +-- ^^^^^ meta.declaration.class.haskell +-- ^^^^ meta.declaration.class.context.haskell +-- ^^^ meta.declaration.class.haskell +-- ^^^^^ keyword.declaration.class.haskell +-- ^^ meta.sequence.tuple.empty.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^^ punctuation.separator.type.context.haskell + + class (Functor t, Foldable t) => Traversable t where +-- ^^^^^ meta.declaration.class.haskell - meta.sequence +-- ^ meta.declaration.class.context.haskell - meta.sequence +-- ^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.class.context.haskell meta.sequence.tuple.haskell +-- ^ meta.declaration.class.context.haskell - meta.sequence +-- ^^^^^^^^^^^^^^^^^ meta.declaration.class.haskell - meta.sequence +-- ^^^^^ keyword.declaration.class.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^^^^ support.class.prelude.haskell +-- ^ variable.other.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^ storage.type.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^^ punctuation.separator.type.context.haskell +-- ^^^^^^^^^^^ entity.name.class.haskell +-- ^ variable.other.haskell +-- ^^^^^ keyword.control.context.haskell + +-- A class declaration with no where part may be useful for combining +-- a collection of classes into a larger one that inherits all of the class +-- methods in the original ones. + + class Eq a => a -> a +-- ^^^^^ meta.declaration.class.haskell +-- ^^^^^^ meta.declaration.class.context.haskell +-- ^^^^^^^^^^ meta.declaration.class.haskell +-- ^^^^^ keyword.declaration.class.haskell +-- ^^ support.class.prelude.haskell +-- ^ variable.other.haskell +-- ^^ punctuation.separator.type.context.haskell +-- ^ variable.other.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^ variable.other.haskell + + class (Eq a, Show a, Eq b) => [a] -> [b] -> String +-- ^^^^^ meta.declaration.class.haskell - meta.sequence +-- ^ meta.declaration.class.context.haskell - meta.sequence +-- ^^^^^^^^^^^^^^^^^^^^ meta.declaration.class.context.haskell meta.sequence.tuple.haskell +-- ^ meta.declaration.class.context.haskell - meta.sequence +-- ^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.class.haskell +-- ^^^^^ keyword.declaration.class.haskell +-- ^^ support.class.prelude.haskell +-- ^ variable.other.haskell +-- ^^ punctuation.separator.type.context.haskell +-- ^ variable.other.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^ variable.other.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^^^^ support.type.prelude.haskell + + class (Eq (f a), Functor f) => (a -> b) -> f a -> f b -> Bool +-- ^^^^^ meta.declaration.class.haskell - meta.sequence - meta.group +-- ^ meta.declaration.class.context.haskell - meta.sequence +-- ^^^^ meta.declaration.class.context.haskell meta.sequence.tuple.haskell - meta.sequence meta.group +-- ^^^^^ meta.declaration.class.context.haskell meta.sequence.tuple.haskell meta.group.haskell +-- ^^^^^^^^^^^^ meta.declaration.class.context.haskell meta.sequence.tuple.haskell - meta.sequence meta.group +-- ^ meta.declaration.class.context.haskell - meta.sequence +-- ^^^ meta.declaration.class.haskell - meta.sequence - meta.group +-- ^^^^^^^^ meta.declaration.class.haskell meta.group.haskell +-- ^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.class.haskell - meta.group +-- ^^^^^ keyword.declaration.class.haskell +-- ^^ support.class.prelude.haskell +-- ^ punctuation.section.group.begin.haskell +-- ^ variable.other.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.group.end.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^ support.class.prelude.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^^ punctuation.separator.type.context.haskell +-- ^ punctuation.section.group.begin.haskell +-- ^ variable.other.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.group.end.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^ variable.other.haskell +-- ^ variable.other.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^ variable.other.haskell +-- ^ variable.other.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^^ support.type.prelude.haskell + + +-- [ DATA DECLARATIONS ] ------------------------------------------------------ + + data +-- ^^^^^ meta.declaration.data.haskell +-- ^^^^ keyword.declaration.data.haskell + + data' +-- ^^^^^ variable.other.haskell + + data TyCls +-- ^^^^^^^^^^^ meta.declaration.data.haskell +-- ^^^^ keyword.declaration.data.haskell +-- ^^^^^ entity.name.type.haskell + + data ModId.QTyCls +-- ^^^^^^^^^^^^^^^^^^ meta.declaration.data.haskell +-- ^^^^ keyword.declaration.data.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.type.haskell + + data CtxCls ctx => ModId.QTyCls +-- ^^^^ meta.declaration.data.haskell +-- ^^^^^^^^^^^^ meta.declaration.data.context.haskell +-- ^^^^^^^^^^^^^^^^ meta.declaration.data.haskell +-- ^^^^ keyword.declaration.data.haskell +-- ^^^^^^ storage.type.haskell +-- ^^^ variable.other.haskell +-- ^^ punctuation.separator.type.context.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.type.haskell + + data = +-- ^^^^^ meta.declaration.data.haskell +-- ^^^^ keyword.declaration.data.haskell +-- ^ keyword.operator.haskell + + -- Declare a list-like data family + data family XList a +-- ^^^^^^^^^^^^^^^^^^^^ meta.declaration.data.haskell +-- ^^^^ keyword.declaration.data.haskell +-- ^^^^^^ storage.modifier.family.haskell +-- ^^^^^ entity.name.type.haskell +-- ^ variable.other.haskell + + data family CtxCls par => XList a +-- ^^^^^^^^^^^ meta.declaration.data.haskell +-- ^^^^^^^^^^^^ meta.declaration.data.context.haskell +-- ^^^^^^^^^^^ meta.declaration.data.haskell +-- ^^^^ keyword.declaration.data.haskell +-- ^^^^^^ storage.modifier.family.haskell +-- ^^^^^^ storage.type.haskell +-- ^^^ variable.other.haskell +-- ^^ punctuation.separator.type.context.haskell +-- ^^^^^ entity.name.type.haskell +-- ^ variable.other.haskell + + -- Declare a list-like instance for Char + data instance XList Char = XCons !Char !(XList Char) | XNil +-- ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.data.haskell +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.declaration +-- ^^^^^^^^^^^^ meta.group.haskell +-- ^^^^ keyword.declaration.data.haskell +-- ^^^^^^^^ storage.modifier.family.haskell +-- ^^^^^ entity.name.type.haskell +-- ^^^^ support.type.prelude.haskell +-- ^ keyword.operator.haskell +-- ^^^^^ storage.type.haskell +-- ^ keyword.operator.haskell +-- ^^^^ support.type.prelude.haskell +-- ^ keyword.operator.haskell +-- ^ punctuation.section.group.begin.haskell +-- ^^^^^ storage.type.haskell +-- ^^^^ support.type.prelude.haskell +-- ^ punctuation.section.group.end.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^ storage.type.haskell + + -- Declare a number-like instance for () + data instance XList () = XListUnit !Int +-- ^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.data.haskell +-- ^^^^^^^^^^^^^^^^^ - meta.declaration +-- ^^^^ keyword.declaration.data.haskell +-- ^^^^^^^^ storage.modifier.family.haskell +-- ^^^^^ entity.name.type.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^ keyword.operator.haskell +-- ^^^^^^^^^ storage.type.haskell +-- ^ keyword.operator.haskell +-- ^^^ support.type.prelude.haskell + + data Record = +-- ^^^^^^^^^^^^ meta.declaration.data.haskell +-- ^^^^ keyword.declaration.data.haskell +-- ^^^^^^ entity.name.type.haskell +-- ^ keyword.operator.haskell + Record { +-- ^^^^^^^ - meta.block +-- ^^ meta.block.haskell +-- ^^^^^^ storage.type.haskell +-- ^ punctuation.section.block.begin.haskell + recordInt :: Int +-- ^^^^^^^^^ variable.other.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^ support.type.prelude.haskell + , recordString :: String +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^^^^^ variable.other.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^^^^ support.type.prelude.haskell + , recordDouble :: Double# +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^^^^^ variable.other.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^^^^^ support.type.unboxed.haskell +-- ^ storage.modifier.unboxed.haskell + , recordRational :: Rational +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^^^^^^^ variable.other.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^^^^^^ support.class.prelude.haskell + } deriving (Eq, Ord, Generic) +-- ^^ meta.block.haskell +-- ^ - meta +-- ^^^^^^^^^ meta.declaration.deriving.haskell - meta.sequence +-- ^^^^^^^^^^^^^^^^^^ meta.declaration.deriving.haskell meta.sequence.tuple.haskell +-- ^ - meta.declaration.deriving - meta.sequence +-- ^^^^^^^^ storage.modifier.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^ support.class.prelude.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^ support.class.prelude.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^ storage.type.haskell +-- ^ punctuation.section.sequence.end.haskell + deriving (Read, Show) via (Quiet Record) +-- ^^^^^^^^^ meta.declaration.deriving.haskell - meta.sequence +-- ^^^^^^^^^^^^ meta.declaration.deriving.haskell meta.sequence.tuple.haskell +-- ^ - meta.declaration.deriving - meta.sequence +-- ^^^^ meta.declaration.deriving.haskell - meta.sequence +-- ^^^^^^^^^^^^^^ meta.declaration.deriving.haskell meta.sequence.tuple.haskell +-- ^ - meta.declaration.deriving - meta.sequence +-- ^^^^^^^^ storage.modifier.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^ support.class.prelude.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^ support.class.prelude.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^^^ storage.modifier.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^^ storage.type.haskell +-- ^ - entity +-- ^^^^^^ storage.type.haskell +-- ^ punctuation.section.sequence.end.haskell + + data Outrageous = +-- ^^^^^^^^^^^^^^^^ meta.declaration.data.haskell +-- ^^^^ keyword.declaration.data.haskell +-- ^^^^^^^^^^ entity.name.type.haskell +-- ^ keyword.operator.haskell + Flipper !Record +-- ^^^^^^^ storage.type.haskell +-- ^ keyword.operator.haskell +-- ^^^^^^ storage.type.haskell + | Int :! Int +-- ^ punctuation.separator.sequence.haskell +-- ^^^ support.type.prelude.haskell +-- ^^ keyword.operator.haskell +-- ^^^ support.type.prelude.haskell + | Double :@ Double +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^ support.type.prelude.haskell +-- ^^ keyword.operator.haskell +-- ^^^^^^ support.type.prelude.haskell + | Int `Quux` Double +-- ^ punctuation.separator.sequence.haskell +-- ^^^ support.type.prelude.haskell +-- ^ meta.infix.haskell punctuation.definition.infix.begin.haskell +-- ^^^^ meta.infix.haskell keyword.operator.function.infix.haskell +-- ^ meta.infix.haskell punctuation.definition.infix.end.haskell +-- ^^^^^^ support.type.prelude.haskell + | String :# Record +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^ support.type.prelude.haskell +-- ^^ keyword.operator.haskell +-- ^^^^^^ storage.type.haskell + | Simple :$ Outrageous +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^ storage.type.haskell +-- ^^ keyword.operator.haskell +-- ^^^^^^^^^^ storage.type.haskell + | DontDoThis { outrageousInt :: Int, outrageousString :: String } +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^^^ storage.type.haskell +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.block.haskell +-- ^ punctuation.section.block.begin.haskell +-- ^^^^^^^^^^^^^ meta.block.haskell variable.other.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^ support.type.prelude.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^^^^^^^^^ meta.block.haskell variable.other.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^^^^ support.type.prelude.haskell +-- ^ punctuation.section.block.end.haskell + deriving (Eq, Ord, Generic) +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.deriving.haskell + deriving (Read, Show) via (Quiet Outrageous) +-- ^^^^^^^^^^^^^^^^^^^^^ meta.declaration.deriving.haskell +-- ^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.deriving.haskell + + data BuilderType = Builder + { (>>=) :: forall m a b. Unrestricted.Monad m => m a -> (a -> m b) -> m b +-- ^^^^^ meta.block.haskell meta.prefix.haskell +-- ^ punctuation.definition.prefix.begin.haskell +-- ^^^ keyword.operator.haskell +-- ^ punctuation.definition.prefix.end.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^^^^ keyword.control.forall.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^ support.class.prelude.haskell + , (>>) :: forall m b . Unrestricted.Monad m => m() -> m b -> m b +-- ^ punctuation.separator.sequence.haskell +-- ^^^^ meta.block.haskell meta.prefix.haskell +-- ^ punctuation.definition.prefix.begin.haskell +-- ^^ keyword.operator.haskell +-- ^ punctuation.definition.prefix.end.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^^^^ keyword.control.forall.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^ support.class.prelude.haskell + , fail :: ∀ m a . Unrestricted.MonadFail m => String -> m a +-- ^ punctuation.separator.sequence.haskell +-- ^^^^ support.function.prelude.haskell +-- ^^ punctuation.separator.type.haskell +-- ^ keyword.control.forall.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^^^^ storage.type.haskell + , return :: forall m a . Unrestricted.Monad m => a -> m a +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^ support.function.prelude.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^^^^ keyword.control.forall.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^ support.class.prelude.haskell + } + +-- [ DEFAULT DECLARATIONS ] --------------------------------------------------- + + default +-- ^^^^^^^^ meta.declaration.default.haskell +-- ^^^^^^^ storage.modifier.haskell + + 'default +-- ^ keyword.operator.haskell +-- ^^^^^^^ storage.modifier.haskell + + default' +-- ^^^^^^^^ - keyword + + default () +-- ^^^^^^^^ meta.declaration.default.haskell - meta.sequence +-- ^^ meta.declaration.default.haskell meta.sequence.tuple.haskell +-- ^^^^^^^ storage.modifier.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell + + default (TyCls, ModId.QTyCls) +-- ^^^^^^^^ meta.declaration.default.haskell - meta.sequence +-- ^^^^^^^^^^^^^^^^^^^^^ meta.declaration.default.haskell meta.sequence.tuple.haskell +-- ^^^^^^^ storage.modifier.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^^ storage.type.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ storage.type.haskell +-- ^ punctuation.section.sequence.end.haskell + + +-- [ DERIVING DECLARATIONS ] -------------------------------------------------- + + deriving +-- ^^^^^^^^^ meta.declaration.deriving.haskell +-- ^^^^^^^^ storage.modifier.haskell + + 'deriving +-- ^ keyword.operator.haskell +-- ^^^^^^^^ storage.modifier.haskell + + deriving' +-- ^^^^^^^^^ - keyword + + deriving TyCls Const +-- ^^^^^^^^^^^^^^ meta.declaration.deriving.haskell +-- ^^^^^^ - meta.declaration +-- ^^^^^^^^ storage.modifier.haskell +-- ^^^^^ storage.type.haskell +-- ^^^^^ storage.type.haskell + + deriving ModId.QTyCls ModId.Const +-- ^^^^^^^^^^^^^^^^^^^^^ meta.declaration.deriving.haskell +-- ^^^^^^^^^^^^ - meta.declaration +-- ^^^^^^^^ storage.modifier.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ storage.type.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^ storage.type.haskell + + deriving () +-- ^^^^^^^^^ meta.declaration.deriving.haskell - meta.sequence +-- ^^ meta.declaration.deriving.haskell meta.sequence.tuple.haskell +-- ^ - meta.declaration +-- ^^^^^^^^ storage.modifier.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell + + deriving (TyCls, ModId.QTyCls) +-- ^^^^^^^^^ meta.declaration.deriving.haskell - meta.sequence +-- ^^^^^^^^^^^^^^^^^^^^^ meta.declaration.deriving.haskell meta.sequence.tuple.haskell +-- ^ - meta.declaration +-- ^^^^^^^^ storage.modifier.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^^ storage.type.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ storage.type.haskell +-- ^ punctuation.section.sequence.end.haskell + + +-- [ INSTANCE DECLARATIONS ] -------------------------------------------------- + + instance +-- ^^^^^^^^^ meta.declaration.instance.haskell +-- ^^^^^^^^ keyword.declaration.instance.haskell + + instance ModId.QTyCls +-- ^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.instance.haskell +-- ^^^^^^^^ keyword.declaration.instance.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.class.haskell + + instance ModId.QTyCls [] +-- ^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.instance.haskell - meta.sequence +-- ^^ meta.declaration.instance.haskell meta.sequence.list.empty.haskell +-- ^ meta.declaration.instance.haskell - meta.sequence +-- ^^^^^^^^ keyword.declaration.instance.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.class.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell + + instance ModId.QTyCls () +-- ^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.instance.haskell - meta.sequence +-- ^^ meta.declaration.instance.haskell meta.sequence.tuple.empty.haskell +-- ^ meta.declaration.instance.haskell - meta.sequence +-- ^^^^^^^^ keyword.declaration.instance.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.class.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell + + instance ModId.QTyCls (,) +-- ^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.instance.haskell - meta.sequence +-- ^^^ meta.declaration.instance.haskell meta.sequence.tuple.haskell +-- ^ meta.declaration.instance.haskell - meta.sequence +-- ^^^^^^^^ keyword.declaration.instance.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.class.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ punctuation.section.sequence.end.haskell + + instance ModId.QTyCls (->) +-- ^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.instance.haskell - meta.prefix +-- ^^^^ meta.declaration.instance.haskell meta.prefix.haskell +-- ^ meta.declaration.instance.haskell - meta.prefix +-- ^^^^^^^^ keyword.declaration.instance.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.class.haskell +-- ^ punctuation.definition.prefix.begin.haskell +-- ^^ keyword.operator.haskell +-- ^ punctuation.definition.prefix.end.haskell + + instance ModId.QTyCls a +-- ^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.instance.haskell +-- ^^^^^^^^ keyword.declaration.instance.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.class.haskell +-- ^ variable.other.haskell + + instance ModId.QTyCls [a] +-- ^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.instance.haskell - meta.sequence +-- ^^^ meta.declaration.instance.haskell meta.sequence.list.haskell +-- ^ meta.declaration.instance.haskell - meta.sequence +-- ^^^^^^^^ keyword.declaration.instance.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.class.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.sequence.end.haskell + + instance ModId.QTyCls (a, b) +-- ^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.instance.haskell - meta.sequence +-- ^^^^^^ meta.declaration.instance.haskell meta.sequence.tuple.haskell +-- ^ meta.declaration.instance.haskell - meta.sequence +-- ^^^^^^^^ keyword.declaration.instance.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.class.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ variable.other.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.sequence.end.haskell + + instance ModId.QTyCls (a -> b) +-- ^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.instance.haskell - meta.group +-- ^^^^^^^^ meta.declaration.instance.haskell meta.group.haskell +-- ^ meta.declaration.instance.haskell - meta.group +-- ^^^^^^^^ keyword.declaration.instance.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.class.haskell +-- ^ punctuation.section.group.begin.haskell +-- ^ variable.other.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.group.end.haskell + + instance ModId.QTyCls ([] a b) +-- ^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.instance.haskell - meta.group +-- ^ meta.declaration.instance.haskell meta.group.haskell +-- ^^ meta.declaration.instance.haskell meta.group.haskell meta.sequence.list.empty.haskell +-- ^^^^^ meta.declaration.instance.haskell meta.group.haskell +-- ^ meta.declaration.instance.haskell - meta.group +-- ^^^^^^^^ keyword.declaration.instance.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.class.haskell +-- ^ punctuation.section.group.begin.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^ variable.other.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.group.end.haskell + + instance ModId.QTyCls (() a b) +-- ^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.instance.haskell - meta.group +-- ^ meta.declaration.instance.haskell meta.group.haskell +-- ^^ meta.declaration.instance.haskell meta.group.haskell meta.sequence.tuple.empty.haskell +-- ^^^^^ meta.declaration.instance.haskell meta.group.haskell +-- ^ meta.declaration.instance.haskell - meta.group +-- ^^^^^^^^ keyword.declaration.instance.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.class.haskell +-- ^ punctuation.section.group.begin.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^ variable.other.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.group.end.haskell + + instance ModId.QTyCls ((,) a b) +-- ^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.instance.haskell - meta.group +-- ^ meta.declaration.instance.haskell meta.group.haskell +-- ^^^ meta.declaration.instance.haskell meta.group.haskell meta.sequence.tuple.haskell +-- ^^^^^ meta.declaration.instance.haskell meta.group.haskell +-- ^ meta.declaration.instance.haskell - meta.group +-- ^^^^^^^^ keyword.declaration.instance.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.class.haskell +-- ^ punctuation.section.group.begin.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^ variable.other.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.group.end.haskell + + instance ModId.QTyCls ((->) a b) +-- ^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.instance.haskell - meta.group +-- ^ meta.declaration.instance.haskell meta.group.haskell +-- ^^^^ meta.declaration.instance.haskell meta.group.haskell meta.prefix.haskell +-- ^^^^^ meta.declaration.instance.haskell meta.group.haskell +-- ^ meta.declaration.instance.haskell - meta.group +-- ^^^^^^^^ keyword.declaration.instance.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.class.haskell +-- ^ punctuation.section.group.begin.haskell +-- ^ punctuation.definition.prefix.begin.haskell +-- ^^ keyword.operator.haskell +-- ^ punctuation.definition.prefix.end.haskell +-- ^ variable.other.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.group.end.haskell + + instance Num a => Bar [a] where ... +-- ^^^^^^^^ meta.declaration.instance.haskell +-- ^^^^^^^ meta.declaration.instance.context.haskell +-- ^^^^^^^ meta.declaration.instance.haskell - meta.sequence +-- ^^^ meta.declaration.instance.haskell meta.sequence.list.haskell +-- ^ meta.declaration.instance.haskell - meta.sequence +-- ^^^^^^^^ keyword.declaration.instance.haskell +-- ^^^ support.class.prelude.haskell +-- ^ variable.other.haskell +-- ^^ punctuation.separator.type.context.haskell +-- ^^^ entity.name.class.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^^^^^ keyword.control.context.haskell + + instance (Eq a, Show a) => Foo [a] where ... +-- ^^^^^^^^ meta.declaration.instance.haskell - meta.sequence +-- ^ meta.declaration.instance.context.haskell - meta.sequence +-- ^^^^^^^^^^^^^^ meta.declaration.instance.context.haskell meta.sequence.tuple.haskell +-- ^ meta.declaration.instance.context.haskell - meta.sequence +-- ^^^^^^^ meta.declaration.instance.haskell - meta.sequence +-- ^^^ meta.declaration.instance.haskell meta.sequence.list.haskell +-- ^ meta.declaration.instance.haskell - meta.sequence +-- ^^^^^^^^ keyword.declaration.instance.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^ support.class.prelude.haskell +-- ^ variable.other.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^ support.class.prelude.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^^ punctuation.separator.type.context.haskell +-- ^^^ entity.name.class.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^^^^^ keyword.control.context.haskell + + {- illegal instance declarations -} + + instance C (a,a) where ... -- a, a is not distict +--- ^ invalid.illegal + + instance C (Int,a) where ... -- no type allowed +--- ^^^ invalid.illegal + + instance C [[a]] where ... -- no nested lists allowed +--- ^^^ invalid.illegal + + +-- [ NEWTYPE DECLARATIONS ] --------------------------------------------------- + + newtype +-- ^^^^^^^^ meta.declaration.newtype.haskell +-- ^^^^^^^ keyword.declaration.newtype.haskell + + 'newtype +-- ^ keyword.operator.haskell +-- ^^^^^^^ keyword.declaration.newtype.haskell + + newtype' +-- ^^^^^^^^ - keyword + + newtype = +-- ^^^^^^^^ meta.declaration.newtype.haskell +-- ^^^^^^^ keyword.declaration.newtype.haskell +-- ^ keyword.operator.haskell + + newtype => +-- ^^^^^^^ meta.declaration.newtype.haskell +-- ^ meta.declaration.newtype.context.haskell +-- ^^^ meta.declaration.newtype.haskell +-- ^^^^^^^ keyword.declaration.newtype.haskell +-- ^^ punctuation.separator.type.context.haskell + + newtype CtxCls tyVar => +-- ^^^^^^^ meta.declaration.newtype.haskell +-- ^^^^^^^^^^^^^^ meta.declaration.newtype.context.haskell +-- ^^^ meta.declaration.newtype.haskell +-- ^^^^^^^ keyword.declaration.newtype.haskell +-- ^^^^^^ storage.type.haskell +-- ^^^^^ variable.other.haskell +-- ^^ punctuation.separator.type.context.haskell + + newtype () => ModId.QTyCls tyVar1 tyVar2 deriving (Class1, QTyCls2) +-- ^^^^^^^ meta.declaration.newtype.haskell +-- ^^^^ meta.declaration.newtype.context.haskell +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.newtype.haskell +-- ^^^^^^^^^ meta.declaration.deriving.haskell - meta.sequence +-- ^^^^^^^^^^^^^^^^^ meta.declaration.deriving.haskell meta.sequence.tuple.haskell +-- ^ - meta.declaration +-- ^^^^ keyword.declaration.newtype.haskell +-- ^^ meta.sequence.tuple.empty.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^^ punctuation.separator.type.context.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.type.haskell +-- ^^^^^^ variable.other.haskell +-- ^^^^^^ variable.other.haskell +-- ^^^^^^^^ storage.modifier.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^^^ storage.type.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^ storage.type.haskell +-- ^ punctuation.section.sequence.end.haskell + + +-- [ TYPE DECLARATIONS ] ------------------------------------------------------ + + type +-- ^^^^^ meta.declaration.type.haskell +-- ^^^^ keyword.declaration.type.haskell + + 'type +-- ^ keyword.operator.haskell +-- ^^^^ keyword.declaration.type.haskell + + type' +-- ^^^^^ - keyword + + type QTyCls tyVar +-- ^^^^^^^^^^^^^^^^^^ meta.declaration.type.haskell +-- ^^^^ keyword.declaration.type.haskell +-- ^^^^^^ entity.name.type.haskell +-- ^^^^^ variable.other.haskell + + type ModId.QTyCls tyVar1 tyVar2 +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.type.haskell +-- ^^^^ keyword.declaration.type.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.type.haskell +-- ^^^^^^ variable.other.haskell +-- ^^^^^^ variable.other.haskell + + type ModId.QTyCls tyVar1 tyVar2 = +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.type.haskell +-- ^^^^ keyword.declaration.type.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.type.haskell +-- ^^^^^^ variable.other.haskell +-- ^^^^^^ variable.other.haskell + + type ModId.QTyCls tyVar1 tyVar2 deriving (Class1, QTyCls2) +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.type.haskell +-- ^^^^^^^^^ meta.declaration.deriving.haskell - meta.sequence +-- ^^^^^^^^^^^^^^^^^ meta.declaration.deriving.haskell meta.sequence.tuple.haskell +-- ^ - meta.declaration +-- ^^^^ keyword.declaration.type.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.type.haskell +-- ^^^^^^ variable.other.haskell +-- ^^^^^^ variable.other.haskell +-- ^^^^^^^^ storage.modifier.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^^^ storage.type.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^ storage.type.haskell +-- ^ punctuation.section.sequence.end.haskell + + type ModId.CtxCls tyVar => ModId.QTyCls +-- ^^^^ meta.declaration.type.haskell +-- ^^^^^^^^^^^^^^^^^^^^ meta.declaration.type.context.haskell +-- ^^^^^^^^^^^^^^^^ meta.declaration.type +-- ^^^^ keyword.declaration.type.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ storage.type.haskell +-- ^^^^^ variable.other.haskell +-- ^^ punctuation.separator.type.context.haskell +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ entity.name.type.haskell + + type Id a = a +-- ^^^^^^^^^^ meta.declaration.type.haskell +-- ^ keyword.operator.haskell +-- ^ variable.other.haskell + + type Const a b = a +-- ^^^^^^^^^^^^^^^ meta.declaration.type.haskell +-- ^ keyword.operator.haskell +-- ^ variable.other.haskell + + type FunctionTo a b = b -> a +-- ^^^^^^^^^^^^^^^^^^^^ meta.declaration.type.haskell +-- ^ keyword.operator.haskell +-- ^ variable.other.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^ variable.other.haskell + + type Indexed f g = forall i. f i -> g i +-- ^^^^^^^^^^^^^^^^^ meta.declaration.type.haskell +-- ^ keyword.operator.haskell +-- ^^^^^^ keyword.control.forall.haskell +-- ^ variable.other.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ variable.other.haskell +-- ^ variable.other.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^ variable.other.haskell +-- ^ variable.other.haskell + + type ShowIndexed f g = forall i. (Show i) => f i -> g i +-- ^^^^^^^^^^^^^^^^^^^^^ meta.declaration.type.haskell +-- ^ keyword.operator.haskell +-- ^^^^^^ keyword.control.forall.haskell +-- ^ variable.other.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^ meta.group.haskell +-- ^ punctuation.section.group.begin.haskell +-- ^^^^ support.class.prelude.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.group.end.haskell +-- ^^ punctuation.separator.type.context.haskell +-- ^ variable.other.haskell +-- ^ variable.other.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^ variable.other.haskell +-- ^ variable.other.haskell + + type ShowConstrained f a = (Show a) => f a +-- ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.type.haskell +-- ^ keyword.operator.haskell +-- ^^^^^^^^ meta.group.haskell +-- ^ punctuation.section.group.begin.haskell +-- ^^^^ support.class.prelude.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.group.end.haskell +-- ^^ punctuation.separator.type.context.haskell +-- ^ variable.other.haskell +-- ^ variable.other.haskell + + type CmdRoute = +-- ^^^^^^^^^^^^^^ meta.declaration.type.haskell +-- ^^^^ keyword.declaration.type.haskell +-- ^^^^^^^^ entity.name.type.haskell +-- ^ keyword.operator.haskell + ( ReqBody '[JSON] CmdDto :> PostCreated '[JSON] NoContent +-- ^^^^^^^^^^^ meta.group.haskell - meta.sequence +-- ^^^^^^ meta.group.haskell meta.sequence.list.haskell +-- ^^^^^^^^^^^^^^^^^^^^^^^^ meta.group.haskell - meta.sequence +-- ^^^^^^ meta.group.haskell meta.sequence.list.haskell +-- ^^^^^^^^^^^ meta.group.haskell - meta.sequence +-- ^ punctuation.section.group.begin.haskell +-- ^ keyword.operator.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^^ keyword.operator.haskell +-- ^ keyword.operator.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell + :<|> Capture "id" Text :> ReqBody '[JSON] CmdDto :> Put '[JSON] NoContent +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.group.haskell - meta.sequence +-- ^^^^^^ meta.group.haskell meta.sequence.list.haskell +-- ^^^^^^^^^^^^^^^^ meta.group.haskell - meta.sequence +-- ^^^^^^ meta.group.haskell meta.sequence.list.haskell +-- ^^^^^^^^^^^ meta.group.haskell - meta.sequence +-- ^^^^ keyword.operator.haskell +-- ^^ keyword.operator.haskell +-- ^ keyword.operator.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^^ keyword.operator.haskell +-- ^ keyword.operator.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell + ) +-- ^ meta.group.haskell punctuation.section.group.end.haskell + + type family TypeFamily +-- ^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.type.haskell +-- ^^^^ keyword.declaration.type.haskell +-- ^^^^^^ storage.modifier.family.haskell +-- ^^^^^^^^^^ entity.name.type.haskell + + type family Elem c :: * +-- ^^^^^^^^^^^^^^^^^^^ meta.declaration.type.haskell +-- ^^^^ keyword.declaration.type.haskell +-- ^^^^^^ storage.modifier.family.haskell +-- ^^^^ entity.name.type.haskell +-- ^ variable.other.haskell +-- ^^ punctuation.separator.type.haskell +-- ^ keyword.operator.haskell + + type family F a b :: * -> * +-- ^^^^^^^^^^^^^^^^^^ meta.declaration.type.haskell +-- ^^^^ keyword.declaration.type.haskell +-- ^^^^^^ storage.modifier.family.haskell +-- ^ entity.name.type.haskell +-- ^ variable.other.haskell +-- ^ variable.other.haskell +-- ^^ punctuation.separator.type.haskell +-- ^ keyword.operator.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^ keyword.operator.haskell + + +-- [ FIXITY DECLARATIONS ] ---------------------------------------------------- + + infix +-- ^^^^^ keyword.declaration.fixity.haskell + + infix' +-- ^^^^^^ variable.other.haskell + + infixl +-- ^^^^^^ keyword.declaration.fixity.haskell + + infixr +-- ^^^^^^ keyword.declaration.fixity.haskell + + infix 0 :$ +-- ^^^^^ keyword.declaration.fixity.haskell +-- ^ constant.numeric.value.haskell +-- ^^ keyword.operator.haskell + + infix 1 `ConId` +-- ^^^^^ keyword.declaration.fixity.haskell +-- ^ constant.numeric.value.haskell +-- ^ meta.infix.haskell punctuation.definition.infix.begin.haskell +-- ^^^^^ meta.infix.haskell keyword.operator.function.infix.haskell +-- ^ meta.infix.haskell punctuation.definition.infix.end.haskell + + infixl 7 ⋆, /, `quot` +-- ^^^^^^ keyword.declaration.fixity.haskell +-- ^ constant.numeric.value.haskell +-- ^ keyword.operator.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ keyword.operator.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ meta.infix.haskell punctuation.definition.infix.begin.haskell +-- ^^^^ meta.infix.haskell keyword.operator.function.infix.haskell +-- ^ meta.infix.haskell punctuation.definition.infix.end.haskell + + +-- [ FUNCTION DECLARATIONS ] -------------------------------------------------- + + {- infix operator declaration -} + (<:>) +-- ^^^^^ meta.function.identifier.haskell meta.prefix.haskell +-- ^ meta.function.identifier.haskell - meta.prefix +-- ^ punctuation.definition.prefix.begin.haskell +-- ^^^ keyword.operator.haskell +-- ^ punctuation.definition.prefix.end.haskell + :: a -> Bool +-- ^ meta.function.identifier.haskell +-- ^^^^^^^^^^^^^ - meta.function +-- ^^ punctuation.separator.type.haskell +-- ^ variable.other.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^^ support.type.prelude.haskell + {- infix operator body -} + (<:>) = do a <:> b +-- ^^^^^ meta.prefix.haskell +-- ^ punctuation.definition.prefix.begin.haskell +-- ^^^ keyword.operator.haskell +-- ^ punctuation.definition.prefix.end.haskell +-- ^ keyword.operator.haskell +-- ^^ keyword.control.context.haskell +-- ^ variable.other.haskell +-- ^^^ keyword.operator.haskell +-- ^ variable.other.haskell + + {- function declaration list -} + isNaN,, isInfinite +-- ^ - meta.function +-- ^^^^^^^^^^^^^^^^^^^ meta.function.identifier.haskell +-- ^^^^^ entity.name.function.haskell +-- ^^ punctuation.separator.sequence.haskell +-- ^^^^^^^^^^ entity.name.function.haskell + :: a -> Bool +-- ^ meta.function.identifier.haskell +-- ^^^^^^^^^^^^^ - meta.function +-- ^^ punctuation.separator.type.haskell +-- ^ variable.other..haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^^ support.type.prelude.haskell + + {- function declaration with context and unicode operators -} + sequenceA ∷ Applicative f ⇒ t (f a) → f (t a) +-- ^^^^^^^^^^ meta.function.identifier.haskell +-- ^^^^^^^^^ entity.name.function.haskell +-- ^ punctuation.separator.type.haskell +-- ^^^^^^^^^^^ support.class.prelude.haskell +-- ^ variable.other.haskell +-- ^ punctuation.separator.type.context.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.group.begin.haskell +-- ^ variable.other.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.group.end.haskell +-- ^ keyword.operator.arrow.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.group.begin.haskell +-- ^ variable.other.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.group.end.haskell + {- function body -} + sequenceA = traverse id +-- ^^^^^^^^^ support.function.prelude.haskell +-- ^ keyword.operator.haskell +-- ^^^^^^^^ support.function.prelude.haskell +-- ^^ support.function.prelude.haskell + + {- function declaration with context and ascii operators -} + traverse :: Applicative f => +-- ^^^^^^^^^ meta.function.identifier.haskell +-- ^^^^^^^^^^^^^^^^^^^^ - meta.function +-- ^^^^^^^^ entity.name.function.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^^^^^^^^^ support.class.prelude.haskell +-- ^ variable.other.haskell +-- ^^ punctuation.separator.type.context.haskell + (a -> f b) +-- ^^ keyword.operator.arrow.haskell + -> t a +-- ^^ keyword.operator.arrow.haskell + -> f (t b) +-- ^^ keyword.operator.arrow.haskell + + {- function body -} + traverse f = sequenceA . fmap f +-- ^^^^^^^^ support.function.prelude.haskell +-- ^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^^^^^^^^^ support.function.prelude.haskell +-- ^ keyword.operator.haskell +-- ^^^^ support.function.prelude.haskell +-- ^ variable.other.haskell + + {- guarded function declarations -} + toAsciiChar :: Char -> Maybe Char + toAsciiChar c | isAscii c = Just c +-- ^^^^^^^^^^^ variable.other.haskell +-- ^ variable.other.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^ variable.other.haskell +-- ^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^^^^ support.type.prelude.haskell +-- ^ variable.other.haskell + | otherwise = M.lookup c asciiMap +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^^^^ support.constant.prelude.haskell +-- ^ keyword.operator.haskell +-- ^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^^^^^^ support.function.prelude.haskell +-- ^ variable.other.haskell +-- ^^^^^^^^ variable.other.haskell + + fromEntities' :: Text -> String +-- ^^^^^^^^^^^^^ entity.name.function.haskell + fromEntities' (T.uncons -> Just ('&', xs)) = +-- ^^^^^^^^^^^^^ variable.other.haskell +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.group.haskell +-- ^ keyword.operator.haskell + case lookupEntity $ T.unpack ent' of + Just c -> c <> fromEntities' rest + Nothing -> "&" <> fromEntities' xs + fromEntities' t = case T.uncons t of +-- ^^^^^^^^^^^^^ variable.other.haskell +-- ^ variable.other.haskell +-- ^ keyword.operator.haskell + Just (x, xs) -> x : fromEntities' xs + Nothing -> "" + + {- Module Level Function Declarations -} + module ModId.ModName (fun) where + fun :: Bool -> Bool +-- ^^^^ meta.function.identifier.haskell +-- ^^^ entity.name.function.haskell +-- ^^ punctuation.separator.type.haskell + fun = print "Hello" +-- ^^^ variable.other.haskell +-- ^ keyword.operator.haskell + + {- Module Level Function Declarations with Block Layout -} + module ModId.ModName (fun1, fun2) where { fun1 :: Bool -> Bool ; fun1 = False ; fun2 :: } +-- ^^^^^^^^^^^^ meta.declaration.module.haskell meta.sequence.tuple.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^ entity.name.export.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^ entity.name.export.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^^^^^ keyword.control.context.haskell +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.block.haskell +-- ^ punctuation.section.block.begin.haskell +-- ^^^^^ meta.function.identifier.haskell +-- ^^^^ entity.name.function.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^^ support.type.prelude.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^^ support.type.prelude.haskell +-- ^ punctuation.terminator.statement.haskell +-- ^^^^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^^^^^ support.constant.prelude.haskell +-- ^ punctuation.terminator.statement.haskell +-- ^^^^ entity.name.function.haskell +-- ^^ punctuation.separator.type.haskell +-- ^ punctuation.section.block.end.haskell + + {- Class Method Declarations -} + class TyCls a where + nethod1 :: a -> Bool +-- ^^^^^^^^ meta.function.identifier.haskell +-- ^^^^^^^ entity.name.function.haskell +-- ^^ punctuation.separator.type.haskell +-- ^ variable.other.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^^ support.type.prelude.haskell + + {- maybe function or pattern binding -} + method1 = True +-- ^^^^^^^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^^^^ support.constant.prelude.haskell + + method' :: +-- ^^^^^^^^ meta.function.identifier.haskell +-- ^^^^^^^ entity.name.function.haskell + a -> Bool +-- ^ variable.other.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^^ support.type.prelude.haskell + + {- Class Method Declarations with Block Layout -} + class TyCls a where { + method :: Bool -> Bool; +-- ^^^^^^^ meta.block.haskell meta.function.identifier.haskell +-- ^^^^^^^^^^^^^^^^^ meta.block.haskell - meta.function +-- ^^^^^^ entity.name.function.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^^ support.type.prelude.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^^ support.type.prelude.haskell +-- ^ punctuation.terminator.statement.haskell + + {- maybe function or pattern binding -} + method = True; +-- ^^^^^^^^^^^^^^^ meta.block.haskell +-- ^^^^^^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^^^^ support.constant.prelude.haskell +-- ^ punctuation.terminator.statement.haskell + + {- preceeded by statement terminator -} + ;method :: Bool -> Bool; +-- ^ meta.block.haskell - meta.function +-- ^^^^^^^ meta.block.haskell meta.function.identifier.haskell +-- ^^^^^^^^^^^^^^^^^ meta.block.haskell - meta.function +-- ^ punctuation.terminator.statement.haskell +-- ^^^^^^ entity.name.function.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^^ support.type.prelude.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^^ support.type.prelude.haskell +-- ^ punctuation.terminator.statement.haskell + } + + {- Instance Method Declarations -} + instance TyCls a where + nethod1 :: a -> Bool +-- ^^^^^^^^ meta.function.identifier.haskell +-- ^^^^^^^ entity.name.function.haskell +-- ^^ punctuation.separator.type.haskell +-- ^ variable.other.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^^ support.type.prelude.haskell + + {- maybe function or pattern binding -} + method1 = True +-- ^^^^^^^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^^^^ support.constant.prelude.haskell + + method' :: +-- ^^^^^^^^ meta.function.identifier.haskell +-- ^^^^^^^ entity.name.function.haskell + a -> Bool +-- ^ variable.other.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^^ support.type.prelude.haskell + + {- Instance Method Declarations with Block Layout -} + instance TyCls a where { + method :: Bool -> Bool; +-- ^^^^^^^ meta.block.haskell meta.function.identifier.haskell +-- ^^^^^^^^^^^^^^^^^ meta.block.haskell - meta.function +-- ^^^^^^ entity.name.function.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^^ support.type.prelude.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^^ support.type.prelude.haskell +-- ^ punctuation.terminator.statement.haskell + + {- maybe function or pattern binding -} + method = True; +-- ^^^^^^^^^^^^^^^ meta.block.haskell +-- ^^^^^^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^^^^ support.constant.prelude.haskell +-- ^ punctuation.terminator.statement.haskell + + {- preceeded by statement terminator -} + ;method :: Bool -> Bool; +-- ^ meta.block.haskell - meta.function +-- ^^^^^^^ meta.block.haskell meta.function.identifier.haskell +-- ^^^^^^^^^^^^^^^^^ meta.block.haskell - meta.function +-- ^ punctuation.terminator.statement.haskell +-- ^^^^^^ entity.name.function.haskell +-- ^^ punctuation.separator.type.haskell +-- ^^^^ support.type.prelude.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^^ support.type.prelude.haskell +-- ^ punctuation.terminator.statement.haskell + } + + +-- [ LET EXPRESSIONS ]--------------------------------------------------------- + + let a +-- ^^^ keyword.declaration.variable.haskell +-- ^ variable.other.haskell + + let a = 5 +-- ^^^ keyword.declaration.variable.haskell +-- ^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^ constant.numeric.value.haskell + + let (a, b) = split arg +-- ^^^ keyword.declaration.variable.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ variable.other.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^ keyword.operator.haskell +-- ^^^^^ variable.other.haskell +-- ^^^ variable.other.haskell + + let a = 2 in a * b where b = 1 +-- ^^^ keyword.declaration.variable.haskell +-- ^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^ constant.numeric.value.haskell +-- ^^ keyword.control.context.haskell +-- ^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^ variable.other.haskell +-- ^^^^^ keyword.control.context.haskell +-- ^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^ constant.numeric.value.haskell + + let +-- ^^^ keyword.declaration.variable.haskell + a = 2 ; d = 5 +-- ^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^ constant.numeric.value.haskell +-- ^ punctuation.terminator.statement.haskell +-- ^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^ constant.numeric.value.haskell + b = 4 +-- ^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^ constant.numeric.value.haskell + in +-- ^^ keyword.control.context.haskell + a * b + c +-- ^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^ variable.other.haskell + where +-- ^^^^^ keyword.control.context.haskell + c = 4 +-- ^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^ constant.numeric.value.haskell + + let { a = 2 ; b = 4 } in { a * b + c } where { c = 4 ; d = 5 } +-- ^^^ keyword.declaration.variable.haskell +-- ^ punctuation.section.block.begin.haskell +-- ^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^ constant.numeric.value.haskell +-- ^ punctuation.terminator.statement.haskell +-- ^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^ constant.numeric.value.haskell +-- ^ punctuation.section.block.end.haskell +-- ^^ keyword.control.context.haskell +-- ^ punctuation.section.block.begin.haskell +-- ^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.block.end.haskell +-- ^^^^^ keyword.control.context.haskell +-- ^ punctuation.section.block.begin.haskell +-- ^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^ constant.numeric.value.haskell +-- ^ punctuation.terminator.statement.haskell +-- ^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^ constant.numeric.value.haskell +-- ^ punctuation.section.block.end.haskell + +test = +-- <- variable.other.haskell +-- ^ keyword.operator.haskell + let x = 2 in x * y +-- ^^^ keyword.declaration.variable.haskell +-- ^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^ constant.numeric.value.haskell +-- ^^ keyword.control.context.haskell +-- ^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^ variable.other.haskell + where +-- ^^^^^ keyword.control.context.haskell + y = 1 +-- ^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^ constant.numeric.value.haskell + + let runIO' :: PandocIO a -> IO a +--^^^ keyword.declaration.variable.haskell +-- ^^^^^^^ meta.function.identifier.haskell +-- ^^^^^^ entity.name.function.haskell +-- ^^ punctuation.separator.type.haskell + runIO' f = do + let isWarning msg = messageVerbosity msg == WARNING +-- ^^^ keyword.declaration.variable.haskell +-- ^^^^^^^^^ variable.other.haskell +-- ^^^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^^^^^^^^^^^^^^^^ variable.other.haskell +-- ^^^ variable.other.haskell +-- ^^ keyword.operator.haskell +-- ^^^^^^^ storage.type.haskell + when (optFailIfWarnings opts && any isWarning reports) $ + E.throwIO PandocFailOnWarningError + return res + + +-- [ KEYWORDS ] --------------------------------------------------------------- + +test a = case a of +-- ^^^^ keyword.control.conditional.select.haskell +-- ^^ keyword.control.conditional.select.haskell + Nothing -> 0 + Just n -> if n > 0 +-- ^^ keyword.control.conditional.if.haskell + then n +-- ^^^^ keyword.control.conditional.then.haskell + else 0 +-- ^^^^ keyword.control.conditional.else.haskell + +main = do +-- ^^ keyword.control.context.haskell + return () +-- ^^^^^^ support.function.prelude.haskell + + +-- [ BLOCKS / GROUPS / LISTS / TUPLES ] --------------------------------------- + + {} +-- ^ - meta.block +-- ^^ meta.block.haskell +-- ^ - meta.block +-- ^ punctuation.section.block.begin.haskell +-- ^ punctuation.section.block.end.haskell + + {;} +-- ^ - meta.block +-- ^^^ meta.block.haskell +-- ^ - meta.block +-- ^ punctuation.section.block.begin.haskell +-- ^ punctuation.terminator.statement.haskell +-- ^ punctuation.section.block.end.haskell + + [] +-- ^ - meta.sequence +-- ^^ meta.sequence.list.empty.haskell +-- ^ - meta.sequence +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell + + [,] +-- ^ - meta.sequence +-- ^^^ meta.sequence.list.haskell +-- ^ - meta.sequence +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ punctuation.section.sequence.end.haskell + + [,,] +-- ^ - meta.sequence +-- ^^^^ meta.sequence.list.haskell +-- ^ - meta.sequence +-- ^ punctuation.section.sequence.begin.haskell +-- ^^ punctuation.separator.sequence.haskell +-- ^ punctuation.section.sequence.end.haskell + + [1,2,a,b','c',..] +-- ^ - meta.sequence +-- ^^^^^^^^^^^^^^^^^ meta.sequence.list.haskell +-- ^ - meta.sequence +-- ^ punctuation.section.sequence.begin.haskell +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ variable.other.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^ variable.other.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^ keyword.operator.haskell +-- ^ punctuation.section.sequence.end.haskell + [ x :: a +-- ^^^^^^^^^ meta.sequence.list.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ variable.other.haskell +-- ^^ punctuation.separator.type.haskell +-- ^ variable.other.haskell + B c ] +-- ^^^^^^ meta.sequence.list.haskell +-- ^ - meta.sequence +-- ^ storage.type.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.sequence.end.haskell + +-- List comprehension + + [ x | xs <- [ [(1,2),(3,4)], [(5,4),(3,2)] ], (3,x) <- xs ] +-- ^ - meta.sequence +-- ^^^^^^^^^^^^ meta.sequence.list.haskell - meta.sequence meta.sequence +-- ^^ meta.sequence.list.haskell meta.sequence.list.haskell - meta.sequence meta.sequence meta.sequence +-- ^ meta.sequence.list.haskell meta.sequence.list.haskell meta.sequence.list.haskell - meta.sequence meta.sequence meta.sequence meta.sequence +-- ^^^^^ meta.sequence.list.haskell meta.sequence.list.haskell meta.sequence.list.haskell meta.sequence.tuple.haskell +-- ^ meta.sequence.list.haskell meta.sequence.list.haskell meta.sequence.list.haskell - meta.sequence meta.sequence meta.sequence meta.sequence +-- ^^^^^ meta.sequence.list.haskell meta.sequence.list.haskell meta.sequence.list.haskell meta.sequence.tuple.haskell +-- ^ meta.sequence.list.haskell meta.sequence.list.haskell meta.sequence.list.haskell - meta.sequence meta.sequence meta.sequence meta.sequence +-- ^^ meta.sequence.list.haskell meta.sequence.list.haskell - meta.sequence meta.sequence meta.sequence +-- ^ meta.sequence.list.haskell meta.sequence.list.haskell meta.sequence.list.haskell - meta.sequence meta.sequence meta.sequence meta.sequence +-- ^^^^^ meta.sequence.list.haskell meta.sequence.list.haskell meta.sequence.list.haskell meta.sequence.tuple.haskell +-- ^ meta.sequence.list.haskell meta.sequence.list.haskell meta.sequence.list.haskell - meta.sequence meta.sequence meta.sequence meta.sequence +-- ^^^^^ meta.sequence.list.haskell meta.sequence.list.haskell meta.sequence.list.haskell meta.sequence.tuple.haskell +-- ^ meta.sequence.list.haskell meta.sequence.list.haskell meta.sequence.list.haskell - meta.sequence meta.sequence meta.sequence meta.sequence +-- ^^ meta.sequence.list.haskell meta.sequence.list.haskell - meta.sequence meta.sequence meta.sequence +-- ^^ meta.sequence.list.haskell - meta.sequence meta.sequence +-- ^^^^^ meta.sequence.list.haskell meta.sequence.tuple.haskell +-- ^^^^^^^^ meta.sequence.list.haskell - meta.sequence meta.sequence +-- ^ - meta.sequence +-- ^ punctuation.section.sequence.begin.haskell +-- ^ variable.other.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^ variable.other.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell +-- ^^ punctuation.section.sequence.end.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell +-- ^^ punctuation.section.sequence.end.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ constant.numeric.value.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ variable.other.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^ variable.other.haskell +-- ^ punctuation.section.sequence.end.haskell +-- + + {- Generalised (SQL-like) List Comprehensions -} + a = [ (the dept, sum salary) +-- ^^ meta.sequence.list.haskell +-- ^^^^^^^^^^^^^^^^^^^^^^ meta.sequence.list.haskell meta.sequence.tuple.haskell +-- ^ meta.sequence.list.haskell - meta.sequence meta.sequence +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^ variable.other.haskell +-- ^^^^ variable.other.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^ support.function.prelude.haskell +-- ^^^^^^ variable.other.haskell +-- ^ punctuation.section.sequence.end.haskell + | (name, dept, salary) <- employees +-- ^^ meta.sequence.list.haskell +-- ^^^^^^^^^^^^^^^^^^^^ meta.sequence.list.haskell meta.sequence.tuple.haskell +-- ^^^^^^^^^^^^^^ meta.sequence.list.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^^ variable.other.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^ variable.other.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^^^ variable.other.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^^^^^^^^^ variable.other.haskell + , then group by dept using groupWith +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.sequence.list.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^ keyword.control.conditional.then.haskell +-- ^^^^^ keyword.control.list.haskell +-- ^^ keyword.control.list.haskell +-- ^^^^ variable.other.haskell +-- ^^^^^ keyword.control.list.haskell +-- ^^^^^^^^^ variable.other.haskell + , then sortWith by (sum salary) +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.sequence.list.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^ keyword.control.conditional.then.haskell +-- ^^^^^^^^ variable.other.haskell +-- ^^ keyword.control.list.haskell +-- ^ punctuation.section.group.begin.haskell +-- ^^^ support.function.prelude.haskell +-- ^^^^^^ variable.other.haskell +-- ^ punctuation.section.group.end.haskell + , then take 5 ] +-- ^^^^^^^^^^^^^^^ meta.sequence.list.haskell +-- ^ - meta.sequence +-- ^ punctuation.separator.sequence.haskell +-- ^^^^ keyword.control.conditional.then.haskell +-- ^^^^ support.function.prelude.haskell +-- ^ constant.numeric.value.haskell +-- ^ punctuation.section.sequence.end.haskell + + () +-- ^ - meta.sequence +-- ^^ meta.sequence.tuple.empty.haskell +-- ^ - meta.sequence +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell + + (,) +-- ^ - meta.sequence +-- ^^^ meta.sequence.tuple.haskell +-- ^ - meta.sequence +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell + + (#,#) +-- ^ - meta.sequence +-- ^^^^^ meta.sequence.tuple.haskell +-- ^ - meta.sequence +-- ^ punctuation.section.sequence.begin.haskell +-- ^ storage.modifier.unboxed.haskell +-- ^ storage.modifier.unboxed.haskell +-- ^ punctuation.section.sequence.end.haskell + + ( , , ) +-- ^ - meta.sequence +-- ^^^^^^^ meta.sequence.tuple.haskell +-- ^ - meta.sequence +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell + + (# , , #) +-- ^ - meta.sequence +-- ^^^^^^^^^ meta.sequence.tuple.haskell +-- ^ - meta.sequence +-- ^ punctuation.section.sequence.begin.haskell +-- ^ storage.modifier.unboxed.haskell +-- ^ storage.modifier.unboxed.haskell +-- ^ punctuation.section.sequence.end.haskell + + (group,) +-- ^^^^^^^^ meta.sequence.tuple.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ punctuation.section.sequence.end.haskell + + (#group,#) +-- ^^^^^^^^^^ meta.sequence.tuple.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ storage.modifier.unboxed.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ storage.modifier.unboxed.haskell +-- ^ punctuation.section.sequence.end.haskell + + ('<':'b':'r':_) +-- ^^^^^^^^^^^^^^^ meta.sequence.tuple.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^^ string.quoted.single.haskell +-- ^ keyword.operator.haskell +-- ^^^ string.quoted.single.haskell +-- ^ keyword.operator.haskell +-- ^^^ string.quoted.single.haskell +-- ^ keyword.operator.haskell +-- ^ variable.language.anonymous.haskell +-- ^ punctuation.section.sequence.end.haskell + + (():(,):[]:[,]:{}:``) +-- ^^^^^^^^^^^^^^^^^^^^^ meta.sequence.tuple.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^^ - keyword +-- ^ keyword.operator.haskell +-- ^^^ - keyword +-- ^ keyword.operator.haskell +-- ^^ - keyword +-- ^ keyword.operator.haskell +-- ^^^ - keyword +-- ^ keyword.operator.haskell +-- ^^ - keyword +-- ^ keyword.operator.haskell +-- ^^ meta.infix.haskell +-- ^ punctuation.section.sequence.end.haskell + + (group) +-- ^^^^^^^ meta.group.haskell +-- ^ punctuation.section.group.begin.haskell +-- ^ punctuation.section.group.end.haskell + + (\arg opt -> +-- ^^^^^^^^^^^^^ meta.group.haskell +-- ^ punctuation.section.group.begin.haskell + case arg of + "auto" -> return opt{ optWrap = WrapAuto } +-- ^^^^^^^^^^^^^^^^^^^^^ meta.group.haskell - meta.block +-- ^^^^^^^^^^^^^^^^^^^^^^ meta.group.haskell meta.block.haskell + "none" -> return opt{ optWrap = WrapNone } +-- ^^^^^^^^^^^^^^^^^^^^^ meta.group.haskell - meta.block +-- ^^^^^^^^^^^^^^^^^^^^^^ meta.group.haskell meta.block.haskell + "preserve" -> return opt{ optWrap = WrapPreserve } +-- ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.group.haskell - meta.block +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.group.haskell meta.block.haskell + _ -> E.throwIO $ PandocOptionError + "--wrap must be auto, none, or preserve") +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.group.haskell meta.string.haskell string.quoted.double.haskell +-- ^ meta.group.haskell punctuation.section.group.end.haskell +-- ^ - meta.group + + +-- [ QUASI QUOTATIONS ]-------------------------------------------------------- + + {- Custom Syntax -} + [expr|$x + $y|] +-- ^^^^^^ meta.quoted.quasi.haskell - meta.string +-- ^^^^^^^ meta.quoted.quasi.haskell meta.string.haskell +-- ^^ meta.quoted.quasi.haskell - meta.string +-- ^ punctuation.section.quoted.begin.haskell +-- ^^^^ variable.function.quasi-quoter +-- ^ punctuation.section.quoted.haskell +-- ^^^^^^^ string.unquoted.haskell +-- ^^ punctuation.section.quoted.end.haskell + + {- Raw Strings -} + [r|\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}|] +-- ^^^ meta.quoted.quasi.haskell - meta.string +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.quoted.quasi.haskell meta.string.haskell +-- ^^ meta.quoted.quasi.haskell - meta.string +-- ^ punctuation.section.quoted.begin.haskell +-- ^ variable.function.quasi-quoter +-- ^ punctuation.section.quoted.haskell +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.haskell +-- ^^ punctuation.section.quoted.end.haskell + + {- Custom QuasiQuoter -} + [1|True|] +-- ^^^^^^^^^ meta.quoted.quasi.haskell - meta.quoted.quasi meta.quoted.quasi +-- ^ punctuation.section.quoted.begin.haskell +-- ^ variable.function.quasi-quoter.haskell +-- ^ punctuation.section.quoted.haskell +-- ^^^^ meta.string.haskell string.unquoted.haskell +-- ^^ punctuation.section.quoted.end.haskell + + {- List Comprehension -} + [1|True] +-- ^^^^^^^^ meta.sequence.list.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^^^ support.constant.prelude.haskell +-- ^ punctuation.section.sequence.end.haskell + + [1||] +-- ^^^^^ meta.sequence.list.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell +-- ^^ keyword.operator.haskell +-- ^ punctuation.section.sequence.end.haskell + + {- Overloaded Quotation -} + [| putStrLn $(f) >> putStrLn $(g) |] :: (Quote m, Quasi m, MonadIO m) => m Exp +-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.quoted.overloaded.haskell +-- ^^ punctuation.section.quoted.begin.haskell +-- ^^^^^^^^ support.function.prelude.haskell +-- ^^ punctuation.section.quoted.end.haskell + + generateLoop :: (MonadReader CodeMap m, Quote m) => String -> m Exp + generateLoop name = [| +-- ^^^ meta.quoted.overloaded.haskell +-- ^^ punctuation.section.quoted.begin.haskell + let loopyCode x = +-- ^^^^^^^^^^^^^^^^^^ meta.quoted.overloaded.haskell +-- ^^^ keyword.declaration.variable.haskell + $(local (Map.insert name [|loopyCode|]) loopBody) + in loopyCode ... + |] +-- ^^^ meta.quoted.overloaded.haskell +-- ^ - meta.brackets +-- ^^ punctuation.section.quoted.end.haskell + + {- Typed Quotation -} + i :: Quote m => Code m (Int -> Int) + i = [|| \x -> x + 1 ||] +-- ^^^^^^^^^^^^^^^^^^^ meta.quoted.typed.haskell +-- ^^^ punctuation.section.quoted.begin.haskell +-- ^^^ punctuation.section.quoted.end.haskell + +-- [ IDENTS ] ----------------------------------------------------------------- + + _ +-- ^ variable.language.anonymous.haskell + + _# +-- ^ variable.language.anonymous.haskell +-- ^ keyword.operator.haskell + + _#_ +-- ^ variable.language.anonymous.haskell +-- ^ keyword.operator.haskell +-- ^ variable.language.anonymous.haskell + + a +-- ^ variable.other.haskell + + _a +-- ^^ variable.other.haskell + + _' +-- ^ variable.language.anonymous.haskell +-- ^ keyword.operator.haskell + + a' +-- ^^ variable.other.haskell + + a# +-- ^ variable.other.haskell - storage.modifer +-- ^ variable.other.haskell storage.modifier.unboxed.haskell + + a'# +-- ^^ variable.other.haskell - storage.modifer +-- ^ variable.other.haskell storage.modifier.unboxed.haskell + + _a'b'c_D'0123456789' +-- ^^^^^^^^^^^^^^^^^^^^ variable.other.haskell + + genericIdent +-- ^^^^^^^^^^^^ variable.other.haskell + + ý ij ǚ ǣ +-- ^ variable.other.haskell +-- ^ - meta.name +-- ^ variable.other.haskell +-- ^ - meta.name +-- ^ variable.other.haskell +-- ^ - meta.name +-- ^ variable.other.haskell +-- ^ - meta.name + + T.a +-- ^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell +-- ^ variable.other.haskell + + T#.a# +-- ^ variable.namespace.haskell - storage.modifier +-- ^ variable.namespace.haskell storage.modifier.haskell +-- ^ punctuation.accessor.dot.haskell - variable +-- ^ variable.other.haskell - storage.modifier +-- ^ variable.other.haskell storage.modifier.unboxed.haskell + + T . a +-- ^ storage.type.haskell +-- ^ keyword.operator.haskell +-- ^ variable.other.haskell + + T# . a +-- ^ storage.type.haskell - storage.modifier +-- ^ storage.type.haskell storage.modifier.unboxed.haskell +-- ^ keyword.operator.haskell +-- ^ variable.other.haskell + + Just +-- ^^^^ support.type.prelude.haskell + + Just# +-- ^^^^ storage.type.haskell - storage.modifier +-- ^ storage.type.haskell storage.modifier.unboxed.haskell + + Nothing +-- ^^^^^^^ support.constant.prelude.haskell + + False +-- ^^^^^ support.constant.prelude.haskell + + True +-- ^^^^ support.constant.prelude.haskell + + map (flip (/)) [1..] +-- ^^^ support.function.prelude.haskell +-- ^^^^ meta.group.haskell support.function.prelude.haskell + + +-- [ LITERAL NUMBERS ] -------------------------------------------------------- + + {- Decimal integer literals -} + + 0 +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell + + 0# +-- ^^ meta.number.integer.decimal.haskell +-- ^ constant.numeric.value.haskell +-- ^ constant.numeric.suffix.haskell + + 1234567890 +-- ^^^^^^^^^^ meta.number.integer.decimal.haskell constant.numeric.value.haskell + + 1_2_34__567890_ +-- ^^^^^^^^^^^^^^^ meta.number.integer.decimal.haskell constant.numeric.value.haskell + + _1234 +-- ^^^^^ - constant.numeric + + 1234567890## +-- ^^^^^^^^^^^^ meta.number.integer.decimal.haskell +-- ^^^^^^^^^^ constant.numeric.value.haskell +-- ^^ constant.numeric.suffix.haskell + + 1_234_567_890_## +-- ^^^^^^^^^^^^^^^^ meta.number.integer.decimal.haskell +-- ^^^^^^^^^^^^^^ constant.numeric.value.haskell +-- ^^ constant.numeric.suffix.haskell + + {- Octal integer literals -} + + 0o1234567 +-- ^^^^^^^^^ meta.number.integer.octal.haskell +-- ^^ constant.numeric.base.haskell +-- ^^^^^^^ constant.numeric.value.haskell + + 0o_1234_567_ +-- ^^^^^^^^^^^^ meta.number.integer.octal.haskell +-- ^^ constant.numeric.base.haskell +-- ^^^^^^^^^^ constant.numeric.value.haskell + + 0o1234567# +-- ^^^^^^^^^^ meta.number.integer.octal.haskell +-- ^^ constant.numeric.base.haskell +-- ^^^^^^^ constant.numeric.value.haskell +-- ^ constant.numeric.suffix.haskell + + 0o_1_234__567_# +-- ^^^^^^^^^^^^^^^ meta.number.integer.octal.haskell +-- ^^ constant.numeric.base.haskell +-- ^^^^^^^^^^^^ constant.numeric.value.haskell +-- ^ constant.numeric.suffix.haskell + + {- Decimal floating point literals -} + + 1. +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell +-- ^ keyword.operator.haskell + + 1.# +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell +-- ^^ keyword.operator.haskell + + .2 +-- ^ keyword.operator.haskell +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell + + .2# +-- ^ keyword.operator.haskell +-- ^^ meta.number.integer.decimal.haskell +-- ^ constant.numeric.value.haskell +-- ^ constant.numeric.suffix.haskell + + 12.345 +-- ^^^^^^ meta.number.float.decimal.haskell constant.numeric.value.haskell +-- ^ punctuation.separator.decimal + + 12.345# +-- ^^^^^^^ meta.number.float.decimal.haskell +-- ^^^^^^ constant.numeric.value.haskell +-- ^ punctuation.separator.decimal +-- ^ constant.numeric.suffix.haskell + + 1_2_._34___5_# +-- ^^^^^^^^^^^^^^ meta.number.float.decimal.haskell +-- ^^^^^^^^^^^^^ constant.numeric.value.haskell +-- ^ punctuation.separator.decimal +-- ^ constant.numeric.suffix.haskell + + 1e10 +-- ^^^^ meta.number.float.decimal.haskell constant.numeric.value.haskell + + 0.5e+0 +-- ^^^^^^ meta.number.float.decimal.haskell constant.numeric.value.haskell +-- ^ punctuation.separator.decimal.haskell + + 0.5e+0# +-- ^^^^^^^ meta.number.float.decimal.haskell +-- ^^^^^^ constant.numeric.value.haskell +-- ^ punctuation.separator.decimal.haskell +-- ^ constant.numeric.suffix.haskell + + 9e-1 +-- ^^^^ meta.number.float.decimal.haskell constant.numeric.value.haskell + + {- Binary integer literals -} + + 0b0 +-- ^^^ meta.number.integer.binary.haskell +-- ^^ constant.numeric.base.haskell +-- ^ constant.numeric.value.haskell + 0b1 +-- ^^^ meta.number.integer.binary.haskell +-- ^^ constant.numeric.base.haskell +-- ^ constant.numeric.value.haskell + + 0b01010111101 +-- ^^^^^^^^^^^^^ meta.number.integer.binary.haskell +-- ^^ constant.numeric.base.haskell +-- ^^^^^^^^^^^ constant.numeric.value.haskell + + 0b_10___1110_ +-- ^^^^^^^^^^^^^ meta.number.integer.binary.haskell +-- ^^ constant.numeric.base.haskell +-- ^^^^^^^^^^^ constant.numeric.value.haskell + + 0b0# +-- ^^^^ meta.number.integer.binary.haskell +-- ^^ constant.numeric.base.haskell +-- ^ constant.numeric.value.haskell +-- ^ constant.numeric.suffix.haskell + + 0b1# +-- ^^^^ meta.number.integer.binary.haskell +-- ^^ constant.numeric.base.haskell +-- ^ constant.numeric.value.haskell +-- ^ constant.numeric.suffix.haskell + + 0b01010111101# +-- ^^^^^^^^^^^^^^ meta.number.integer.binary.haskell +-- ^^ constant.numeric.base.haskell +-- ^^^^^^^^^^^ constant.numeric.value.haskell +-- ^ constant.numeric.suffix.haskell + + 0b_10___1110_# +-- ^^^^^^^^^^^^^^ meta.number.integer.binary.haskell +-- ^^ constant.numeric.base.haskell +-- ^^^^^^^^^^^ constant.numeric.value.haskell +-- ^ constant.numeric.suffix.haskell + + {- Hexadecimal integer literals -} + + 0x0 +-- ^^^ meta.number.integer.hexadecimal.haskell +-- ^^ constant.numeric.base.haskell + + 0XdeafBEEF42 +-- ^^^^^^^^^^^^ meta.number.integer.hexadecimal.haskell +-- ^^ constant.numeric.base.haskell +-- ^^^^^^^^^^ constant.numeric.value.haskell + + 0x__af_EEF4_ +-- ^^^^^^^^^^^^ meta.number.integer.hexadecimal.haskell +-- ^^ constant.numeric.base.haskell +-- ^^^^^^^^^^ constant.numeric.value.haskell + + 0XdeafBEEF42## +-- ^^^^^^^^^^^^^^ meta.number.integer.hexadecimal.haskell +-- ^^ constant.numeric.base.haskell +-- ^^^^^^^^^^ constant.numeric.value.haskell +-- ^^ constant.numeric.suffix.haskell + + 0Xd___BEEF4_## +-- ^^^^^^^^^^^^^^ meta.number.integer.hexadecimal.haskell +-- ^^ constant.numeric.base.haskell +-- ^^^^^^^^^^ constant.numeric.value.haskell +-- ^^ constant.numeric.suffix.haskell + + {- Hexadecimal floating point literals -} + + 0x0.1 -- is the same as 1/16 +-- ^^^^^ meta.number.float.hexadecimal.haskell +-- ^^ constant.numeric.base.haskell +-- ^^^ constant.numeric.value.haskell + + 0x0.01 -- is the same as 1/256 +-- ^^^^^^ meta.number.float.hexadecimal.haskell +-- ^^ constant.numeric.base.haskell +-- ^^^^ constant.numeric.value.haskell + + 0xF.FF -- is the same as 15 + 15/16 + 15/256 +-- ^^^^^^ meta.number.float.hexadecimal.haskell +-- ^^ constant.numeric.base.haskell +-- ^^^^ constant.numeric.value.haskell + + 0x0.1p4 -- is the same as 1 +-- ^^^^^^^ meta.number.float.hexadecimal.haskell +-- ^^ constant.numeric.base.haskell +-- ^^^^^ constant.numeric.value.haskell + + 0x0.1p-4 -- is the same as 1/256 +-- ^^^^^^^^ meta.number.float.hexadecimal.haskell +-- ^^ constant.numeric.base.haskell +-- ^^^^^^ constant.numeric.value.haskell + + 0x0.1p12 -- is the same as 256 +-- ^^^^^^^^ meta.number.float.hexadecimal.haskell +-- ^^ constant.numeric.base.haskell +-- ^^^^^^ constant.numeric.value.haskell + + 0xA_0._1_p12# +-- ^^^^^^^^^^^^^ meta.number.float.hexadecimal.haskell +-- ^^ constant.numeric.base.haskell +-- ^^^^^^^^^^ constant.numeric.value.haskell +-- ^ constant.numeric.suffix.haskell + + 123identifier +-- ^^^ meta.number.integer.decimal.haskell constant.numeric.value.haskell +-- ^^^^^^^^^^ variable.other.haskell + +-- [ LITERAL CHARACTERS ] ----------------------------------------------------- + + ''.' ' +-- ^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell + + 'a--' +-- ^^ meta.string.haskell string.quoted.single.haskell - comment +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^^^^ comment.line.double-dash.haskell - string +-- ^^ punctuation.definition.comment.haskell + + 'a' -- literal character +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell + + 'a'# -- unboxed literal character +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ storage.modifier.unboxed.haskell + + '5' -- literal digit character +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell + + '!'.'#'.'$'.'%'.'&'.'⋆'.'+'.'.'.'/'.'<' -- ascii symbols +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell + + '='.'>'.'?'.'@'.'^'.'|'.'-'.'~'.':' -- ascii symbols +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell + + '('.')'.','.';'.'['.']'.'`'.'{'.'}' -- special symbols +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell + + '‘'.'’'.'"'.'“'.'”'.'—'.'¯'.'˙'.'´'.'˝' +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell + + '←'.'→'.'↔'.'↓'.'↑'.'↕'.'⇐'.'⇒'.'⇔'.'⇓'.'⇑'.'⇕' +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell + + 'α'.'β'.'γ'.'δ'.'ε'.'ζ'.'η'.'θ'.'ι'.'κ'.'λ'.'μ' +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ constant.character.literal.haskell +-- ^ punctuation.definition.string.end.haskell + + '\'' . '\"' . '\&' . '\\' -- escape characters +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.haskell +-- ^ punctuation.definition.string.end.haskell + + '\a' . '\b' . '\n' . '\f' . '\t' . '\v' -- escape characters +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^^^ - meta.string - string +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^^^ - meta.string - string +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^^^ - meta.string - string +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^^^ - meta.string - string +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^^^ - meta.string - string +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.haskell +-- ^ punctuation.definition.string.end.haskell + + '\NUL' . '\SOH' . '\STX' . '\ETX' . '\EOT' . '\ENQ' . '\ACK' +-- ^^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^^ constant.character.escape.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^^^ - meta.string - string +-- ^^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^^ constant.character.escape.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^^^ - meta.string - string +-- ^^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^^ constant.character.escape.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^^^ - meta.string - string +-- ^^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^^ constant.character.escape.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^^^ - meta.string - string +-- ^^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^^ constant.character.escape.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^^^ - meta.string - string +-- ^^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^^ constant.character.escape.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^^^ - meta.string - string +-- ^^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^^ constant.character.escape.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string + + '\0' '\1' '\2' '\3' '\4' '\5' '\6' '\7' '\8' '\9' +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.decimal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.decimal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.decimal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.decimal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.decimal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.decimal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.decimal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.decimal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.decimal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.decimal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string + + '\o0' '\o1' '\o2' '\o3' '\o4' '\o5' '\o6' '\o7' +-- ^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^ constant.character.escape.octal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^ constant.character.escape.octal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^ constant.character.escape.octal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^ constant.character.escape.octal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^ constant.character.escape.octal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^ constant.character.escape.octal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^ constant.character.escape.octal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^ constant.character.escape.octal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string + + '\x0' '\x1' '\x2' '\x3' '\x8' '\xA' '\xC' '\xF' +-- ^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^ constant.character.escape.hexadecimal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^ constant.character.escape.hexadecimal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^ constant.character.escape.hexadecimal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^ constant.character.escape.hexadecimal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^ constant.character.escape.hexadecimal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^ constant.character.escape.hexadecimal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^ constant.character.escape.hexadecimal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string +-- ^^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^ constant.character.escape.hexadecimal.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ - meta.string - string + + '^A' . '^Z' . '^@' . '^[' . '^]' . '^\' . '^^' . '^_' +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.control.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^^^ - meta.string - string +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.control.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^^^ - meta.string - string +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.control.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^^^ - meta.string - string +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.control.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^^^ - meta.string - string +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.control.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^^^ - meta.string - string +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.control.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^^^ - meta.string - string +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.control.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^^^ - meta.string - string +-- ^^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.control.haskell +-- ^ punctuation.definition.string.end.haskell + + +-- [ NO LITEARL CHARACTERS ]--------------------------------------------------- + + ' +-- ^ - meta.string - string +-- ^ keyword.operator.haskell + + 'a +-- ^^ - meta.string - string +-- ^ keyword.operator.haskell +-- ^ variable.other.haskell + + 'ab' +-- ^^^^ - meta.string - string +-- ^ keyword.operator.haskell +-- ^^^ variable.other.haskell + + A' = A' +-- ^^^^^^^ - meta.string - string +-- ^^ storage.type.haskell +-- ^ keyword.operator.haskell +-- ^^ storage.type.haskell + + a' = b' +-- ^^^^^^^ - meta.string - string +-- ^^ variable.other.haskell - string +-- ^ keyword.operator.haskell +-- ^^ variable.other.haskell - string + + '\c' . '\z' +-- ^^^^^^^^^^^ - meta.string - string +-- ^^ keyword.operator.haskell +-- ^^ variable.other.haskell +-- ^ keyword.operator.haskell +-- ^^ keyword.operator.haskell +-- ^^ variable.other.haskell + + '\?' +-- ^^^^ keyword.operator.haskell - string + + '\129x' +-- ^^^^^^^ - meta.string - string +-- ^^ keyword.operator.haskell + + '\o8' '\o9' +-- ^^^^^^^^^^^ - meta.string - string - constant.character +-- ^^ keyword.operator.haskell +-- ^^^ variable.other.haskell +-- ^^ keyword.operator.haskell +-- ^^^ variable.other.haskell + + '\xG' '\xh' +-- ^^^^^^^^^^^ - meta.string - string - constant.character +-- ^^ keyword.operator.haskell +-- ^^^ variable.other.haskell +-- ^^ keyword.operator.haskell +-- ^^^ variable.other.haskell + + '^a' '^)' +-- ^^^^^^^^^ - meta.string - string - constant.character +-- ^^ keyword.operator.haskell +-- ^^ variable.other.haskell +-- ^^ keyword.operator.haskell +-- ^ keyword.operator.haskell + + +-- [ LITERAL STRINGS ]--------------------------------------------------------- + + "\o129x\NUL" +-- ^^^^^^^^^^^^ meta.string.haskell string.quoted.double.haskell +-- ^^^^ constant.character.escape.octal.haskell +-- ^ - constant +-- ^ punctuation.definition.string.end.haskell +-- ^^^^ constant.character.escape.haskell + + "ok\"()--"'b' +-- ^^^^^^^^^^ meta.string.haskell string.quoted.double.haskell - comment +-- ^^^ meta.string.haskell string.quoted.single.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^ constant.character.escape.haskell +-- ^^ - punctuation + + "string"# -- unboxed literal string +-- ^^^^^^^^^ meta.string.haskell string.quoted.double.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ storage.modifier.unboxed.haskell + + "string" # +-- ^^^^^^^^ meta.string.haskell string.quoted.double.haskell +-- ^^^ - meta.string - string +-- ^ punctuation.definition.string.begin.haskell +-- ^ punctuation.definition.string.end.haskell +-- ^ keyword.operator.haskell + + "This is a\ +-- ^^^^^^^^^^ meta.string.haskell string.quoted.double.haskell +-- ^^ meta.string.continuation.haskell - string +-- ^ punctuation.definition.continuation.begin.haskell + "This is a\ + \multi-line string literal\ +-- <- meta.string.continuation.haskell - string +-- ^^ meta.string.continuation.haskell - string +-- ^ punctuation.definition.continuation.end.haskell +-- ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.haskell string.quoted.double.haskell +-- ^^ meta.string.continuation.haskell - string +-- ^ punctuation.definition.continuation.begin.haskell + "This is a\ + \multi-line string literal\ + /example" +-- <- meta.string.continuation.haskell - string +-- ^^ meta.string.continuation.haskell - string +-- ^ invalid.illegal.expect-continuation-end.haskell +-- ^^^^^^^^ meta.string.haskell string.quoted.double.haskell +-- ^ punctuation.definition.string.end.haskell + + "This is a\ + " +-- <- meta.string.continuation.haskell - string +-- ^^ meta.string.continuation.haskell - string +-- ^ invalid.illegal.expect-continuation-end.haskell +-- ^ - meta.string - string - invalid + +-- [ INFIX OPERATORS ] -------------------------------------------------------- + + ! # $ % & ⋆ + . / < = > ? @ \ ^ | - ~ : -- ascii symbols +-- ^ - keyword +-- ^ keyword.operator.haskell +-- ^ - keyword +-- ^ keyword.operator.haskell +-- ^ - keyword +-- ^ keyword.operator.haskell +-- ^ - keyword +-- ^ keyword.operator.haskell +-- ^ - keyword +-- ^ keyword.operator.haskell +-- ^ - keyword +-- ^ keyword.operator.haskell +-- ^ - keyword +-- ^ keyword.operator.haskell +-- ^ - keyword +-- ^ keyword.operator.haskell +-- ^ - keyword +-- ^ keyword.operator.haskell +-- ^ - keyword +-- ^ keyword.operator.haskell +-- ^ - keyword +-- ^ keyword.operator.haskell +-- ^ - keyword +-- ^ keyword.operator.haskell +-- ^ - keyword +-- ^ keyword.operator.haskell +-- ^ - keyword +-- ^ keyword.operator.haskell +-- ^ - keyword +-- ^ keyword.operator.haskell +-- ^ - keyword +-- ^ keyword.operator.haskell +-- ^ - keyword +-- ^ punctuation.separator.sequence.haskell +-- ^ - keyword +-- ^ keyword.operator.haskell +-- ^ - keyword +-- ^ keyword.operator.haskell +-- ^ - keyword +-- ^ keyword.operator.haskell +-- ^ - keyword + + .. : :: = \ <- | -> @ ~ => -- reserved operators +-- ^^ keyword.operator.haskell +-- ^ keyword.operator.haskell +-- ^^ punctuation.separator.type.haskell +-- ^ keyword.operator.haskell +-- ^ keyword.operator.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^^ keyword.operator.arrow.haskell +-- ^ keyword.operator.haskell +-- ^ keyword.operator.haskell +-- ^^ punctuation.separator.type.context.haskell + + ( ) , ; [ ] ` { } -- special symbols +-- ^^^^^^^^^^^^^^^^^ - keyword +-- ^ punctuation.section.group.begin.haskell +-- ^ punctuation.section.group.end.haskell +-- ^ punctuation.separator.sequence.haskell +-- ^ punctuation.terminator.statement.haskell +-- ^ punctuation.section.sequence.begin.haskell +-- ^ punctuation.section.sequence.end.haskell +-- ^ punctuation.section.block.begin.haskell +-- ^ punctuation.section.block.end.haskell + + a a = a || b +-- ^ keyword.operator.haskell +-- ^^ keyword.operator.haskell + + a a = (+) a 2 +-- ^ keyword.operator.haskell +-- ^^^ meta.prefix.haskell +-- ^ punctuation.definition.prefix.begin.haskell +-- ^ keyword.operator.haskell +-- ^ punctuation.definition.prefix.end.haskell +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell + + a a = ( + ) a 2 +-- ^ keyword.operator.haskell +-- ^^^^^ meta.prefix.haskell +-- ^ punctuation.definition.prefix.begin.haskell +-- ^ - punctuation - keyword +-- ^ keyword.operator.haskell +-- ^ - punctuation - keyword +-- ^ punctuation.definition.prefix.end.haskell +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell + + a a = (-) a 2 +-- ^ keyword.operator.haskell +-- ^^^ meta.prefix.haskell +-- ^ punctuation.definition.prefix.begin.haskell +-- ^ keyword.operator.haskell +-- ^ punctuation.definition.prefix.end.haskell +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell + + a a = ( - ) a 2 +-- ^ keyword.operator.haskell +-- ^^^^^ meta.prefix.haskell +-- ^ punctuation.definition.prefix.begin.haskell +-- ^ - punctuation - keyword +-- ^ keyword.operator.haskell +-- ^ - punctuation - keyword +-- ^ punctuation.definition.prefix.end.haskell +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell + + a a = (*) a 2 +-- ^ keyword.operator.haskell +-- ^^^ meta.prefix.haskell +-- ^ punctuation.definition.prefix.begin.haskell +-- ^ keyword.operator.haskell +-- ^ punctuation.definition.prefix.end.haskell +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell + + a a = ( * ) a 2 +-- ^ keyword.operator.haskell +-- ^^^^^ meta.prefix.haskell +-- ^ punctuation.definition.prefix.begin.haskell +-- ^ - punctuation - keyword +-- ^ keyword.operator.haskell +-- ^ - punctuation - keyword +-- ^ punctuation.definition.prefix.end.haskell +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell + + a a = (/) a 2 +-- ^ keyword.operator.haskell +-- ^^^ meta.prefix.haskell +-- ^ punctuation.definition.prefix.begin.haskell +-- ^ keyword.operator.haskell +-- ^ punctuation.definition.prefix.end.haskell +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell + + a a = ( / ) a 2 +-- ^ keyword.operator.haskell +-- ^^^^^ meta.prefix.haskell +-- ^ punctuation.definition.prefix.begin.haskell +-- ^ - punctuation - keyword +-- ^ keyword.operator.haskell +-- ^ - punctuation - keyword +-- ^ punctuation.definition.prefix.end.haskell +-- ^ meta.number.integer.decimal.haskell constant.numeric.value.haskell + + a a = (--) a 2 +-- ^ keyword.operator.haskell +-- ^^^^ - variable.function.infix +-- ^ punctuation.section.group.begin.haskell +-- ^^^^^^^^ comment.line.double-dash.haskell + ) +-- ^ punctuation.section.group.end.haskell + + a a = (---) a 2 +-- ^ keyword.operator.haskell +-- ^^^^^ - variable.function.infix +-- ^ punctuation.section.group.begin.haskell +-- ^^^^^^^^^ comment.line.double-dash.haskell + ) +-- ^ punctuation.section.group.end.haskell + + {- unqualified infix variable operator id -} + a `member` x +-- ^^^^^^^^ meta.infix.haskell +-- ^ punctuation.definition.infix.begin.haskell - keyword +-- ^^^^^^ keyword.operator.function.infix.haskell +-- ^ punctuation.definition.infix.end.haskell - keyword + + {- qualified infix variable operator id -} + a `P.atan2` x +-- ^^^^^^^^^ meta.infix.haskell +-- ^ punctuation.definition.infix.begin.haskell - keyword +-- ^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell - keyword - variale +-- ^^^^^ keyword.operator.function.infix.haskell +-- ^ punctuation.definition.infix.end.haskell - keyword + + {- unqualified infix constructor operator id -} + a `Quux` x +-- ^^^^^^ meta.infix.haskell +-- ^ punctuation.definition.infix.begin.haskell - keyword +-- ^^^^ keyword.operator.function.infix.haskell +-- ^ punctuation.definition.infix.end.haskell - keyword + + {- qualified infix constructor operator id -} + a `Monad.Quux` x +-- ^^^^^^^^^^^^ meta.infix.haskell +-- ^ punctuation.definition.infix.begin.haskell - keyword +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell - keyword - variale +-- ^^^^ keyword.operator.function.infix.haskell +-- ^ punctuation.definition.infix.end.haskell - keyword + + 5 `f `7`f`"3 'ab'" +-- ^ constant.numeric.value.haskell +-- ^^^^ meta.infix.haskell +-- ^ punctuation.definition.infix.begin.haskell - keyword +-- ^ keyword.operator.function.infix.haskell +-- ^ - keyword - punctuation +-- ^ punctuation.definition.infix.end.haskell - keyword +-- ^ constant.numeric.value.haskell +-- ^^^ meta.infix.haskell +-- ^ punctuation.definition.infix.begin.haskell - keyword +-- ^ keyword.operator.function.infix.haskell +-- ^ punctuation.definition.infix.end.haskell - keyword +-- ^^^^^^^^ meta.string.haskell string.quoted.double.haskell +-- ^ punctuation.definition.string.begin.haskell +-- ^^^^^^ - constant - punctuation +-- ^ punctuation.definition.string.end.haskell + + a ` f` b +-- ^^^^ meta.infix.haskell +-- ^ punctuation.definition.infix.begin.haskell - keyword +-- ^ keyword.operator.function.infix.haskell +-- ^ punctuation.definition.infix.end.haskell - keyword + + a `--` b +-- ^ - illegal - keyword - operator - punctuation +-- ^^^^^^ comment.line.double-dash.haskell + + a ` +-- ^ - illegal - keyword - operator - punctuation + + a `shiftL#` b +-- ^^^^^^^^^ meta.infix.haskell +-- ^ punctuation.definition.infix.begin.haskell - keyword +-- ^^^^^^^ keyword.operator.function.infix.haskell +-- ^ storage.modifier.unboxed.haskell +-- ^ punctuation.definition.infix.end.haskell - keyword + + a ` shiftL# ` b +-- ^^^^^^^^^^^ meta.infix.haskell +-- ^ punctuation.definition.infix.begin.haskell - keyword +-- ^^^^^^^ keyword.operator.function.infix.haskell +-- ^ storage.modifier.unboxed.haskell +-- ^ punctuation.definition.infix.end.haskell - keyword + + a `Ns.shiftL#` b +-- ^^^^^^^^^^^^ meta.infix.haskell +-- ^ punctuation.definition.infix.begin.haskell - keyword +-- ^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell - keyword - variale +-- ^^^^^^^ keyword.operator.function.infix.haskell +-- ^ storage.modifier.unboxed.haskell +-- ^ punctuation.definition.infix.end.haskell - keyword + + a `ModId.Ns.shiftL#` b +-- ^^^^^^^^^^^^^^^^^^ meta.infix.haskell +-- ^ punctuation.definition.infix.begin.haskell - keyword +-- ^^^^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell - variable +-- ^^ variable.namespace.haskell +-- ^ punctuation.accessor.dot.haskell - keyword - variale +-- ^^^^^^^ keyword.operator.function.infix.haskell +-- ^ storage.modifier.unboxed.haskell +-- ^ punctuation.definition.infix.end.haskell - keyword + + a `Unboxed#` b +-- ^^^^^^^^^^ meta.infix.haskell +-- ^ punctuation.definition.infix.begin.haskell - keyword +-- ^^^^^^^^ keyword.operator.function.infix.haskell +-- ^ storage.modifier.unboxed.haskell +-- ^ punctuation.definition.infix.end.haskell - keyword + + +-- [ INFIX OPERATORS IN CONTEXT ]---------------------------------------------- + + genOutrageous :: Gen Outrageous + genOutrageous = + Gen.recursive Gen.choice [ + Flipper <$> genRecord +-- ^^^ keyword.operator.haskell + , (:!) <$> genInt <*> genInt +-- ^ punctuation.separator.sequence.haskell +-- ^^^^ meta.sequence.list.haskell meta.prefix.haskell +-- ^ punctuation.definition.prefix.begin.haskell +-- ^^ keyword.operator.haskell +-- ^ punctuation.definition.prefix.end.haskell +-- ^^^ keyword.operator.haskell +-- ^^^ keyword.operator.haskell + , (:@) <$> genDouble <*> genDouble +-- ^ punctuation.separator.sequence.haskell +-- ^^^^ meta.sequence.list.haskell meta.prefix.haskell +-- ^ punctuation.definition.prefix.begin.haskell +-- ^^ keyword.operator.haskell +-- ^ punctuation.definition.prefix.end.haskell +-- ^^^ keyword.operator.haskell +-- ^^^ keyword.operator.haskell + , Quux <$> genInt <*> genDouble +-- ^ punctuation.separator.sequence.haskell +-- ^^^^ storage.type.haskell +-- ^^^ keyword.operator.haskell +-- ^^^ keyword.operator.haskell + , (:#) <$> genString <*> genRecord +-- ^ punctuation.separator.sequence.haskell +-- ^^^^ meta.sequence.list.haskell meta.prefix.haskell +-- ^ punctuation.definition.prefix.begin.haskell +-- ^^ keyword.operator.haskell +-- ^ punctuation.definition.prefix.end.haskell +-- ^^^ keyword.operator.haskell +-- ^^^ keyword.operator.haskell + , DontDoThis <$> genInt <*> genString +-- ^ punctuation.separator.sequence.haskell +-- ^^^ keyword.operator.haskell +-- ^^^ keyword.operator.haskell + ] [ + Gen.subtermM genOutrageous (\x -> (:$) <$> genSimple <*> pure x) + ] + +myManageHook = composeAll + [ isDialog --> doFullFloat +-- ^^^ keyword.operator + , return True --> doShift "1" +-- ^^^ keyword.operator + ] + + +shiftL# :: Word# -> Int# -> Word# +a `shiftL#` b | isTrue# (b >=# WORD_SIZE_IN_BITS#) = 0## + | otherwise = a `uncheckedShiftL#` b \ No newline at end of file diff --git a/Haskell/tests/syntax_test_literate.lhs b/Haskell/tests/syntax_test_literate.lhs new file mode 100644 index 00000000000..84580da048c --- /dev/null +++ b/Haskell/tests/syntax_test_literate.lhs @@ -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