OLD | NEW |
1 Prism.languages.haskell= { | 1 Prism.languages.haskell= { |
2 'comment': { | 2 'comment': { |
3 » » pattern: /(^|[^-!#$%*+=\?&@|~.:<>^\\])(--[^-!#$%*+=\?&@|~.:<>^\\
].*(\r?\n|$)|{-[\w\W]*?-})/m, | 3 » » pattern: /(^|[^-!#$%*+=?&@|~.:<>^\\\/])(--[^-!#$%*+=?&@|~.:<>^\\
\/].*|{-[\w\W]*?-})/m, |
4 lookbehind: true | 4 lookbehind: true |
5 }, | 5 }, |
6 » 'char': /'([^\\"]|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|E
NQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ES
C|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+))'/, | 6 » 'char': /'([^\\']|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|E
NQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ES
C|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+))'/, |
7 'string': /"([^\\"]|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|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|\d+|o[0-7]+|x[0-9a-fA-F]+)|\\\s+\\)*"/, | 7 'string': /"([^\\"]|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|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|\d+|o[0-7]+|x[0-9a-fA-F]+)|\\\s+\\)*"/, |
8 'keyword' : /\b(case|class|data|deriving|do|else|if|in|infixl|infixr|ins
tance|let|module|newtype|of|primitive|then|type|where)\b/, | 8 'keyword' : /\b(case|class|data|deriving|do|else|if|in|infixl|infixr|ins
tance|let|module|newtype|of|primitive|then|type|where)\b/, |
9 'import_statement' : { | 9 'import_statement' : { |
10 // The imported or hidden names are not included in this import | 10 // The imported or hidden names are not included in this import |
11 // statement. This is because we want to highlight those exactly
like | 11 // statement. This is because we want to highlight those exactly
like |
12 // we do for the names in the program. | 12 // we do for the names in the program. |
13 » » pattern: /(\n|^)\s*(import)\s+(qualified\s+)?(([A-Z][_a-zA-Z0-9'
]*)(\.[A-Z][_a-zA-Z0-9']*)*)(\s+(as)\s+(([A-Z][_a-zA-Z0-9']*)(\.[A-Z][_a-zA-Z0-9
']*)*))?(\s+hiding\b)?/m, | 13 » » pattern: /(\r?\n|\r|^)\s*import\s+(qualified\s+)?([A-Z][_a-zA-Z0
-9']*)(\.[A-Z][_a-zA-Z0-9']*)*(\s+as\s+([A-Z][_a-zA-Z0-9']*)(\.[A-Z][_a-zA-Z0-9'
]*)*)?(\s+hiding\b)?/m, |
14 inside: { | 14 inside: { |
15 'keyword': /\b(import|qualified|as|hiding)\b/ | 15 'keyword': /\b(import|qualified|as|hiding)\b/ |
16 } | 16 } |
17 }, | 17 }, |
18 // These are builtin variables only. Constructors are highlighted later
as a constant. | 18 // These are builtin variables only. Constructors are highlighted later
as a constant. |
19 'builtin': /\b(abs|acos|acosh|all|and|any|appendFile|approxRational|asTy
peOf|asin|asinh|atan|atan2|atanh|basicIORun|break|catch|ceiling|chr|compare|conc
at|concatMap|const|cos|cosh|curry|cycle|decodeFloat|denominator|digitToInt|div|d
ivMod|drop|dropWhile|either|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenT
o|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|flo
atRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromDouble|fromEnum|fromInt|fromInt
eger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|group|head|id
|inRange|index|init|intToDigit|interact|ioError|isAlpha|isAlphaNum|isAscii|isCon
trol|isDenormalized|isDigit|isHexDigit|isIEEE|isInfinite|isLower|isNaN|isNegativ
eZero|isOctDigit|isPrint|isSpace|isUpper|iterate|last|lcm|length|lex|lexDigits|l
exLitChar|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min
|minBound|minimum|mod|negate|not|notElem|null|numerator|odd|or|ord|otherwise|pac
k|pi|pred|primExitWith|print|product|properFraction|putChar|putStr|putStrLn|quot
|quotRem|range|rangeSize|read|readDec|readFile|readFloat|readHex|readIO|readInt|
readList|readLitChar|readLn|readOct|readParen|readSigned|reads|readsPrec|realToF
rac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scan
r|scanr1|seq|sequence|sequence_|show|showChar|showInt|showList|showLitChar|showP
aren|showSigned|showString|shows|showsPrec|significand|signum|sin|sinh|snd|sort|
span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|threadToIOResul
t|toEnum|toInt|toInteger|toLower|toRational|toUpper|truncate|uncurry|undefined|u
nlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zip
With3)\b/, | 19 'builtin': /\b(abs|acos|acosh|all|and|any|appendFile|approxRational|asTy
peOf|asin|asinh|atan|atan2|atanh|basicIORun|break|catch|ceiling|chr|compare|conc
at|concatMap|const|cos|cosh|curry|cycle|decodeFloat|denominator|digitToInt|div|d
ivMod|drop|dropWhile|either|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenT
o|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|flo
atRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromDouble|fromEnum|fromInt|fromInt
eger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|group|head|id
|inRange|index|init|intToDigit|interact|ioError|isAlpha|isAlphaNum|isAscii|isCon
trol|isDenormalized|isDigit|isHexDigit|isIEEE|isInfinite|isLower|isNaN|isNegativ
eZero|isOctDigit|isPrint|isSpace|isUpper|iterate|last|lcm|length|lex|lexDigits|l
exLitChar|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min
|minBound|minimum|mod|negate|not|notElem|null|numerator|odd|or|ord|otherwise|pac
k|pi|pred|primExitWith|print|product|properFraction|putChar|putStr|putStrLn|quot
|quotRem|range|rangeSize|read|readDec|readFile|readFloat|readHex|readIO|readInt|
readList|readLitChar|readLn|readOct|readParen|readSigned|reads|readsPrec|realToF
rac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scan
r|scanr1|seq|sequence|sequence_|show|showChar|showInt|showList|showLitChar|showP
aren|showSigned|showString|shows|showsPrec|significand|signum|sin|sinh|snd|sort|
span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|threadToIOResul
t|toEnum|toInt|toInteger|toLower|toRational|toUpper|truncate|uncurry|undefined|u
nlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zip
With3)\b/, |
20 // decimal integers and floating point numbers | octal integers | hexade
cimal integers | 20 // decimal integers and floating point numbers | octal integers | hexade
cimal integers |
21 » 'number' : /\b(\d+(\.\d+)?([eE][+-]?\d+)?|0[Oo][0-7]+|0[Xx][0-9a-fA-F]+)
\b/, | 21 » 'number' : /\b(\d+(\.\d+)?(e[+-]?\d+)?|0o[0-7]+|0x[0-9a-f]+)\b/i, |
22 // Most of this is needed because of the meaning of a single '.'. | 22 // Most of this is needed because of the meaning of a single '.'. |
23 // If it stands alone freely, it is the function composition. | 23 // If it stands alone freely, it is the function composition. |
24 // It may also be a separator between a module name and an identifier =>
no | 24 // It may also be a separator between a module name and an identifier =>
no |
25 // operator. If it comes together with other special characters it is an | 25 // operator. If it comes together with other special characters it is an |
26 // operator too. | 26 // operator too. |
27 » 'operator' : /\s\.\s|([-!#$%*+=\?&@|~:<>^\\]*\.[-!#$%*+=\?&@|~:<>^\\]+)|
([-!#$%*+=\?&@|~:<>^\\]+\.[-!#$%*+=\?&@|~:<>^\\]*)|[-!#$%*+=\?&@|~:<>^\\]+|(`([A
-Z][_a-zA-Z0-9']*\.)*[_a-z][_a-zA-Z0-9']*`)/, | 27 » 'operator' : /\s\.\s|[-!#$%*+=?&@|~.:<>^\\\/]*\.[-!#$%*+=?&@|~.:<>^\\\/]
+|[-!#$%*+=?&@|~.:<>^\\\/]+\.[-!#$%*+=?&@|~.:<>^\\\/]*|[-!#$%*+=?&@|~:<>^\\\/]+|
`([A-Z][_a-zA-Z0-9']*\.)*[_a-z][_a-zA-Z0-9']*`/, |
28 // In Haskell, nearly everything is a variable, do not highlight these. | 28 // In Haskell, nearly everything is a variable, do not highlight these. |
29 'hvariable': /\b([A-Z][_a-zA-Z0-9']*\.)*[_a-z][_a-zA-Z0-9']*\b/, | 29 'hvariable': /\b([A-Z][_a-zA-Z0-9']*\.)*[_a-z][_a-zA-Z0-9']*\b/, |
30 'constant': /\b([A-Z][_a-zA-Z0-9']*\.)*[A-Z][_a-zA-Z0-9']*\b/, | 30 'constant': /\b([A-Z][_a-zA-Z0-9']*\.)*[A-Z][_a-zA-Z0-9']*\b/, |
31 'punctuation' : /[{}[\];(),.:]/ | 31 'punctuation' : /[{}[\];(),.:]/ |
32 }; | 32 }; |
OLD | NEW |