main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
1.6 KB
|
Rev | Line | |
---|
[d24f17c] | 1 | 'use strict'
|
---|
| 2 |
|
---|
| 3 | module.exports = gap
|
---|
| 4 | gap.displayName = 'gap'
|
---|
| 5 | gap.aliases = []
|
---|
| 6 | function gap(Prism) {
|
---|
| 7 | // https://www.gap-system.org/Manuals/doc/ref/chap4.html
|
---|
| 8 | // https://www.gap-system.org/Manuals/doc/ref/chap27.html
|
---|
| 9 | Prism.languages.gap = {
|
---|
| 10 | shell: {
|
---|
| 11 | pattern: /^gap>[\s\S]*?(?=^gap>|$(?![\s\S]))/m,
|
---|
| 12 | greedy: true,
|
---|
| 13 | inside: {
|
---|
| 14 | gap: {
|
---|
| 15 | pattern: /^(gap>).+(?:(?:\r(?:\n|(?!\n))|\n)>.*)*/,
|
---|
| 16 | lookbehind: true,
|
---|
| 17 | inside: null // see below
|
---|
| 18 | },
|
---|
| 19 | punctuation: /^gap>/
|
---|
| 20 | }
|
---|
| 21 | },
|
---|
| 22 | comment: {
|
---|
| 23 | pattern: /#.*/,
|
---|
| 24 | greedy: true
|
---|
| 25 | },
|
---|
| 26 | string: {
|
---|
| 27 | pattern:
|
---|
| 28 | /(^|[^\\'"])(?:'(?:[^\r\n\\']|\\.){1,10}'|"(?:[^\r\n\\"]|\\.)*"(?!")|"""[\s\S]*?""")/,
|
---|
| 29 | lookbehind: true,
|
---|
| 30 | greedy: true,
|
---|
| 31 | inside: {
|
---|
| 32 | continuation: {
|
---|
| 33 | pattern: /([\r\n])>/,
|
---|
| 34 | lookbehind: true,
|
---|
| 35 | alias: 'punctuation'
|
---|
| 36 | }
|
---|
| 37 | }
|
---|
| 38 | },
|
---|
| 39 | keyword:
|
---|
| 40 | /\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/,
|
---|
| 41 | boolean: /\b(?:false|true)\b/,
|
---|
| 42 | function: /\b[a-z_]\w*(?=\s*\()/i,
|
---|
| 43 | number: {
|
---|
| 44 | pattern:
|
---|
| 45 | /(^|[^\w.]|\.\.)(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?:_[a-z]?)?(?=$|[^\w.]|\.\.)/,
|
---|
| 46 | lookbehind: true
|
---|
| 47 | },
|
---|
| 48 | continuation: {
|
---|
| 49 | pattern: /([\r\n])>/,
|
---|
| 50 | lookbehind: true,
|
---|
| 51 | alias: 'punctuation'
|
---|
| 52 | },
|
---|
| 53 | operator: /->|[-+*/^~=!]|<>|[<>]=?|:=|\.\./,
|
---|
| 54 | punctuation: /[()[\]{},;.:]/
|
---|
| 55 | }
|
---|
| 56 | Prism.languages.gap.shell.inside.gap.inside = Prism.languages.gap
|
---|
| 57 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.