mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 20:52:56 +01:00
Handle whitespace within C++ preprocessor comments
This commit is contained in:
parent
0500e21d95
commit
5bca489245
2 changed files with 50 additions and 11 deletions
|
|
@ -294,17 +294,20 @@ export const language = <languages.IMonarchLanguage>{
|
|||
}
|
||||
],
|
||||
|
||||
// The preprocessor checks must be before whitespace as they check /^\s*#/ which
|
||||
// otherwise fails to match later after other whitespace has been removed.
|
||||
|
||||
// Inclusion
|
||||
[/^\s*#\s*include/, { token: 'keyword.directive.include', next: '@include' }],
|
||||
|
||||
// Preprocessor directive
|
||||
[/^\s*#\s*\w+/, 'keyword.directive'],
|
||||
|
||||
// whitespace
|
||||
{ include: '@whitespace' },
|
||||
|
||||
// [[ attributes ]].
|
||||
[/\[\s*\[/, { token: 'annotation', next: '@annotation' }],
|
||||
|
||||
[/^\s*#include/, { token: 'keyword.directive.include', next: '@include' }],
|
||||
|
||||
// Preprocessor directive
|
||||
[/^\s*#\s*\w+/, 'keyword'],
|
||||
|
||||
// delimiters and operators
|
||||
[/[{}()\[\]]/, '@brackets'],
|
||||
[/[<>](?!@symbols)/, '@brackets'],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue