prism-fsharp.js 1.1 KB

123456789101112131415161718192021
  1. Prism.languages.fsharp = Prism.languages.extend('clike', {
  2. 'comment': [
  3. {
  4. pattern: /(^|[^\\])\(\*[\w\W]*?\*\)/,
  5. lookbehind: true
  6. },
  7. {
  8. pattern: /(^|[^\\:])\/\/.*/,
  9. lookbehind: true
  10. }
  11. ],
  12. '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/,
  13. 'string': /@?("""|"|')((\\|\n)?.)*?\1B?/,
  14. 'preprocessor': /^\s*#.*/m,
  15. 'number': [
  16. /\b-?0x[\da-fA-F]+(un|lf|LF)?\b/,
  17. /\b-?0b[01]+(y|uy)?\b/,
  18. /\b-?(\d+\.|\d*\.?\d+)([fFmM]|[eE][+-]?\d+)?\b/,
  19. /\b-?\d+(y|uy|s|us|l|u|ul|L|UL|I)?\b/
  20. ]
  21. });