Index: lib/src/prism/components/prism-fsharp.js |
diff --git a/lib/src/prism/components/prism-fsharp.js b/lib/src/prism/components/prism-fsharp.js |
index cb4f5d5dd840f7eb56f04894a9b161c42099f986..7828495855b0af8c2150a0e841da6e5f4f00ed34 100644 |
--- a/lib/src/prism/components/prism-fsharp.js |
+++ b/lib/src/prism/components/prism-fsharp.js |
@@ -9,13 +9,15 @@ Prism.languages.fsharp = Prism.languages.extend('clike', { |
lookbehind: true |
} |
], |
- 'keyword': /\b(abstract|and|as|assert|base|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|global|if|in|inherit|inline|interface|internal|lazy|let|let!|match|member|module|mutable|namespace|new|not|null|of|open|or|override|private|public|rec|return|return!|select|static|struct|then|to|true|try|type|upcast|use|use!|val|void|when|while|with|yield|yield!|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|include|method|mixin|object|parallel|process|protected|pure|sealed|tailcall|trait|virtual|volatile)\b/, |
- 'string': /@?("""|"|')((\\|\n)?.)*?\1B?/, |
- 'preprocessor': /^\s*#.*/m, |
+ 'keyword': /\b(?:let|return|use|yield)(?:!\B|\b)|\b(abstract|and|as|assert|base|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|global|if|in|inherit|inline|interface|internal|lazy|match|member|module|mutable|namespace|new|not|null|of|open|or|override|private|public|rec|select|static|struct|then|to|true|try|type|upcast|val|void|when|while|with|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|include|method|mixin|object|parallel|process|protected|pure|sealed|tailcall|trait|virtual|volatile)\b/, |
+ 'string': /(?:"""[\s\S]*?"""|@"(?:""|[^"])*"|("|')(?:\\\1|\\?(?!\1)[\s\S])*\1)B?/, |
'number': [ |
/\b-?0x[\da-fA-F]+(un|lf|LF)?\b/, |
/\b-?0b[01]+(y|uy)?\b/, |
- /\b-?(\d+\.|\d*\.?\d+)([fFmM]|[eE][+-]?\d+)?\b/, |
+ /\b-?(\d*\.?\d+|\d+\.)([fFmM]|[eE][+-]?\d+)?\b/, |
/\b-?\d+(y|uy|s|us|l|u|ul|L|UL|I)?\b/ |
] |
+}); |
+Prism.languages.insertBefore('fsharp', 'keyword', { |
+ 'preprocessor': /^[^\r\n\S]*#.*/m |
}); |