tinymist/syntaxes/textmate/tests/unit/basic/control-flow-if.typ
Myriad-Dreamin 2e7c7732dc
feat: mark correct expression boundary on all testing files from typst/typst (#85)
* fix: comment and set rules

* fix: losen for rules

* fix: chore field, escape

* fix: hash termination

* dev: handle math mode

* fix: terminate expressions on right braces

* dev: match spread operator

* dev: remove complex check on if

* dev: add two bugs

* dev: fix if/while conditions

* fix: terminate expressions on right braces 2
2024-03-23 01:19:43 +08:00

99 lines
1.2 KiB
XML

#if 1
#if {} 1
#if {} else {} 1
#if 1 {} else {} 1
#if [] {} else {} #1
#if {} {} else {} {}
#if () {} else {} # a
#if () {} else {}
1
#if () {} else {}
{}
#if () {} else {}
{
#if () {} else {}
1
# if () {} else {}
1
#if 1 < 2 [
One.
]
#if true == false [
{Bad}, but we {dont-care}!
]
#if {true} [
One.
]
#if [] != none [
Two.
]
#if (
1 + 1
== 1
) [
Nope.
] else {
"Three."
}
#if false [
Bad.
] else {
let point = "."
"Four" + point
}
#{
if content == type[b] [Fi] else [Nope]
if content == type [Nope] else [ve.]
}
#if () () {}
#if () [] {}
#if () {} {}
#if [] () {}
#if [] [] {}
#if [] {} {}
#if {} () {}
#if {} [] {}
#if {} {} {}
#if () == () () {}
#if () == () [] {}
#if () == () {} {}
#if [] == [] () {}
#if [] == [] [] {}
#if [] == [] {} {}
#if {} == {} () {}
#if {} == {} [] {}
#if {} == {} {} {}
#if () and () () {}
#if () and () [] {}
#if () and () {} {}
#if [] and [] () {}
#if [] and [] [] {}
#if [] and [] {} {}
#if {} and {} () {}
#if {} and {} [] {}
#if {} and {} {} {}
#if not () () {}
#if not () [] {}
#if not () {} {}
#if not [] () {}
#if not [] [] {}
#if not [] {} {}
#if not {} () {}
#if not {} [] {}
#if not {} {} {}