summaryrefslogtreecommitdiffstats
path: root/public/prism/prism-scala.js
blob: 2cb037e9f4d30d1dd0b1b91ec5b83bed38425af7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Prism.languages.scala = Prism.languages.extend('java', {
  'triple-quoted-string': {
    pattern: /"""[\s\S]*?"""/,
    greedy: true,
    alias: 'string',
  },
  string: {
    pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
    greedy: true,
  },
  keyword:
    /<-|=>|\b(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|null|object|override|package|private|protected|return|sealed|self|super|this|throw|trait|try|type|val|var|while|with|yield)\b/,
  number:
    /\b0x(?:[\da-f]*\.)?[\da-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e\d+)?[dfl]?/i,
  builtin:
    /\b(?:Any|AnyRef|AnyVal|Boolean|Byte|Char|Double|Float|Int|Long|Nothing|Short|String|Unit)\b/,
  symbol: /'[^\d\s\\]\w*/,
});
delete Prism.languages.scala['class-name'];
delete Prism.languages.scala['function'];
/^.*\$ git .*$/m, inside: { /* * A git command can contain a parameter starting by a single or a double dash followed by a string * For instance: * $ git diff --cached * $ git log -p */ parameter: /\s--?\w+/, }, }, /* * Coordinates displayed in a git diff command * For instance: * $ git diff * diff --git file.txt file.txt * index 6214953..1d54a52 100644 * --- file.txt * +++ file.txt * @@ -1 +1,2 @@ * -Here's my tetx file * +Here's my text file * +And this is the second line */ coord: /^@@.*@@$/m, /* * Match a "commit [SHA1]" line in a git log output. * For instance: * $ git log * commit a11a14ef7e26f2ca62d4b35eac455ce636d0dc09 * Author: lgiraudel * Date: Mon Feb 17 11:18:34 2014 +0100 * * Add of a new line */ 'commit-sha1': /^commit \w{40}$/m, };