Skip to content

Commit

Permalink
Update dev-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 23, 2022
1 parent 66862df commit 40494b8
Show file tree
Hide file tree
Showing 79 changed files with 371 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ jobs:
strategy:
matrix:
node:
- lts/erbium
- lts/fermium
- node
4 changes: 4 additions & 0 deletions lang/abap.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lang/actionscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ export default function actionscript(Prism) {
operator: /\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/
})
Prism.languages.actionscript['class-name'].alias = 'function' // doesn't work with AS because AS is too complex

delete Prism.languages.actionscript['parameter']
delete Prism.languages.actionscript['literal-property']

if (Prism.languages.markup) {
Prism.languages.insertBefore('actionscript', 'string', {
xml: {
Expand Down
2 changes: 2 additions & 0 deletions lang/apex.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default function apex(Prism) {
}
)
/** @param {string} pattern */

function insertClassName(pattern) {
return RegExp(
pattern.replace(/<CLASS-NAME>/g, function () {
Expand All @@ -27,6 +28,7 @@ export default function apex(Prism) {
'i'
)
}

var classNameInside = {
keyword: keywords,
punctuation: /[()\[\]{};,:.<>]/
Expand Down
1 change: 1 addition & 0 deletions lang/arturo.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default function arturo(Prism) {
}
}
}

Prism.languages.arturo = {
comment: {
pattern: /;.*/,
Expand Down
5 changes: 5 additions & 0 deletions lang/asciidoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,18 @@ They are, in order: __emphasis__, **strong**, ++monospace++, +++passthrough+++,
alias: 'punctuation'
}
}) // Allow some nesting. There is no recursion though, so cloning should not be needed.

function copyFromAsciiDoc(keys) {
keys = keys.split(' ')
var o = {}

for (var i = 0, l = keys.length; i < l; i++) {
o[keys[i]] = asciidoc[keys[i]]
}

return o
}

attributes.inside['interpreted'].inside.rest = copyFromAsciiDoc(
'macro inline replacement entity'
)
Expand All @@ -218,6 +222,7 @@ They are, in order: __emphasis__, **strong**, ++monospace++, +++passthrough+++,
asciidoc['title'].inside.rest = copyFromAsciiDoc(
'macro inline replacement entity'
) // Plugin to make entity title show the real entity, idea by Roman Komarov

Prism.hooks.add('wrap', function (env) {
if (env.type === 'entity') {
env.attributes['title'] = env.content.value.replace(/&amp;/, '&')
Expand Down
3 changes: 3 additions & 0 deletions lang/aspnet.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ export default function aspnet(Prism) {
}
}
}) // Regexp copied from prism-markup, with a negative look-ahead added

Prism.languages.aspnet.tag.pattern =
/<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/ // match directives of attribute value foo="<% Bar %>"

Prism.languages.insertBefore(
'inside',
'punctuation',
Expand All @@ -49,6 +51,7 @@ export default function aspnet(Prism) {
alias: ['asp', 'comment']
}
}) // script runat="server" contains csharp, not javascript

Prism.languages.insertBefore(
'aspnet',
Prism.languages.javascript ? 'script' : 'tag',
Expand Down
2 changes: 2 additions & 0 deletions lang/avisynth.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ export default function avisynth(Prism) {
return replacements[+index]
})
}

function re(pattern, replacements, flags) {
return RegExp(replace(pattern, replacements), flags || '')
}

var types = /bool|clip|float|int|string|val/.source
var internals = [
// bools
Expand Down
3 changes: 3 additions & 0 deletions lang/bash.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ export default function bash(Prism) {
}
commandAfterHeredoc.inside = Prism.languages.bash
/* Patterns in command substitution. */

var toBeCopied = [
'comment',
'function-name',
Expand All @@ -226,9 +227,11 @@ export default function bash(Prism) {
'number'
]
var inside = insideString.variable[1].inside

for (var i = 0; i < toBeCopied.length; i++) {
inside[toBeCopied[i]] = Prism.languages.bash[toBeCopied[i]]
}

Prism.languages.shell = Prism.languages.bash
})(Prism)
}
2 changes: 2 additions & 0 deletions lang/coq.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ export default function coq(Prism) {
;(function (Prism) {
// https://github.com/coq/coq
var commentSource = /\(\*(?:[^(*]|\((?!\*)|\*(?!\))|<self>)*\*\)/.source

for (var i = 0; i < 2; i++) {
commentSource = commentSource.replace(/<self>/g, function () {
return commentSource
})
}

commentSource = commentSource.replace(/<self>/g, '[]')
Prism.languages.coq = {
comment: RegExp(commentSource),
Expand Down
18 changes: 18 additions & 0 deletions lang/csharp.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default function csharp(Prism) {
* @param {string} [flags]
* @returns {RegExp}
*/

function re(pattern, replacements, flags) {
return RegExp(replace(pattern, replacements), flags || '')
}
Expand All @@ -38,14 +39,17 @@ export default function csharp(Prism) {
* @param {number} depthLog2
* @returns {string}
*/

function nested(pattern, depthLog2) {
for (var i = 0; i < depthLog2; i++) {
pattern = pattern.replace(/<<self>>/g, function () {
return '(?:' + pattern + ')'
})
}

return pattern.replace(/<<self>>/g, '[^\\s\\S]')
} // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/

var keywordKinds = {
// keywords which represent a return or variable type
type: 'bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void',
Expand All @@ -59,9 +63,11 @@ export default function csharp(Prism) {
other:
'abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield'
} // keywords

function keywordsToPattern(words) {
return '\\b(?:' + words.trim().replace(/ /g, '|') + ')\\b'
}

var typeDeclarationKeywords = keywordsToPattern(
keywordKinds.typeDeclaration
)
Expand Down Expand Up @@ -90,7 +96,9 @@ export default function csharp(Prism) {
' ' +
keywordKinds.other
) // types

var generic = nested(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source, 2) // the idea behind the other forbidden characters is to prevent false positives. Same for tupleElement.

var nestedRound = nested(/\((?:[^()]|<<self>>)*\)/.source, 2)
var name = /@?\b[A-Za-z_]\w*\b/.source
var genericName = replace(/<<0>>(?:\s*<<1>>)?/.source, [name, generic])
Expand Down Expand Up @@ -118,7 +126,9 @@ export default function csharp(Prism) {
} // strings & characters
// https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#character-literals
// https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#string-literals

var character = /'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source // simplified pattern

var regularString = /"(?:\\.|[^\\"\r\n])*"/.source
var verbatimString = /@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source
Prism.languages.csharp = Prism.languages.extend('clike', {
Expand Down Expand Up @@ -268,6 +278,7 @@ export default function csharp(Prism) {
inside: typeInside,
alias: 'class-name'
},

/*'explicit-implementation': {
// int IFoo<Foo>.Bar => 0; void IFoo<Foo<Foo>>.Foo<T>();
pattern: replace(/\b<<0>>(?=\.<<1>>)/, className, methodOrPropertyDeclaration),
Expand Down Expand Up @@ -338,6 +349,7 @@ alias: 'class-name'
}
}
}) // attributes

var regularStringOrCharacter = regularString + '|' + character
var regularStringCharacterOrComment = replace(
/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,
Expand All @@ -349,6 +361,7 @@ alias: 'class-name'
]),
2
) // https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/attributes/#attribute-targets

var attrTarget =
/\b(?:assembly|event|field|method|module|param|property|return|type)\b/
.source
Expand Down Expand Up @@ -386,7 +399,9 @@ alias: 'class-name'
}
}
}) // string interpolation

var formatString = /:[^}\r\n]+/.source // multi line

var mInterpolationRound = nested(
replace(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [
regularStringCharacterOrComment
Expand All @@ -397,6 +412,7 @@ alias: 'class-name'
mInterpolationRound,
formatString
]) // single line

var sInterpolationRound = nested(
replace(
/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/
Expand All @@ -409,6 +425,7 @@ alias: 'class-name'
sInterpolationRound,
formatString
])

function createInterpolationInside(interpolation, interpolationRound) {
return {
interpolation: {
Expand Down Expand Up @@ -436,6 +453,7 @@ alias: 'class-name'
string: /[\s\S]+/
}
}

Prism.languages.insertBefore('csharp', 'string', {
'interpolation-string': [
{
Expand Down
5 changes: 5 additions & 0 deletions lang/cshtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,20 @@ export default function cshtml(Prism) {
* @param {number} depthLog2
* @returns {string}
*/

function nested(pattern, depthLog2) {
for (var i = 0; i < depthLog2; i++) {
pattern = pattern.replace(/<self>/g, function () {
return '(?:' + pattern + ')'
})
}

return pattern
.replace(/<self>/g, '[^\\s\\S]')
.replace(/<str>/g, '(?:' + stringLike + ')')
.replace(/<comment>/g, '(?:' + commentLike + ')')
}

var round = nested(/\((?:[^()'"@/]|<str>|<comment>|<self>)*\)/.source, 2)
var square = nested(/\[(?:[^\[\]'"@/]|<str>|<comment>|<self>)*\]/.source, 1)
var curly = nested(/\{(?:[^{}'"@/]|<str>|<comment>|<self>)*\}/.source, 2)
Expand Down Expand Up @@ -69,6 +72,7 @@ export default function cshtml(Prism) {
//
// To somewhat alleviate the problem a bit, the patterns for characters (e.g. 'a') is very permissive, it also
// allows invalid characters to support HTML expressions like this: <p>That's it!</p>.

var tagAttrInlineCs = /@(?![\w()])/.source + '|' + inlineCs
var tagAttrValue =
'(?:' +
Expand Down Expand Up @@ -127,6 +131,7 @@ export default function cshtml(Prism) {
//
// In the below code, both CSHTML and C#+HTML will be create as separate language definitions that reference each
// other. However, only CSHTML will be exported via `Prism.languages`.

Prism.languages.cshtml = Prism.languages.extend('markup', {})
var csharpWithHtml = Prism.languages.insertBefore(
'csharp',
Expand Down
1 change: 1 addition & 0 deletions lang/csp.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default function csp(Prism) {
'i'
)
}

Prism.languages.csp = {
directive: {
pattern:
Expand Down
1 change: 1 addition & 0 deletions lang/css-extras.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export default function cssExtras(Prism) {
pattern: /(\b\d+)(?:%|[a-z]+(?![\w-]))/,
lookbehind: true
} // 123 -123 .123 -.123 12.3 -12.3

var number = {
pattern: /(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,
lookbehind: true
Expand Down
1 change: 1 addition & 0 deletions lang/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export default function css(Prism) {
}
Prism.languages.css['atrule'].inside.rest = Prism.languages.css
var markup = Prism.languages.markup

if (markup) {
markup.tag.addInlined('style', 'css')
markup.tag.addAttribute('style', 'css')
Expand Down
1 change: 1 addition & 0 deletions lang/cue.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default function cue(Prism) {
// https://cuelang.org/docs/references/spec/
// eslint-disable-next-line regexp/strict
var stringEscape = /\\(?:(?!\2)|\2(?:[^()\r\n]|\([^()]*\)))/.source // eslint-disable-next-line regexp/strict

var stringTypes =
/"""(?:[^\\"]|"(?!""\2)|<esc>)*"""/.source + // eslint-disable-next-line regexp/strict
'|' +
Expand Down
2 changes: 2 additions & 0 deletions lang/dart.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ export default function dart(Prism) {
/\b(?:async|sync|yield)\*/,
/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/
] // Handles named imports, such as http.Client

var packagePrefix = /(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/
.source // based on the dart naming conventions

var className = {
pattern: RegExp(packagePrefix + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
lookbehind: true,
Expand Down
Loading

0 comments on commit 40494b8

Please sign in to comment.