MCPcopy
hub / github.com/PrismJS/prism / createInterpolationInside

Function createInterpolationInside

components/prism-csharp.js:318–341  ·  view source on GitHub ↗
(interpolation, interpolationRound)

Source from the content-addressed store, hash-verified

316 var sInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [sInterpolationRound, formatString]);
317
318 function createInterpolationInside(interpolation, interpolationRound) {
319 return {
320 'interpolation': {
321 pattern: re(/((?:^|[^{])(?:\{\{)*)<<0>>/.source, [interpolation]),
322 lookbehind: true,
323 inside: {
324 'format-string': {
325 pattern: re(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source, [interpolationRound, formatString]),
326 lookbehind: true,
327 inside: {
328 'punctuation': /^:/
329 }
330 },
331 'punctuation': /^\{|\}$/,
332 'expression': {
333 pattern: /[\s\S]+/,
334 alias: 'language-csharp',
335 inside: Prism.languages.csharp
336 }
337 }
338 },
339 'string': /[\s\S]+/
340 };
341 }
342
343 Prism.languages.insertBefore('csharp', 'string', {
344 'interpolation-string': [

Callers 1

prism-csharp.jsFile · 0.85

Calls 1

reFunction · 0.70

Tested by

no test coverage detected