source: node_modules/refractor/lang/json5.js@ d24f17c

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

Initial commit

  • Property mode set to 100644
File size: 808 bytes
Line 
1'use strict'
2var refractorJson = require('./json.js')
3module.exports = json5
4json5.displayName = 'json5'
5json5.aliases = []
6function json5(Prism) {
7 Prism.register(refractorJson)
8 ;(function (Prism) {
9 var string = /("|')(?:\\(?:\r\n?|\n|.)|(?!\1)[^\\\r\n])*\1/
10 Prism.languages.json5 = Prism.languages.extend('json', {
11 property: [
12 {
13 pattern: RegExp(string.source + '(?=\\s*:)'),
14 greedy: true
15 },
16 {
17 pattern:
18 /(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/,
19 alias: 'unquoted'
20 }
21 ],
22 string: {
23 pattern: string,
24 greedy: true
25 },
26 number:
27 /[+-]?\b(?:NaN|Infinity|0x[a-fA-F\d]+)\b|[+-]?(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+\b)?/
28 })
29 })(Prism)
30}
Note: See TracBrowser for help on using the repository browser.