Skip to content

Commit

Permalink
Merge branch 'master' into issue2852
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment committed Sep 6, 2021
2 parents af74b0f + 8df825e commit a193e6f
Show file tree
Hide file tree
Showing 53 changed files with 1,273 additions and 21 deletions.
5 changes: 3 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,18 @@ module.exports = {
'jsdoc/require-property-name': 'warn',

// regexp
'regexp/no-empty-capturing-group': 'error',
'regexp/no-dupe-disjunctions': 'error',
'regexp/no-empty-alternative': 'error',
'regexp/no-empty-capturing-group': 'error',
'regexp/no-empty-lookarounds-assertion': 'error',
'regexp/no-lazy-ends': 'error',
'regexp/no-obscure-range': 'error',
'regexp/no-optional-assertion': 'error',
'regexp/no-standalone-backslash': 'error',
'regexp/no-super-linear-backtracking': 'error',
'regexp/no-unused-capturing-group': 'error',
'regexp/no-zero-quantifier': 'error',
'regexp/optimal-lookaround-quantifier': 'error',
'regexp/no-unused-capturing-group': 'error',

'regexp/match-any': 'warn',
'regexp/negation': 'warn',
Expand Down
2 changes: 1 addition & 1 deletion components.js

Large diffs are not rendered by default.

16 changes: 15 additions & 1 deletion components.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@
"title": "AutoIt",
"owner": "Golmote"
},
"avro-idl": {
"title":"Avro IDL",
"alias": "avdl",
"owner": "RunDevelopment"
},
"bash": {
"title": "Bash",
"alias": "shell",
Expand Down Expand Up @@ -466,6 +471,11 @@
"require": "c",
"owner": "Golmote"
},
"gn": {
"title": "GN",
"alias": "gni",
"owner": "RunDevelopment"
},
"go": {
"title": "Go",
"require": "clike",
Expand Down Expand Up @@ -1227,6 +1237,10 @@
"title": "Swift",
"owner": "chrischares"
},
"systemd": {
"title": "Systemd configuration file",
"owner": "RunDevelopment"
},
"t4-templating": {
"title": "T4 templating",
"owner": "RunDevelopment"
Expand Down Expand Up @@ -1464,7 +1478,7 @@
},
"highlight-keywords": {
"title": "Highlight Keywords",
"description": "Adds special CSS classes for each keyword matched in the code. For example, the keyword <code>if</code> will have the class <code>keyword-if</code> as well. You can have fine grained control over the appearance of each keyword by providing your own CSS rules.",
"description": "Adds special CSS classes for each keyword for fine-grained highlighting.",
"owner": "vkbansal",
"noCSS": true
},
Expand Down
57 changes: 57 additions & 0 deletions components/prism-avro-idl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// GitHub: https://github.com/apache/avro
// Docs: https://avro.apache.org/docs/current/idl.html

Prism.languages['avro-idl'] = {
'comment': {
pattern: /\/\/.*|\/\*[\s\S]*?\*\//,
greedy: true
},
'string': [
{
pattern: /(^|[^\\])"(?:[^\r\n"\\]|\\.)*"/,
lookbehind: true,
greedy: true
},
{
pattern: /(^|[^\\])'(?:[^\r\n'\\]|\\(?:[\s\S]|\d{1,3}))'/,
lookbehind: true,
greedy: true
}
],

'annotation': {
pattern: /@(?:[$\w.-]|`[^\r\n`]+`)+/,
greedy: true,
alias: 'function'
},
'function-identifier': {
pattern: /`[^\r\n`]+`(?=\s*\()/,
greedy: true,
alias: 'function'
},
'identifier': {
pattern: /`[^\r\n`]+`/,
greedy: true
},

'class-name': {
pattern: /(\b(?:enum|error|protocol|record|throws)\b\s+)[$\w]+/,
lookbehind: true,
greedy: true
},
'keyword': /\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/,
'function': /\b[a-z_]\w*(?=\s*\()/i,

'number': [
{
pattern: /(^|[^\w.])-?(?:(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|0x(?:[a-f0-9]+(?:\.[a-f0-9]*)?|\.[a-f0-9]+)(?:p[+-]?\d+)?)[dfl]?(?![\w.])/i,
lookbehind: true
},
/-?\b(?:NaN|Infinity)\b/
],

'operator': /=/,
'punctuation': /[()\[\]{}<>.:,;-]/
};

Prism.languages.avdl = Prism.languages['avro-idl'];
1 change: 1 addition & 0 deletions components/prism-avro-idl.min.js

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

2 changes: 1 addition & 1 deletion components/prism-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ var Prism = (function (_self) {
// at _.util.currentScript (http://localhost/components/prism-core.js:119:5)
// at Global code (http://localhost/components/prism-core.js:606:1)

var src = (/at [^(\r\n]*\((.*):.+:.+\)$/i.exec(err.stack) || [])[1];
var src = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(err.stack) || [])[1];
if (src) {
var scripts = document.getElementsByTagName('script');
for (var i in scripts) {
Expand Down
2 changes: 1 addition & 1 deletion components/prism-core.min.js

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

2 changes: 1 addition & 1 deletion components/prism-cpp.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

Prism.languages.insertBefore('cpp', 'keyword', {
'generic-function': {
pattern: /\b[a-z_]\w*\s*<(?:[^<>]|<(?:[^<>])*>)*>(?=\s*\()/i,
pattern: /\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,
inside: {
'function': /^\w+/,
'generic': {
Expand Down
Loading

0 comments on commit a193e6f

Please sign in to comment.