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.4 KB
|
Line | |
---|
1 | 'use strict'
|
---|
2 |
|
---|
3 | module.exports = neon
|
---|
4 | neon.displayName = 'neon'
|
---|
5 | neon.aliases = []
|
---|
6 | function neon(Prism) {
|
---|
7 | Prism.languages.neon = {
|
---|
8 | comment: {
|
---|
9 | pattern: /#.*/,
|
---|
10 | greedy: true
|
---|
11 | },
|
---|
12 | datetime: {
|
---|
13 | pattern:
|
---|
14 | /(^|[[{(=:,\s])\d\d\d\d-\d\d?-\d\d?(?:(?:[Tt]| +)\d\d?:\d\d:\d\d(?:\.\d*)? *(?:Z|[-+]\d\d?(?::?\d\d)?)?)?(?=$|[\]}),\s])/,
|
---|
15 | lookbehind: true,
|
---|
16 | alias: 'number'
|
---|
17 | },
|
---|
18 | key: {
|
---|
19 | pattern: /(^|[[{(,\s])[^,:=[\]{}()'"\s]+(?=\s*:(?:$|[\]}),\s])|\s*=)/,
|
---|
20 | lookbehind: true,
|
---|
21 | alias: 'atrule'
|
---|
22 | },
|
---|
23 | number: {
|
---|
24 | pattern:
|
---|
25 | /(^|[[{(=:,\s])[+-]?(?:0x[\da-fA-F]+|0o[0-7]+|0b[01]+|(?:\d+(?:\.\d*)?|\.?\d+)(?:[eE][+-]?\d+)?)(?=$|[\]}),:=\s])/,
|
---|
26 | lookbehind: true
|
---|
27 | },
|
---|
28 | boolean: {
|
---|
29 | pattern: /(^|[[{(=:,\s])(?:false|no|true|yes)(?=$|[\]}),:=\s])/i,
|
---|
30 | lookbehind: true
|
---|
31 | },
|
---|
32 | null: {
|
---|
33 | pattern: /(^|[[{(=:,\s])(?:null)(?=$|[\]}),:=\s])/i,
|
---|
34 | lookbehind: true,
|
---|
35 | alias: 'keyword'
|
---|
36 | },
|
---|
37 | string: {
|
---|
38 | pattern:
|
---|
39 | /(^|[[{(=:,\s])(?:('''|""")\r?\n(?:(?:[^\r\n]|\r?\n(?![\t ]*\2))*\r?\n)?[\t ]*\2|'[^'\r\n]*'|"(?:\\.|[^\\"\r\n])*")/,
|
---|
40 | lookbehind: true,
|
---|
41 | greedy: true
|
---|
42 | },
|
---|
43 | literal: {
|
---|
44 | pattern:
|
---|
45 | /(^|[[{(=:,\s])(?:[^#"',:=[\]{}()\s`-]|[:-][^"',=[\]{}()\s])(?:[^,:=\]})(\s]|:(?![\s,\]})]|$)|[ \t]+[^#,:=\]})(\s])*/,
|
---|
46 | lookbehind: true,
|
---|
47 | alias: 'string'
|
---|
48 | },
|
---|
49 | punctuation: /[,:=[\]{}()-]/
|
---|
50 | }
|
---|
51 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.