mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 17:25:39 +01:00
This commit is contained in:
parent
9961f06110
commit
ad77f86a8c
2 changed files with 31 additions and 5 deletions
|
|
@ -279,4 +279,13 @@ testTokenization('shell', [
|
||||||
{ startIndex: 4, type: 'string.heredoc.shell' }
|
{ startIndex: 4, type: 'string.heredoc.shell' }
|
||||||
]
|
]
|
||||||
}],
|
}],
|
||||||
|
|
||||||
|
[{
|
||||||
|
line: 'echo $( echo "hi" )',
|
||||||
|
tokens: [
|
||||||
|
{ startIndex: 0, type: 'type.identifier.shell' },
|
||||||
|
{ startIndex: 4, type: 'white.shell' },
|
||||||
|
{ startIndex: 5, type: 'variable.shell' }
|
||||||
|
]
|
||||||
|
}],
|
||||||
])
|
])
|
||||||
|
|
|
||||||
|
|
@ -201,13 +201,30 @@ export const language = <ILanguage>{
|
||||||
[/\$\d+/, 'variable.predefined'],
|
[/\$\d+/, 'variable.predefined'],
|
||||||
[/\$\w+/, 'variable'],
|
[/\$\w+/, 'variable'],
|
||||||
[/\$[*@#?\-$!0_]/, 'variable'],
|
[/\$[*@#?\-$!0_]/, 'variable'],
|
||||||
[/\$['"{(]/, 'variable', '@parameterBody']
|
[/\$'/, 'variable', '@parameterBodyQuote'],
|
||||||
|
[/\$"/, 'variable', '@parameterBodyDoubleQuote'],
|
||||||
|
[/\$\(/, 'variable', '@parameterBodyParen'],
|
||||||
|
[/\$\{/, 'variable', '@parameterBodyCurlyBrace'],
|
||||||
],
|
],
|
||||||
|
parameterBodyQuote: [
|
||||||
parameterBody: [
|
[/[^#:%*@\-!_']+/, 'variable'],
|
||||||
[/[#:%*@\-!_]/, 'delimiter'],
|
[/[#:%*@\-!_]/, 'delimiter'],
|
||||||
[/['"{(]/, 'variable', '@pop'],
|
[/[']/, 'variable', '@pop'],
|
||||||
[/./, 'variable']
|
],
|
||||||
|
parameterBodyDoubleQuote: [
|
||||||
|
[/[^#:%*@\-!_"]+/, 'variable'],
|
||||||
|
[/[#:%*@\-!_]/, 'delimiter'],
|
||||||
|
[/["]/, 'variable', '@pop'],
|
||||||
|
],
|
||||||
|
parameterBodyParen: [
|
||||||
|
[/[^#:%*@\-!_)]+/, 'variable'],
|
||||||
|
[/[#:%*@\-!_]/, 'delimiter'],
|
||||||
|
[/[)]/, 'variable', '@pop'],
|
||||||
|
],
|
||||||
|
parameterBodyCurlyBrace: [
|
||||||
|
[/[^#:%*@\-!_}]+/, 'variable'],
|
||||||
|
[/[#:%*@\-!_]/, 'delimiter'],
|
||||||
|
[/[}]/, 'variable', '@pop'],
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue