summaryrefslogtreecommitdiffstats
path: root/public/prism/prism-eiffel.min.js
blob: 18651b9ca20285e52ecd0c9ae47be2dd6337d443 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Prism.languages.eiffel = {
  comment: /--.*/,
  string: [
    { pattern: /"([^[]*)\[[\s\S]*?\]\1"/, greedy: !0 },
    { pattern: /"([^{]*)\{[\s\S]*?\}\1"/, greedy: !0 },
    { pattern: /"(?:%(?:(?!\n)\s)*\n\s*%|%\S|[^%"\r\n])*"/, greedy: !0 },
  ],
  char: /'(?:%.|[^%'\r\n])+'/,
  keyword:
    /\b(?:across|agent|alias|all|and|as|assign|attached|attribute|check|class|convert|create|Current|debug|deferred|detachable|do|else|elseif|end|ensure|expanded|export|external|feature|from|frozen|if|implies|inherit|inspect|invariant|like|local|loop|not|note|obsolete|old|once|or|Precursor|redefine|rename|require|rescue|Result|retry|select|separate|some|then|undefine|until|variant|Void|when|xor)\b/i,
  boolean: /\b(?:False|True)\b/i,
  'class-name': /\b[A-Z][\dA-Z_]*\b/,
  number: [
    /\b0[xcb][\da-f](?:_*[\da-f])*\b/i,
    /(?:\b\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?e[+-]?)?\d(?:_*\d)*\b|\b\d(?:_*\d)*\b\.?/i,
  ],
  punctuation: /:=|<<|>>|\(\||\|\)|->|\.(?=\w)|[{}[\];(),:?]/,
  operator: /\\\\|\|\.\.\||\.\.|\/[~\/=]?|[><]=?|[-+*^=~]/,
};
>+ // <user> ":" ( <path> )? (/[^\s@:$#%*!/\\]+@[^\r\n@:$#%*!/\\]+(?::[^\0-\x1F$#%*?"<>:;|]+)?/ .source + '|' + // <path> // Since the path pattern is quite general, we will require it to start with a special character to // prevent false positives. /[/~.][^\0-\x1F$#%*?"<>@:;|]*/.source) + ')?' + // shell symbol /[$#%](?=\s)/.source + // bash command /(?:[^\\\r\n \t'"<$]|[ \t](?:(?!#)|#.*$)|\\(?:[^\r]|\r\n?)|\$(?!')|<(?!<)|<<str>>)+/.source.replace( /<<str>>/g, function () { return strings; } ), 'm' ), greedy: true, inside: { info: { // foo@bar:~/files$ exit // foo@bar$ exit // ~/files$ exit pattern: /^[^#$%]+/, alias: 'punctuation', inside: { user: /^[^\s@:$#%*!/\\]+@[^\r\n@:$#%*!/\\]+/, punctuation: /:/, path: /[\s\S]+/, }, }, bash: { pattern: /(^[$#%]\s*)\S[\s\S]*/, lookbehind: true, alias: 'language-bash', inside: Prism.languages.bash, }, 'shell-symbol': { pattern: /^[$#%]/, alias: 'important', }, }, }, output: /.(?:.*(?:[\r\n]|.$))*/, }; Prism.languages['sh-session'] = Prism.languages['shellsession'] = Prism.languages['shell-session']; })(Prism);