Prism.languages.groovy = Prism.languages.extend('clike', {
string: [
{
// https://groovy-lang.org/syntax.html#_dollar_slashy_string
pattern:
/("""|''')(?:[^\\]|\\[\s\S])*?\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/,
greedy: true,
},
{
// TODO: Slash strings (e.g. /foo/) can contain line breaks but this will cause a lot of trouble with
// simple division (see JS regex), so find a fix maybe?
pattern: /(["'/])(?:\\.|(?!\1)[^\\\r\n])*\1/,
greedy: