2023-05-04 06:28:08 +02:00
/*! `kotlin` grammar compiled for Highlight.js 11.8.0 */
2021-10-18 07:02:03 +02:00
( ( ) => { var e = ( ( ) => { "use strict"
2023-05-04 06:28:08 +02:00
; var e = "[0-9](_*[0-9])*" , n = ` \\ .( ${ e } ) ` , a = "[0-9a-fA-F](_*[0-9a-fA-F])*" , i = {
2021-06-08 07:40:19 +02:00
className : "number" , variants : [ {
2023-05-04 06:28:08 +02:00
begin : ` ( \\ b( ${ e } )(( ${ n } )| \\ .)?|( ${ n } ))[eE][+-]?( ${ e } )[fFdD]? \\ b ` } , {
begin : ` \\ b( ${ e } )(( ${ n } )[fFdD]? \\ b| \\ .([fFdD] \\ b)?) ` } , { begin : ` ( ${ n } )[fFdD]? \\ b `
} , { begin : ` \\ b( ${ e } )[fFdD] \\ b ` } , {
begin : ` \\ b0[xX](( ${ a } ) \\ .?|( ${ a } )? \\ .( ${ a } ))[pP][+-]?( ${ e } )[fFdD]? \\ b ` } , {
begin : "\\b(0|[1-9](_*[0-9])*)[lL]?\\b" } , { begin : ` \\ b0[xX]( ${ a } )[lL]? \\ b ` } , {
2021-06-08 07:40:19 +02:00
begin : "\\b0(_*[0-7])*[lL]?\\b" } , { begin : "\\b0[bB][01](_*[01])*[lL]?\\b" } ] ,
relevance : 0 } ; return e => { const n = {
keyword : "abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual" ,
built _in : "Byte Short Char Int Long Boolean Float Double Void Unit Nothing" ,
2023-05-04 06:28:08 +02:00
literal : "true false null" } , a = { className : "symbol" , begin : e . UNDERSCORE _IDENT _RE + "@"
2021-06-08 07:40:19 +02:00
} , s = { className : "subst" , begin : /\$\{/ , end : /\}/ , contains : [ e . C _NUMBER _MODE ] } , t = {
className : "variable" , begin : "\\$" + e . UNDERSCORE _IDENT _RE } , r = { className : "string" ,
variants : [ { begin : '"""' , end : '"""(?=[^"])' , contains : [ t , s ] } , { begin : "'" , end : "'" ,
illegal : /\n/ , contains : [ e . BACKSLASH _ESCAPE ] } , { begin : '"' , end : '"' , illegal : /\n/ ,
contains : [ e . BACKSLASH _ESCAPE , t , s ] } ] } ; s . contains . push ( r ) ; const l = {
className : "meta" ,
begin : "@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*" + e . UNDERSCORE _IDENT _RE + ")?"
} , c = { className : "meta" , begin : "@" + e . UNDERSCORE _IDENT _RE , contains : [ { begin : /\(/ ,
2022-07-15 06:10:25 +02:00
end : /\)/ , contains : [ e . inherit ( r , { className : "string" } ) , "self" ] } ]
2023-05-04 06:28:08 +02:00
} , o = i , b = e . COMMENT ( "/\\*" , "\\*/" , { contains : [ e . C _BLOCK _COMMENT _MODE ] } ) , E = {
2021-06-08 07:40:19 +02:00
variants : [ { className : "type" , begin : e . UNDERSCORE _IDENT _RE } , { begin : /\(/ , end : /\)/ ,
contains : [ ] } ] } , d = E ; return d . variants [ 1 ] . contains = [ E ] , E . variants [ 1 ] . contains = [ d ] ,
{ name : "Kotlin" , aliases : [ "kt" , "kts" ] , keywords : n ,
contains : [ e . COMMENT ( "/\\*\\*" , "\\*/" , { relevance : 0 , contains : [ { className : "doctag" ,
begin : "@[A-Za-z]+" } ] } ) , e . C _LINE _COMMENT _MODE , b , { className : "keyword" ,
begin : /\b(break|continue|return|this)\b/ , starts : { contains : [ { className : "symbol" ,
2023-05-04 06:28:08 +02:00
begin : /@\w+/ } ] } } , a , l , c , { className : "function" , beginKeywords : "fun" , end : "[(]|$" ,
2021-06-08 07:40:19 +02:00
returnBegin : ! 0 , excludeEnd : ! 0 , keywords : n , relevance : 5 , contains : [ {
begin : e . UNDERSCORE _IDENT _RE + "\\s*\\(" , returnBegin : ! 0 , relevance : 0 ,
contains : [ e . UNDERSCORE _TITLE _MODE ] } , { className : "type" , begin : /</ , end : />/ ,
keywords : "reified" , relevance : 0 } , { className : "params" , begin : /\(/ , end : /\)/ ,
endsParent : ! 0 , keywords : n , relevance : 0 , contains : [ { begin : /:/ , end : /[=,\/]/ ,
endsWithParent : ! 0 , contains : [ E , e . C _LINE _COMMENT _MODE , b ] , relevance : 0
2022-07-15 06:10:25 +02:00
} , e . C _LINE _COMMENT _MODE , b , l , c , r , e . C _NUMBER _MODE ] } , b ] } , {
begin : [ /class|interface|trait/ , /\s+/ , e . UNDERSCORE _IDENT _RE ] , beginScope : {
3 : "title.class" } , keywords : "class interface trait" , end : /[:\{(]|$/ , excludeEnd : ! 0 ,
2021-06-08 07:40:19 +02:00
illegal : "extends implements" , contains : [ {
beginKeywords : "public protected internal private constructor"
} , e . UNDERSCORE _TITLE _MODE , { className : "type" , begin : /</ , end : />/ , excludeBegin : ! 0 ,
2022-07-15 06:10:25 +02:00
excludeEnd : ! 0 , relevance : 0 } , { className : "type" , begin : /[,:]\s*/ , end : /[<\(,){\s]|$/ ,
2021-06-08 07:40:19 +02:00
excludeBegin : ! 0 , returnEnd : ! 0 } , l , c ] } , r , { className : "meta" , begin : "^#!/usr/bin/env" ,
2021-10-18 07:02:03 +02:00
end : "$" , illegal : "\n" } , o ] } } } ) ( ) ; hljs . registerLanguage ( "kotlin" , e ) } ) ( ) ;