Skip to content

Commit 66c62e6

Browse files
committed
v3: Update Prism to 1.25.0
Related to 175fa9f. Closes GH-55.
1 parent 94e7a99 commit 66c62e6

39 files changed

+1492
-86
lines changed

index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ refractor.register(require('./lang/asm6502.js'))
2323
refractor.register(require('./lang/aspnet.js'))
2424
refractor.register(require('./lang/autohotkey.js'))
2525
refractor.register(require('./lang/autoit.js'))
26+
refractor.register(require('./lang/avisynth.js'))
27+
refractor.register(require('./lang/avro-idl.js'))
2628
refractor.register(require('./lang/bash.js'))
2729
refractor.register(require('./lang/basic.js'))
2830
refractor.register(require('./lang/batch.js'))
2931
refractor.register(require('./lang/bbcode.js'))
32+
refractor.register(require('./lang/bicep.js'))
3033
refractor.register(require('./lang/birb.js'))
3134
refractor.register(require('./lang/bison.js'))
3235
refractor.register(require('./lang/bnf.js'))
@@ -47,6 +50,7 @@ refractor.register(require('./lang/coq.js'))
4750
refractor.register(require('./lang/cpp.js'))
4851
refractor.register(require('./lang/crystal.js'))
4952
refractor.register(require('./lang/csharp.js'))
53+
refractor.register(require('./lang/cshtml.js'))
5054
refractor.register(require('./lang/csp.js'))
5155
refractor.register(require('./lang/css-extras.js'))
5256
refractor.register(require('./lang/csv.js'))
@@ -78,13 +82,15 @@ refractor.register(require('./lang/flow.js'))
7882
refractor.register(require('./lang/fortran.js'))
7983
refractor.register(require('./lang/fsharp.js'))
8084
refractor.register(require('./lang/ftl.js'))
85+
refractor.register(require('./lang/gap.js'))
8186
refractor.register(require('./lang/gcode.js'))
8287
refractor.register(require('./lang/gdscript.js'))
8388
refractor.register(require('./lang/gedcom.js'))
8489
refractor.register(require('./lang/gherkin.js'))
8590
refractor.register(require('./lang/git.js'))
8691
refractor.register(require('./lang/glsl.js'))
8792
refractor.register(require('./lang/gml.js'))
93+
refractor.register(require('./lang/gn.js'))
8894
refractor.register(require('./lang/go.js'))
8995
refractor.register(require('./lang/graphql.js'))
9096
refractor.register(require('./lang/groovy.js'))
@@ -94,6 +100,7 @@ refractor.register(require('./lang/haskell.js'))
94100
refractor.register(require('./lang/haxe.js'))
95101
refractor.register(require('./lang/hcl.js'))
96102
refractor.register(require('./lang/hlsl.js'))
103+
refractor.register(require('./lang/hoon.js'))
97104
refractor.register(require('./lang/hpkp.js'))
98105
refractor.register(require('./lang/hsts.js'))
99106
refractor.register(require('./lang/http.js'))
@@ -126,6 +133,7 @@ refractor.register(require('./lang/julia.js'))
126133
refractor.register(require('./lang/keyman.js'))
127134
refractor.register(require('./lang/kotlin.js'))
128135
refractor.register(require('./lang/kumir.js'))
136+
refractor.register(require('./lang/kusto.js'))
129137
refractor.register(require('./lang/latex.js'))
130138
refractor.register(require('./lang/latte.js'))
131139
refractor.register(require('./lang/less.js'))
@@ -137,11 +145,14 @@ refractor.register(require('./lang/llvm.js'))
137145
refractor.register(require('./lang/log.js'))
138146
refractor.register(require('./lang/lolcode.js'))
139147
refractor.register(require('./lang/lua.js'))
148+
refractor.register(require('./lang/magma.js'))
140149
refractor.register(require('./lang/makefile.js'))
141150
refractor.register(require('./lang/markdown.js'))
142151
refractor.register(require('./lang/markup-templating.js'))
143152
refractor.register(require('./lang/matlab.js'))
153+
refractor.register(require('./lang/maxscript.js'))
144154
refractor.register(require('./lang/mel.js'))
155+
refractor.register(require('./lang/mermaid.js'))
145156
refractor.register(require('./lang/mizar.js'))
146157
refractor.register(require('./lang/mongodb.js'))
147158
refractor.register(require('./lang/monkey.js'))
@@ -224,6 +235,7 @@ refractor.register(require('./lang/squirrel.js'))
224235
refractor.register(require('./lang/stan.js'))
225236
refractor.register(require('./lang/stylus.js'))
226237
refractor.register(require('./lang/swift.js'))
238+
refractor.register(require('./lang/systemd.js'))
227239
refractor.register(require('./lang/t4-cs.js'))
228240
refractor.register(require('./lang/t4-templating.js'))
229241
refractor.register(require('./lang/t4-vb.js'))
@@ -251,6 +263,7 @@ refractor.register(require('./lang/warpscript.js'))
251263
refractor.register(require('./lang/wasm.js'))
252264
refractor.register(require('./lang/wiki.js'))
253265
refractor.register(require('./lang/wolfram.js'))
266+
refractor.register(require('./lang/wren.js'))
254267
refractor.register(require('./lang/xeora.js'))
255268
refractor.register(require('./lang/xml-doc.js'))
256269
refractor.register(require('./lang/xojo.js'))

lang/asciidoc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function asciidoc(Prism) {
4040
inside: {
4141
specifiers: {
4242
pattern:
43-
/(?!\|)(?:(?:(?:\d+(?:\.\d+)?|\.\d+)[+*])?(?:[<^>](?:\.[<^>])?|\.[<^>])?[a-z]*)(?=\|)/,
43+
/(?:(?:(?:\d+(?:\.\d+)?|\.\d+)[+*](?:[<^>](?:\.[<^>])?|\.[<^>])?|[<^>](?:\.[<^>])?|\.[<^>])[a-z]*|[a-z]+)(?=\|)/,
4444
alias: 'attr-value'
4545
},
4646
punctuation: {

lang/avisynth.js

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
'use strict'
2+
3+
module.exports = avisynth
4+
avisynth.displayName = 'avisynth'
5+
avisynth.aliases = ['avs']
6+
function avisynth(Prism) {
7+
// http://avisynth.nl/index.php/The_full_AviSynth_grammar
8+
;(function (Prism) {
9+
function replace(pattern, replacements) {
10+
return pattern.replace(/<<(\d+)>>/g, function (m, index) {
11+
return replacements[+index]
12+
})
13+
}
14+
function re(pattern, replacements, flags) {
15+
return RegExp(replace(pattern, replacements), flags || '')
16+
}
17+
var types = /clip|int|float|string|bool|val/.source
18+
var internals = [
19+
// bools
20+
/is(?:bool|clip|float|int|string)|defined|(?:var|(?:internal)?function)?exists?/
21+
.source, // control
22+
/apply|assert|default|eval|import|select|nop|undefined/.source, // global
23+
/set(?:memorymax|cachemode|maxcpu|workingdir|planarlegacyalignment)|opt_(?:allowfloataudio|usewaveextensible|dwchannelmask|avipadscanlines|vdubplanarhack|enable_(?:v210|y3_10_10|y3_10_16|b64a|planartopackedrgb))/
24+
.source, // conv
25+
/hex(?:value)?|value/.source, // numeric
26+
/max|min|muldiv|floor|ceil|round|fmod|pi|exp|log(?:10)?|pow|sqrt|abs|sign|frac|rand|spline|continued(?:numerator|denominator)?/
27+
.source, // trig
28+
/a?sinh?|a?cosh?|a?tan[2h]?/.source, // bit
29+
/(?:bit(?:and|not|x?or|[lr]?shift[aslu]?|sh[lr]|sa[lr]|[lr]rotatel?|ro[rl]|te?st|set(?:count)?|cl(?:ea)?r|ch(?:an)?ge?))/
30+
.source, // runtime
31+
/average(?:luma|chroma[uv]|[bgr])|(?:luma|chroma[uv]|rgb|[rgb]|[yuv](?=difference(?:fromprevious|tonext)))difference(?:fromprevious|tonext)?|[yuvrgb]plane(?:median|min|max|minmaxdifference)/
32+
.source, // script
33+
/script(?:name(?:utf8)?|file(?:utf8)?|dir(?:utf8)?)|setlogparams|logmsg|getprocessinfo/
34+
.source, // string
35+
/[lu]case|str(?:toutf8|fromutf8|len|cmpi?)|(?:rev|left|right|mid|find|replace|fill)str|format|trim(?:left|right|all)|chr|ord|time/
36+
.source, // version
37+
/version(?:number|string)|isversionorgreater/.source, // helper
38+
/buildpixeltype|colorspacenametopixeltype/.source, // avsplus
39+
/setfiltermtmode|prefetch|addautoloaddir|on(?:cpu|cuda)/.source
40+
].join('|')
41+
var properties = [
42+
// content
43+
/has(?:audio|video)/.source, // resolution
44+
/width|height/.source, // framerate
45+
/frame(?:count|rate)|framerate(?:numerator|denominator)/.source, // interlacing
46+
/is(?:field|frame)based|getparity/.source, // color format
47+
/pixeltype|is(?:planar(?:rgba?)?|interleaved|rgb(?:24|32|48|64)?|y(?:8|u(?:y2|va?))?|yv(?:12|16|24|411)|420|422|444|packedrgb)|hasalpha|componentsize|numcomponents|bitspercomponent/
48+
.source, // audio
49+
/audio(?:rate|duration|length(?:[fs]|lo|hi)?|channels|bits)|isaudio(?:float|int)/
50+
.source
51+
].join('|')
52+
var filters = [
53+
// source
54+
/avi(?:file)?source|opendmlsource|directshowsource|image(?:reader|source|sourceanim)|segmented(?:avisource|directshowsource)|wavsource/
55+
.source, // color
56+
/coloryuv|convertto(?:RGB(?:24|32|48|64)|(?:planar)?RGBA?|Y8?|YV(?:12|16|24|411)|YUVA?(?:444|422|420|411)|YUY2)|convertbacktoyuy2|fixluminance|gr[ae]yscale|invert|levels|limiter|mergea?rgb|merge(?:luma|chroma)|rgbadjust|show(?:red|green|blue|alpha)|swapuv|tweak|[uv]toy8?|ytouv/
57+
.source, // overlay
58+
/(?:colorkey|reset)mask|mask(?:hs)?|layer|merge|overlay|subtract/.source, // geometry
59+
/addborders|crop(?:bottom)?|flip(?:horizontal|vertical)|letterbox|(?:horizontal|vertical)?reduceby2|(?:bicubic|bilinear|blackman|gauss|lanczos|lanczos4|point|sinc|spline(?:16|36|64))resize|skewrows|turn(?:left|right|180)/
60+
.source, // pixel
61+
/blur|sharpen|generalconvolution|(?:spatial|temporal)soften|fixbrokenchromaupsampling/
62+
.source, // timeline
63+
/trim|(?:un)?alignedsplice|(?:assume|assumescaled|change|convert)FPS|(?:delete|duplicate)frame|dissolve|fade(?:in|out|io)[02]?|freezeframe|interleave|loop|reverse|select(?:even|odd|(?:range)?every)/
64+
.source, // interlace
65+
/assume(?:frame|field)based|assume[bt]ff|bob|complementparity|doubleweave|peculiarblend|pulldown|separate(?:columns|rows|fields)|swapfields|weave(?:columns|rows)?/
66+
.source, // audio
67+
/amplify(?:db)?|assumesamplerate|audiodub(?:ex)?|audiotrim|convertaudioto(?:(?:8|16|24|32)bit|float)|converttomono|delayaudio|ensurevbrmp3sync|get(?:left|right)?channel|kill(?:audio|video)|mergechannels|mixaudio|monotostereo|normalize|resampleaudio|supereq|ssrc|timestretch/
68+
.source, // conditional
69+
/conditional(?:filter|select|reader)|frameevaluate|scriptclip|writefile(?:if|start|end)?|animate|applyrange|tcp(?:server|source)/
70+
.source, // export
71+
/imagewriter/.source, // debug
72+
/subtitle|blankclip|blackness|colorbars(?:hd)?|compare|dumpfiltergraph|setgraphanalysis|echo|histogram|info|messageclip|preroll|showfiveversions|show(?:framenumber|smpte|time)|stack(?:horizontal|vertical)|tone|version/
73+
.source
74+
].join('|')
75+
var allinternals = [internals, properties, filters].join('|')
76+
Prism.languages.avisynth = {
77+
comment: [
78+
{
79+
// Matches [* *] nestable block comments, but only supports 1 level of nested comments
80+
// /\[\*(?:[^\[*]|\[(?!\*)|\*(?!\])|<self>)*\*\]/
81+
pattern:
82+
/(^|[^\\])\[\*(?:[^\[*]|\[(?!\*)|\*(?!\])|\[\*(?:[^\[*]|\[(?!\*)|\*(?!\]))*\*\])*\*\]/,
83+
lookbehind: true,
84+
greedy: true
85+
},
86+
{
87+
// Matches /* */ block comments
88+
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
89+
lookbehind: true,
90+
greedy: true
91+
},
92+
{
93+
// Matches # comments
94+
pattern: /(^|[^\\$])#.*/,
95+
lookbehind: true,
96+
greedy: true
97+
}
98+
],
99+
// Handle before strings because optional arguments are surrounded by double quotes
100+
argument: {
101+
pattern: re(/\b(?:<<0>>)\s+("?)\w+\1/.source, [types], 'i'),
102+
inside: {
103+
keyword: /^\w+/
104+
}
105+
},
106+
// Optional argument assignment
107+
'argument-label': {
108+
pattern: /([,(][\s\\]*)\w+\s*=(?!=)/,
109+
lookbehind: true,
110+
inside: {
111+
'argument-name': {
112+
pattern: /^\w+/,
113+
alias: 'punctuation'
114+
},
115+
punctuation: /=$/
116+
}
117+
},
118+
string: [
119+
{
120+
// triple double-quoted
121+
pattern: /"""[\s\S]*?"""/,
122+
greedy: true
123+
},
124+
{
125+
// single double-quoted
126+
pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
127+
greedy: true,
128+
inside: {
129+
constant: {
130+
// These *are* case-sensitive!
131+
pattern:
132+
/\b(?:DEFAULT_MT_MODE|(?:SCRIPT|MAINSCRIPT|PROGRAM)DIR|(?:USER|MACHINE)_(?:PLUS|CLASSIC)_PLUGINS)\b/
133+
}
134+
}
135+
}
136+
],
137+
// The special "last" variable that takes the value of the last implicitly returned clip
138+
variable: /\b(?:last)\b/i,
139+
boolean: /\b(?:true|false|yes|no)\b/i,
140+
keyword:
141+
/\b(?:function|global|return|try|catch|if|else|while|for|__END__)\b/i,
142+
constant: /\bMT_(?:NICE_FILTER|MULTI_INSTANCE|SERIALIZED|SPECIAL_MT)\b/,
143+
// AviSynth's internal functions, filters, and properties
144+
'builtin-function': {
145+
pattern: re(/\b(?:<<0>>)\b/.source, [allinternals], 'i'),
146+
alias: 'function'
147+
},
148+
'type-cast': {
149+
pattern: re(/\b(?:<<0>>)(?=\s*\()/.source, [types], 'i'),
150+
alias: 'keyword'
151+
},
152+
// External/user-defined filters
153+
function: {
154+
pattern: /\b[a-z_]\w*(?=\s*\()|(\.)[a-z_]\w*\b/i,
155+
lookbehind: true
156+
},
157+
// Matches a \ as the first or last character on a line
158+
'line-continuation': {
159+
pattern: /(^[ \t]*)\\|\\(?=[ \t]*$)/m,
160+
lookbehind: true,
161+
alias: 'punctuation'
162+
},
163+
number:
164+
/\B\$(?:[\da-f]{6}|[\da-f]{8})\b|(?:(?:\b|\B-)\d+(?:\.\d*)?\b|\B\.\d+\b)/i,
165+
operator: /\+\+?|[!=<>]=?|&&|\|\||[?:*/%-]/,
166+
punctuation: /[{}\[\]();,.]/
167+
}
168+
Prism.languages.avs = Prism.languages.avisynth
169+
})(Prism)
170+
}

lang/avro-idl.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
'use strict'
2+
3+
module.exports = avroIdl
4+
avroIdl.displayName = 'avroIdl'
5+
avroIdl.aliases = []
6+
function avroIdl(Prism) {
7+
// GitHub: https://github.com/apache/avro
8+
// Docs: https://avro.apache.org/docs/current/idl.html
9+
Prism.languages['avro-idl'] = {
10+
comment: {
11+
pattern: /\/\/.*|\/\*[\s\S]*?\*\//,
12+
greedy: true
13+
},
14+
string: [
15+
{
16+
pattern: /(^|[^\\])"(?:[^\r\n"\\]|\\.)*"/,
17+
lookbehind: true,
18+
greedy: true
19+
},
20+
{
21+
pattern: /(^|[^\\])'(?:[^\r\n'\\]|\\(?:[\s\S]|\d{1,3}))'/,
22+
lookbehind: true,
23+
greedy: true
24+
}
25+
],
26+
annotation: {
27+
pattern: /@(?:[$\w.-]|`[^\r\n`]+`)+/,
28+
greedy: true,
29+
alias: 'function'
30+
},
31+
'function-identifier': {
32+
pattern: /`[^\r\n`]+`(?=\s*\()/,
33+
greedy: true,
34+
alias: 'function'
35+
},
36+
identifier: {
37+
pattern: /`[^\r\n`]+`/,
38+
greedy: true
39+
},
40+
'class-name': {
41+
pattern: /(\b(?:enum|error|protocol|record|throws)\b\s+)[$\w]+/,
42+
lookbehind: true,
43+
greedy: true
44+
},
45+
keyword:
46+
/\b(?:array|boolean|bytes|date|decimal|double|enum|error|false|fixed|float|idl|import|int|local_timestamp_ms|long|map|null|oneway|protocol|record|schema|string|throws|time_ms|timestamp_ms|true|union|uuid|void)\b/,
47+
function: /\b[a-z_]\w*(?=\s*\()/i,
48+
number: [
49+
{
50+
pattern:
51+
/(^|[^\w.])-?(?:(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|0x(?:[a-f0-9]+(?:\.[a-f0-9]*)?|\.[a-f0-9]+)(?:p[+-]?\d+)?)[dfl]?(?![\w.])/i,
52+
lookbehind: true
53+
},
54+
/-?\b(?:NaN|Infinity)\b/
55+
],
56+
operator: /=/,
57+
punctuation: /[()\[\]{}<>.:,;-]/
58+
}
59+
Prism.languages.avdl = Prism.languages['avro-idl']
60+
}

0 commit comments

Comments
 (0)