summaryrefslogtreecommitdiff
path: root/tests/query/highlights/fusion/expressions.fusion
blob: a0b82b5113bc014bf0760352f995eb21ae434987 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
string = ${'foo'}
//          ^string

string = ${'foo \'bar\' baz'}
//                ^string

string = ${"foo"}
//          ^string

string = ${"foo ${test}"}
//               ^string

boolean = ${true}
//          ^boolean

number = ${1}
//         ^number

number = ${1.2}
//         ^number

propertyPath = ${property.path}
//               ^variable
//                        ^variable

thisorProps = ${this.path}
//              ^variable.builtin
//                   ^variable

thisorProps = ${props.path}
//              ^variable.builtin
//                    ^variable

array = ${[]}
//        ^punctuation.bracket

array = ${[true, 'string', 1, [true]]}
//        ^punctuation.bracket
//         ^boolean
//                ^string
//                         ^number
//                            ^punctuation.bracket
//                             ^boolean

object = ${{}}
//         ^punctuation.bracket

object = ${{first: 'value', second: true, third: [], fourth: object.path }}
//          ^property
//                  ^string
//                          ^property
//                                  ^boolean
//                                        ^property
//                                               ^punctuation.bracket
//                                                   ^property
//                                                                  ^variable

result = ${methodCall()}
//         ^function

result = ${Some.methodCall(param, param)}
//              ^function
//                         ^variable
//                                ^variable

arrowFunction =  ${map(foo, (bar, buz) => bar * buz)}
//                 ^function
//                           ^variable
//                                ^variable

logic = ${!foo && !(bar || baz) and not 'string'}
//        ^operator
//             ^operator
//                ^operator
//                      ^operator
//                              ^operator

ternary = ${ check ? true : false}
//                 ^punctuation.delimiter
//                        ^punctuation.delimiter