2023-10-12 08:17:48 +02:00
/*! `scala` grammar compiled for Highlight.js 11.9.0 */
2021-10-18 07:02:03 +02:00
( ( ) => { var e = ( ( ) => { "use strict" ; return e => { const n = e . regex , a = { className : "subst" ,
variants : [ { begin : "\\$[A-Za-z0-9_]+" } , { begin : /\$\{/ , end : /\}/ } ] } , s = {
className : "string" , variants : [ { begin : '"""' , end : '"""' } , { begin : '"' , end : '"' ,
illegal : "\\n" , contains : [ e . BACKSLASH _ESCAPE ] } , { begin : '[a-z]+"' , end : '"' ,
illegal : "\\n" , contains : [ e . BACKSLASH _ESCAPE , a ] } , { className : "string" ,
begin : '[a-z]+"""' , end : '"""' , contains : [ a ] , relevance : 10 } ] } , i = { className : "type" ,
begin : "\\b[A-Z][A-Za-z0-9_]*" , relevance : 0 } , t = { className : "title" ,
begin : /[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/ ,
2023-10-12 08:17:48 +02:00
relevance : 0 } , c = { className : "class" , beginKeywords : "class object trait type" ,
2021-10-18 07:02:03 +02:00
end : /[:={\[\n;]/ , excludeEnd : ! 0 ,
contains : [ e . C _LINE _COMMENT _MODE , e . C _BLOCK _COMMENT _MODE , {
beginKeywords : "extends with" , relevance : 10 } , { begin : /\[/ , end : /\]/ , excludeBegin : ! 0 ,
2023-10-12 08:17:48 +02:00
excludeEnd : ! 0 , relevance : 0 ,
contains : [ i , e . C _LINE _COMMENT _MODE , e . C _BLOCK _COMMENT _MODE ] } , { className : "params" ,
begin : /\(/ , end : /\)/ , excludeBegin : ! 0 , excludeEnd : ! 0 , relevance : 0 ,
contains : [ i , e . C _LINE _COMMENT _MODE , e . C _BLOCK _COMMENT _MODE ] } , t ] } , r = {
2021-10-18 07:02:03 +02:00
className : "function" , beginKeywords : "def" , end : n . lookahead ( /[:={\[(\n;]/ ) ,
contains : [ t ] } ; return { name : "Scala" , keywords : { literal : "true false null" ,
2022-07-15 06:10:25 +02:00
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 transparent"
2023-10-12 08:17:48 +02:00
} , contains : [ { begin : [ "//>" , /\s+/ , /using/ , /\s+/ , /\S+/ ] , beginScope : { 1 : "comment" ,
3 : "keyword" , 5 : "type" } , end : /$/ , contains : [ { className : "string" , begin : /\S+/ } ]
} , e . C _LINE _COMMENT _MODE , e . C _BLOCK _COMMENT _MODE , s , i , r , c , e . C _NUMBER _MODE , {
2022-07-15 06:10:25 +02:00
begin : [ /^\s*/ , "extension" , /\s+(?=[[(])/ ] , beginScope : { 2 : "keyword" } } , {
2021-10-18 07:02:03 +02:00
begin : [ /^\s*/ , /end/ , /\s+/ , /(extension\b)?/ ] , beginScope : { 2 : "keyword" , 4 : "keyword" }
2022-07-15 06:10:25 +02:00
} , { match : /\.inline\b/ } , { begin : /\binline(?=\s)/ , keywords : "inline" } , {
2021-10-18 07:02:03 +02:00
begin : [ /\(\s*/ , /using/ , /\s+(?!\))/ ] , beginScope : { 2 : "keyword" } } , { className : "meta" ,
begin : "@[A-Za-z]+" } ] } } } ) ( ) ; hljs . registerLanguage ( "scala" , e ) } ) ( ) ;