branch: elpa/scala-mode commit a1ff6f38b6d5e3585ade3d466cdd6cc147ba7436 Author: Keith Pinson <keith.pin...@banno.com> Commit: Keith Pinson <keith.pin...@banno.com>
feat: add Scala 3 keywords Based on [the docs](https://dotty.epfl.ch/docs/internals/syntax.html). 1. Scala 3 is not perfectly backwards compatible, but is significantly backwards compatible, with Scala 2. Therefore, it seems reasonable at a syntax level to begin with the assumption that they are sufficiently compatible that we can just start migrating towards the grammar of Scala 3. 2. Scala 3 has reserved more keywords. Arguably it's a benefit, even if you are writing Scala 2 code, to be made aware of the Scala 3 keywords by way of syntax highlighting. That way you have an opportunity to rename your variables before ever upgrading to 3. 3. The lack of highlighting new keywords is probably the most obvious lack of highlighting w.r.t. to the new syntax; i.e., this is a "do 20%, get 80%" scenario. Overall this seems to me like a fairly simple and safe step toward adopting Scala 3 syntax. --- scala-mode-syntax.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scala-mode-syntax.el b/scala-mode-syntax.el index 1817868..6d65008 100644 --- a/scala-mode-syntax.el +++ b/scala-mode-syntax.el @@ -283,11 +283,12 @@ (concat "\\(^\\|[^`'_]\\)\\(" scala-syntax:value-keywords-unsafe-re "\\)")) (defconst scala-syntax:other-keywords-unsafe-re - (regexp-opt '("abstract" "case" "catch" "class" "def" "do" "else" "extends" - "final" "finally" "for" "forSome" "if" "implicit" "import" - "lazy" "match" "new" "object" "override" "package" "private" - "protected" "return" "sealed" "throw" "trait" "try" "type" - "val" "var" "while" "with" "yield" "inline") 'words)) + (regexp-opt '("abstract" "case" "catch" "class" "def" "do" "else" "enum" + "export" "extends" "final" "finally" "for" "given" "forSome" + "if" "implicit" "import" "lazy" "match" "new" "object" + "override" "package" "private" "protected" "return" "sealed" + "then" "throw" "trait" "try" "type" "val" "var" "while" + "with" "yield" "inline") 'words)) (defconst scala-syntax:other-keywords-re (concat "\\(^\\|[^`'_]\\)\\(" scala-syntax:other-keywords-unsafe-re "\\)"))