]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/es/languages/nginx.js
1 /*! `nginx` grammar compiled for Highlight.js 11.11.1 */
2 var hljsGrammar
= (function () {
7 Author: Peter Leonov <gojpeg@yandex.ru>
8 Contributors: Ivan Sagalaev <maniac@softwaremaniacs.org>
10 Website: https://www.nginx.com
13 /** @type LanguageFn */
14 function nginx(hljs
) {
15 const regex
= hljs
.regex
;
17 className: 'variable',
20 { begin: /\$\{\w+\}/ },
21 { begin: regex
.concat(/[$@]/, hljs
.UNDERSCORE_IDENT_RE
) }
53 $pattern: /[a-z_]{2,}|\/dev\/poll/,
59 hljs
.HASH_COMMENT_MODE
,
63 hljs
.BACKSLASH_ESCAPE
,
77 // this swallows entire URLs to avoid detecting numbers within
88 hljs
.BACKSLASH_ESCAPE
,
97 // regexp locations (~, ~*)
104 { begin: "\\*(\\.[a-z\\-]+)+" },
106 { begin: "([a-z\\-]+\\.)+\\*" }
112 begin: '\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b'
117 begin: '\\b\\d+[kKmMgGdshdwy]?\\b',
125 name: 'Nginx config',
126 aliases: [ 'nginxconf' ],
128 hljs
.HASH_COMMENT_MODE
,
130 beginKeywords: "upstream location",
132 contains: DEFAULT
.contains
,
133 keywords: { section: "upstream location" }
136 className: 'section',
137 begin: regex
.concat(hljs
.UNDERSCORE_IDENT_RE
+ regex
.lookahead(/\s+\{/)),
141 begin: regex
.lookahead(hljs
.UNDERSCORE_IDENT_RE
+ '\\s'),
145 className: 'attribute',
146 begin: hljs
.UNDERSCORE_IDENT_RE
,
153 illegal: '[^\\s\\}\\{]'
161 export default hljsGrammar
;