mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 20:52:56 +01:00
FIx word breaker for keyword identifiers
This commit is contained in:
parent
250f5d42d8
commit
7c6fe3b1bf
2 changed files with 36 additions and 2 deletions
|
|
@ -116,6 +116,27 @@ testTokenization('powerquery', [
|
|||
}],
|
||||
|
||||
// Number formats
|
||||
[{
|
||||
line: '0Xabc',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'number.hex.pq' }
|
||||
]
|
||||
}],
|
||||
|
||||
[{
|
||||
line: '0xA',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'number.hex.pq' }
|
||||
]
|
||||
}],
|
||||
|
||||
[{
|
||||
line: '1e1',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'number.pq' }
|
||||
]
|
||||
}],
|
||||
|
||||
[{
|
||||
line: '5 / 1.2e+2 + 0x1234abc',
|
||||
tokens: [
|
||||
|
|
@ -280,4 +301,17 @@ testTokenization('powerquery', [
|
|||
{ startIndex: 55, type: "delimiter.pq" }
|
||||
]
|
||||
}],
|
||||
|
||||
[{
|
||||
line: 'isFunctionthen = 1;// comment',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'identifier.pq' },
|
||||
{ startIndex: 14, type: 'white.pq' },
|
||||
{ startIndex: 15, type: 'operators.pq' },
|
||||
{ startIndex: 16, type: 'white.pq' },
|
||||
{ startIndex: 17, type: 'number.pq' },
|
||||
{ startIndex: 18, type: 'delimiter.pq' },
|
||||
{ startIndex: 19, type: 'comment.pq' },
|
||||
]
|
||||
}],
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ export const language = <ILanguage>{
|
|||
[/\d+([eE][\-+]?\d+)?/, "number"],
|
||||
|
||||
// keywords
|
||||
[/(#?[a-z]+)/,
|
||||
[/(#?[a-z]+)\b/,
|
||||
{
|
||||
cases: {
|
||||
"@typeKeywords": "type",
|
||||
|
|
@ -111,7 +111,7 @@ export const language = <ILanguage>{
|
|||
],
|
||||
|
||||
// other identifiers
|
||||
[/([a-zA-Z_][\w\.]*)/, "identifier"],
|
||||
[/\b([a-zA-Z_][\w\.]*)\b/, "identifier"],
|
||||
|
||||
{ include: "@whitespace" },
|
||||
{ include: "@comments" },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue