mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-22 16:22:17 +00:00
parent
fb9a2c0f47
commit
704779dfc7
2 changed files with 33 additions and 1 deletions
|
@ -561,7 +561,17 @@
|
||||||
"patterns": [
|
"patterns": [
|
||||||
{
|
{
|
||||||
"name": "constant.character.escape.untitled.slint",
|
"name": "constant.character.escape.untitled.slint",
|
||||||
"match": "\\\\(n|\\\\|u\\{\\d+\\}|\\{[^\\}]+\\})"
|
"match": "\\\\(n|\\\\|u\\{\\d+\\})"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "constant.character.escape.untitled.slint",
|
||||||
|
"begin": "\\\\\\{",
|
||||||
|
"end": "\\}",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#expression"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
22
editors/vscode/tests/grammar/strings.slint
Normal file
22
editors/vscode/tests/grammar/strings.slint
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
// SYNTAX TEST "source.slint" "String parsing test based on #6014"
|
||||||
|
|
||||||
|
export component Test {
|
||||||
|
in property <bool> condition;
|
||||||
|
|
||||||
|
property <string> t1: "Text";
|
||||||
|
// ^^^^^^ string.quoted.double.slint
|
||||||
|
property <string> t2: "Text \{root.condition ? "\u{2003}" : ""}";
|
||||||
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double.slint
|
||||||
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant.character.escape.untitled.slint
|
||||||
|
// ^^^^^^^^^^ string.quoted.double.slint
|
||||||
|
// ^^^^^^^^ constant.character.escape.untitled.slint
|
||||||
|
property <string> t3: "Test \{ root.condition ? "}" : ""} test";
|
||||||
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double.slint
|
||||||
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant.character.escape.untitled.slint
|
||||||
|
// ^^^^ variable.language.special-element.slint
|
||||||
|
property <string> t4: "Test \{root.condition ? "{" : ""} foo ";
|
||||||
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double.slint
|
||||||
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant.character.escape.untitled.slint
|
||||||
|
// ^^^^ variable.language.special-element.slint
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue