mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-02 12:57:32 -06:00
Merge pull request #1788 from rayman22201/nim-monaco-support
Fix some edge cases around bracket tokenization in the Nim syntax definition for monaco. Closes #1781
This commit is contained in:
@@ -48,7 +48,8 @@ function definition() {
|
||||
"using",
|
||||
"var",
|
||||
"when", "while",
|
||||
"yield"
|
||||
"yield",
|
||||
"push", "pop"
|
||||
],
|
||||
operators: [
|
||||
'=', '+', '-', '*', '/', '<', '>',
|
||||
@@ -67,6 +68,16 @@ function definition() {
|
||||
octNumber: /0o[0-7](_?[0-7])*/,
|
||||
binNumber: /0(b|B)[0-1](_?[0-1])*/,
|
||||
exponent: /(e|E)(\+|-)?\d(_?\d)*/,
|
||||
brackets: [
|
||||
['{','}','delimiter.curly'],
|
||||
['{.','.}','delimiter.curly'],
|
||||
['[',']','delimiter.square'],
|
||||
['[:',']','delimiter.square'],
|
||||
['[.','.]','delimiter.square'],
|
||||
['(',')','delimiter.parenthesis'],
|
||||
['(.','.)','delimiter.parenthesis'],
|
||||
['<','>','delimiter.angle']
|
||||
],
|
||||
|
||||
// The main tokenizer for our languages
|
||||
tokenizer: {
|
||||
@@ -79,7 +90,7 @@ function definition() {
|
||||
}
|
||||
}],
|
||||
{include: '@whitespace'},
|
||||
[/([[{(][.:]|\.[\]})]|[[\]{}()])/, '@brackets'],
|
||||
[/([:|[[{(]\.|\.[\]})]|[[\]{}()])/, '@brackets'],
|
||||
[/@symbols/, {
|
||||
cases: {
|
||||
'@operators': 'operator',
|
||||
|
||||
Reference in New Issue
Block a user