Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Gradle #3443

Merged
merged 9 commits into from Apr 29, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
63 changes: 15 additions & 48 deletions components.json
Expand Up @@ -189,7 +189,7 @@
"owner": "Zinfidel"
},
"avro-idl": {
"title":"Avro IDL",
"title": "Avro IDL",
"alias": "avdl",
"owner": "RunDevelopment"
},
Expand Down Expand Up @@ -544,6 +544,11 @@
"alias": "go-mod",
"owner": "RunDevelopment"
},
"gradle": {
"title": "Gradle",
"require": "clike",
"owner": "zeabdelkhalek-badido18"
},
"graphql": {
"title": "GraphQL",
"optional": "markdown",
Expand All @@ -554,11 +559,6 @@
"require": "clike",
"owner": "robfletcher"
},
"gradle": {
"title": "Gradle",
"require": "clike",
"owner": "zellat-boudis"
},
"haml": {
"title": "Haml",
"require": "ruby",
Expand Down Expand Up @@ -651,11 +651,7 @@
"ignore": {
"title": ".ignore",
"owner": "osipxd",
"alias": [
"gitignore",
"hgignore",
"npmignore"
],
"alias": ["gitignore", "hgignore", "npmignore"],
"aliasTitles": {
"gitignore": ".gitignore",
"hgignore": ".hgignore",
Expand Down Expand Up @@ -692,11 +688,7 @@
},
"javadoclike": {
"title": "JavaDoc-like",
"modify": [
"java",
"javascript",
"php"
],
"modify": ["java", "javascript", "php"],
"owner": "RunDevelopment"
},
"javastacktrace": {
Expand All @@ -720,10 +712,7 @@
"title": "JSDoc",
"require": ["javascript", "javadoclike", "typescript"],
"modify": "javascript",
"optional": [
"actionscript",
"coffeescript"
],
"optional": ["actionscript", "coffeescript"],
"owner": "RunDevelopment"
},
"js-extras": {
Expand Down Expand Up @@ -985,10 +974,7 @@
"opencl": {
"title": "OpenCL",
"require": "c",
"modify": [
"c",
"cpp"
],
"modify": ["c", "cpp"],
"owner": "Milania1"
},
"openqasm": {
Expand Down Expand Up @@ -1119,11 +1105,7 @@
},
"pure": {
"title": "Pure",
"optional": [
"c",
"cpp",
"fortran"
],
"optional": ["c", "cpp", "fortran"],
"owner": "Golmote"
},
"purebasic": {
Expand Down Expand Up @@ -1177,22 +1159,13 @@
"title": "Razor C#",
"alias": "razor",
"require": ["markup", "csharp"],
"optional":[
"css",
"css-extras",
"javascript",
"js-extras"
],
"optional": ["css", "css-extras", "javascript", "js-extras"],
"owner": "RunDevelopment"
},
"jsx": {
"title": "React JSX",
"require": ["markup", "javascript"],
"optional": [
"jsdoc",
"js-extras",
"js-templates"
],
"optional": ["jsdoc", "js-extras", "js-templates"],
"owner": "vkbansal"
},
"tsx": {
Expand Down Expand Up @@ -1414,10 +1387,7 @@
},
"tremor": {
"title": "Tremor",
"alias": [
"trickle",
"troy"
],
"alias": ["trickle", "troy"],
RunDevelopment marked this conversation as resolved.
Show resolved Hide resolved
"owner": "darach",
"aliasTitles": {
"trickle": "trickle",
Expand Down Expand Up @@ -1596,10 +1566,7 @@
"show-invisibles": {
"title": "Show Invisibles",
"description": "Show hidden characters such as tabs and line breaks.",
"optional": [
"autolinker",
"data-uri-highlight"
]
"optional": ["autolinker", "data-uri-highlight"]
},
"autolinker": {
"title": "Autolinker",
Expand Down
22 changes: 11 additions & 11 deletions components/prism-gradle.js
Expand Up @@ -3,9 +3,9 @@
pattern: /((?:^|[^\\$])(?:\\{2})*)\$(?:\w+|\{[^{}]*\})/,
lookbehind: true,
inside: {
"interpolation-punctuation": {
'interpolation-punctuation': {
pattern: /^\$\{?|\}$/,
alias: "punctuation",
alias: 'punctuation',
},
expression: {
RunDevelopment marked this conversation as resolved.
Show resolved Hide resolved
pattern: /[\s\S]+/,
Expand All @@ -14,7 +14,7 @@
},
};

Prism.languages.gradle = Prism.languages.extend("clike", {
Prism.languages.gradle = Prism.languages.extend('clike', {
string: {
RunDevelopment marked this conversation as resolved.
Show resolved Hide resolved
pattern: /'''(?:[^\\]|\\[\s\S])*?'''|'(?:\\.|[^\\'\r\n])*'/,
greedy: true,
Expand All @@ -30,13 +30,13 @@
punctuation: /\.+|[{}[\];(),:$]/,
});

Prism.languages.insertBefore("gradle", "string", {
Prism.languages.insertBefore('gradle', 'string', {
shebang: {
pattern: /#!.+/,
alias: "comment",
alias: 'comment',
greedy: true,
},
"interpolation-string": {
'interpolation-string': {
pattern:
/"""(?:[^\\]|\\[\s\S])*?"""|(["/])(?:\\.|(?!\1)[^\\\r\n])*\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/,
greedy: true,
Expand All @@ -47,17 +47,17 @@
},
});

Prism.languages.insertBefore("gradle", "punctuation", {
"spock-block": /\b(?:and|cleanup|expect|given|setup|then|when|where):/,
Prism.languages.insertBefore('gradle', 'punctuation', {
'spock-block': /\b(?:and|cleanup|expect|given|setup|then|when|where):/,
});

Prism.languages.insertBefore("gradle", "function", {
Prism.languages.insertBefore('gradle', 'function', {
annotation: {
pattern: /(^|[^.])@\w+/,
lookbehind: true,
alias: "punctuation",
alias: 'punctuation',
},
});

interpolation.inside.expression.inside = Prism.languages.gradle;
})(Prism);
}(Prism));