1{ 2 "type": "Program", 3 "statements": [ 4 { 5 "type": "VariableDeclaration", 6 "declarations": [ 7 { 8 "type": "VariableDeclarator", 9 "id": { 10 "type": "Identifier", 11 "name": "a", 12 "decorators": [], 13 "loc": { 14 "start": { 15 "line": 17, 16 "column": 5, 17 "program": "test-ts-as-expression.ts" 18 }, 19 "end": { 20 "line": 17, 21 "column": 6, 22 "program": "test-ts-as-expression.ts" 23 } 24 } 25 }, 26 "init": { 27 "type": "TSAsExpression", 28 "expression": { 29 "type": "StringLiteral", 30 "value": "x", 31 "loc": { 32 "start": { 33 "line": 17, 34 "column": 9, 35 "program": "test-ts-as-expression.ts" 36 }, 37 "end": { 38 "line": 17, 39 "column": 12, 40 "program": "test-ts-as-expression.ts" 41 } 42 } 43 }, 44 "typeAnnotation": { 45 "type": "TSUnionType", 46 "types": [ 47 { 48 "type": "TSLiteralType", 49 "literal": { 50 "type": "StringLiteral", 51 "value": "x", 52 "loc": { 53 "start": { 54 "line": 17, 55 "column": 16, 56 "program": "test-ts-as-expression.ts" 57 }, 58 "end": { 59 "line": 17, 60 "column": 19, 61 "program": "test-ts-as-expression.ts" 62 } 63 } 64 }, 65 "loc": { 66 "start": { 67 "line": 17, 68 "column": 16, 69 "program": "test-ts-as-expression.ts" 70 }, 71 "end": { 72 "line": 17, 73 "column": 19, 74 "program": "test-ts-as-expression.ts" 75 } 76 } 77 }, 78 { 79 "type": "TSLiteralType", 80 "literal": { 81 "type": "StringLiteral", 82 "value": "y", 83 "loc": { 84 "start": { 85 "line": 17, 86 "column": 22, 87 "program": "test-ts-as-expression.ts" 88 }, 89 "end": { 90 "line": 17, 91 "column": 25, 92 "program": "test-ts-as-expression.ts" 93 } 94 } 95 }, 96 "loc": { 97 "start": { 98 "line": 17, 99 "column": 22, 100 "program": "test-ts-as-expression.ts" 101 }, 102 "end": { 103 "line": 17, 104 "column": 25, 105 "program": "test-ts-as-expression.ts" 106 } 107 } 108 } 109 ], 110 "loc": { 111 "start": { 112 "line": 17, 113 "column": 16, 114 "program": "test-ts-as-expression.ts" 115 }, 116 "end": { 117 "line": 17, 118 "column": 25, 119 "program": "test-ts-as-expression.ts" 120 } 121 } 122 }, 123 "loc": { 124 "start": { 125 "line": 17, 126 "column": 9, 127 "program": "test-ts-as-expression.ts" 128 }, 129 "end": { 130 "line": 17, 131 "column": 26, 132 "program": "test-ts-as-expression.ts" 133 } 134 } 135 }, 136 "loc": { 137 "start": { 138 "line": 17, 139 "column": 5, 140 "program": "test-ts-as-expression.ts" 141 }, 142 "end": { 143 "line": 17, 144 "column": 26, 145 "program": "test-ts-as-expression.ts" 146 } 147 } 148 } 149 ], 150 "kind": "var", 151 "loc": { 152 "start": { 153 "line": 17, 154 "column": 1, 155 "program": "test-ts-as-expression.ts" 156 }, 157 "end": { 158 "line": 17, 159 "column": 26, 160 "program": "test-ts-as-expression.ts" 161 } 162 } 163 }, 164 { 165 "type": "VariableDeclaration", 166 "declarations": [ 167 { 168 "type": "VariableDeclarator", 169 "id": { 170 "type": "Identifier", 171 "name": "b", 172 "decorators": [], 173 "loc": { 174 "start": { 175 "line": 18, 176 "column": 5, 177 "program": "test-ts-as-expression.ts" 178 }, 179 "end": { 180 "line": 18, 181 "column": 6, 182 "program": "test-ts-as-expression.ts" 183 } 184 } 185 }, 186 "init": { 187 "type": "TSAsExpression", 188 "expression": { 189 "type": "TSAsExpression", 190 "expression": { 191 "type": "TSAsExpression", 192 "expression": { 193 "type": "NullLiteral", 194 "value": null, 195 "loc": { 196 "start": { 197 "line": 18, 198 "column": 9, 199 "program": "test-ts-as-expression.ts" 200 }, 201 "end": { 202 "line": 18, 203 "column": 13, 204 "program": "test-ts-as-expression.ts" 205 } 206 } 207 }, 208 "typeAnnotation": { 209 "type": "TSAnyKeyword", 210 "loc": { 211 "start": { 212 "line": 18, 213 "column": 17, 214 "program": "test-ts-as-expression.ts" 215 }, 216 "end": { 217 "line": 18, 218 "column": 20, 219 "program": "test-ts-as-expression.ts" 220 } 221 } 222 }, 223 "loc": { 224 "start": { 225 "line": 18, 226 "column": 9, 227 "program": "test-ts-as-expression.ts" 228 }, 229 "end": { 230 "line": 18, 231 "column": 23, 232 "program": "test-ts-as-expression.ts" 233 } 234 } 235 }, 236 "typeAnnotation": { 237 "type": "TSUnionType", 238 "types": [ 239 { 240 "type": "TSStringKeyword", 241 "loc": { 242 "start": { 243 "line": 18, 244 "column": 24, 245 "program": "test-ts-as-expression.ts" 246 }, 247 "end": { 248 "line": 18, 249 "column": 30, 250 "program": "test-ts-as-expression.ts" 251 } 252 } 253 }, 254 { 255 "type": "TSUndefinedKeyword", 256 "loc": { 257 "start": { 258 "line": 18, 259 "column": 33, 260 "program": "test-ts-as-expression.ts" 261 }, 262 "end": { 263 "line": 18, 264 "column": 42, 265 "program": "test-ts-as-expression.ts" 266 } 267 } 268 } 269 ], 270 "loc": { 271 "start": { 272 "line": 18, 273 "column": 24, 274 "program": "test-ts-as-expression.ts" 275 }, 276 "end": { 277 "line": 18, 278 "column": 42, 279 "program": "test-ts-as-expression.ts" 280 } 281 } 282 }, 283 "loc": { 284 "start": { 285 "line": 18, 286 "column": 9, 287 "program": "test-ts-as-expression.ts" 288 }, 289 "end": { 290 "line": 18, 291 "column": 45, 292 "program": "test-ts-as-expression.ts" 293 } 294 } 295 }, 296 "typeAnnotation": { 297 "type": "TSNeverKeyword", 298 "loc": { 299 "start": { 300 "line": 18, 301 "column": 46, 302 "program": "test-ts-as-expression.ts" 303 }, 304 "end": { 305 "line": 18, 306 "column": 51, 307 "program": "test-ts-as-expression.ts" 308 } 309 } 310 }, 311 "loc": { 312 "start": { 313 "line": 18, 314 "column": 9, 315 "program": "test-ts-as-expression.ts" 316 }, 317 "end": { 318 "line": 18, 319 "column": 52, 320 "program": "test-ts-as-expression.ts" 321 } 322 } 323 }, 324 "loc": { 325 "start": { 326 "line": 18, 327 "column": 5, 328 "program": "test-ts-as-expression.ts" 329 }, 330 "end": { 331 "line": 18, 332 "column": 52, 333 "program": "test-ts-as-expression.ts" 334 } 335 } 336 } 337 ], 338 "kind": "var", 339 "loc": { 340 "start": { 341 "line": 18, 342 "column": 1, 343 "program": "test-ts-as-expression.ts" 344 }, 345 "end": { 346 "line": 18, 347 "column": 52, 348 "program": "test-ts-as-expression.ts" 349 } 350 } 351 }, 352 { 353 "type": "VariableDeclaration", 354 "declarations": [ 355 { 356 "type": "VariableDeclarator", 357 "id": { 358 "type": "Identifier", 359 "name": "c", 360 "decorators": [], 361 "loc": { 362 "start": { 363 "line": 19, 364 "column": 5, 365 "program": "test-ts-as-expression.ts" 366 }, 367 "end": { 368 "line": 19, 369 "column": 6, 370 "program": "test-ts-as-expression.ts" 371 } 372 } 373 }, 374 "init": { 375 "type": "TSAsExpression", 376 "expression": { 377 "type": "NumberLiteral", 378 "value": 1, 379 "loc": { 380 "start": { 381 "line": 19, 382 "column": 9, 383 "program": "test-ts-as-expression.ts" 384 }, 385 "end": { 386 "line": 19, 387 "column": 10, 388 "program": "test-ts-as-expression.ts" 389 } 390 } 391 }, 392 "typeAnnotation": { 393 "type": "TSTypeReference", 394 "typeName": { 395 "type": "Identifier", 396 "name": "const", 397 "decorators": [], 398 "loc": { 399 "start": { 400 "line": 19, 401 "column": 14, 402 "program": "test-ts-as-expression.ts" 403 }, 404 "end": { 405 "line": 19, 406 "column": 19, 407 "program": "test-ts-as-expression.ts" 408 } 409 } 410 }, 411 "loc": { 412 "start": { 413 "line": 19, 414 "column": 14, 415 "program": "test-ts-as-expression.ts" 416 }, 417 "end": { 418 "line": 19, 419 "column": 19, 420 "program": "test-ts-as-expression.ts" 421 } 422 } 423 }, 424 "loc": { 425 "start": { 426 "line": 19, 427 "column": 9, 428 "program": "test-ts-as-expression.ts" 429 }, 430 "end": { 431 "line": 19, 432 "column": 20, 433 "program": "test-ts-as-expression.ts" 434 } 435 } 436 }, 437 "loc": { 438 "start": { 439 "line": 19, 440 "column": 5, 441 "program": "test-ts-as-expression.ts" 442 }, 443 "end": { 444 "line": 19, 445 "column": 20, 446 "program": "test-ts-as-expression.ts" 447 } 448 } 449 } 450 ], 451 "kind": "var", 452 "loc": { 453 "start": { 454 "line": 19, 455 "column": 1, 456 "program": "test-ts-as-expression.ts" 457 }, 458 "end": { 459 "line": 19, 460 "column": 20, 461 "program": "test-ts-as-expression.ts" 462 } 463 } 464 } 465 ], 466 "loc": { 467 "start": { 468 "line": 1, 469 "column": 1, 470 "program": "test-ts-as-expression.ts" 471 }, 472 "end": { 473 "line": 20, 474 "column": 1, 475 "program": "test-ts-as-expression.ts" 476 } 477 } 478} 479