mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 17:25:39 +01:00
Merge pull request #139 from spahnke/regexp-match-indices
[JS/TS] Add support for the RegExp Match Indices flag
This commit is contained in:
commit
6148b8a130
3 changed files with 4 additions and 4 deletions
|
|
@ -652,7 +652,7 @@ testTokenization('javascript', [
|
|||
|
||||
[
|
||||
{
|
||||
line: '/foo/gimsuy',
|
||||
line: '/foo/dgimsuy',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'regexp.js' },
|
||||
{ startIndex: 5, type: 'keyword.other.js' }
|
||||
|
|
|
|||
|
|
@ -674,7 +674,7 @@ testTokenization('typescript', [
|
|||
|
||||
[
|
||||
{
|
||||
line: '/foo/gimsuy',
|
||||
line: '/foo/dgimsuy',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'regexp.ts' },
|
||||
{ startIndex: 5, type: 'keyword.other.ts' }
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ export const language = {
|
|||
|
||||
// regular expression: ensure it is terminated before beginning (otherwise it is an opeator)
|
||||
[
|
||||
/\/(?=([^\\\/]|\\.)+\/([gimsuy]*)(\s*)(\.|;|,|\)|\]|\}|$))/,
|
||||
/\/(?=([^\\\/]|\\.)+\/([dgimsuy]*)(\s*)(\.|;|,|\)|\]|\}|$))/,
|
||||
{ token: 'regexp', bracket: '@open', next: '@regexp' }
|
||||
],
|
||||
|
||||
|
|
@ -313,7 +313,7 @@ export const language = {
|
|||
[/@regexpesc/, 'regexp.escape'],
|
||||
[/\\\./, 'regexp.invalid'],
|
||||
[
|
||||
/(\/)([gimsuy]*)/,
|
||||
/(\/)([dgimsuy]*)/,
|
||||
[{ token: 'regexp', bracket: '@close', next: '@pop' }, 'keyword.other']
|
||||
]
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue