From daf2597a68cda641af3c66b751ff20babbfb97a3 Mon Sep 17 00:00:00 2001 From: Golmote Date: Mon, 31 Aug 2015 08:27:53 +0200 Subject: [PATCH] Scala: Simplified patterns --- components/prism-scala.js | 10 +++++----- components/prism-scala.min.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/prism-scala.js b/components/prism-scala.js index 62070a2fb8..8d021b7dbb 100644 --- a/components/prism-scala.js +++ b/components/prism-scala.js @@ -1,9 +1,9 @@ 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/, - 'builtin': /\b(String|Int|Long|Short|Byte|Boolean|Double|Float|Char|Any|AnyRef|AnyVal|Unit|Nothing)\b/, - 'number': /\b0x[\da-f]*\.?[\da-f\-]+\b|\b\d*\.?\d+[e]?[\d]*[dfl]?\b/i, - 'symbol': /'([^\d\s]\w*)/, - 'string': /(""")[\W\w]*?\1|("|\/)[\W\w]*?\2|('.')/ + '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': /"""[\W\w]*?"""|"(?:[^"\\\r\n]|\\.)*"|'(?:[^\\\r\n']|\\.[^\\']*)'/, + 'builtin': /\b(?:String|Int|Long|Short|Byte|Boolean|Double|Float|Char|Any|AnyRef|AnyVal|Unit|Nothing)\b/, + 'number': /\b(?:0x[\da-f]*\.?[\da-f]+|\d*\.?\d+e?\d*[dfl]?)\b/i, + 'symbol': /'[^\d\s\\]\w*/ }); delete Prism.languages.scala['class-name']; delete Prism.languages.scala['function']; diff --git a/components/prism-scala.min.js b/components/prism-scala.min.js index 014c793db5..a8acb0aff8 100644 --- a/components/prism-scala.min.js +++ b/components/prism-scala.min.js @@ -1 +1 @@ -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/,builtin:/\b(String|Int|Long|Short|Byte|Boolean|Double|Float|Char|Any|AnyRef|AnyVal|Unit|Nothing)\b/,number:/\b0x[\da-f]*\.?[\da-f\-]+\b|\b\d*\.?\d+[e]?[\d]*[dfl]?\b/i,symbol:/'([^\d\s]\w*)/,string:/(""")[\W\w]*?\1|("|\/)[\W\w]*?\2|('.')/}),delete Prism.languages.scala["class-name"],delete Prism.languages.scala["function"]; \ No newline at end of file +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:/"""[\W\w]*?"""|"(?:[^"\\\r\n]|\\.)*"|'(?:[^\\\r\n']|\\.[^\\']*)'/,builtin:/\b(?:String|Int|Long|Short|Byte|Boolean|Double|Float|Char|Any|AnyRef|AnyVal|Unit|Nothing)\b/,number:/\b(?:0x[\da-f]*\.?[\da-f]+|\d*\.?\d+e?\d*[dfl]?)\b/i,symbol:/'[^\d\s\\]\w*/}),delete Prism.languages.scala["class-name"],delete Prism.languages.scala["function"]; \ No newline at end of file