Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ea8a0f4

Browse filesBrowse files
Added support for AWK (#3374)
1 parent 7bda2bf commit ea8a0f4
Copy full SHA for ea8a0f4
Expand file treeCollapse file tree

18 files changed

+244
-3
lines changed
Open diff view settings
Collapse file

‎components.js‎

Copy file name to clipboardExpand all lines: components.js
+1-1Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎components.json‎

Copy file name to clipboardExpand all lines: components.json
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,14 @@
175175
"alias": "avdl",
176176
"owner": "RunDevelopment"
177177
},
178+
"awk": {
179+
"title": "AWK",
180+
"alias": "gawk",
181+
"aliasTitles": {
182+
"gawk": "GAWK"
183+
},
184+
"owner": "RunDevelopment"
185+
},
178186
"bash": {
179187
"title": "Bash",
180188
"alias": "shell",
Collapse file

‎components/prism-awk.js‎

Copy file name to clipboard
+32Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Prism.languages.awk = {
2+
'hashbang': {
3+
pattern: /^#!.*/,
4+
greedy: true,
5+
alias: 'comment'
6+
},
7+
'comment': {
8+
pattern: /#.*/,
9+
greedy: true
10+
},
11+
'string': {
12+
pattern: /(^|[^\\])"(?:[^\\"\r\n]|\\.)*"/,
13+
lookbehind: true,
14+
greedy: true
15+
},
16+
'regex': {
17+
pattern: /((?:^|[^\w\s)])\s*)\/(?:[^\/\\\r\n]|\\.)*\//,
18+
lookbehind: true,
19+
greedy: true
20+
},
21+
22+
'variable': /\$\w+/,
23+
'keyword': /\b(?:BEGIN|BEGINFILE|END|ENDFILE|break|case|continue|default|delete|do|else|exit|for|function|getline|if|in|next|nextfile|printf?|return|switch|while)\b|@(?:include|load)\b/,
24+
25+
'function': /\b[a-z_]\w*(?=\s*\()/i,
26+
'number': /\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0x[a-fA-F0-9]+)\b/,
27+
28+
'operator': /--|\+\+|!?~|>&|>>|<<|(?:\*\*|[<>!=+\-*/%^])=?|&&|\|[|&]|[?:]/,
29+
'punctuation': /[()[\]{},;]/
30+
};
31+
32+
Prism.languages.gawk = Prism.languages.awk;
Collapse file

‎components/prism-awk.min.js‎

Copy file name to clipboardExpand all lines: components/prism-awk.min.js
+1Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎examples/prism-awk.html‎

Copy file name to clipboard
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<h2>Full example</h2>
2+
<pre><code># Source: awklang.org
3+
BEGIN { ascetion = bsection = 0 }
4+
$2 ~ /^[aA][0-9]+/ { asection++ }
5+
$2 ~ /^[bB][0-9]+/ { bsection++ }
6+
END { print asection, bsection }
7+
</code></pre>
Collapse file

‎plugins/autoloader/prism-autoloader.js‎

Copy file name to clipboardExpand all lines: plugins/autoloader/prism-autoloader.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@
179179
"adoc": "asciidoc",
180180
"avs": "avisynth",
181181
"avdl": "avro-idl",
182+
"gawk": "awk",
182183
"shell": "bash",
183184
"shortcode": "bbcode",
184185
"rbnf": "bnf",
Collapse file

‎plugins/autoloader/prism-autoloader.min.js‎

Copy file name to clipboardExpand all lines: plugins/autoloader/prism-autoloader.min.js
+1-1Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎plugins/show-language/prism-show-language.js‎

Copy file name to clipboardExpand all lines: plugins/show-language/prism-show-language.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
"avs": "AviSynth",
5050
"avro-idl": "Avro IDL",
5151
"avdl": "Avro IDL",
52+
"awk": "AWK",
53+
"gawk": "GAWK",
5254
"basic": "BASIC",
5355
"bbcode": "BBcode",
5456
"bnf": "BNF",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.