File tree 3 files changed +55
-34
lines changed
3 files changed +55
-34
lines changed Original file line number Diff line number Diff line change @@ -31,16 +31,6 @@ switch {
31
31
};
32
32
};
33
33
34
- type X = unit {
35
- switch (True) {
36
- * -> {
37
- switch (True) {
38
- * -> x: uint8;
39
- };
40
- }
41
- };
42
- };
43
-
44
34
type X = unit{
45
35
on %init {}
46
36
b: uint8 {print $$;}
@@ -55,13 +45,6 @@ type X = unit {
55
45
: uint8 if (True);
56
46
};
57
47
58
- public type X = unit {
59
- switch (1+1) {
60
- 1 -> a : b"1";
61
- * -> : void;
62
- };
63
- };
64
-
65
48
type X = unit () {};
66
49
67
50
type X = unit (x: X) {};
@@ -113,6 +96,31 @@ type X = unit {
113
96
# Bar.
114
97
};
115
98
99
+ public type X = unit {
100
+ switch (1+1) {
101
+ 1 -> a : b"1";
102
+ * -> : void;
103
+ };
104
+ };
105
+
106
+ type X = unit {
107
+ switch (True) {
108
+ * -> {
109
+ switch (True) {
110
+ * -> x: uint8;
111
+ };
112
+ }
113
+ };
114
+ };
115
+
116
+ type X = unit(a: uint8) {
117
+ switch (a) {
118
+ 1,
119
+ 2,
120
+ 3 -> : skip uint8;
121
+ };
122
+ };
123
+
116
124
# Sink syntax.
117
125
public type X = unit {
118
126
: bytes &eod -> self.data;
Original file line number Diff line number Diff line change @@ -40,16 +40,6 @@ type X = unit {
40
40
};
41
41
};
42
42
43
- type X = unit {
44
- switch (True) {
45
- * -> {
46
- switch (True) {
47
- * -> x: uint8;
48
- };
49
- }
50
- };
51
- };
52
-
53
43
type X = unit {
54
44
on %init {}
55
45
b: uint8 {
@@ -66,13 +56,6 @@ type X = unit {
66
56
: uint8 if(True);
67
57
};
68
58
69
- public type X = unit {
70
- switch (1 + 1) {
71
- 1 -> a: b"1";
72
- * -> : void;
73
- };
74
- };
75
-
76
59
type X = unit {};
77
60
78
61
type X = unit(x: X) {};
@@ -136,6 +119,31 @@ type X = unit {
136
119
# Bar.
137
120
};
138
121
122
+ public type X = unit {
123
+ switch (1 + 1) {
124
+ 1 -> a: b"1";
125
+ * -> : void;
126
+ };
127
+ };
128
+
129
+ type X = unit {
130
+ switch (True) {
131
+ * -> {
132
+ switch (True) {
133
+ * -> x: uint8;
134
+ };
135
+ }
136
+ };
137
+ };
138
+
139
+ type X = unit(a: uint8) {
140
+ switch (a) {
141
+ 1,
142
+ 2,
143
+ 3 -> : skip uint8;
144
+ };
145
+ };
146
+
139
147
# Sink syntax.
140
148
public type X = unit {
141
149
: bytes &eod -> self.data;
Original file line number Diff line number Diff line change 97
97
" ->" @prepend_space @append_space
98
98
)
99
99
100
+ (unit_switch_case
101
+ (expression)+
102
+ (expression) @prepend_hardline
103
+ )
104
+
100
105
(switch
101
106
" switch" @append_space
102
107
" (" (expression) " )" @append_space
You can’t perform that action at this time.
0 commit comments