diff --git a/CHANGES.md b/CHANGES.md index 20a40eea22..15e42eff7f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 [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 diff --git a/src/languages/scala.js b/src/languages/scala.js index 69aa988a24..e9917c5619 100644 --- a/src/languages/scala.js +++ b/src/languages/scala.js @@ -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, diff --git a/test/markup/scala/for-do.expect.txt b/test/markup/scala/for-do.expect.txt new file mode 100644 index 0000000000..6df2d3e0fb --- /dev/null +++ b/test/markup/scala/for-do.expect.txt @@ -0,0 +1 @@ +def f = for x <- Nil do println("hello") diff --git a/test/markup/scala/for-do.txt b/test/markup/scala/for-do.txt new file mode 100644 index 0000000000..8d72cfa663 --- /dev/null +++ b/test/markup/scala/for-do.txt @@ -0,0 +1 @@ +def f = for x <- Nil do println("hello") diff --git a/test/markup/scala/if-then-else.expect.txt b/test/markup/scala/if-then-else.expect.txt new file mode 100644 index 0000000000..4e01ad73df --- /dev/null +++ b/test/markup/scala/if-then-else.expect.txt @@ -0,0 +1 @@ +def f = if true then 1 else 2 diff --git a/test/markup/scala/if-then-else.txt b/test/markup/scala/if-then-else.txt new file mode 100644 index 0000000000..b142c6011d --- /dev/null +++ b/test/markup/scala/if-then-else.txt @@ -0,0 +1 @@ +def f = if true then 1 else 2 diff --git a/test/markup/scala/while-do.expect.txt b/test/markup/scala/while-do.expect.txt new file mode 100644 index 0000000000..d5291cc1ba --- /dev/null +++ b/test/markup/scala/while-do.expect.txt @@ -0,0 +1 @@ +def f = while true do println("hello") diff --git a/test/markup/scala/while-do.txt b/test/markup/scala/while-do.txt new file mode 100644 index 0000000000..d7874aa2af --- /dev/null +++ b/test/markup/scala/while-do.txt @@ -0,0 +1 @@ +def f = while true do println("hello")