-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsyntax_test_struct.tact
101 lines (92 loc) · 3.68 KB
/
syntax_test_struct.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
// SYNTAX TEST "Packages/Tact/package/Tact.tmLanguage"
struct Whatever {
// <- keyword.other.struct.tact
// ^^^^^^^^ entity.name.type.tact
// ^ punctuation.brackets.curly.tact
a : Int;
// <- variable.other.tact
// ^ punctuation.colon.tact
// ^^^ entity.name.type.tact
// ^ punctuation.semi.tact
b : String = "hello!";
// <- variable.other.tact
// ^ punctuation.colon.tact
// ^^^^^^ entity.name.type.tact
// ^ punctuation.semi.tact
c : Int as int32;
// <- variable.other.tact
// ^ punctuation.colon.tact
// ^^^ entity.name.type.tact
// ^^ keyword.other.as.tact storage.modifier.tact
// ^^^^^ entity.name.type.tact
// ^ punctuation.semi.tact
d : Int as int256 = 10;
// <- variable.other.tact
// ^ punctuation.colon.tact
// ^^^ entity.name.type.tact
// ^^ keyword.other.as.tact storage.modifier.tact
// ^^^^^^ entity.name.type.tact
// ^ keyword.operator.assignment.equal.tact
// ^^ constant.numeric.decimal.tact
// ^ punctuation.semi.tact
}
// <- punctuation.brackets.curly.tact
fun TestStruct() {
Whatever{a: 10, b: "hello!", c: 10, d: 10, };
// <- entity.name.type.tact
// ^ punctuation.brackets.curly.tact
// ^ variable.other.tact
// ^ punctuation.colon.tact
// ^^ constant.numeric.decimal.tact
// ^ punctuation.comma.tact
// ^ variable.other.tact
// ^ punctuation.colon.tact
// ^ string.quoted.double.tact punctuation.definition.string.begin.tact
// ^^^^^^ string.quoted.double.tact
// ^ string.quoted.double.tact punctuation.definition.string.end.tact
// ^ punctuation.comma.tact
// ^ variable.other.tact
// ^ punctuation.colon.tact
// ^^ constant.numeric.decimal.tact
// ^ punctuation.comma.tact
// ^ variable.other.tact
// ^ punctuation.colon.tact
// ^^ constant.numeric.decimal.tact
// ^ punctuation.comma.tact
// ^ punctuation.brackets.curly.tact
// ^ punctuation.semi.tact
}
struct Serialization {
f1: Int as uint1;
// ^^^^^ entity.name.type.tact
f2: Int as int1;
// ^^^^ entity.name.type.tact
f3: Int as uint10;
// ^^^^^^ entity.name.type.tact
f4: Int as int10;
// ^^^^^ entity.name.type.tact
f5: Int as uint100;
// ^^^^^^^ entity.name.type.tact
f6: Int as int100;
// ^^^^^^ entity.name.type.tact
f7: Int as uint200;
// ^^^^^^^ entity.name.type.tact
f8: Int as int249;
// ^^^^^^ entity.name.type.tact
f9: Int as uint256;
// ^^^^^^^ entity.name.type.tact
f10: Int as int257;
// ^^^^^^ entity.name.type.tact
f9wrong: Int as uint257;
// ^^^^^^^ variable.other.tact
f10wrong: Int as int258;
// ^^^^^^ variable.other.tact
b32: Slice as bytes32;
// ^^^^^^^ entity.name.type.tact
b64: Slice as bytes64;
// ^^^^^^^ entity.name.type.tact
coin: Int as coins;
// ^^^^^ entity.name.type.tact
payload: Slice as remaining;
// ^^^^^^^^^ entity.name.type.tact
}