diff --git a/CHANGES.md b/CHANGES.md index b66ef69a0f..0ed7d3229a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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) add missing `enum`, `export` and `given` keywords [Nicolas Stucki][] [Austin Schick]: https://github.com/austin-schick [Josh Goebel]: https://github.com/joshgoebel diff --git a/src/languages/scala.js b/src/languages/scala.js index e9917c5619..6d8152e251 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 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' + 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 export enum given' }, contains: [ hljs.C_LINE_COMMENT_MODE, diff --git a/test/markup/scala/enum.expect.txt b/test/markup/scala/enum.expect.txt new file mode 100644 index 0000000000..1e95396f8e --- /dev/null +++ b/test/markup/scala/enum.expect.txt @@ -0,0 +1,6 @@ +enum Color: + case Red, Green, Blue + +enum State: + case On + case Off diff --git a/test/markup/scala/enum.txt b/test/markup/scala/enum.txt new file mode 100644 index 0000000000..24a17922ca --- /dev/null +++ b/test/markup/scala/enum.txt @@ -0,0 +1,6 @@ +enum Color: + case Red, Green, Blue + +enum State: + case On + case Off diff --git a/test/markup/scala/export.expect.txt b/test/markup/scala/export.expect.txt new file mode 100644 index 0000000000..8621c31270 --- /dev/null +++ b/test/markup/scala/export.expect.txt @@ -0,0 +1,2 @@ +export scanUnit.scan +export printUnit.{status => _, *} diff --git a/test/markup/scala/export.txt b/test/markup/scala/export.txt new file mode 100644 index 0000000000..7716ecead0 --- /dev/null +++ b/test/markup/scala/export.txt @@ -0,0 +1,2 @@ +export scanUnit.scan +export printUnit.{status => _, *} diff --git a/test/markup/scala/given.expect.txt b/test/markup/scala/given.expect.txt new file mode 100644 index 0000000000..81cef461ea --- /dev/null +++ b/test/markup/scala/given.expect.txt @@ -0,0 +1,2 @@ +given T = ??? +given x: T = ??? diff --git a/test/markup/scala/given.txt b/test/markup/scala/given.txt new file mode 100644 index 0000000000..c8b27a1b5d --- /dev/null +++ b/test/markup/scala/given.txt @@ -0,0 +1,2 @@ +given T = ??? +given x: T = ???