-
Notifications
You must be signed in to change notification settings - Fork 0
/
syntax_test_primary_expression.tact
145 lines (128 loc) · 5.06 KB
/
syntax_test_primary_expression.tact
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
// SYNTAX TEST "Packages/Tact/package/Tact.tmLanguage"
struct Basic {
prop: Int;
}
extends fun c(self: Int, ) {
// ^^^^ variable.language.this.tact
// ^ punctuation.comma.tact
// unbox_not_null_expression (non-null assert)
null!!;
// ^^ keyword.operator.logical.tact
// method_call_expression
95.toString();
// ^^^^^^^^ entity.name.function.tact
// method_call_expression and non-null assert
a .asCell()!!.toString();
// <- variable.other.tact
// ^ punctuation.dot.tact
// ^^^^^^ entity.name.function.tact
// ^ punctuation.brackets.round.tact
// ^ punctuation.brackets.round.tact
// ^^ keyword.operator.logical.tact
// ^ punctuation.dot.tact
// ^^^^^^^^ entity.name.function.tact
// ^ punctuation.brackets.round.tact
// ^ punctuation.brackets.round.tact
// ^ punctuation.semi.tact
/// field_access_expression
context().sender;
// <- entity.name.function.tact
// ^^^^^^ variable.other.tact
// static_call_expression
now();
// <- entity.name.function.tact
now ();
// <- entity.name.function.tact
// parens_expression
( 10 );
// <- punctuation.brackets.round.tact
// ^ constant.numeric.decimal.tact
// ^ punctuation.brackets.round.tact
// ^ punctuation.semi.tact
// struct_instance_expression
Basic{prop: ton("1"), };
// <- entity.name.type.tact
// ^ punctuation.brackets.curly.tact
// ^^^^ variable.other.tact
// ^ punctuation.colon.tact
// ^^^ entity.name.function.tact
// ^ punctuation.brackets.round.tact
// ^ string.quoted.double.tact punctuation.definition.string.begin.tact
// ^ string.quoted.double.tact
// ^ string.quoted.double.tact punctuation.definition.string.end.tact
// ^ punctuation.brackets.round.tact
// ^ punctuation.comma.tact
// ^ punctuation.brackets.curly.tact
// ^ punctuation.semi.tact
// punned struct_instance_expression
Basic{prop, };
// <- entity.name.type.tact
// ^ punctuation.brackets.curly.tact
// ^^^^ variable.other.tact
// ^ punctuation.comma.tact
// ^ punctuation.brackets.curly.tact
// ^ punctuation.semi.tact
// integer
0b101;
// <- constant.numeric.bin.tact
// ^ punctuation.semi.tact
0xf0f;
// <- constant.numeric.hex.tact
0o707;
// <- constant.numeric.oct.tact
909;
// <- constant.numeric.decimal.tact
1_0_1;
// <- constant.numeric.decimal.tact
00001;
// <- constant.numeric.decimal.tact
// boolean
true;
// <- constant.language.bool.tact
// ^ punctuation.semi.tact
false;
// <- constant.language.bool.tact
// identifier
name;
// <- variable.other.tact
// ^ punctuation.semi.tact
// null
null;
// <- constant.language.null.tact
// ^ punctuation.semi.tact
// initOf_expression
initOf Contract(123, 123, );
// <- keyword.operator.new.tact
// ^^^^^^^^ entity.name.type.tact
// ^ punctuation.brackets.round.tact
// ^^^ constant.numeric.decimal.tact
// ^ punctuation.comma.tact
// ^^^ constant.numeric.decimal.tact
// ^ punctuation.comma.tact
// ^ punctuation.brackets.round.tact
// ^ punctuation.semi.tact
// NOTE: editing constant.character stuff right now
// consider simplifying capture names there :)
// string
"// \\ \" \n\r \t\v \b\f \u{0} \u{FFFFFF} \u0000 \xFF";
// ^ string.quoted.double.tact punctuation.definition.string.begin.tact
// ^^ constant.character.escape.tact
// ^^ constant.character.escape.tact
// ^^ constant.character.escape.tact
// ^^ constant.character.escape.tact
// ^^ constant.character.escape.tact
// ^^ constant.character.escape.tact
// ^^ constant.character.escape.tact
// ^^ constant.character.escape.tact
// ^^^^^ constant.character.escape.tact
// ^^^^^^^^^^ constant.character.escape.tact
// ^^^^^^ constant.character.escape.tact
// ^^^^ constant.character.escape.tact
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double.tact
// ^ string.quoted.double.tact punctuation.definition.string.end.tact
// ^ punctuation.semi.tact
// self, not as a builtin, but as a parameter
self.toString();
// <- variable.language.this.tact
// ^^^^^^^^ entity.name.function.tact
}