-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d0b74b
commit 23cd9b6
Showing
15 changed files
with
502 additions
and
2 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// https://www.gap-system.org/Manuals/doc/ref/chap4.html | ||
// https://www.gap-system.org/Manuals/doc/ref/chap27.html | ||
|
||
Prism.languages.gap = { | ||
'shell': { | ||
pattern: /^gap>[\s\S]*?(?=^gap>|$(?![\s\S]))/m, | ||
greedy: true, | ||
inside: { | ||
'gap': { | ||
pattern: /^(gap>).+(?:(?:\r(?:\n|(?!\n))|\n)>.*)*/, | ||
lookbehind: true, | ||
inside: null // see below | ||
}, | ||
'punctuation': /^gap>/ | ||
} | ||
}, | ||
|
||
'comment': { | ||
pattern: /#.*/, | ||
greedy: true | ||
}, | ||
'string': { | ||
pattern: /(^|[^\\'"])(?:'(?:[^\r\n\\']|\\.){1,10}'|"(?:[^\r\n\\"]|\\.)*"(?!")|"""[\s\S]*?""")/, | ||
lookbehind: true, | ||
greedy: true, | ||
inside: { | ||
'continuation': { | ||
pattern: /([\r\n])>/, | ||
lookbehind: true, | ||
alias: 'punctuation' | ||
} | ||
} | ||
}, | ||
|
||
'keyword': /\b(?:Assert|Info|IsBound|QUIT|TryNextMethod|Unbind|and|atomic|break|continue|do|elif|else|end|fi|for|function|if|in|local|mod|not|od|or|quit|readonly|readwrite|rec|repeat|return|then|until|while)\b/, | ||
'boolean': /\b(?:false|true)\b/, | ||
|
||
'function': /\b[a-z_]\w*(?=\s*\()/i, | ||
|
||
'number': { | ||
pattern: /(^|[^\w.]|\.\.)(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?:_[a-z]?)?(?=$|[^\w.]|\.\.)/, | ||
lookbehind: true | ||
}, | ||
|
||
'continuation': { | ||
pattern: /([\r\n])>/, | ||
lookbehind: true, | ||
alias: 'punctuation' | ||
}, | ||
'operator': /->|[-+*/^~=!]|<>|[<>]=?|:=|\.\./, | ||
'punctuation': /[()[\]{},;.:]/ | ||
}; | ||
|
||
Prism.languages.gap.shell.inside.gap.inside = Prism.languages.gap; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<h2>Full example</h2> | ||
<pre><code># Source: https://www.gap-system.org/Manuals/doc/ref/chap4.html#X815F71EA7BC0EB6F | ||
gap> fib := function ( n ) | ||
> local f1, f2, f3, i; | ||
> f1 := 1; f2 := 1; | ||
> for i in [3..n] do | ||
> f3 := f1 + f2; | ||
> f1 := f2; | ||
> f2 := f3; | ||
> od; | ||
> return f2; | ||
> end;; | ||
gap> List( [1..10], fib ); | ||
[ 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 ] | ||
</code></pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
false | ||
true | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["boolean", "false"], | ||
["boolean", "true"] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# comment | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["comment", "# comment"] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
Assert; | ||
Info; | ||
IsBound; | ||
QUIT; | ||
TryNextMethod; | ||
Unbind; | ||
and; | ||
atomic; | ||
break; | ||
continue; | ||
do; | ||
elif; | ||
else; | ||
end; | ||
fi; | ||
for; | ||
function; | ||
if; | ||
in; | ||
local; | ||
mod; | ||
not; | ||
od; | ||
or; | ||
quit; | ||
readonly; | ||
readwrite; | ||
rec; | ||
repeat; | ||
return; | ||
then; | ||
until; | ||
while; | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["keyword", "Assert"], ["punctuation", ";"], | ||
["keyword", "Info"], ["punctuation", ";"], | ||
["keyword", "IsBound"], ["punctuation", ";"], | ||
["keyword", "QUIT"], ["punctuation", ";"], | ||
["keyword", "TryNextMethod"], ["punctuation", ";"], | ||
["keyword", "Unbind"], ["punctuation", ";"], | ||
["keyword", "and"], ["punctuation", ";"], | ||
["keyword", "atomic"], ["punctuation", ";"], | ||
["keyword", "break"], ["punctuation", ";"], | ||
["keyword", "continue"], ["punctuation", ";"], | ||
["keyword", "do"], ["punctuation", ";"], | ||
["keyword", "elif"], ["punctuation", ";"], | ||
["keyword", "else"], ["punctuation", ";"], | ||
["keyword", "end"], ["punctuation", ";"], | ||
["keyword", "fi"], ["punctuation", ";"], | ||
["keyword", "for"], ["punctuation", ";"], | ||
["keyword", "function"], ["punctuation", ";"], | ||
["keyword", "if"], ["punctuation", ";"], | ||
["keyword", "in"], ["punctuation", ";"], | ||
["keyword", "local"], ["punctuation", ";"], | ||
["keyword", "mod"], ["punctuation", ";"], | ||
["keyword", "not"], ["punctuation", ";"], | ||
["keyword", "od"], ["punctuation", ";"], | ||
["keyword", "or"], ["punctuation", ";"], | ||
["keyword", "quit"], ["punctuation", ";"], | ||
["keyword", "readonly"], ["punctuation", ";"], | ||
["keyword", "readwrite"], ["punctuation", ";"], | ||
["keyword", "rec"], ["punctuation", ";"], | ||
["keyword", "repeat"], ["punctuation", ";"], | ||
["keyword", "return"], ["punctuation", ";"], | ||
["keyword", "then"], ["punctuation", ";"], | ||
["keyword", "until"], ["punctuation", ";"], | ||
["keyword", "while"], ["punctuation", ";"] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
0 | ||
123134523423423412345132123123432744839127384723987497 | ||
+123123 | ||
-245435 | ||
|
||
66/123 | ||
66/-123 | ||
|
||
3.14 | ||
6.62606896e-34 | ||
.1 | ||
.1e1 | ||
-.999 | ||
1._ | ||
1._l | ||
|
||
[1..100] | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["number", "0"], | ||
["number", "123134523423423412345132123123432744839127384723987497"], | ||
["operator", "+"], ["number", "123123"], | ||
["operator", "-"], ["number", "245435"], | ||
|
||
["number", "66"], ["operator", "/"], ["number", "123"], | ||
["number", "66"], ["operator", "/"], ["operator", "-"], ["number", "123"], | ||
|
||
["number", "3.14"], | ||
["number", "6.62606896e-34"], | ||
["number", ".1"], | ||
["number", ".1e1"], | ||
["operator", "-"], ["number", ".999"], | ||
["number", "1._"], | ||
["number", "1._l"], | ||
|
||
["punctuation", "["], | ||
["number", "1"], | ||
["operator", ".."], | ||
["number", "100"], | ||
["punctuation", "]"] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
+ - * / ^ ~ | ||
= <> < > <= >= | ||
:= .. -> | ||
|
||
!. ![ !{ | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["operator", "+"], | ||
["operator", "-"], | ||
["operator", "*"], | ||
["operator", "/"], | ||
["operator", "^"], | ||
["operator", "~"], | ||
|
||
["operator", "="], | ||
["operator", "<>"], | ||
["operator", "<"], | ||
["operator", ">"], | ||
["operator", "<="], | ||
["operator", ">="], | ||
|
||
["operator", ":="], | ||
["operator", ".."], | ||
["operator", "->"], | ||
|
||
["operator", "!"], | ||
["punctuation", "."], | ||
["operator", "!"], | ||
["punctuation", "["], | ||
["operator", "!"], | ||
["punctuation", "{"] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
( ) [ ] { } | ||
, ; . : | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["punctuation", "("], | ||
["punctuation", ")"], | ||
["punctuation", "["], | ||
["punctuation", "]"], | ||
["punctuation", "{"], | ||
["punctuation", "}"], | ||
|
||
["punctuation", ","], | ||
["punctuation", ";"], | ||
["punctuation", "."], | ||
["punctuation", ":"] | ||
] |
Oops, something went wrong.