• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{
2  "type": "Program",
3  "statements": [
4    {
5      "type": "ClassDeclaration",
6      "definition": {
7        "id": {
8          "type": "Identifier",
9          "name": "ETSGLOBAL",
10          "decorators": [],
11          "loc": {
12            "start": {
13              "line": 1,
14              "column": 1,
15              "program": "switch.ets"
16            },
17            "end": {
18              "line": 1,
19              "column": 1,
20              "program": "switch.ets"
21            }
22          }
23        },
24        "superClass": null,
25        "implements": [],
26        "body": [
27          {
28            "type": "MethodDefinition",
29            "key": {
30              "type": "Identifier",
31              "name": "_$init$_",
32              "decorators": [],
33              "loc": {
34                "start": {
35                  "line": 1,
36                  "column": 1,
37                  "program": null
38                },
39                "end": {
40                  "line": 1,
41                  "column": 1,
42                  "program": null
43                }
44              }
45            },
46            "kind": "method",
47            "accessibility": "public",
48            "static": true,
49            "optional": false,
50            "computed": false,
51            "value": {
52              "type": "FunctionExpression",
53              "function": {
54                "type": "ScriptFunction",
55                "id": {
56                  "type": "Identifier",
57                  "name": "_$init$_",
58                  "decorators": [],
59                  "loc": {
60                    "start": {
61                      "line": 1,
62                      "column": 1,
63                      "program": null
64                    },
65                    "end": {
66                      "line": 1,
67                      "column": 1,
68                      "program": null
69                    }
70                  }
71                },
72                "generator": false,
73                "async": false,
74                "expression": false,
75                "params": [],
76                "body": {
77                  "type": "BlockStatement",
78                  "statements": [],
79                  "loc": {
80                    "start": {
81                      "line": 1,
82                      "column": 1,
83                      "program": null
84                    },
85                    "end": {
86                      "line": 1,
87                      "column": 1,
88                      "program": null
89                    }
90                  }
91                },
92                "loc": {
93                  "start": {
94                    "line": 1,
95                    "column": 1,
96                    "program": null
97                  },
98                  "end": {
99                    "line": 1,
100                    "column": 1,
101                    "program": null
102                  }
103                }
104              },
105              "loc": {
106                "start": {
107                  "line": 1,
108                  "column": 1,
109                  "program": null
110                },
111                "end": {
112                  "line": 1,
113                  "column": 1,
114                  "program": null
115                }
116              }
117            },
118            "overloads": [],
119            "decorators": [],
120            "loc": {
121              "start": {
122                "line": 1,
123                "column": 1,
124                "program": "switch.ets"
125              },
126              "end": {
127                "line": 1,
128                "column": 1,
129                "program": "switch.ets"
130              }
131            }
132          },
133          {
134            "type": "MethodDefinition",
135            "key": {
136              "type": "Identifier",
137              "name": "main",
138              "decorators": [],
139              "loc": {
140                "start": {
141                  "line": 17,
142                  "column": 10,
143                  "program": "switch.ets"
144                },
145                "end": {
146                  "line": 17,
147                  "column": 14,
148                  "program": "switch.ets"
149                }
150              }
151            },
152            "kind": "method",
153            "accessibility": "public",
154            "static": true,
155            "optional": false,
156            "computed": false,
157            "value": {
158              "type": "FunctionExpression",
159              "function": {
160                "type": "ScriptFunction",
161                "id": {
162                  "type": "Identifier",
163                  "name": "main",
164                  "decorators": [],
165                  "loc": {
166                    "start": {
167                      "line": 17,
168                      "column": 10,
169                      "program": "switch.ets"
170                    },
171                    "end": {
172                      "line": 17,
173                      "column": 14,
174                      "program": "switch.ets"
175                    }
176                  }
177                },
178                "generator": false,
179                "async": false,
180                "expression": false,
181                "params": [],
182                "returnType": {
183                  "type": "ETSPrimitiveType",
184                  "loc": {
185                    "start": {
186                      "line": 17,
187                      "column": 18,
188                      "program": "switch.ets"
189                    },
190                    "end": {
191                      "line": 17,
192                      "column": 22,
193                      "program": "switch.ets"
194                    }
195                  }
196                },
197                "body": {
198                  "type": "BlockStatement",
199                  "statements": [
200                    {
201                      "type": "VariableDeclaration",
202                      "declarations": [
203                        {
204                          "type": "VariableDeclarator",
205                          "id": {
206                            "type": "Identifier",
207                            "name": "value",
208                            "typeAnnotation": {
209                              "type": "ETSTypeReference",
210                              "part": {
211                                "type": "ETSTypeReferencePart",
212                                "name": {
213                                  "type": "Identifier",
214                                  "name": "String",
215                                  "decorators": [],
216                                  "loc": {
217                                    "start": {
218                                      "line": 18,
219                                      "column": 13,
220                                      "program": "switch.ets"
221                                    },
222                                    "end": {
223                                      "line": 18,
224                                      "column": 19,
225                                      "program": "switch.ets"
226                                    }
227                                  }
228                                },
229                                "loc": {
230                                  "start": {
231                                    "line": 18,
232                                    "column": 13,
233                                    "program": "switch.ets"
234                                  },
235                                  "end": {
236                                    "line": 18,
237                                    "column": 21,
238                                    "program": "switch.ets"
239                                  }
240                                }
241                              },
242                              "loc": {
243                                "start": {
244                                  "line": 18,
245                                  "column": 13,
246                                  "program": "switch.ets"
247                                },
248                                "end": {
249                                  "line": 18,
250                                  "column": 21,
251                                  "program": "switch.ets"
252                                }
253                              }
254                            },
255                            "decorators": [],
256                            "loc": {
257                              "start": {
258                                "line": 18,
259                                "column": 6,
260                                "program": "switch.ets"
261                              },
262                              "end": {
263                                "line": 18,
264                                "column": 11,
265                                "program": "switch.ets"
266                              }
267                            }
268                          },
269                          "init": {
270                            "type": "StringLiteral",
271                            "value": "10",
272                            "loc": {
273                              "start": {
274                                "line": 18,
275                                "column": 22,
276                                "program": "switch.ets"
277                              },
278                              "end": {
279                                "line": 18,
280                                "column": 26,
281                                "program": "switch.ets"
282                              }
283                            }
284                          },
285                          "loc": {
286                            "start": {
287                              "line": 18,
288                              "column": 6,
289                              "program": "switch.ets"
290                            },
291                            "end": {
292                              "line": 18,
293                              "column": 26,
294                              "program": "switch.ets"
295                            }
296                          }
297                        }
298                      ],
299                      "kind": "let",
300                      "loc": {
301                        "start": {
302                          "line": 18,
303                          "column": 2,
304                          "program": "switch.ets"
305                        },
306                        "end": {
307                          "line": 18,
308                          "column": 27,
309                          "program": "switch.ets"
310                        }
311                      }
312                    },
313                    {
314                      "type": "VariableDeclaration",
315                      "declarations": [
316                        {
317                          "type": "VariableDeclarator",
318                          "id": {
319                            "type": "Identifier",
320                            "name": "result",
321                            "typeAnnotation": {
322                              "type": "ETSTypeReference",
323                              "part": {
324                                "type": "ETSTypeReferencePart",
325                                "name": {
326                                  "type": "Identifier",
327                                  "name": "String",
328                                  "decorators": [],
329                                  "loc": {
330                                    "start": {
331                                      "line": 19,
332                                      "column": 14,
333                                      "program": "switch.ets"
334                                    },
335                                    "end": {
336                                      "line": 19,
337                                      "column": 20,
338                                      "program": "switch.ets"
339                                    }
340                                  }
341                                },
342                                "loc": {
343                                  "start": {
344                                    "line": 19,
345                                    "column": 14,
346                                    "program": "switch.ets"
347                                  },
348                                  "end": {
349                                    "line": 19,
350                                    "column": 21,
351                                    "program": "switch.ets"
352                                  }
353                                }
354                              },
355                              "loc": {
356                                "start": {
357                                  "line": 19,
358                                  "column": 14,
359                                  "program": "switch.ets"
360                                },
361                                "end": {
362                                  "line": 19,
363                                  "column": 21,
364                                  "program": "switch.ets"
365                                }
366                              }
367                            },
368                            "decorators": [],
369                            "loc": {
370                              "start": {
371                                "line": 19,
372                                "column": 6,
373                                "program": "switch.ets"
374                              },
375                              "end": {
376                                "line": 19,
377                                "column": 12,
378                                "program": "switch.ets"
379                              }
380                            }
381                          },
382                          "init": null,
383                          "loc": {
384                            "start": {
385                              "line": 19,
386                              "column": 6,
387                              "program": "switch.ets"
388                            },
389                            "end": {
390                              "line": 19,
391                              "column": 12,
392                              "program": "switch.ets"
393                            }
394                          }
395                        }
396                      ],
397                      "kind": "let",
398                      "loc": {
399                        "start": {
400                          "line": 19,
401                          "column": 2,
402                          "program": "switch.ets"
403                        },
404                        "end": {
405                          "line": 19,
406                          "column": 21,
407                          "program": "switch.ets"
408                        }
409                      }
410                    },
411                    {
412                      "type": "SwitchStatement",
413                      "discriminant": {
414                        "type": "Identifier",
415                        "name": "value",
416                        "decorators": [],
417                        "loc": {
418                          "start": {
419                            "line": 20,
420                            "column": 10,
421                            "program": "switch.ets"
422                          },
423                          "end": {
424                            "line": 20,
425                            "column": 15,
426                            "program": "switch.ets"
427                          }
428                        }
429                      },
430                      "cases": [
431                        {
432                          "type": "SwitchCase",
433                          "test": {
434                            "type": "StringLiteral",
435                            "value": "0",
436                            "loc": {
437                              "start": {
438                                "line": 21,
439                                "column": 8,
440                                "program": "switch.ets"
441                              },
442                              "end": {
443                                "line": 21,
444                                "column": 11,
445                                "program": "switch.ets"
446                              }
447                            }
448                          },
449                          "consequent": [],
450                          "loc": {
451                            "start": {
452                              "line": 21,
453                              "column": 3,
454                              "program": "switch.ets"
455                            },
456                            "end": {
457                              "line": 21,
458                              "column": 12,
459                              "program": "switch.ets"
460                            }
461                          }
462                        },
463                        {
464                          "type": "SwitchCase",
465                          "test": {
466                            "type": "StringLiteral",
467                            "value": "1",
468                            "loc": {
469                              "start": {
470                                "line": 22,
471                                "column": 8,
472                                "program": "switch.ets"
473                              },
474                              "end": {
475                                "line": 22,
476                                "column": 11,
477                                "program": "switch.ets"
478                              }
479                            }
480                          },
481                          "consequent": [
482                            {
483                              "type": "ExpressionStatement",
484                              "expression": {
485                                "type": "AssignmentExpression",
486                                "operator": "=",
487                                "left": {
488                                  "type": "Identifier",
489                                  "name": "result",
490                                  "decorators": [],
491                                  "loc": {
492                                    "start": {
493                                      "line": 23,
494                                      "column": 4,
495                                      "program": "switch.ets"
496                                    },
497                                    "end": {
498                                      "line": 23,
499                                      "column": 10,
500                                      "program": "switch.ets"
501                                    }
502                                  }
503                                },
504                                "right": {
505                                  "type": "StringLiteral",
506                                  "value": "One or zero",
507                                  "loc": {
508                                    "start": {
509                                      "line": 23,
510                                      "column": 13,
511                                      "program": "switch.ets"
512                                    },
513                                    "end": {
514                                      "line": 23,
515                                      "column": 26,
516                                      "program": "switch.ets"
517                                    }
518                                  }
519                                },
520                                "loc": {
521                                  "start": {
522                                    "line": 23,
523                                    "column": 4,
524                                    "program": "switch.ets"
525                                  },
526                                  "end": {
527                                    "line": 23,
528                                    "column": 26,
529                                    "program": "switch.ets"
530                                  }
531                                }
532                              },
533                              "loc": {
534                                "start": {
535                                  "line": 23,
536                                  "column": 4,
537                                  "program": "switch.ets"
538                                },
539                                "end": {
540                                  "line": 23,
541                                  "column": 27,
542                                  "program": "switch.ets"
543                                }
544                              }
545                            },
546                            {
547                              "type": "BreakStatement",
548                              "label": null,
549                              "loc": {
550                                "start": {
551                                  "line": 24,
552                                  "column": 4,
553                                  "program": "switch.ets"
554                                },
555                                "end": {
556                                  "line": 24,
557                                  "column": 10,
558                                  "program": "switch.ets"
559                                }
560                              }
561                            }
562                          ],
563                          "loc": {
564                            "start": {
565                              "line": 22,
566                              "column": 3,
567                              "program": "switch.ets"
568                            },
569                            "end": {
570                              "line": 24,
571                              "column": 10,
572                              "program": "switch.ets"
573                            }
574                          }
575                        },
576                        {
577                          "type": "SwitchCase",
578                          "test": {
579                            "type": "StringLiteral",
580                            "value": "2",
581                            "loc": {
582                              "start": {
583                                "line": 25,
584                                "column": 8,
585                                "program": "switch.ets"
586                              },
587                              "end": {
588                                "line": 25,
589                                "column": 11,
590                                "program": "switch.ets"
591                              }
592                            }
593                          },
594                          "consequent": [
595                            {
596                              "type": "ExpressionStatement",
597                              "expression": {
598                                "type": "AssignmentExpression",
599                                "operator": "=",
600                                "left": {
601                                  "type": "Identifier",
602                                  "name": "result",
603                                  "decorators": [],
604                                  "loc": {
605                                    "start": {
606                                      "line": 26,
607                                      "column": 4,
608                                      "program": "switch.ets"
609                                    },
610                                    "end": {
611                                      "line": 26,
612                                      "column": 10,
613                                      "program": "switch.ets"
614                                    }
615                                  }
616                                },
617                                "right": {
618                                  "type": "StringLiteral",
619                                  "value": "Two",
620                                  "loc": {
621                                    "start": {
622                                      "line": 26,
623                                      "column": 13,
624                                      "program": "switch.ets"
625                                    },
626                                    "end": {
627                                      "line": 26,
628                                      "column": 18,
629                                      "program": "switch.ets"
630                                    }
631                                  }
632                                },
633                                "loc": {
634                                  "start": {
635                                    "line": 26,
636                                    "column": 4,
637                                    "program": "switch.ets"
638                                  },
639                                  "end": {
640                                    "line": 26,
641                                    "column": 18,
642                                    "program": "switch.ets"
643                                  }
644                                }
645                              },
646                              "loc": {
647                                "start": {
648                                  "line": 26,
649                                  "column": 4,
650                                  "program": "switch.ets"
651                                },
652                                "end": {
653                                  "line": 26,
654                                  "column": 19,
655                                  "program": "switch.ets"
656                                }
657                              }
658                            },
659                            {
660                              "type": "BreakStatement",
661                              "label": null,
662                              "loc": {
663                                "start": {
664                                  "line": 27,
665                                  "column": 4,
666                                  "program": "switch.ets"
667                                },
668                                "end": {
669                                  "line": 27,
670                                  "column": 10,
671                                  "program": "switch.ets"
672                                }
673                              }
674                            }
675                          ],
676                          "loc": {
677                            "start": {
678                              "line": 25,
679                              "column": 3,
680                              "program": "switch.ets"
681                            },
682                            "end": {
683                              "line": 27,
684                              "column": 10,
685                              "program": "switch.ets"
686                            }
687                          }
688                        },
689                        {
690                          "type": "SwitchCase",
691                          "test": null,
692                          "consequent": [
693                            {
694                              "type": "ExpressionStatement",
695                              "expression": {
696                                "type": "AssignmentExpression",
697                                "operator": "=",
698                                "left": {
699                                  "type": "Identifier",
700                                  "name": "result",
701                                  "decorators": [],
702                                  "loc": {
703                                    "start": {
704                                      "line": 29,
705                                      "column": 4,
706                                      "program": "switch.ets"
707                                    },
708                                    "end": {
709                                      "line": 29,
710                                      "column": 10,
711                                      "program": "switch.ets"
712                                    }
713                                  }
714                                },
715                                "right": {
716                                  "type": "StringLiteral",
717                                  "value": "An unknown value",
718                                  "loc": {
719                                    "start": {
720                                      "line": 29,
721                                      "column": 13,
722                                      "program": "switch.ets"
723                                    },
724                                    "end": {
725                                      "line": 29,
726                                      "column": 31,
727                                      "program": "switch.ets"
728                                    }
729                                  }
730                                },
731                                "loc": {
732                                  "start": {
733                                    "line": 29,
734                                    "column": 4,
735                                    "program": "switch.ets"
736                                  },
737                                  "end": {
738                                    "line": 29,
739                                    "column": 31,
740                                    "program": "switch.ets"
741                                  }
742                                }
743                              },
744                              "loc": {
745                                "start": {
746                                  "line": 29,
747                                  "column": 4,
748                                  "program": "switch.ets"
749                                },
750                                "end": {
751                                  "line": 29,
752                                  "column": 32,
753                                  "program": "switch.ets"
754                                }
755                              }
756                            }
757                          ],
758                          "loc": {
759                            "start": {
760                              "line": 28,
761                              "column": 3,
762                              "program": "switch.ets"
763                            },
764                            "end": {
765                              "line": 29,
766                              "column": 32,
767                              "program": "switch.ets"
768                            }
769                          }
770                        }
771                      ],
772                      "loc": {
773                        "start": {
774                          "line": 20,
775                          "column": 2,
776                          "program": "switch.ets"
777                        },
778                        "end": {
779                          "line": 30,
780                          "column": 3,
781                          "program": "switch.ets"
782                        }
783                      }
784                    }
785                  ],
786                  "loc": {
787                    "start": {
788                      "line": 17,
789                      "column": 23,
790                      "program": "switch.ets"
791                    },
792                    "end": {
793                      "line": 31,
794                      "column": 2,
795                      "program": "switch.ets"
796                    }
797                  }
798                },
799                "loc": {
800                  "start": {
801                    "line": 17,
802                    "column": 10,
803                    "program": "switch.ets"
804                  },
805                  "end": {
806                    "line": 31,
807                    "column": 2,
808                    "program": "switch.ets"
809                  }
810                }
811              },
812              "loc": {
813                "start": {
814                  "line": 17,
815                  "column": 10,
816                  "program": "switch.ets"
817                },
818                "end": {
819                  "line": 31,
820                  "column": 2,
821                  "program": "switch.ets"
822                }
823              }
824            },
825            "overloads": [],
826            "decorators": [],
827            "loc": {
828              "start": {
829                "line": 17,
830                "column": 1,
831                "program": "switch.ets"
832              },
833              "end": {
834                "line": 31,
835                "column": 2,
836                "program": "switch.ets"
837              }
838            }
839          }
840        ],
841        "loc": {
842          "start": {
843            "line": 1,
844            "column": 1,
845            "program": "switch.ets"
846          },
847          "end": {
848            "line": 1,
849            "column": 1,
850            "program": "switch.ets"
851          }
852        }
853      },
854      "loc": {
855        "start": {
856          "line": 1,
857          "column": 1,
858          "program": "switch.ets"
859        },
860        "end": {
861          "line": 1,
862          "column": 1,
863          "program": "switch.ets"
864        }
865      }
866    }
867  ],
868  "loc": {
869    "start": {
870      "line": 1,
871      "column": 1,
872      "program": "switch.ets"
873    },
874    "end": {
875      "line": 32,
876      "column": 1,
877      "program": "switch.ets"
878    }
879  }
880}
881