source: node_modules/refractor/lang/nginx.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.5 KB
Line 
1'use strict'
2
3module.exports = nginx
4nginx.displayName = 'nginx'
5nginx.aliases = []
6function nginx(Prism) {
7 ;(function (Prism) {
8 var variable =
9 /\$(?:\w[a-z\d]*(?:_[^\x00-\x1F\s"'\\()$]*)?|\{[^}\s"'\\]+\})/i
10 Prism.languages.nginx = {
11 comment: {
12 pattern: /(^|[\s{};])#.*/,
13 lookbehind: true,
14 greedy: true
15 },
16 directive: {
17 pattern:
18 /(^|\s)\w(?:[^;{}"'\\\s]|\\.|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|\s+(?:#.*(?!.)|(?![#\s])))*?(?=\s*[;{])/,
19 lookbehind: true,
20 greedy: true,
21 inside: {
22 string: {
23 pattern:
24 /((?:^|[^\\])(?:\\\\)*)(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,
25 lookbehind: true,
26 greedy: true,
27 inside: {
28 escape: {
29 pattern: /\\["'\\nrt]/,
30 alias: 'entity'
31 },
32 variable: variable
33 }
34 },
35 comment: {
36 pattern: /(\s)#.*/,
37 lookbehind: true,
38 greedy: true
39 },
40 keyword: {
41 pattern: /^\S+/,
42 greedy: true
43 },
44 // other patterns
45 boolean: {
46 pattern: /(\s)(?:off|on)(?!\S)/,
47 lookbehind: true
48 },
49 number: {
50 pattern: /(\s)\d+[a-z]*(?!\S)/i,
51 lookbehind: true
52 },
53 variable: variable
54 }
55 },
56 punctuation: /[{};]/
57 }
58 })(Prism)
59}
Note: See TracBrowser for help on using the repository browser.