source: node_modules/refractor/lang/clike.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.0 KB
RevLine 
[d24f17c]1'use strict'
2
3module.exports = clike
4clike.displayName = 'clike'
5clike.aliases = []
6function clike(Prism) {
7 Prism.languages.clike = {
8 comment: [
9 {
10 pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
11 lookbehind: true,
12 greedy: true
13 },
14 {
15 pattern: /(^|[^\\:])\/\/.*/,
16 lookbehind: true,
17 greedy: true
18 }
19 ],
20 string: {
21 pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
22 greedy: true
23 },
24 'class-name': {
25 pattern:
26 /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
27 lookbehind: true,
28 inside: {
29 punctuation: /[.\\]/
30 }
31 },
32 keyword:
33 /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
34 boolean: /\b(?:false|true)\b/,
35 function: /\b\w+(?=\()/,
36 number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
37 operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
38 punctuation: /[{}[\];(),.:]/
39 }
40}
Note: See TracBrowser for help on using the repository browser.