Repository navigation
[Bug][Monarch] A token in a string is still considered as a token rather than a string #3715
Unanswered
Beishao Cao (BeishaoCao-db)
asked this question in
Q&A
Replies: 2 comments 1 reply
Why do you think it should work like that? |
1 reply
Hi Henning Dieterichs (@hediet) , thanks for your reply. As shown in the code, since we are already in the string substate, I think the $$ should be consider as a part in the string rather than an exit token. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Reproducible in vscode.dev or in VS Code Desktop?
Reproducible in the monaco editor playground?
Monaco Editor Playground Code
Reproduction Steps
https://microsoft.github.io/monaco-editor/monarch.html[ /LANGUAGE\s+PYTHON\s+AS\s+\$\$/, { token: 'keyword', bracket: '@open', next: '@python_block', nextEmbedded: 'python' }, ],and one python block:
python_block: [ [/\$\$/, { token: 'keyword', next: '@popall', nextEmbedded: '@pop' }], [/"/, 'string', '@string' ]],LANGUAGE PYTHON AS $$ "$$" $$, then we will see that the python_block exit even we in a string state, which is contradictory to the doc of monarch (https://microsoft.github.io/monaco-editor/monarch.html#nextEmbedded)Actual (Problematic) Behavior
Expected Behavior
$$in doublequote should be considered as a string rather than exit tokenAdditional Context
If this is a designed behavior, can you guys update the docs about monarch? If not, please fix this bug.
All reactions