Skip to content

Commit

Permalink
(scala) remove symbol syntax and fix quoted code syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasstucki committed Sep 4, 2021
1 parent 3cc0800 commit 72dcb8c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -16,6 +16,7 @@ Grammars:
- enh(css/less/stylus/scss) add support for CSS Grid properties [monochromer][]
- enh(java) add support for Java Text Block (#3322) [Teletha][]
- enh(scala) add missing `do` and `then` keyword (#3323) [Nicolas Stucki][]
- enh(scala) remove symbol syntax and fix quoted code syntax (#3324) [Nicolas Stucki][]

[Austin Schick]: https://github.com/austin-schick
[Josh Goebel]: https://github.com/joshgoebel
Expand Down
6 changes: 0 additions & 6 deletions src/languages/scala.js
Expand Up @@ -59,11 +59,6 @@ export default function(hljs) {

};

const SYMBOL = {
className: 'symbol',
begin: '\'\\w[\\w\\d_]*(?!\')'
};

const TYPE = {
className: 'type',
begin: '\\b[A-Z][A-Za-z0-9_]*',
Expand Down Expand Up @@ -127,7 +122,6 @@ export default function(hljs) {
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
STRING,
SYMBOL,
TYPE,
METHOD,
CLASS,
Expand Down
1 change: 1 addition & 0 deletions test/markup/scala/quoted-code.expect.txt
@@ -0,0 +1 @@
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">f</span></span>(using <span class="hljs-type">Quotes</span>) = &#x27;{ <span class="hljs-keyword">val</span> x = <span class="hljs-number">1</span>; ${g(&#x27;x)} }
1 change: 1 addition & 0 deletions test/markup/scala/quoted-code.txt
@@ -0,0 +1 @@
def f(using Quotes) = '{ val x = 1; ${g('x)} }
5 changes: 5 additions & 0 deletions test/markup/scala/symbol.expect.txt
@@ -0,0 +1,5 @@
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">f</span></span>(s: <span class="hljs-type">Symbol</span>) = {
s <span class="hljs-keyword">match</span> {
<span class="hljs-keyword">case</span> &#x27;foo =&gt;
}
}
5 changes: 5 additions & 0 deletions test/markup/scala/symbol.txt
@@ -0,0 +1,5 @@
def f(s: Symbol) = {
s match {
case 'foo =>
}
}

0 comments on commit 72dcb8c

Please sign in to comment.