Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(scala) Add do and then keywords #3323

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Expand Up @@ -14,11 +14,13 @@ Grammars:
- fix(cpp) fix `xor_eq` keyword highlighting. [Denis Kovalchuk][]
- enh(c,cpp) highlight type modifiers as type (#3316) [Josh Goebel][]
- enh(css/less/stylus/scss) add support for CSS Grid properties [monochromer][]
- enh(scala) add missing `do` and `then` keyword (#3323) [Nicolas Stucki][]

[Austin Schick]: https://github.com/austin-schick
[Josh Goebel]: https://github.com/joshgoebel
[Denis Kovalchuk]: https://github.com/deniskovalchuk
[monochromer]: https://github.com/monochromer
[Nicolas Stucki]: https://github.com/nicolasstucki


## Version 11.2.0
Expand Down
2 changes: 1 addition & 1 deletion src/languages/scala.js
Expand Up @@ -121,7 +121,7 @@ export default function(hljs) {
name: 'Scala',
keywords: {
literal: 'true false null',
keyword: 'type yield lazy override def with val var sealed abstract private trait object if forSome for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit'
keyword: 'type yield lazy override def with val var sealed abstract private trait object if then forSome for while do throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit'
},
contains: [
hljs.C_LINE_COMMENT_MODE,
Expand Down
1 change: 1 addition & 0 deletions test/markup/scala/for-do.expect.txt
@@ -0,0 +1 @@
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">f</span> </span>= <span class="hljs-keyword">for</span> x &lt;- <span class="hljs-type">Nil</span> <span class="hljs-keyword">do</span> println(<span class="hljs-string">&quot;hello&quot;</span>)
1 change: 1 addition & 0 deletions test/markup/scala/for-do.txt
@@ -0,0 +1 @@
def f = for x <- Nil do println("hello")
1 change: 1 addition & 0 deletions test/markup/scala/if-then-else.expect.txt
@@ -0,0 +1 @@
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">f</span> </span>= <span class="hljs-keyword">if</span> <span class="hljs-literal">true</span> <span class="hljs-keyword">then</span> <span class="hljs-number">1</span> <span class="hljs-keyword">else</span> <span class="hljs-number">2</span>
1 change: 1 addition & 0 deletions test/markup/scala/if-then-else.txt
@@ -0,0 +1 @@
def f = if true then 1 else 2
1 change: 1 addition & 0 deletions test/markup/scala/while-do.expect.txt
@@ -0,0 +1 @@
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">f</span> </span>= <span class="hljs-keyword">while</span> <span class="hljs-literal">true</span> <span class="hljs-keyword">do</span> println(<span class="hljs-string">&quot;hello&quot;</span>)
1 change: 1 addition & 0 deletions test/markup/scala/while-do.txt
@@ -0,0 +1 @@
def f = while true do println("hello")