UNPKG

1.15 kBJavaScriptView Raw
1hljs.registerLanguage("fsharp",(()=>{"use strict";return e=>{const n={begin:"<",
2end:">",contains:[e.inherit(e.TITLE_MODE,{begin:/'[a-zA-Z0-9_]+/})]};return{
3name:"F#",aliases:["fs"],
4keywords:"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 match member module mutable namespace new null of open or override private public rec return sig static struct then to true try type upcast use val void when while with yield",
5illegal:/\/\*/,contains:[{className:"keyword",begin:/\b(yield|return|let|do)!/
6},{className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},{
7className:"string",begin:'"""',end:'"""'},e.COMMENT("\\(\\*(\\s)","\\*\\)",{
8contains:["self"]}),{className:"class",beginKeywords:"type",end:"\\(|=|$",
9excludeEnd:!0,contains:[e.UNDERSCORE_TITLE_MODE,n]},{className:"meta",
10begin:"\\[<",end:">\\]",relevance:10},{className:"symbol",
11begin:"\\B('[A-Za-z])\\b",contains:[e.BACKSLASH_ESCAPE]
12},e.C_LINE_COMMENT_MODE,e.inherit(e.QUOTE_STRING_MODE,{illegal:null
13}),e.C_NUMBER_MODE]}}})());
\No newline at end of file