|
| 1 | +original file |
| 2 | +----------------------------------- |
| 3 | +type Diff1<T, U> = T extends U ? never : T |
| 4 | +type TypeName<T> = |
| 5 | + T extends string ? "string" : |
| 6 | + T extends number ? "number" : |
| 7 | + T extends boolean ? "boolean" : |
| 8 | + T extends undefined ? "undefined" : |
| 9 | + T extends Function ? "function" : |
| 10 | + "object"; |
| 11 | +----------------------------------- |
| 12 | + |
| 13 | +Grammar: TypeScript.tmLanguage |
| 14 | +----------------------------------- |
| 15 | +>type Diff1<T, U> = T extends U ? never : T |
| 16 | + ^^^^ |
| 17 | + source.ts meta.type.declaration.ts storage.type.type.ts |
| 18 | + ^ |
| 19 | + source.ts meta.type.declaration.ts |
| 20 | + ^^^^^ |
| 21 | + source.ts meta.type.declaration.ts entity.name.type.alias.ts |
| 22 | + ^ |
| 23 | + source.ts meta.type.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts |
| 24 | + ^ |
| 25 | + source.ts meta.type.declaration.ts meta.type.parameters.ts entity.name.type.ts |
| 26 | + ^ |
| 27 | + source.ts meta.type.declaration.ts meta.type.parameters.ts punctuation.separator.comma.ts |
| 28 | + ^ |
| 29 | + source.ts meta.type.declaration.ts meta.type.parameters.ts |
| 30 | + ^ |
| 31 | + source.ts meta.type.declaration.ts meta.type.parameters.ts entity.name.type.ts |
| 32 | + ^ |
| 33 | + source.ts meta.type.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts |
| 34 | + ^ |
| 35 | + source.ts meta.type.declaration.ts |
| 36 | + ^ |
| 37 | + source.ts meta.type.declaration.ts keyword.operator.assignment.ts |
| 38 | + ^ |
| 39 | + source.ts meta.type.declaration.ts |
| 40 | + ^ |
| 41 | + source.ts meta.type.declaration.ts entity.name.type.ts |
| 42 | + ^ |
| 43 | + source.ts meta.type.declaration.ts |
| 44 | + ^^^^^^^ |
| 45 | + source.ts meta.type.declaration.ts storage.modifier.ts |
| 46 | + ^ |
| 47 | + source.ts meta.type.declaration.ts |
| 48 | + ^ |
| 49 | + source.ts meta.type.declaration.ts entity.name.type.ts |
| 50 | + ^ |
| 51 | + source.ts meta.type.declaration.ts |
| 52 | + ^ |
| 53 | + source.ts meta.type.declaration.ts keyword.operator.ternary.ts |
| 54 | + ^ |
| 55 | + source.ts meta.type.declaration.ts |
| 56 | + ^^^^^ |
| 57 | + source.ts meta.type.declaration.ts support.type.primitive.ts |
| 58 | + ^ |
| 59 | + source.ts meta.type.declaration.ts |
| 60 | + ^ |
| 61 | + source.ts meta.type.declaration.ts keyword.operator.ternary.ts |
| 62 | + ^ |
| 63 | + source.ts meta.type.declaration.ts |
| 64 | + ^ |
| 65 | + source.ts meta.type.declaration.ts entity.name.type.ts |
| 66 | + ^^ |
| 67 | + source.ts meta.type.declaration.ts |
| 68 | +>type TypeName<T> = |
| 69 | + ^^^^ |
| 70 | + source.ts meta.type.declaration.ts storage.type.type.ts |
| 71 | + ^ |
| 72 | + source.ts meta.type.declaration.ts |
| 73 | + ^^^^^^^^ |
| 74 | + source.ts meta.type.declaration.ts entity.name.type.alias.ts |
| 75 | + ^ |
| 76 | + source.ts meta.type.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts |
| 77 | + ^ |
| 78 | + source.ts meta.type.declaration.ts meta.type.parameters.ts entity.name.type.ts |
| 79 | + ^ |
| 80 | + source.ts meta.type.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts |
| 81 | + ^ |
| 82 | + source.ts meta.type.declaration.ts |
| 83 | + ^ |
| 84 | + source.ts meta.type.declaration.ts keyword.operator.assignment.ts |
| 85 | + ^^ |
| 86 | + source.ts meta.type.declaration.ts |
| 87 | +> T extends string ? "string" : |
| 88 | + ^^^^ |
| 89 | + source.ts meta.type.declaration.ts |
| 90 | + ^ |
| 91 | + source.ts meta.type.declaration.ts entity.name.type.ts |
| 92 | + ^ |
| 93 | + source.ts meta.type.declaration.ts |
| 94 | + ^^^^^^^ |
| 95 | + source.ts meta.type.declaration.ts storage.modifier.ts |
| 96 | + ^ |
| 97 | + source.ts meta.type.declaration.ts |
| 98 | + ^^^^^^ |
| 99 | + source.ts meta.type.declaration.ts support.type.primitive.ts |
| 100 | + ^ |
| 101 | + source.ts meta.type.declaration.ts |
| 102 | + ^ |
| 103 | + source.ts meta.type.declaration.ts keyword.operator.ternary.ts |
| 104 | + ^ |
| 105 | + source.ts meta.type.declaration.ts |
| 106 | + ^ |
| 107 | + source.ts meta.type.declaration.ts string.quoted.double.ts punctuation.definition.string.begin.ts |
| 108 | + ^^^^^^ |
| 109 | + source.ts meta.type.declaration.ts string.quoted.double.ts |
| 110 | + ^ |
| 111 | + source.ts meta.type.declaration.ts string.quoted.double.ts punctuation.definition.string.end.ts |
| 112 | + ^ |
| 113 | + source.ts meta.type.declaration.ts |
| 114 | + ^ |
| 115 | + source.ts meta.type.declaration.ts keyword.operator.ternary.ts |
| 116 | + ^^ |
| 117 | + source.ts meta.type.declaration.ts |
| 118 | +> T extends number ? "number" : |
| 119 | + ^^^^^^^^ |
| 120 | + source.ts meta.type.declaration.ts |
| 121 | + ^ |
| 122 | + source.ts meta.type.declaration.ts entity.name.type.ts |
| 123 | + ^ |
| 124 | + source.ts meta.type.declaration.ts |
| 125 | + ^^^^^^^ |
| 126 | + source.ts meta.type.declaration.ts storage.modifier.ts |
| 127 | + ^ |
| 128 | + source.ts meta.type.declaration.ts |
| 129 | + ^^^^^^ |
| 130 | + source.ts meta.type.declaration.ts support.type.primitive.ts |
| 131 | + ^ |
| 132 | + source.ts meta.type.declaration.ts |
| 133 | + ^ |
| 134 | + source.ts meta.type.declaration.ts keyword.operator.ternary.ts |
| 135 | + ^ |
| 136 | + source.ts meta.type.declaration.ts |
| 137 | + ^ |
| 138 | + source.ts meta.type.declaration.ts string.quoted.double.ts punctuation.definition.string.begin.ts |
| 139 | + ^^^^^^ |
| 140 | + source.ts meta.type.declaration.ts string.quoted.double.ts |
| 141 | + ^ |
| 142 | + source.ts meta.type.declaration.ts string.quoted.double.ts punctuation.definition.string.end.ts |
| 143 | + ^ |
| 144 | + source.ts meta.type.declaration.ts |
| 145 | + ^ |
| 146 | + source.ts meta.type.declaration.ts keyword.operator.ternary.ts |
| 147 | + ^^ |
| 148 | + source.ts meta.type.declaration.ts |
| 149 | +> T extends boolean ? "boolean" : |
| 150 | + ^^^^^^^^^^^^ |
| 151 | + source.ts meta.type.declaration.ts |
| 152 | + ^ |
| 153 | + source.ts meta.type.declaration.ts entity.name.type.ts |
| 154 | + ^ |
| 155 | + source.ts meta.type.declaration.ts |
| 156 | + ^^^^^^^ |
| 157 | + source.ts meta.type.declaration.ts storage.modifier.ts |
| 158 | + ^ |
| 159 | + source.ts meta.type.declaration.ts |
| 160 | + ^^^^^^^ |
| 161 | + source.ts meta.type.declaration.ts support.type.primitive.ts |
| 162 | + ^ |
| 163 | + source.ts meta.type.declaration.ts |
| 164 | + ^ |
| 165 | + source.ts meta.type.declaration.ts keyword.operator.ternary.ts |
| 166 | + ^ |
| 167 | + source.ts meta.type.declaration.ts |
| 168 | + ^ |
| 169 | + source.ts meta.type.declaration.ts string.quoted.double.ts punctuation.definition.string.begin.ts |
| 170 | + ^^^^^^^ |
| 171 | + source.ts meta.type.declaration.ts string.quoted.double.ts |
| 172 | + ^ |
| 173 | + source.ts meta.type.declaration.ts string.quoted.double.ts punctuation.definition.string.end.ts |
| 174 | + ^ |
| 175 | + source.ts meta.type.declaration.ts |
| 176 | + ^ |
| 177 | + source.ts meta.type.declaration.ts keyword.operator.ternary.ts |
| 178 | + ^^ |
| 179 | + source.ts meta.type.declaration.ts |
| 180 | +> T extends undefined ? "undefined" : |
| 181 | + ^^^^^^^^^^^^^^^^ |
| 182 | + source.ts meta.type.declaration.ts |
| 183 | + ^ |
| 184 | + source.ts meta.type.declaration.ts entity.name.type.ts |
| 185 | + ^ |
| 186 | + source.ts meta.type.declaration.ts |
| 187 | + ^^^^^^^ |
| 188 | + source.ts meta.type.declaration.ts storage.modifier.ts |
| 189 | + ^ |
| 190 | + source.ts meta.type.declaration.ts |
| 191 | + ^^^^^^^^^ |
| 192 | + source.ts meta.type.declaration.ts support.type.builtin.ts |
| 193 | + ^ |
| 194 | + source.ts meta.type.declaration.ts |
| 195 | + ^ |
| 196 | + source.ts meta.type.declaration.ts keyword.operator.ternary.ts |
| 197 | + ^ |
| 198 | + source.ts meta.type.declaration.ts |
| 199 | + ^ |
| 200 | + source.ts meta.type.declaration.ts string.quoted.double.ts punctuation.definition.string.begin.ts |
| 201 | + ^^^^^^^^^ |
| 202 | + source.ts meta.type.declaration.ts string.quoted.double.ts |
| 203 | + ^ |
| 204 | + source.ts meta.type.declaration.ts string.quoted.double.ts punctuation.definition.string.end.ts |
| 205 | + ^ |
| 206 | + source.ts meta.type.declaration.ts |
| 207 | + ^ |
| 208 | + source.ts meta.type.declaration.ts keyword.operator.ternary.ts |
| 209 | + ^^ |
| 210 | + source.ts meta.type.declaration.ts |
| 211 | +> T extends Function ? "function" : |
| 212 | + ^^^^^^^^^^^^^^^^^^^^ |
| 213 | + source.ts meta.type.declaration.ts |
| 214 | + ^ |
| 215 | + source.ts meta.type.declaration.ts entity.name.type.ts |
| 216 | + ^ |
| 217 | + source.ts meta.type.declaration.ts |
| 218 | + ^^^^^^^ |
| 219 | + source.ts meta.type.declaration.ts storage.modifier.ts |
| 220 | + ^ |
| 221 | + source.ts meta.type.declaration.ts |
| 222 | + ^^^^^^^^ |
| 223 | + source.ts meta.type.declaration.ts entity.name.type.ts |
| 224 | + ^ |
| 225 | + source.ts meta.type.declaration.ts |
| 226 | + ^ |
| 227 | + source.ts meta.type.declaration.ts keyword.operator.ternary.ts |
| 228 | + ^ |
| 229 | + source.ts meta.type.declaration.ts |
| 230 | + ^ |
| 231 | + source.ts meta.type.declaration.ts string.quoted.double.ts punctuation.definition.string.begin.ts |
| 232 | + ^^^^^^^^ |
| 233 | + source.ts meta.type.declaration.ts string.quoted.double.ts |
| 234 | + ^ |
| 235 | + source.ts meta.type.declaration.ts string.quoted.double.ts punctuation.definition.string.end.ts |
| 236 | + ^ |
| 237 | + source.ts meta.type.declaration.ts |
| 238 | + ^ |
| 239 | + source.ts meta.type.declaration.ts keyword.operator.ternary.ts |
| 240 | + ^^ |
| 241 | + source.ts meta.type.declaration.ts |
| 242 | +> "object"; |
| 243 | + ^^^^^^^^^^^^^^^^^^^^^^^^ |
| 244 | + source.ts meta.type.declaration.ts |
| 245 | + ^ |
| 246 | + source.ts meta.type.declaration.ts string.quoted.double.ts punctuation.definition.string.begin.ts |
| 247 | + ^^^^^^ |
| 248 | + source.ts meta.type.declaration.ts string.quoted.double.ts |
| 249 | + ^ |
| 250 | + source.ts meta.type.declaration.ts string.quoted.double.ts punctuation.definition.string.end.ts |
| 251 | + ^ |
| 252 | + source.ts punctuation.terminator.statement.ts |
0 commit comments