Loki: Update syntax highlighting to colorize strings (#45962)

* Loki: Update syntax highlighting to colorize strings

* Updated patterns
This commit is contained in:
Torkel Ödegaard 2022-03-02 13:43:56 +01:00 committed by GitHub
parent aeec087065
commit a53f169350
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -239,9 +239,19 @@ export const lokiGrammar: Grammar = {
},
},
],
quote: {
pattern: /"(?:\\.|[^\\"])*"/,
alias: 'string',
greedy: true,
},
backticks: {
pattern: /`(?:\\.|[^\\`])*`/,
alias: 'string',
greedy: true,
},
number: /\b-?\d+((\.\d*)?([eE][+-]?\d+)?)?\b/,
operator: /\s?(\|[=~]?|!=?|<(?:=>?|<|>)?|>[>=]?)\s?/i,
punctuation: /[{}()`,.]/,
punctuation: /[{}(),.]/,
};
export default lokiGrammar;