CS-Notes/docs/_style/prism-master/components/prism-scala.js

19 lines
760 B
Java
Raw Normal View History

2018-12-19 14:09:39 +08:00
Prism.languages.scala = Prism.languages.extend('java', {
'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/,
'string': [
{
pattern: /"""[\s\S]*?"""/,
greedy: true
},
{
pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
greedy: true
}
],
'builtin': /\b(?:String|Int|Long|Short|Byte|Boolean|Double|Float|Char|Any|AnyRef|AnyVal|Unit|Nothing)\b/,
'number': /\b0x[\da-f]*\.?[\da-f]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e\d+)?[dfl]?/i,
'symbol': /'[^\d\s\\]\w*/
});
delete Prism.languages.scala['class-name'];
delete Prism.languages.scala['function'];