mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 20:52:56 +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' }
|
||||
]
|
||||
}],
|
||||
|
||||
[{
|
||||
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'],
|
||||
[/\$\w+/, 'variable'],
|
||||
[/\$[*@#?\-$!0_]/, 'variable'],
|
||||
[/\$['"{(]/, 'variable', '@parameterBody']
|
||||
[/\$'/, 'variable', '@parameterBodyQuote'],
|
||||
[/\$"/, 'variable', '@parameterBodyDoubleQuote'],
|
||||
[/\$\(/, 'variable', '@parameterBodyParen'],
|
||||
[/\$\{/, 'variable', '@parameterBodyCurlyBrace'],
|
||||
],
|
||||
|
||||
parameterBody: [
|
||||
parameterBodyQuote: [
|
||||
[/[^#:%*@\-!_']+/, 'variable'],
|
||||
[/[#:%*@\-!_]/, 'delimiter'],
|
||||
[/['"{(]/, 'variable', '@pop'],
|
||||
[/./, 'variable']
|
||||
[/[']/, 'variable', '@pop'],
|
||||
],
|
||||
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