History

Add Zig documentation (0.9.0)

Simon Legner committed 4 years ago

Commit 4ed22db1 parent b1963549 files · +705 −376Browse files

Showing the changes to assets/javascripts (3 of 9 files). Show all

Unified · Split

3 files
  1. assets/javascripts/news.json +5 −1
  2. assets/javascripts/templates/pages/about_tmpl.coffee +4 −0
  3. assets/javascripts/vendor/prism.js +628 −377
assets/javascripts/news.json+5−1
@@ -1,7 +1,11 @@
11 [
2+ [
3+ "2021-12-27",
4+ "New documentation: <a href=\"/zig/\">Zig</a>"
5+ ],
26 [
37 "2021-12-26",
4− "New documentation: <a href=\"/gnu_make/\">Gnu Make</a>"
8+ "New documentation: <a href=\"/gnu_make/\">GNU Make</a>"
59 ],
610 [
711 "2021-12-07",
assets/javascripts/templates/pages/about_tmpl.coffee+4−0
@@ -918,5 +918,9 @@ credits = [ · 917 unmodified lines
918918 'BSD',
919919 'https://raw.githubusercontent.com/yiisoft/yii/master/LICENSE'
920920 ], [
921+ 'Zig',
922+ '2015–2021, Zig contributors',
923+ 'MIT',
924+ 'https://raw.githubusercontent.com/ziglang/zig/master/LICENSE'
921925 ]
922926 ]
assets/javascripts/vendor/prism.js+628−377
@@ -1,5 +1,5 @@
11 /* PrismJS 1.25.0
2−https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+bash+c+cpp+cmake+coffeescript+crystal+d+dart+diff+django+elixir+erlang+go+groovy+java+json+julia+kotlin+latex+lua+markup-templating+matlab+nginx+nim+ocaml+perl+php+python+r+jsx+ruby+rust+scss+shell-session+sql+typescript+yaml */
2+https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+bash+c+cpp+cmake+coffeescript+crystal+d+dart+diff+django+elixir+erlang+go+groovy+java+json+julia+kotlin+latex+lua+markup-templating+matlab+nginx+nim+ocaml+perl+php+python+r+jsx+ruby+rust+scss+shell-session+sql+typescript+yaml+zig */
33 /// <reference lib="WebWorker"/>
44
55 var _self = (typeof window !== 'undefined')
@@ -21,7 +21,7 @@ var _self = (typeof window !== 'undefined') · 15 unmodified lines
2121 var Prism = (function (_self) {
2222
2323 // Private helper vars
24− var lang = /\blang(?:uage)?-([\w-]+)\b/i;
24+ var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i;
2525 var uniqueId = 0;
2626
2727 // The grammar object for plaintext
@@ -186,15 +186,33 @@ var Prism = (function (_self) { · 158 unmodified lines
186186 * @returns {string}
187187 */
188188 getLanguage: function (element) {
189− while (element && !lang.test(element.className)) {
189+ while (element) {
190+ var m = lang.exec(element.className);
191+ if (m) {
192+ return m[1].toLowerCase();
193+ }
190194 element = element.parentElement;
191195 }
192− if (element) {
193− return (element.className.match(lang) || [, 'none'])[1].toLowerCase();
194− }
195196 return 'none';
196197 },
197198
199+ /**
200+ * Sets the Prism `language-xxxx` class of the given element.
201+ *
202+ * @param {Element} element
203+ * @param {string} language
204+ * @returns {void}
205+ */
206+ setLanguage: function (element, language) {
207+ // remove all `language-xxxx` classes
208+ // (this might leave behind a leading space)
209+ element.className = element.className.replace(RegExp(lang, 'gi'), '');
210+
211+ // add the new `language-xxxx` class
212+ // (using `classList` will automatically clean up spaces for us)
213+ element.classList.add('language-' + language);
214+ },
215+
198216 /**
199217 * Returns the script element that is currently executing.
200218 *
@@ -549,12 +567,12 @@ var Prism = (function (_self) { · 348 unmodified lines
549567 var grammar = _.languages[language];
550568
551569 // Set language on the element, if not present
552− element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
570+ _.util.setLanguage(element, language);
553571
554572 // Set language on the parent, for styling
555573 var parent = element.parentElement;
556574 if (parent && parent.nodeName.toLowerCase() === 'pre') {
557− parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
575+ _.util.setLanguage(parent, language);
558576 }
559577
560578 var code = element.textContent;
@@ -1843,7 +1861,7 @@ Prism.languages.js = Prism.languages.javascript; · 1282 unmodified lines
18431861 },
18441862 'variable': insideString.variable,
18451863 'function': {
1846− pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
1864+ pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
18471865 lookbehind: true
18481866 },
18491867 'keyword': {
@@ -1914,6 +1932,11 @@ Prism.languages.c = Prism.languages.extend('clike', { · 64 unmodified lines
19141932 pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,
19151933 greedy: true
19161934 },
1935+ 'string': {
1936+ // https://en.cppreference.com/w/c/language/string_literal
1937+ pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
1938+ greedy: true
1939+ },
19171940 'class-name': {
19181941 pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,
19191942 lookbehind: true
@@ -1924,6 +1947,14 @@ Prism.languages.c = Prism.languages.extend('clike', { · 4 unmodified lines
19241947 'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/
19251948 });
19261949
1950+Prism.languages.insertBefore('c', 'string', {
1951+ 'char': {
1952+ // https://en.cppreference.com/w/c/language/character_constant
1953+ pattern: /'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,
1954+ greedy: true
1955+ }
1956+});
1957+
19271958 Prism.languages.insertBefore('c', 'string', {
19281959 'macro': {
19291960 // allow for multiline macro definitions
@@ -1941,6 +1972,7 @@ Prism.languages.insertBefore('c', 'string', { · 11 unmodified lines
19411972 },
19421973 Prism.languages.c['string']
19431974 ],
1975+ 'char': Prism.languages.c['char'],
19441976 'comment': Prism.languages.c['comment'],
19451977 'macro-name': [
19461978 {
@@ -1966,7 +1998,10 @@ Prism.languages.insertBefore('c', 'string', { · 19 unmodified lines
19661998 inside: Prism.languages.c
19671999 }
19682000 }
1969− },
2001+ }
2002+});
2003+
2004+Prism.languages.insertBefore('c', 'function', {
19702005 // highlight predefined macros as constants
19712006 'constant': /\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/
19722007 });
@@ -2208,50 +2243,65 @@ Prism.languages.cmake = { · 235 unmodified lines
22082243 */
22092244 (function (Prism) {
22102245 Prism.languages.ruby = Prism.languages.extend('clike', {
2211− 'comment': [
2212− /#.*/,
2213− {
2214− pattern: /^=begin\s[\s\S]*?^=end/m,
2215− greedy: true
2216− }
2217− ],
2246+ 'comment': {
2247+ pattern: /#.*|^=begin\s[\s\S]*?^=end/m,
2248+ greedy: true
2249+ },
22182250 'class-name': {
2219− pattern: /(\b(?:class)\s+|\bcatch\s+\()[\w.\\]+/i,
2251+ pattern: /(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,
22202252 lookbehind: true,
22212253 inside: {
22222254 'punctuation': /[.\\]/
22232255 }
22242256 },
2225− 'keyword': /\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/
2257+ 'keyword': /\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,
2258+ 'operator': /\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,
2259+ 'punctuation': /[(){}[\].,;]/,
2260+ });
2261+
2262+ Prism.languages.insertBefore('ruby', 'operator', {
2263+ 'double-colon': {
2264+ pattern: /::/,
2265+ alias: 'punctuation'
2266+ },
22262267 });
22272268
22282269 var interpolation = {
2229− pattern: /#\{[^}]+\}/,
2270+ pattern: /((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,
2271+ lookbehind: true,
22302272 inside: {
2273+ 'content': {
2274+ pattern: /^(#\{)[\s\S]+(?=\}$)/,
2275+ lookbehind: true,
2276+ inside: Prism.languages.ruby
2277+ },
22312278 'delimiter': {
22322279 pattern: /^#\{|\}$/,
2233− alias: 'tag'
2234− },
2235− rest: Prism.languages.ruby
2280+ alias: 'punctuation'
2281+ }
22362282 }
22372283 };
22382284
22392285 delete Prism.languages.ruby.function;
22402286
2287+ var percentExpression = '(?:' + [
2288+ /([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
2289+ /\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,
2290+ /\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,
2291+ /\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,
2292+ /<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source
2293+ ].join('|') + ')';
2294+
2295+ var symbolName = /(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;
2296+
22412297 Prism.languages.insertBefore('ruby', 'keyword', {
2242− 'regex': [
2298+ 'regex-literal': [
22432299 {
2244− pattern: RegExp(/%r/.source + '(?:' + [
2245− /([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
2246− /\((?:[^()\\]|\\[\s\S])*\)/.source,
2247− // Here we need to specifically allow interpolation
2248− /\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/.source,
2249− /\[(?:[^\[\]\\]|\\[\s\S])*\]/.source,
2250− /<(?:[^<>\\]|\\[\s\S])*>/.source
2251− ].join('|') + ')' + /[egimnosux]{0,6}/.source),
2300+ pattern: RegExp(/%r/.source + percentExpression + /[egimnosux]{0,6}/.source),
22522301 greedy: true,
22532302 inside: {
2254− 'interpolation': interpolation
2303+ 'interpolation': interpolation,
2304+ 'regex': /[\s\S]+/
22552305 }
22562306 },
22572307 {
@@ -2259,134 +2309,176 @@ Prism.languages.cmake = { · 1 unmodified line
22592309 lookbehind: true,
22602310 greedy: true,
22612311 inside: {
2262− 'interpolation': interpolation
2312+ 'interpolation': interpolation,
2313+ 'regex': /[\s\S]+/
22632314 }
22642315 }
22652316 ],
22662317 'variable': /[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,
2267− 'symbol': {
2268− pattern: /(^|[^:]):[a-zA-Z_]\w*(?:[?!]|\b)/,
2269− lookbehind: true
2270− },
2318+ 'symbol': [
2319+ {
2320+ pattern: RegExp(/(^|[^:]):/.source + symbolName),
2321+ lookbehind: true,
2322+ greedy: true
2323+ },
2324+ {
2325+ pattern: RegExp(/([\r\n{(,][ \t]*)/.source + symbolName + /(?=:(?!:))/.source),
2326+ lookbehind: true,
2327+ greedy: true
2328+ },
2329+ ],
22712330 'method-definition': {
2272− pattern: /(\bdef\s+)[\w.]+/,
2331+ pattern: /(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,
22732332 lookbehind: true,
22742333 inside: {
2275− 'function': /\w+$/,
2276− rest: Prism.languages.ruby
2334+ 'function': /\b\w+$/,
2335+ 'keyword': /^self\b/,
2336+ 'class-name': /^\w+/,
2337+ 'punctuation': /\./
22772338 }
22782339 }
22792340 });
22802341
2281− Prism.languages.insertBefore('ruby', 'number', {
2282− 'builtin': /\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,
2283− 'constant': /\b[A-Z]\w*(?:[?!]|\b)/
2284− });
2285−
2286− Prism.languages.ruby.string = [
2287− {
2288− pattern: RegExp(/%[qQiIwWxs]?/.source + '(?:' + [
2289− /([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
2290− /\((?:[^()\\]|\\[\s\S])*\)/.source,
2291− // Here we need to specifically allow interpolation
2292− /\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/.source,
2293− /\[(?:[^\[\]\\]|\\[\s\S])*\]/.source,
2294− /<(?:[^<>\\]|\\[\s\S])*>/.source
2295− ].join('|') + ')'),
2296− greedy: true,
2297− inside: {
2298− 'interpolation': interpolation
2299− }
2300− },
2301− {
2302− pattern: /("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,
2303− greedy: true,
2304− inside: {
2305− 'interpolation': interpolation
2342+ Prism.languages.insertBefore('ruby', 'string', {
2343+ 'string-literal': [
2344+ {
2345+ pattern: RegExp(/%[qQiIwWs]?/.source + percentExpression),
2346+ greedy: true,
2347+ inside: {
2348+ 'interpolation': interpolation,
2349+ 'string': /[\s\S]+/
2350+ }
2351+ },
2352+ {
2353+ pattern: /("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,
2354+ greedy: true,
2355+ inside: {
2356+ 'interpolation': interpolation,
2357+ 'string': /[\s\S]+/
2358+ }
2359+ },
2360+ {
2361+ pattern: /<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
2362+ alias: 'heredoc-string',
2363+ greedy: true,
2364+ inside: {
2365+ 'delimiter': {
2366+ pattern: /^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,
2367+ inside: {
2368+ 'symbol': /\b\w+/,
2369+ 'punctuation': /^<<[-~]?/
2370+ }
2371+ },
2372+ 'interpolation': interpolation,
2373+ 'string': /[\s\S]+/
2374+ }
2375+ },
2376+ {
2377+ pattern: /<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
2378+ alias: 'heredoc-string',
2379+ greedy: true,
2380+ inside: {
2381+ 'delimiter': {
2382+ pattern: /^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,
2383+ inside: {
2384+ 'symbol': /\b\w+/,
2385+ 'punctuation': /^<<[-~]?'|'$/,
2386+ }
2387+ },
2388+ 'string': /[\s\S]+/
2389+ }
23062390 }
2307− },
2308− {
2309− pattern: /<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
2310− alias: 'heredoc-string',
2311− greedy: true,
2312− inside: {
2313− 'delimiter': {
2314− pattern: /^<<[-~]?[a-z_]\w*|[a-z_]\w*$/i,
2315− alias: 'symbol',
2316− inside: {
2317− 'punctuation': /^<<[-~]?/
2391+ ],
2392+ 'command-literal': [
2393+ {
2394+ pattern: RegExp(/%x/.source + percentExpression),
2395+ greedy: true,
2396+ inside: {
2397+ 'interpolation': interpolation,
2398+ 'command': {
2399+ pattern: /[\s\S]+/,
2400+ alias: 'string'
23182401 }
2319− },
2320− 'interpolation': interpolation
2321− }
2322− },
2323− {
2324− pattern: /<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
2325− alias: 'heredoc-string',
2326− greedy: true,
2327− inside: {
2328− 'delimiter': {
2329− pattern: /^<<[-~]?'[a-z_]\w*'|[a-z_]\w*$/i,
2330− alias: 'symbol',
2331− inside: {
2332− 'punctuation': /^<<[-~]?'|'$/,
2402+ }
2403+ },
2404+ {
2405+ pattern: /`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,
2406+ greedy: true,
2407+ inside: {
2408+ 'interpolation': interpolation,
2409+ 'command': {
2410+ pattern: /[\s\S]+/,
2411+ alias: 'string'
23332412 }
23342413 }
23352414 }
2336− }
2337− ];
2415+ ]
2416+ });
2417+
2418+ delete Prism.languages.ruby.string;
2419+
2420+ Prism.languages.insertBefore('ruby', 'number', {
2421+ 'builtin': /\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,
2422+ 'constant': /\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/
2423+ });
23382424
23392425 Prism.languages.rb = Prism.languages.ruby;
23402426 }(Prism));
23412427
23422428 (function (Prism) {
23432429 Prism.languages.crystal = Prism.languages.extend('ruby', {
2344− keyword: [
2345− /\b(?:__DIR__|__END_LINE__|__FILE__|__LINE__|abstract|alias|as|asm|begin|break|case|class|def|do|else|elsif|end|ensure|enum|extend|for|fun|if|include|instance_sizeof|lib|macro|module|next|of|out|pointerof|private|protected|require|rescue|return|select|self|sizeof|struct|super|then|type|typeof|uninitialized|union|unless|until|when|while|with|yield)\b/,
2430+ 'keyword': [
2431+ /\b(?:__DIR__|__END_LINE__|__FILE__|__LINE__|abstract|alias|annotation|as|asm|begin|break|case|class|def|do|else|elsif|end|ensure|enum|extend|for|fun|if|ifdef|include|instance_sizeof|lib|macro|module|next|of|out|pointerof|private|protected|ptr|require|rescue|return|select|self|sizeof|struct|super|then|type|typeof|undef|uninitialized|union|unless|until|when|while|with|yield)\b/,
23462432 {
23472433 pattern: /(\.\s*)(?:is_a|responds_to)\?/,
23482434 lookbehind: true
23492435 }
23502436 ],
2351−
2352− number: /\b(?:0b[01_]*[01]|0o[0-7_]*[0-7]|0x[\da-fA-F_]*[\da-fA-F]|(?:\d(?:[\d_]*\d)?)(?:\.[\d_]*\d)?(?:[eE][+-]?[\d_]*\d)?)(?:_(?:[uif](?:8|16|32|64))?)?\b/
2437+ 'number': /\b(?:0b[01_]*[01]|0o[0-7_]*[0-7]|0x[\da-fA-F_]*[\da-fA-F]|(?:\d(?:[\d_]*\d)?)(?:\.[\d_]*\d)?(?:[eE][+-]?[\d_]*\d)?)(?:_(?:[uif](?:8|16|32|64))?)?\b/,
2438+ 'operator': [
2439+ /->/,
2440+ Prism.languages.ruby.operator,
2441+ ],
2442+ 'punctuation': /[(){}[\].,;\\]/,
23532443 });
23542444
2355− Prism.languages.insertBefore('crystal', 'string', {
2356− attribute: {
2357− pattern: /@\[.+?\]/,
2358− alias: 'attr-name',
2445+ Prism.languages.insertBefore('crystal', 'string-literal', {
2446+ 'attribute': {
2447+ pattern: /@\[.*?\]/,
23592448 inside: {
2360− delimiter: {
2449+ 'delimiter': {
23612450 pattern: /^@\[|\]$/,
2362− alias: 'tag'
2451+ alias: 'punctuation'
2452+ },
2453+ 'attribute': {
2454+ pattern: /^(\s*)\w+/,
2455+ lookbehind: true,
2456+ alias: 'class-name'
2457+ },
2458+ 'args': {
2459+ pattern: /\S(?:[\s\S]*\S)?/,
2460+ inside: Prism.languages.crystal
23632461 },
2364− rest: Prism.languages.crystal
23652462 }
23662463 },
2367−
2368− expansion: [
2369− {
2370− pattern: /\{\{.+?\}\}/,
2371− inside: {
2372− delimiter: {
2373− pattern: /^\{\{|\}\}$/,
2374− alias: 'tag'
2375− },
2376− rest: Prism.languages.crystal
2377− }
2378− },
2379− {
2380− pattern: /\{%.+?%\}/,
2381− inside: {
2382− delimiter: {
2383− pattern: /^\{%|%\}$/,
2384− alias: 'tag'
2385− },
2386− rest: Prism.languages.crystal
2464+ 'expansion': {
2465+ pattern: /\{(?:\{.*?\}|%.*?%)\}/,
2466+ inside: {
2467+ 'content': {
2468+ pattern: /^(\{.)[\s\S]+(?=.\}$)/,
2469+ lookbehind: true,
2470+ inside: Prism.languages.crystal
2471+ },
2472+ 'delimiter': {
2473+ pattern: /^\{[\{%]|[\}%]\}$/,
2474+ alias: 'operator'
23872475 }
23882476 }
2389− ]
2477+ },
2478+ 'char': {
2479+ pattern: /'(?:[^\\\r\n]{1,2}|\\(?:.|u(?:[A-Fa-f0-9]{1,4}|\{[A-Fa-f0-9]{1,6}\})))'/,
2480+ greedy: true
2481+ }
23902482 });
23912483
23922484 }(Prism));
@@ -2430,10 +2522,6 @@ Prism.languages.d = Prism.languages.extend('clike', { · 37 unmodified lines
24302522 // eslint-disable-next-line regexp/strict
24312523 /\bq"(.)[\s\S]*?\2"/.source,
24322524
2433− // Characters
2434− // 'a', '\\', '\n', '\xFF', '\377', '\uFFFF', '\U0010FFFF', '\quot'
2435− /'(?:\\(?:\W|\w+)|[^\\])'/.source,
2436−
24372525 // eslint-disable-next-line regexp/strict
24382526 /(["`])(?:\\[\s\S]|(?!\3)[^\\])*\3[cwd]?/.source
24392527 ].join('|'), 'm'),
@@ -2462,6 +2550,12 @@ Prism.languages.d = Prism.languages.extend('clike', { · 22 unmodified lines
24622550 'operator': /\|[|=]?|&[&=]?|\+[+=]?|-[-=]?|\.?\.\.|=[>=]?|!(?:i[ns]\b|<>?=?|>=?|=)?|\bi[ns]\b|(?:<[<>]?|>>?>?|\^\^|[*\/%^~])=?/
24632551 });
24642552
2553+Prism.languages.insertBefore('d', 'string', {
2554+ // Characters
2555+ // 'a', '\\', '\n', '\xFF', '\377', '\uFFFF', '\U0010FFFF', '\quot'
2556+ 'char': /'(?:\\(?:\W|\w+)|[^\\])'/
2557+});
2558+
24652559 Prism.languages.insertBefore('d', 'keyword', {
24662560 'property': /\B@\w*/
24672561 });
@@ -2498,16 +2592,6 @@ Prism.languages.insertBefore('d', 'function', { · 30 unmodified lines
24982592 };
24992593
25002594 Prism.languages.dart = Prism.languages.extend('clike', {
2501− 'string': [
2502− {
2503− pattern: /r?("""|''')[\s\S]*?\1/,
2504− greedy: true
2505− },
2506− {
2507− pattern: /r?(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,
2508− greedy: true
2509− }
2510− ],
25112595 'class-name': [
25122596 className,
25132597 {
@@ -2522,10 +2606,32 @@ Prism.languages.insertBefore('d', 'function', { · 8 unmodified lines
25222606 'operator': /\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/
25232607 });
25242608
2525− Prism.languages.insertBefore('dart', 'function', {
2609+ Prism.languages.insertBefore('dart', 'string', {
2610+ 'string-literal': {
2611+ pattern: /r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,
2612+ greedy: true,
2613+ inside: {
2614+ 'interpolation': {
2615+ pattern: /((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,
2616+ lookbehind: true,
2617+ inside: {
2618+ 'punctuation': /^\$\{?|\}$/,
2619+ 'expression': {
2620+ pattern: /[\s\S]+/,
2621+ inside: Prism.languages.dart
2622+ }
2623+ }
2624+ },
2625+ 'string': /[\s\S]+/
2626+ }
2627+ },
2628+ 'string': undefined
2629+ });
2630+
2631+ Prism.languages.insertBefore('dart', 'class-name', {
25262632 'metadata': {
25272633 pattern: /@\w+/,
2528− alias: 'symbol'
2634+ alias: 'function'
25292635 }
25302636 });
25312637
@@ -2939,15 +3045,31 @@ Prism.languages.erlang = { · 407 unmodified lines
29393045
29403046 Prism.languages.go = Prism.languages.extend('clike', {
29413047 'string': {
2942− pattern: /(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,
3048+ pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,
3049+ lookbehind: true,
29433050 greedy: true
29443051 },
29453052 'keyword': /\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,
29463053 'boolean': /\b(?:_|false|iota|nil|true)\b/,
2947− 'number': /(?:\b0x[a-f\d]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[-+]?\d+)?)i?/i,
3054+ 'number': [
3055+ // binary and octal integers
3056+ /\b0(?:b[01_]+|o[0-7_]+)i?\b/i,
3057+ // hexadecimal integers and floats
3058+ /\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,
3059+ // decimal integers and floats
3060+ /(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i
3061+ ],
29483062 'operator': /[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,
29493063 'builtin': /\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/
29503064 });
3065+
3066+Prism.languages.insertBefore('go', 'string', {
3067+ 'char': {
3068+ pattern: /'(?:\\.|[^'\\\r\n]){0,10}'/,
3069+ greedy: true
3070+ }
3071+});
3072+
29513073 delete Prism.languages.go['class-name'];
29523074
29533075 Prism.languages.groovy = Prism.languages.extend('clike', {
@@ -3042,6 +3164,11 @@ Prism.hooks.add('wrap', function (env) { · 88 unmodified lines
30423164 };
30433165
30443166 Prism.languages.java = Prism.languages.extend('clike', {
3167+ 'string': {
3168+ pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,
3169+ lookbehind: true,
3170+ greedy: true
3171+ },
30453172 'class-name': [
30463173 className,
30473174 {
@@ -3073,6 +3200,10 @@ Prism.hooks.add('wrap', function (env) { · 25 unmodified lines
30733200 pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,
30743201 greedy: true,
30753202 alias: 'string'
3203+ },
3204+ 'char': {
3205+ pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/,
3206+ greedy: true
30763207 }
30773208 });
30783209
@@ -3144,11 +3275,15 @@ Prism.languages.julia = { · 65 unmodified lines
31443275 greedy: true
31453276 },
31463277 'string': {
3147− // https://docs.julialang.org/en/v1/manual/strings/#man-characters-1
31483278 // https://docs.julialang.org/en/v1/manual/strings/#String-Basics-1
31493279 // https://docs.julialang.org/en/v1/manual/strings/#non-standard-string-literals-1
31503280 // https://docs.julialang.org/en/v1/manual/running-external-programs/#Running-External-Programs-1
3151− pattern: /"""[\s\S]+?"""|(?:\b\w+)?"(?:\\.|[^"\\\r\n])*"|(^|[^\w'])'(?:\\[^\r\n][^'\r\n]*|[^\\\r\n])'|`(?:[^\\`\r\n]|\\.)*`/,
3281+ pattern: /"""[\s\S]+?"""|(?:\b\w+)?"(?:\\.|[^"\\\r\n])*"|`(?:[^\\`\r\n]|\\.)*`/,
3282+ greedy: true
3283+ },
3284+ 'char': {
3285+ // https://docs.julialang.org/en/v1/manual/strings/#man-characters-1
3286+ pattern: /(^|[^\w'])'(?:\\[^\r\n][^'\r\n]*|[^\\\r\n])'/,
31523287 lookbehind: true,
31533288 greedy: true
31543289 },
@@ -3187,19 +3322,60 @@ Prism.languages.julia = { · 32 unmodified lines
31873322
31883323 delete Prism.languages.kotlin['class-name'];
31893324
3325+ var interpolationInside = {
3326+ 'interpolation-punctuation': {
3327+ pattern: /^\$\{?|\}$/,
3328+ alias: 'punctuation'
3329+ },
3330+ 'expression': {
3331+ pattern: /[\s\S]+/,
3332+ inside: Prism.languages.kotlin
3333+ }
3334+ };
3335+
31903336 Prism.languages.insertBefore('kotlin', 'string', {
3191− 'raw-string': {
3192− pattern: /("""|''')[\s\S]*?\1/,
3193− alias: 'string'
3194− // See interpolation below
3337+ // https://kotlinlang.org/spec/expressions.html#string-interpolation-expressions
3338+ 'string-literal': [
3339+ {
3340+ pattern: /"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,
3341+ alias: 'multiline',
3342+ inside: {
3343+ 'interpolation': {
3344+ pattern: /\$(?:[a-z_]\w*|\{[^{}]*\})/i,
3345+ inside: interpolationInside
3346+ },
3347+ 'string': /[\s\S]+/
3348+ }
3349+ },
3350+ {
3351+ pattern: /"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,
3352+ alias: 'singleline',
3353+ inside: {
3354+ 'interpolation': {
3355+ pattern: /((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,
3356+ lookbehind: true,
3357+ inside: interpolationInside
3358+ },
3359+ 'string': /[\s\S]+/
3360+ }
3361+ }
3362+ ],
3363+ 'char': {
3364+ // https://kotlinlang.org/spec/expressions.html#character-literals
3365+ pattern: /'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,
3366+ greedy: true
31953367 }
31963368 });
3369+
3370+ delete Prism.languages.kotlin['string'];
3371+
31973372 Prism.languages.insertBefore('kotlin', 'keyword', {
31983373 'annotation': {
31993374 pattern: /\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,
32003375 alias: 'builtin'
32013376 }
32023377 });
3378+
32033379 Prism.languages.insertBefore('kotlin', 'function', {
32043380 'label': {
32053381 pattern: /\b\w+@|@\w+\b/,
@@ -3207,27 +3383,6 @@ Prism.languages.julia = { · 1 unmodified line
32073383 }
32083384 });
32093385
3210− var interpolation = [
3211− {
3212− pattern: /\$\{[^}]+\}/,
3213− inside: {
3214− 'delimiter': {
3215− pattern: /^\$\{|\}$/,
3216− alias: 'variable'
3217− },
3218− rest: Prism.languages.kotlin
3219− }
3220− },
3221− {
3222− pattern: /\$\w+/,
3223− alias: 'variable'
3224− }
3225− ];
3226−
3227− Prism.languages.kotlin['string'].inside = Prism.languages.kotlin['raw-string'].inside = {
3228− interpolation: interpolation
3229− };
3230−
32313386 Prism.languages.kt = Prism.languages.kotlin;
32323387 Prism.languages.kts = Prism.languages.kotlin;
32333388 }(Prism));
@@ -3342,7 +3497,8 @@ Prism.languages.matlab = { · 108 unmodified lines
33423497 Prism.languages.nginx = {
33433498 'comment': {
33443499 pattern: /(^|[\s{};])#.*/,
3345− lookbehind: true
3500+ lookbehind: true,
3501+ greedy: true
33463502 },
33473503 'directive': {
33483504 pattern: /(^|\s)\w(?:[^;{}"'\\\s]|\\.|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|\s+(?:#.*(?!.)|(?![#\s])))*?(?=\s*[;{])/,
@@ -3352,6 +3508,7 @@ Prism.languages.matlab = { · 3 unmodified lines
33523508 'string': {
33533509 pattern: /((?:^|[^\\])(?:\\\\)*)(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,
33543510 lookbehind: true,
3511+ greedy: true,
33553512 inside: {
33563513 'escape': {
33573514 pattern: /\\["'\\nrt]/,
@@ -3389,23 +3546,29 @@ Prism.languages.matlab = { · 31 unmodified lines
33893546 }(Prism));
33903547
33913548 Prism.languages.nim = {
3392− 'comment': /#.*/,
3393− // Double-quoted strings can be prefixed by an identifier (Generalized raw string literals)
3394− // Character literals are handled specifically to prevent issues with numeric type suffixes
3549+ 'comment': {
3550+ pattern: /#.*/,
3551+ greedy: true
3552+ },
33953553 'string': {
3396− pattern: /(?:(?:\b(?!\d)(?:\w|\\x[89a-fA-F][0-9a-fA-F])+)?(?:"""[\s\S]*?"""(?!")|"(?:\\[\s\S]|""|[^"\\])*")|'(?:\\(?:\d+|x[\da-fA-F]{2}|.)|[^'])')/,
3554+ // Double-quoted strings can be prefixed by an identifier (Generalized raw string literals)
3555+ pattern: /(?:\b(?!\d)(?:\w|\\x[89a-fA-F][0-9a-fA-F])+)?(?:"""[\s\S]*?"""(?!")|"(?:\\[\s\S]|""|[^"\\])*")/,
33973556 greedy: true
33983557 },
3399− // The negative look ahead prevents wrong highlighting of the .. operator
3400− 'number': /\b(?:0[xXoObB][\da-fA-F_]+|\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:[eE][+-]?\d[\d_]*)?)(?:'?[iuf]\d*)?/,
3401− 'keyword': /\b(?:addr|as|asm|atomic|bind|block|break|case|cast|concept|const|continue|converter|defer|discard|distinct|do|elif|else|end|enum|except|export|finally|for|from|func|generic|if|import|include|interface|iterator|let|macro|method|mixin|nil|object|out|proc|ptr|raise|ref|return|static|template|try|tuple|type|using|var|when|while|with|without|yield)\b/,
3558+ 'char': {
3559+ // Character literals are handled specifically to prevent issues with numeric type suffixes
3560+ pattern: /'(?:\\(?:\d+|x[\da-fA-F]{0,2}|.)|[^'])'/,
3561+ greedy: true
3562+ },
3563+
34023564 'function': {
34033565 pattern: /(?:(?!\d)(?:\w|\\x[89a-fA-F][0-9a-fA-F])+|`[^`\r\n]+`)\*?(?:\[[^\]]+\])?(?=\s*\()/,
3566+ greedy: true,
34043567 inside: {
34053568 'operator': /\*$/
34063569 }
34073570 },
3408− // We don't want to highlight operators inside backticks
3571+ // We don't want to highlight operators (and anything really) inside backticks
34093572 'identifier': {
34103573 pattern: /`[^`\r\n]+`/,
34113574 greedy: true,
@@ -3413,6 +3576,10 @@ Prism.languages.nim = { · 1 unmodified line
34133576 'punctuation': /`/
34143577 }
34153578 },
3579+
3580+ // The negative look ahead prevents wrong highlighting of the .. operator
3581+ 'number': /\b(?:0[xXoObB][\da-fA-F_]+|\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:[eE][+-]?\d[\d_]*)?)(?:'?[iuf]\d*)?/,
3582+ 'keyword': /\b(?:addr|as|asm|atomic|bind|block|break|case|cast|concept|const|continue|converter|defer|discard|distinct|do|elif|else|end|enum|except|export|finally|for|from|func|generic|if|import|include|interface|iterator|let|macro|method|mixin|nil|object|out|proc|ptr|raise|ref|return|static|template|try|tuple|type|using|var|when|while|with|without|yield)\b/,
34163583 'operator': {
34173584 // Look behind and look ahead prevent wrong highlighting of punctuations [. .] {. .} (. .)
34183585 // but allow the slice operator .. to take precedence over them
@@ -3423,26 +3590,42 @@ Prism.languages.nim = { · 4 unmodified lines
34233590 'punctuation': /[({\[]\.|\.[)}\]]|[`(){}\[\],:]/
34243591 };
34253592
3593+// https://ocaml.org/manual/lex.html
3594+
34263595 Prism.languages.ocaml = {
3427− 'comment': /\(\*[\s\S]*?\*\)/,
3596+ 'comment': {
3597+ pattern: /\(\*[\s\S]*?\*\)/,
3598+ greedy: true
3599+ },
3600+ 'char': {
3601+ pattern: /'(?:[^\\\r\n']|\\(?:.|[ox]?[0-9a-f]{1,3}))'/i,
3602+ greedy: true
3603+ },
34283604 'string': [
34293605 {
3430− pattern: /"(?:\\.|[^\\\r\n"])*"/,
3606+ pattern: /"(?:\\(?:[\s\S]|\r\n)|[^\\\r\n"])*"/,
34313607 greedy: true
34323608 },
34333609 {
3434− pattern: /(['`])(?:\\(?:\d+|x[\da-f]+|.)|(?!\1)[^\\\r\n])\1/i,
3610+ pattern: /\{([a-z_]*)\|[\s\S]*?\|\1\}/,
34353611 greedy: true
34363612 }
34373613 ],
3438− 'number': /\b(?:0x[\da-f][\da-f_]+|(?:0[bo])?\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?[\d_]+)?)/i,
3614+ 'number': [
3615+ // binary and octal
3616+ /\b(?:0b[01][01_]*|0o[0-7][0-7_]*)\b/i,
3617+ // hexadecimal
3618+ /\b0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]*)?(?:p[+-]?\d[\d_]*)?(?!\w)/i,
3619+ // decimal
3620+ /\b\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?\d[\d_]*)?(?!\w)/i,
3621+ ],
34393622 'directive': {
34403623 pattern: /\B#\w+/,
3441− alias: 'important'
3624+ alias: 'property'
34423625 },
34433626 'label': {
34443627 pattern: /\B~\w+/,
3445− alias: 'function'
3628+ alias: 'property'
34463629 },
34473630 'type-variable': {
34483631 pattern: /\B'\w+/,
@@ -3450,212 +3633,178 @@ Prism.languages.ocaml = { · 1 unmodified line
34503633 },
34513634 'variant': {
34523635 pattern: /`\w+/,
3453− alias: 'variable'
3454− },
3455− 'module': {
3456− pattern: /\b[A-Z]\w+/,
3457− alias: 'variable'
3636+ alias: 'symbol'
34583637 },
34593638 // For the list of keywords and operators,
34603639 // see: http://caml.inria.fr/pub/docs/manual-ocaml/lex.html#sec84
34613640 'keyword': /\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/,
34623641 'boolean': /\b(?:false|true)\b/,
3642+
3643+ 'operator-like-punctuation': {
3644+ pattern: /\[[<>|]|[>|]\]|\{<|>\}/,
3645+ alias: 'punctuation'
3646+ },
34633647 // Custom operators are allowed
3464− 'operator': /:=|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,
3465− 'punctuation': /[(){}\[\].,:;]|\b_\b/
3648+ 'operator': /\.[.~]|:[=>]|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,
3649+ 'punctuation': /;;|::|[(){}\[\].,:;#]|\b_\b/
34663650 };
34673651
3468−Prism.languages.perl = {
3469− 'comment': [
3470− {
3471− // POD
3472− pattern: /(^\s*)=\w[\s\S]*?=cut.*/m,
3473− lookbehind: true
3474− },
3475− {
3476− pattern: /(^|[^\\$])#.*/,
3477− lookbehind: true
3478− }
3479− ],
3480− // TODO Could be nice to handle Heredoc too.
3481− 'string': [
3482− // q/.../
3483− {
3484− pattern: /\b(?:q|qq|qw|qx)\s*([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/,
3485− greedy: true
3486− },
3487−
3488− // q a...a
3489− {
3490− pattern: /\b(?:q|qq|qw|qx)\s+([a-zA-Z0-9])(?:(?!\1)[^\\]|\\[\s\S])*\1/,
3491− greedy: true
3492− },
3493−
3494− // q(...)
3495− {
3496− pattern: /\b(?:q|qq|qw|qx)\s*\((?:[^()\\]|\\[\s\S])*\)/,
3497− greedy: true
3498− },
3499−
3500− // q{...}
3501− {
3502− pattern: /\b(?:q|qq|qw|qx)\s*\{(?:[^{}\\]|\\[\s\S])*\}/,
3503− greedy: true
3504− },
3505−
3506− // q[...]
3507− {
3508− pattern: /\b(?:q|qq|qw|qx)\s*\[(?:[^[\]\\]|\\[\s\S])*\]/,
3509− greedy: true
3510− },
3511−
3512− // q<...>
3513− {
3514− pattern: /\b(?:q|qq|qw|qx)\s*<(?:[^<>\\]|\\[\s\S])*>/,
3515− greedy: true
3516− },
3517−
3518− // "...", `...`
3519− {
3520− pattern: /("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,
3521− greedy: true
3522− },
3523−
3524− // '...'
3525− // FIXME Multi-line single-quoted strings are not supported as they would break variables containing '
3526− {
3527− pattern: /'(?:[^'\\\r\n]|\\.)*'/,
3528− greedy: true
3529− }
3530− ],
3531− 'regex': [
3532− // m/.../
3533− {
3534− pattern: /\b(?:m|qr)\s*([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1[msixpodualngc]*/,
3535− greedy: true
3536− },
3537−
3538− // m a...a
3539− {
3540− pattern: /\b(?:m|qr)\s+([a-zA-Z0-9])(?:(?!\1)[^\\]|\\[\s\S])*\1[msixpodualngc]*/,
3541− greedy: true
3542− },
3543−
3544− // m(...)
3545− {
3546− pattern: /\b(?:m|qr)\s*\((?:[^()\\]|\\[\s\S])*\)[msixpodualngc]*/,
3547− greedy: true
3548− },
3652+(function (Prism) {
35493653
3550− // m{...}
3551− {
3552− pattern: /\b(?:m|qr)\s*\{(?:[^{}\\]|\\[\s\S])*\}[msixpodualngc]*/,
3553− greedy: true
3554− },
3654+ var brackets = /(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;
35553655
3556− // m[...]
3557− {
3558− pattern: /\b(?:m|qr)\s*\[(?:[^[\]\\]|\\[\s\S])*\][msixpodualngc]*/,
3559− greedy: true
3560− },
3656+ Prism.languages.perl = {
3657+ 'comment': [
3658+ {
3659+ // POD
3660+ pattern: /(^\s*)=\w[\s\S]*?=cut.*/m,
3661+ lookbehind: true,
3662+ greedy: true
3663+ },
3664+ {
3665+ pattern: /(^|[^\\$])#.*/,
3666+ lookbehind: true,
3667+ greedy: true
3668+ }
3669+ ],
3670+ // TODO Could be nice to handle Heredoc too.
3671+ 'string': [
3672+ {
3673+ pattern: RegExp(
3674+ /\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source +
3675+ '(?:' +
3676+ [
3677+ // q/.../
3678+ /([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
3679+
3680+ // q a...a
3681+ // eslint-disable-next-line regexp/strict
3682+ /([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,
3683+
3684+ // q(...)
3685+ // q{...}
3686+ // q[...]
3687+ // q<...>
3688+ brackets,
3689+ ].join('|') +
3690+ ')'
3691+ ),
3692+ greedy: true
3693+ },
35613694
3562− // m<...>
3563− {
3564− pattern: /\b(?:m|qr)\s*<(?:[^<>\\]|\\[\s\S])*>[msixpodualngc]*/,
3565− greedy: true
3566− },
3695+ // "...", `...`
3696+ {
3697+ pattern: /("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,
3698+ greedy: true
3699+ },
35673700
3568− // The lookbehinds prevent -s from breaking
3569− // FIXME We don't handle change of separator like s(...)[...]
3570− // s/.../.../
3571− {
3572− pattern: /(^|[^-]\b)(?:s|tr|y)\s*([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2[msixpodualngcer]*/,
3573− lookbehind: true,
3574− greedy: true
3575− },
3701+ // '...'
3702+ // FIXME Multi-line single-quoted strings are not supported as they would break variables containing '
3703+ {
3704+ pattern: /'(?:[^'\\\r\n]|\\.)*'/,
3705+ greedy: true
3706+ }
3707+ ],
3708+ 'regex': [
3709+ {
3710+ pattern: RegExp(
3711+ /\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source +
3712+ '(?:' +
3713+ [
3714+ // m/.../
3715+ /([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
3716+
3717+ // m a...a
3718+ // eslint-disable-next-line regexp/strict
3719+ /([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,
3720+
3721+ // m(...)
3722+ // m{...}
3723+ // m[...]
3724+ // m<...>
3725+ brackets,
3726+ ].join('|') +
3727+ ')' +
3728+ /[msixpodualngc]*/.source
3729+ ),
3730+ greedy: true
3731+ },
35763732
3577− // s a...a...a
3578− {
3579− pattern: /(^|[^-]\b)(?:s|tr|y)\s+([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2[msixpodualngcer]*/,
3580− lookbehind: true,
3581− greedy: true
3582− },
3733+ // The lookbehinds prevent -s from breaking
3734+ {
3735+ pattern: RegExp(
3736+ /(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source +
3737+ '(?:' +
3738+ [
3739+ // s/.../.../
3740+ // eslint-disable-next-line regexp/strict
3741+ /([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,
3742+
3743+ // s a...a...a
3744+ // eslint-disable-next-line regexp/strict
3745+ /([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,
3746+
3747+ // s(...)(...)
3748+ // s{...}{...}
3749+ // s[...][...]
3750+ // s<...><...>
3751+ // s(...)[...]
3752+ brackets + /\s*/.source + brackets,
3753+ ].join('|') +
3754+ ')' +
3755+ /[msixpodualngcer]*/.source
3756+ ),
3757+ lookbehind: true,
3758+ greedy: true
3759+ },
35833760
3584− // s(...)(...)
3585− {
3586− pattern: /(^|[^-]\b)(?:s|tr|y)\s*\((?:[^()\\]|\\[\s\S])*\)\s*\((?:[^()\\]|\\[\s\S])*\)[msixpodualngcer]*/,
3587− lookbehind: true,
3588− greedy: true
3589− },
3761+ // /.../
3762+ // The look-ahead tries to prevent two divisions on
3763+ // the same line from being highlighted as regex.
3764+ // This does not support multi-line regex.
3765+ {
3766+ pattern: /\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,
3767+ greedy: true
3768+ }
3769+ ],
35903770
3591− // s{...}{...}
3592− {
3593− pattern: /(^|[^-]\b)(?:s|tr|y)\s*\{(?:[^{}\\]|\\[\s\S])*\}\s*\{(?:[^{}\\]|\\[\s\S])*\}[msixpodualngcer]*/,
3594− lookbehind: true,
3595− greedy: true
3771+ // FIXME Not sure about the handling of ::, ', and #
3772+ 'variable': [
3773+ // ${^POSTMATCH}
3774+ /[&*$@%]\{\^[A-Z]+\}/,
3775+ // $^V
3776+ /[&*$@%]\^[A-Z_]/,
3777+ // ${...}
3778+ /[&*$@%]#?(?=\{)/,
3779+ // $foo
3780+ /[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,
3781+ // $1
3782+ /[&*$@%]\d+/,
3783+ // $_, @_, %!
3784+ // The negative lookahead prevents from breaking the %= operator
3785+ /(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/
3786+ ],
3787+ 'filehandle': {
3788+ // <>, <FOO>, _
3789+ pattern: /<(?![<=])\S*?>|\b_\b/,
3790+ alias: 'symbol'
35963791 },
3597−
3598− // s[...][...]
3599− {
3600− pattern: /(^|[^-]\b)(?:s|tr|y)\s*\[(?:[^[\]\\]|\\[\s\S])*\]\s*\[(?:[^[\]\\]|\\[\s\S])*\][msixpodualngcer]*/,
3601− lookbehind: true,
3602− greedy: true
3792+ 'v-string': {
3793+ // v1.2, 1.2.3
3794+ pattern: /v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,
3795+ alias: 'string'
36033796 },
3604−
3605− // s<...><...>
3606− {
3607− pattern: /(^|[^-]\b)(?:s|tr|y)\s*<(?:[^<>\\]|\\[\s\S])*>\s*<(?:[^<>\\]|\\[\s\S])*>[msixpodualngcer]*/,
3608− lookbehind: true,
3609− greedy: true
3797+ 'function': {
3798+ pattern: /(\bsub[ \t]+)\w+/,
3799+ lookbehind: true
36103800 },
3801+ 'keyword': /\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,
3802+ 'number': /\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,
3803+ 'operator': /-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,
3804+ 'punctuation': /[{}[\];(),:]/
3805+ };
36113806
3612− // /.../
3613− // The look-ahead tries to prevent two divisions on
3614− // the same line from being highlighted as regex.
3615− // This does not support multi-line regex.
3616− {
3617− pattern: /\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,
3618− greedy: true
3619− }
3620− ],
3621−
3622− // FIXME Not sure about the handling of ::, ', and #
3623− 'variable': [
3624− // ${^POSTMATCH}
3625− /[&*$@%]\{\^[A-Z]+\}/,
3626− // $^V
3627− /[&*$@%]\^[A-Z_]/,
3628− // ${...}
3629− /[&*$@%]#?(?=\{)/,
3630− // $foo
3631− /[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,
3632− // $1
3633− /[&*$@%]\d+/,
3634− // $_, @_, %!
3635− // The negative lookahead prevents from breaking the %= operator
3636− /(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/
3637− ],
3638− 'filehandle': {
3639− // <>, <FOO>, _
3640− pattern: /<(?![<=])\S*>|\b_\b/,
3641− alias: 'symbol'
3642− },
3643− 'vstring': {
3644− // v1.2, 1.2.3
3645− pattern: /v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,
3646− alias: 'string'
3647− },
3648− 'function': {
3649− pattern: /sub \w+/i,
3650− inside: {
3651− keyword: /sub/
3652− }
3653− },
3654− 'keyword': /\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,
3655− 'number': /\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,
3656− 'operator': /-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,
3657− 'punctuation': /[{}[\];(),:]/
3658−};
3807+}(Prism));
36593808
36603809 /**
36613810 * Original by Aaron Harun: http://aahacreative.com/2012/07/31/php-syntax-highlighting-prism/
@@ -4003,7 +4152,8 @@ Prism.languages.perl = { · 341 unmodified lines
40034152 Prism.languages.python = {
40044153 'comment': {
40054154 pattern: /(^|[^\\])#.*/,
4006− lookbehind: true
4155+ lookbehind: true,
4156+ greedy: true
40074157 },
40084158 'string-interpolation': {
40094159 pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
@@ -4132,6 +4282,7 @@ Prism.languages.r = { · 122 unmodified lines
41324282 'script': {
41334283 // Allow for two levels of nesting
41344284 pattern: re(/=<BRACES>/.source),
4285+ alias: 'language-javascript',
41354286 inside: {
41364287 'script-punctuation': {
41374288 pattern: /^=(?=\{)/,
@@ -4139,7 +4290,6 @@ Prism.languages.r = { · 1 unmodified line
41394290 },
41404291 rest: Prism.languages.jsx
41414292 },
4142− 'alias': 'language-javascript'
41434293 }
41444294 }, Prism.languages.jsx.tag);
41454295
@@ -4263,8 +4413,7 @@ Prism.languages.r = { · 117 unmodified lines
42634413 },
42644414 'char': {
42654415 pattern: /b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,
4266− greedy: true,
4267− alias: 'string'
4416+ greedy: true
42684417 },
42694418 'attribute': {
42704419 pattern: /#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,
@@ -4307,7 +4456,7 @@ Prism.languages.r = { · 36 unmodified lines
43074456 alias: 'function'
43084457 },
43094458 'type-definition': {
4310− pattern: /(\b(?:enum|struct|union)\s+)\w+/,
4459+ pattern: /(\b(?:enum|struct|trait|type|union)\s+)\w+/,
43114460 lookbehind: true,
43124461 alias: 'class-name'
43134462 },
@@ -4695,3 +4844,105 @@ Prism.languages.sql = { · 381 unmodified lines
46954844
46964845 }(Prism));
46974846
4847+(function (Prism) {
4848+
4849+ function literal(str) {
4850+ return function () { return str; };
4851+ }
4852+
4853+ var keyword = /\b(?:align|allowzero|and|anyframe|anytype|asm|async|await|break|cancel|catch|comptime|const|continue|defer|else|enum|errdefer|error|export|extern|fn|for|if|inline|linksection|nakedcc|noalias|nosuspend|null|or|orelse|packed|promise|pub|resume|return|stdcallcc|struct|suspend|switch|test|threadlocal|try|undefined|union|unreachable|usingnamespace|var|volatile|while)\b/;
4854+
4855+ var IDENTIFIER = '\\b(?!' + keyword.source + ')(?!\\d)\\w+\\b';
4856+ var ALIGN = /align\s*\((?:[^()]|\([^()]*\))*\)/.source;
4857+ var PREFIX_TYPE_OP = /(?:\?|\bpromise->|(?:\[[^[\]]*\]|\*(?!\*)|\*\*)(?:\s*<ALIGN>|\s*const\b|\s*volatile\b|\s*allowzero\b)*)/.source.replace(/<ALIGN>/g, literal(ALIGN));
4858+ var SUFFIX_EXPR = /(?:\bpromise\b|(?:\berror\.)?<ID>(?:\.<ID>)*(?!\s+<ID>))/.source.replace(/<ID>/g, literal(IDENTIFIER));
4859+ var TYPE = '(?!\\s)(?:!?\\s*(?:' + PREFIX_TYPE_OP + '\\s*)*' + SUFFIX_EXPR + ')+';
4860+
4861+ /*
4862+ * A simplified grammar for Zig compile time type literals:
4863+ *
4864+ * TypeExpr = ( "!"? PREFIX_TYPE_OP* SUFFIX_EXPR )+
4865+ *
4866+ * SUFFIX_EXPR = ( \b "promise" \b | ( \b "error" "." )? IDENTIFIER ( "." IDENTIFIER )* (?! \s+ IDENTIFIER ) )
4867+ *
4868+ * PREFIX_TYPE_OP = "?"
4869+ * | \b "promise" "->"
4870+ * | ( "[" [^\[\]]* "]" | "*" | "**" ) ( ALIGN | "const" \b | "volatile" \b | "allowzero" \b )*
4871+ *
4872+ * ALIGN = "align" "(" ( [^()] | "(" [^()]* ")" )* ")"
4873+ *
4874+ * IDENTIFIER = \b (?! KEYWORD ) [a-zA-Z_] \w* \b
4875+ *
4876+ */
4877+
4878+ Prism.languages.zig = {
4879+ 'comment': [
4880+ {
4881+ pattern: /\/\/[/!].*/,
4882+ alias: 'doc-comment'
4883+ },
4884+ /\/{2}.*/
4885+ ],
4886+ 'string': [
4887+ {
4888+ // "string" and c"string"
4889+ pattern: /(^|[^\\@])c?"(?:[^"\\\r\n]|\\.)*"/,
4890+ lookbehind: true,
4891+ greedy: true
4892+ },
4893+ {
4894+ // multiline strings and c-strings
4895+ pattern: /([\r\n])([ \t]+c?\\{2}).*(?:(?:\r\n?|\n)\2.*)*/,
4896+ lookbehind: true,
4897+ greedy: true
4898+ }
4899+ ],
4900+ 'char': {
4901+ // characters 'a', '\n', '\xFF', '\u{10FFFF}'
4902+ pattern: /(^|[^\\])'(?:[^'\\\r\n]|[\uD800-\uDFFF]{2}|\\(?:.|x[a-fA-F\d]{2}|u\{[a-fA-F\d]{1,6}\}))'/,
4903+ lookbehind: true,
4904+ greedy: true
4905+ },
4906+ 'builtin': /\B@(?!\d)\w+(?=\s*\()/,
4907+ 'label': {
4908+ pattern: /(\b(?:break|continue)\s*:\s*)\w+\b|\b(?!\d)\w+\b(?=\s*:\s*(?:\{|while\b))/,
4909+ lookbehind: true
4910+ },
4911+ 'class-name': [
4912+ // const Foo = struct {};
4913+ /\b(?!\d)\w+(?=\s*=\s*(?:(?:extern|packed)\s+)?(?:enum|struct|union)\s*[({])/,
4914+ {
4915+ // const x: i32 = 9;
4916+ // var x: Bar;
4917+ // fn foo(x: bool, y: f32) void {}
4918+ pattern: RegExp(/(:\s*)<TYPE>(?=\s*(?:<ALIGN>\s*)?[=;,)])|<TYPE>(?=\s*(?:<ALIGN>\s*)?\{)/.source.replace(/<TYPE>/g, literal(TYPE)).replace(/<ALIGN>/g, literal(ALIGN))),
4919+ lookbehind: true,
4920+ inside: null // see below
4921+ },
4922+ {
4923+ // extern fn foo(x: f64) f64; (optional alignment)
4924+ pattern: RegExp(/(\)\s*)<TYPE>(?=\s*(?:<ALIGN>\s*)?;)/.source.replace(/<TYPE>/g, literal(TYPE)).replace(/<ALIGN>/g, literal(ALIGN))),
4925+ lookbehind: true,
4926+ inside: null // see below
4927+ }
4928+ ],
4929+ 'builtin-type': {
4930+ pattern: /\b(?:anyerror|bool|c_u?(?:int|long|longlong|short)|c_longdouble|c_void|comptime_(?:float|int)|f(?:16|32|64|128)|[iu](?:8|16|32|64|128|size)|noreturn|type|void)\b/,
4931+ alias: 'keyword'
4932+ },
4933+ 'keyword': keyword,
4934+ 'function': /\b(?!\d)\w+(?=\s*\()/,
4935+ 'number': /\b(?:0b[01]+|0o[0-7]+|0x[a-fA-F\d]+(?:\.[a-fA-F\d]*)?(?:[pP][+-]?[a-fA-F\d]+)?|\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)\b/,
4936+ 'boolean': /\b(?:false|true)\b/,
4937+ 'operator': /\.[*?]|\.{2,3}|[-=]>|\*\*|\+\+|\|\||(?:<<|>>|[-+*]%|[-+*/%^&|<>!=])=?|[?~]/,
4938+ 'punctuation': /[.:,;(){}[\]]/
4939+ };
4940+
4941+ Prism.languages.zig['class-name'].forEach(function (obj) {
4942+ if (obj.inside === null) {
4943+ obj.inside = Prism.languages.zig;
4944+ }
4945+ });
4946+
4947+}(Prism));
4948+