hlrender 0.0.199 → 0.0.200
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{_pdf-5693a3a5.js → _pdf-7c668149.js} +6 -6
- package/{_txt-cc9ff6a4.js → _txt-31429e8d.js} +6 -6
- package/{_unsupport-fec00214.js → _unsupport-35f551f9.js} +1 -1
- package/{affix-widget-e83690e6.js → affix-widget-034c7d4d.js} +16 -16
- package/{alert-widget-6e4122a0.js → alert-widget-a48330b2.js} +16 -16
- package/{anchor-widget-433cca12.js → anchor-widget-037639ea.js} +13 -13
- package/{auto-complete-widget-94f0bf82.js → auto-complete-widget-e4e86d9e.js} +16 -16
- package/{avatar-widget-0373b089.js → avatar-widget-d1c793cc.js} +16 -16
- package/{backtop-widget-ee4874e4.js → backtop-widget-6b1ebbe7.js} +16 -16
- package/{badge-widget-56550313.js → badge-widget-998855b5.js} +16 -16
- package/{barcode-widget-3ac11e9e.js → barcode-widget-ef9f4287.js} +13 -13
- package/{baseImp-79376d04.js → baseImp-242db99f.js} +106 -108
- package/{breadcrumb-widget-d6a3ea52.js → breadcrumb-widget-7dc796c1.js} +13 -13
- package/{button-widget-aa311e6c.js → button-widget-0c934082.js} +16 -16
- package/{cache-widget-feac9f7d.js → cache-widget-c934288d.js} +15 -15
- package/{card-widget-18cd6661.js → card-widget-07f24989.js} +14 -14
- package/{carousel-widget-0f89e75b.js → carousel-widget-6941d08e.js} +14 -14
- package/{cascader-widget-bd8f686f.js → cascader-widget-e58b3e0d.js} +15 -15
- package/{chart-widget-df52a80e.js → chart-widget-5e56fdb4.js} +13 -13
- package/{checkbox-widget-49d4c657.js → checkbox-widget-6d68ec7d.js} +15 -15
- package/{collapse-widget-b874885b.js → collapse-widget-644b208e.js} +14 -14
- package/{color-picker-widget-df3ff6db.js → color-picker-widget-1c40bd02.js} +15 -15
- package/{cont-cell-widget-159e50ef.js → cont-cell-widget-732eefe6.js} +1 -1
- package/{cont-cell-widget.vue_vue_type_script_setup_true_name_cont-cell-widget_lang-abcba0d4.js → cont-cell-widget.vue_vue_type_script_setup_true_name_cont-cell-widget_lang-e08c9390.js} +5 -5
- package/{cont-widget-47e8d275.js → cont-widget-effc69e5.js} +5 -5
- package/{content-wrapper-21a9e51b.js → content-wrapper-9d93e627.js} +7 -7
- package/{content-wrapper.vue_vue_type_script_setup_true_lang-159b5487.js → content-wrapper.vue_vue_type_script_setup_true_lang-55618b6d.js} +3 -3
- package/{date-picker-range-widget-b05d4879.js → date-picker-range-widget-3bf58f7a.js} +15 -15
- package/{date-picker-widget-f7bba7ad.js → date-picker-widget-b8122ef8.js} +15 -15
- package/default-slot-widget-a0f65dd8.js +26 -0
- package/{default-slot-widget.vue_vue_type_script_setup_true_name_default-slot-widget_lang-8343af69.js → default-slot-widget.vue_vue_type_script_setup_true_name_default-slot-widget_lang-fee41121.js} +7 -7
- package/{descriptions-widget-181e7daa.js → descriptions-widget-d7051753.js} +14 -14
- package/{dialog-0acb2540.js → dialog-cb26ee83.js} +2 -2
- package/{dialog-widget-1dd9299a.js → dialog-widget-f3ed3043.js} +15 -15
- package/{divider-widget-6d4d7b57.js → divider-widget-d40312e4.js} +16 -16
- package/{drag-wrapper-571e1bf5.js → drag-wrapper-0e14be76.js} +6 -6
- package/{drawer-widget-d8ac79e3.js → drawer-widget-c43ea91b.js} +15 -15
- package/{dropdown-widget-06ab98de.js → dropdown-widget-ebc65be4.js} +14 -14
- package/{empty-widget-13baa871.js → empty-widget-19f251d3.js} +16 -16
- package/{enum-type-523bc2b7.js → enum-type-1c0ae1da.js} +29 -0
- package/{enum-type-4aac0ead.js → enum-type-768f07b9.js} +1 -1
- package/{expression-8dec47fe.js → expression-d514d13e.js} +2 -2
- package/feedback-widget-c40ced49.js +26 -0
- package/{feedback-widget.vue_vue_type_script_setup_true_name_feedback-widget_lang-8af4ae9f.js → feedback-widget.vue_vue_type_script_setup_true_name_feedback-widget_lang-ee1ab63a.js} +5 -5
- package/{fieldobj-b9dc0fa4.js → fieldobj-5eca64a8.js} +1 -1
- package/{file-upload-widget-962de378.js → file-upload-widget-0af7e6b0.js} +20 -20
- package/{form-item-wrapper-d3ad2de0.js → form-item-wrapper-b761d512.js} +11 -11
- package/{form-widget-ef09a16a.js → form-widget-dba47daa.js} +10 -10
- package/{grid-col-widget-d4acebd9.js → grid-col-widget-1b5681fb.js} +1 -1
- package/{grid-col-widget.vue_vue_type_script_setup_true_name_grid-col-widget_lang-9f4143f4.js → grid-col-widget.vue_vue_type_script_setup_true_name_grid-col-widget_lang-cc5d3edc.js} +5 -5
- package/{grid-widget-59dc4c39.js → grid-widget-3ecf6a11.js} +5 -5
- package/{html-text-widget-3b6ee038.js → html-text-widget-36485f97.js} +14 -14
- package/{icon-widget-a66d9a02.js → icon-widget-e36dc571.js} +13 -13
- package/{iframe-widget-c0fab6c8.js → iframe-widget-2caf0591.js} +13 -13
- package/{image-widget-80426cea.js → image-widget-f143ad7b.js} +13 -13
- package/{index-c5927286.js → index-2f190dda.js} +4 -4
- package/{index-87d3b375.js → index-38b887d7.js} +5 -5
- package/{index-b82fc973.js → index-a152420d.js} +1 -1
- package/{input-number-widget-f44c8ebc.js → input-number-widget-e5c07f89.js} +15 -15
- package/{input-widget-ace0300e.js → input-widget-279dc40a.js} +16 -16
- package/{label-wrapper-b294182f.js → label-wrapper-0b97fbf7.js} +5 -5
- package/{label-wrapper.vue_vue_type_style_index_0_lang-a68fc27e.js → label-wrapper.vue_vue_type_style_index_0_lang-21ba79d3.js} +3 -3
- package/{link-widget-ec449bd6.js → link-widget-5ad11be9.js} +16 -16
- package/{ltable-col-widget-51e07713.js → ltable-col-widget-0cf29ced.js} +1 -1
- package/{ltable-col-widget.vue_vue_type_script_setup_true_name_ltable-col-widget_lang-369d758f.js → ltable-col-widget.vue_vue_type_script_setup_true_name_ltable-col-widget_lang-4c6285fb.js} +9 -9
- package/{ltable-widget-14580904.js → ltable-widget-a51b9298.js} +5 -5
- package/{menu-widget-efb62411.js → menu-widget-f0aff412.js} +14 -14
- package/{model-widget-b8188485.js → model-widget-cf496ac9.js} +13 -13
- package/{multirow-169e628f.js → multirow-3c042f3e.js} +6 -6
- package/{multirow-widget-fffaa309.js → multirow-widget-bc212cff.js} +15 -15
- package/package.json +1 -1
- package/{pagination-widget-749ab51c.js → pagination-widget-20da3b2c.js} +13 -13
- package/{picture-upload-widget-870997b0.js → picture-upload-widget-293522c8.js} +16 -16
- package/{progress-widget-0fdf11d5.js → progress-widget-10e53b93.js} +14 -14
- package/{propresult-10fa007b.js → propresult-e4364460.js} +1 -1
- package/{qrcode-widget-4f8af10a.js → qrcode-widget-59bfecb7.js} +13 -13
- package/{radio-widget-8693eb03.js → radio-widget-b3c38fa8.js} +15 -15
- package/{range-widget-6cf5b012.js → range-widget-e5f3b45d.js} +16 -16
- package/{rate-widget-ae480517.js → rate-widget-c6a1faff.js} +15 -15
- package/render.es.js +109 -109
- package/render.umd.js +400 -408
- package/{result-widget-312936cf.js → result-widget-7bcffff4.js} +14 -14
- package/{rich-editor-widget-0b382b09.js → rich-editor-widget-4f33f6bd.js} +15 -15
- package/{router-widget-554e8fd9.js → router-widget-22f253dc.js} +13 -13
- package/{select-widget-53daaec3.js → select-widget-c63c45bb.js} +15 -15
- package/{sfc-39e2a132.js → sfc-53fae228.js} +8 -8
- package/{sfcview-d2924e26.js → sfcview-5e86900c.js} +7 -7
- package/{share-field-227e573a.js → share-field-a27c55ba.js} +8 -8
- package/{share-file-97683189.js → share-file-005d3d63.js} +6 -6
- package/{slider-widget-11f6773b.js → slider-widget-392119ee.js} +15 -15
- package/slot-5f1a47c4.js +265 -0
- package/{static-text-widget-46f29a58.js → static-text-widget-6ddc17fa.js} +14 -14
- package/{steps-widget-c694f349.js → steps-widget-94d3b751.js} +13 -13
- package/{subMenu-widget-db1f3b9c.js → subMenu-widget-31b2de2f.js} +8 -8
- package/{subMenu-widget.vue_vue_type_script_setup_true_lang-02e8aaee.js → subMenu-widget.vue_vue_type_script_setup_true_lang-705e9942.js} +3 -3
- package/{switch-widget-8f21f942.js → switch-widget-61749af2.js} +15 -15
- package/{tab-pane-widget-c45db025.js → tab-pane-widget-c08ce395.js} +1 -1
- package/{tab-pane-widget.vue_vue_type_script_setup_true_name_tab-pane-widget_lang-0352bf40.js → tab-pane-widget.vue_vue_type_script_setup_true_name_tab-pane-widget_lang-09274c7d.js} +5 -5
- package/table-col-widget-2571f470.js +22 -0
- package/{table-col-widget.vue_vue_type_script_setup_true_name_table-col-widget_lang-5623617e.js → table-col-widget.vue_vue_type_script_setup_true_name_table-col-widget_lang-ef294d28.js} +6 -6
- package/{table-widget-eac0c746.js → table-widget-30640474.js} +15 -15
- package/{tabs-widget-1ddf6535.js → tabs-widget-736fade5.js} +7 -7
- package/{tag-widget-33cde894.js → tag-widget-0d78a155.js} +16 -16
- package/{text-widget-eec191a3.js → text-widget-2bae3f47.js} +16 -16
- package/{textarea-widget-617f4408.js → textarea-widget-b85b4356.js} +15 -15
- package/{time-picker-range-widget-f0fe2eea.js → time-picker-range-widget-15a6a246.js} +15 -15
- package/{time-picker-widget-80a02857.js → time-picker-widget-7e8ff4d5.js} +15 -15
- package/{time-select-widget-1c52c4ba.js → time-select-widget-50201f1b.js} +15 -15
- package/{tmpl-widget-6a99246c.js → tmpl-widget-d905f4b2.js} +14 -14
- package/{tree-select-widget-ffee176b.js → tree-select-widget-365313ed.js} +15 -15
- package/{tree-widget-3f55b5e2.js → tree-widget-88663bef.js} +13 -13
- package/{uuid-de039332.js → uuid-81bac653.js} +1 -1
- package/{verifycode-widget-fa1e1b23.js → verifycode-widget-3dd0e9b3.js} +13 -13
- package/{widget-wrapper.vue_vue_type_script_setup_true_name_form-item-wrapper_lang-4c03293b.js → widget-wrapper.vue_vue_type_script_setup_true_name_form-item-wrapper_lang-b2aca878.js} +7 -7
- package/{wrapper-widget-b770069e.js → wrapper-widget-259e5f16.js} +6 -6
- package/acorn-a3705767.js +0 -3128
- package/default-slot-widget-64643481.js +0 -26
- package/feedback-widget-170e748c.js +0 -26
- package/slot-da3b397f.js +0 -313
- package/table-col-widget-4228d3c2.js +0 -22
package/acorn-a3705767.js
DELETED
|
@@ -1,3128 +0,0 @@
|
|
|
1
|
-
var pt = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239], Ne = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191], lt = "·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・", Ve = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ꟑꟑꟓꟕ-ꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ", pe = {
|
|
2
|
-
3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
|
|
3
|
-
5: "class enum extends super const export import",
|
|
4
|
-
6: "enum",
|
|
5
|
-
strict: "implements interface let package private protected public static yield",
|
|
6
|
-
strictBind: "eval arguments"
|
|
7
|
-
}, le = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this", ft = {
|
|
8
|
-
5: le,
|
|
9
|
-
"5module": le + " export import",
|
|
10
|
-
6: le + " const class extends export import super"
|
|
11
|
-
}, dt = /^in(stanceof)?$/, xt = new RegExp("[" + Ve + "]"), mt = new RegExp("[" + Ve + lt + "]");
|
|
12
|
-
function de(e, t) {
|
|
13
|
-
for (var i = 65536, s = 0; s < t.length; s += 2) {
|
|
14
|
-
if (i += t[s], i > e)
|
|
15
|
-
return !1;
|
|
16
|
-
if (i += t[s + 1], i >= e)
|
|
17
|
-
return !0;
|
|
18
|
-
}
|
|
19
|
-
return !1;
|
|
20
|
-
}
|
|
21
|
-
function V(e, t) {
|
|
22
|
-
return e < 65 ? e === 36 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && xt.test(String.fromCharCode(e)) : t === !1 ? !1 : de(e, Ne);
|
|
23
|
-
}
|
|
24
|
-
function F(e, t) {
|
|
25
|
-
return e < 48 ? e === 36 : e < 58 ? !0 : e < 65 ? !1 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && mt.test(String.fromCharCode(e)) : t === !1 ? !1 : de(e, Ne) || de(e, pt);
|
|
26
|
-
}
|
|
27
|
-
var v = function(t, i) {
|
|
28
|
-
i === void 0 && (i = {}), this.label = t, this.keyword = i.keyword, this.beforeExpr = !!i.beforeExpr, this.startsExpr = !!i.startsExpr, this.isLoop = !!i.isLoop, this.isAssign = !!i.isAssign, this.prefix = !!i.prefix, this.postfix = !!i.postfix, this.binop = i.binop || null, this.updateContext = null;
|
|
29
|
-
};
|
|
30
|
-
function A(e, t) {
|
|
31
|
-
return new v(e, { beforeExpr: !0, binop: t });
|
|
32
|
-
}
|
|
33
|
-
var E = { beforeExpr: !0 }, k = { startsExpr: !0 }, ge = {};
|
|
34
|
-
function m(e, t) {
|
|
35
|
-
return t === void 0 && (t = {}), t.keyword = e, ge[e] = new v(e, t);
|
|
36
|
-
}
|
|
37
|
-
var a = {
|
|
38
|
-
num: new v("num", k),
|
|
39
|
-
regexp: new v("regexp", k),
|
|
40
|
-
string: new v("string", k),
|
|
41
|
-
name: new v("name", k),
|
|
42
|
-
privateId: new v("privateId", k),
|
|
43
|
-
eof: new v("eof"),
|
|
44
|
-
// Punctuation token types.
|
|
45
|
-
bracketL: new v("[", { beforeExpr: !0, startsExpr: !0 }),
|
|
46
|
-
bracketR: new v("]"),
|
|
47
|
-
braceL: new v("{", { beforeExpr: !0, startsExpr: !0 }),
|
|
48
|
-
braceR: new v("}"),
|
|
49
|
-
parenL: new v("(", { beforeExpr: !0, startsExpr: !0 }),
|
|
50
|
-
parenR: new v(")"),
|
|
51
|
-
comma: new v(",", E),
|
|
52
|
-
semi: new v(";", E),
|
|
53
|
-
colon: new v(":", E),
|
|
54
|
-
dot: new v("."),
|
|
55
|
-
question: new v("?", E),
|
|
56
|
-
questionDot: new v("?."),
|
|
57
|
-
arrow: new v("=>", E),
|
|
58
|
-
template: new v("template"),
|
|
59
|
-
invalidTemplate: new v("invalidTemplate"),
|
|
60
|
-
ellipsis: new v("...", E),
|
|
61
|
-
backQuote: new v("`", k),
|
|
62
|
-
dollarBraceL: new v("${", { beforeExpr: !0, startsExpr: !0 }),
|
|
63
|
-
// Operators. These carry several kinds of properties to help the
|
|
64
|
-
// parser use them properly (the presence of these properties is
|
|
65
|
-
// what categorizes them as operators).
|
|
66
|
-
//
|
|
67
|
-
// `binop`, when present, specifies that this operator is a binary
|
|
68
|
-
// operator, and will refer to its precedence.
|
|
69
|
-
//
|
|
70
|
-
// `prefix` and `postfix` mark the operator as a prefix or postfix
|
|
71
|
-
// unary operator.
|
|
72
|
-
//
|
|
73
|
-
// `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as
|
|
74
|
-
// binary operators with a very low precedence, that should result
|
|
75
|
-
// in AssignmentExpression nodes.
|
|
76
|
-
eq: new v("=", { beforeExpr: !0, isAssign: !0 }),
|
|
77
|
-
assign: new v("_=", { beforeExpr: !0, isAssign: !0 }),
|
|
78
|
-
incDec: new v("++/--", { prefix: !0, postfix: !0, startsExpr: !0 }),
|
|
79
|
-
prefix: new v("!/~", { beforeExpr: !0, prefix: !0, startsExpr: !0 }),
|
|
80
|
-
logicalOR: A("||", 1),
|
|
81
|
-
logicalAND: A("&&", 2),
|
|
82
|
-
bitwiseOR: A("|", 3),
|
|
83
|
-
bitwiseXOR: A("^", 4),
|
|
84
|
-
bitwiseAND: A("&", 5),
|
|
85
|
-
equality: A("==/!=/===/!==", 6),
|
|
86
|
-
relational: A("</>/<=/>=", 7),
|
|
87
|
-
bitShift: A("<</>>/>>>", 8),
|
|
88
|
-
plusMin: new v("+/-", { beforeExpr: !0, binop: 9, prefix: !0, startsExpr: !0 }),
|
|
89
|
-
modulo: A("%", 10),
|
|
90
|
-
star: A("*", 10),
|
|
91
|
-
slash: A("/", 10),
|
|
92
|
-
starstar: new v("**", { beforeExpr: !0 }),
|
|
93
|
-
coalesce: A("??", 1),
|
|
94
|
-
// Keyword token types.
|
|
95
|
-
_break: m("break"),
|
|
96
|
-
_case: m("case", E),
|
|
97
|
-
_catch: m("catch"),
|
|
98
|
-
_continue: m("continue"),
|
|
99
|
-
_debugger: m("debugger"),
|
|
100
|
-
_default: m("default", E),
|
|
101
|
-
_do: m("do", { isLoop: !0, beforeExpr: !0 }),
|
|
102
|
-
_else: m("else", E),
|
|
103
|
-
_finally: m("finally"),
|
|
104
|
-
_for: m("for", { isLoop: !0 }),
|
|
105
|
-
_function: m("function", k),
|
|
106
|
-
_if: m("if"),
|
|
107
|
-
_return: m("return", E),
|
|
108
|
-
_switch: m("switch"),
|
|
109
|
-
_throw: m("throw", E),
|
|
110
|
-
_try: m("try"),
|
|
111
|
-
_var: m("var"),
|
|
112
|
-
_const: m("const"),
|
|
113
|
-
_while: m("while", { isLoop: !0 }),
|
|
114
|
-
_with: m("with"),
|
|
115
|
-
_new: m("new", { beforeExpr: !0, startsExpr: !0 }),
|
|
116
|
-
_this: m("this", k),
|
|
117
|
-
_super: m("super", k),
|
|
118
|
-
_class: m("class", k),
|
|
119
|
-
_extends: m("extends", E),
|
|
120
|
-
_export: m("export"),
|
|
121
|
-
_import: m("import", k),
|
|
122
|
-
_null: m("null", k),
|
|
123
|
-
_true: m("true", k),
|
|
124
|
-
_false: m("false", k),
|
|
125
|
-
_in: m("in", { beforeExpr: !0, binop: 7 }),
|
|
126
|
-
_instanceof: m("instanceof", { beforeExpr: !0, binop: 7 }),
|
|
127
|
-
_typeof: m("typeof", { beforeExpr: !0, prefix: !0, startsExpr: !0 }),
|
|
128
|
-
_void: m("void", { beforeExpr: !0, prefix: !0, startsExpr: !0 }),
|
|
129
|
-
_delete: m("delete", { beforeExpr: !0, prefix: !0, startsExpr: !0 })
|
|
130
|
-
}, w = /\r\n?|\n|\u2028|\u2029/, vt = new RegExp(w.source, "g");
|
|
131
|
-
function H(e) {
|
|
132
|
-
return e === 10 || e === 13 || e === 8232 || e === 8233;
|
|
133
|
-
}
|
|
134
|
-
function Te(e, t, i) {
|
|
135
|
-
i === void 0 && (i = e.length);
|
|
136
|
-
for (var s = t; s < i; s++) {
|
|
137
|
-
var r = e.charCodeAt(s);
|
|
138
|
-
if (H(r))
|
|
139
|
-
return s < i - 1 && r === 13 && e.charCodeAt(s + 1) === 10 ? s + 2 : s + 1;
|
|
140
|
-
}
|
|
141
|
-
return -1;
|
|
142
|
-
}
|
|
143
|
-
var Le = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, C = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, Re = Object.prototype, gt = Re.hasOwnProperty, bt = Re.toString, W = Object.hasOwn || function(e, t) {
|
|
144
|
-
return gt.call(e, t);
|
|
145
|
-
}, we = Array.isArray || function(e) {
|
|
146
|
-
return bt.call(e) === "[object Array]";
|
|
147
|
-
}, Ae = /* @__PURE__ */ Object.create(null);
|
|
148
|
-
function D(e) {
|
|
149
|
-
return Ae[e] || (Ae[e] = new RegExp("^(?:" + e.replace(/ /g, "|") + ")$"));
|
|
150
|
-
}
|
|
151
|
-
function R(e) {
|
|
152
|
-
return e <= 65535 ? String.fromCharCode(e) : (e -= 65536, String.fromCharCode((e >> 10) + 55296, (e & 1023) + 56320));
|
|
153
|
-
}
|
|
154
|
-
var yt = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/, X = function(t, i) {
|
|
155
|
-
this.line = t, this.column = i;
|
|
156
|
-
};
|
|
157
|
-
X.prototype.offset = function(t) {
|
|
158
|
-
return new X(this.line, this.column + t);
|
|
159
|
-
};
|
|
160
|
-
var re = function(t, i, s) {
|
|
161
|
-
this.start = i, this.end = s, t.sourceFile !== null && (this.source = t.sourceFile);
|
|
162
|
-
};
|
|
163
|
-
function Oe(e, t) {
|
|
164
|
-
for (var i = 1, s = 0; ; ) {
|
|
165
|
-
var r = Te(e, s, t);
|
|
166
|
-
if (r < 0)
|
|
167
|
-
return new X(i, t - s);
|
|
168
|
-
++i, s = r;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
var xe = {
|
|
172
|
-
// `ecmaVersion` indicates the ECMAScript version to parse. Must be
|
|
173
|
-
// either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10
|
|
174
|
-
// (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"`
|
|
175
|
-
// (the latest version the library supports). This influences
|
|
176
|
-
// support for strict mode, the set of reserved words, and support
|
|
177
|
-
// for new syntax features.
|
|
178
|
-
ecmaVersion: null,
|
|
179
|
-
// `sourceType` indicates the mode the code should be parsed in.
|
|
180
|
-
// Can be either `"script"` or `"module"`. This influences global
|
|
181
|
-
// strict mode and parsing of `import` and `export` declarations.
|
|
182
|
-
sourceType: "script",
|
|
183
|
-
// `onInsertedSemicolon` can be a callback that will be called when
|
|
184
|
-
// a semicolon is automatically inserted. It will be passed the
|
|
185
|
-
// position of the inserted semicolon as an offset, and if
|
|
186
|
-
// `locations` is enabled, it is given the location as a `{line,
|
|
187
|
-
// column}` object as second argument.
|
|
188
|
-
onInsertedSemicolon: null,
|
|
189
|
-
// `onTrailingComma` is similar to `onInsertedSemicolon`, but for
|
|
190
|
-
// trailing commas.
|
|
191
|
-
onTrailingComma: null,
|
|
192
|
-
// By default, reserved words are only enforced if ecmaVersion >= 5.
|
|
193
|
-
// Set `allowReserved` to a boolean value to explicitly turn this on
|
|
194
|
-
// an off. When this option has the value "never", reserved words
|
|
195
|
-
// and keywords can also not be used as property names.
|
|
196
|
-
allowReserved: null,
|
|
197
|
-
// When enabled, a return at the top level is not considered an
|
|
198
|
-
// error.
|
|
199
|
-
allowReturnOutsideFunction: !1,
|
|
200
|
-
// When enabled, import/export statements are not constrained to
|
|
201
|
-
// appearing at the top of the program, and an import.meta expression
|
|
202
|
-
// in a script isn't considered an error.
|
|
203
|
-
allowImportExportEverywhere: !1,
|
|
204
|
-
// By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022.
|
|
205
|
-
// When enabled, await identifiers are allowed to appear at the top-level scope,
|
|
206
|
-
// but they are still not allowed in non-async functions.
|
|
207
|
-
allowAwaitOutsideFunction: null,
|
|
208
|
-
// When enabled, super identifiers are not constrained to
|
|
209
|
-
// appearing in methods and do not raise an error when they appear elsewhere.
|
|
210
|
-
allowSuperOutsideMethod: null,
|
|
211
|
-
// When enabled, hashbang directive in the beginning of file is
|
|
212
|
-
// allowed and treated as a line comment. Enabled by default when
|
|
213
|
-
// `ecmaVersion` >= 2023.
|
|
214
|
-
allowHashBang: !1,
|
|
215
|
-
// By default, the parser will verify that private properties are
|
|
216
|
-
// only used in places where they are valid and have been declared.
|
|
217
|
-
// Set this to false to turn such checks off.
|
|
218
|
-
checkPrivateFields: !0,
|
|
219
|
-
// When `locations` is on, `loc` properties holding objects with
|
|
220
|
-
// `start` and `end` properties in `{line, column}` form (with
|
|
221
|
-
// line being 1-based and column 0-based) will be attached to the
|
|
222
|
-
// nodes.
|
|
223
|
-
locations: !1,
|
|
224
|
-
// A function can be passed as `onToken` option, which will
|
|
225
|
-
// cause Acorn to call that function with object in the same
|
|
226
|
-
// format as tokens returned from `tokenizer().getToken()`. Note
|
|
227
|
-
// that you are not allowed to call the parser from the
|
|
228
|
-
// callback—that will corrupt its internal state.
|
|
229
|
-
onToken: null,
|
|
230
|
-
// A function can be passed as `onComment` option, which will
|
|
231
|
-
// cause Acorn to call that function with `(block, text, start,
|
|
232
|
-
// end)` parameters whenever a comment is skipped. `block` is a
|
|
233
|
-
// boolean indicating whether this is a block (`/* */`) comment,
|
|
234
|
-
// `text` is the content of the comment, and `start` and `end` are
|
|
235
|
-
// character offsets that denote the start and end of the comment.
|
|
236
|
-
// When the `locations` option is on, two more parameters are
|
|
237
|
-
// passed, the full `{line, column}` locations of the start and
|
|
238
|
-
// end of the comments. Note that you are not allowed to call the
|
|
239
|
-
// parser from the callback—that will corrupt its internal state.
|
|
240
|
-
// When this option has an array as value, objects representing the
|
|
241
|
-
// comments are pushed to it.
|
|
242
|
-
onComment: null,
|
|
243
|
-
// Nodes have their start and end characters offsets recorded in
|
|
244
|
-
// `start` and `end` properties (directly on the node, rather than
|
|
245
|
-
// the `loc` object, which holds line/column data. To also add a
|
|
246
|
-
// [semi-standardized][range] `range` property holding a `[start,
|
|
247
|
-
// end]` array with the same numbers, set the `ranges` option to
|
|
248
|
-
// `true`.
|
|
249
|
-
//
|
|
250
|
-
// [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678
|
|
251
|
-
ranges: !1,
|
|
252
|
-
// It is possible to parse multiple files into a single AST by
|
|
253
|
-
// passing the tree produced by parsing the first file as
|
|
254
|
-
// `program` option in subsequent parses. This will add the
|
|
255
|
-
// toplevel forms of the parsed file to the `Program` (top) node
|
|
256
|
-
// of an existing parse tree.
|
|
257
|
-
program: null,
|
|
258
|
-
// When `locations` is on, you can pass this to record the source
|
|
259
|
-
// file in every node's `loc` object.
|
|
260
|
-
sourceFile: null,
|
|
261
|
-
// This value, if given, is stored in every node, whether
|
|
262
|
-
// `locations` is on or off.
|
|
263
|
-
directSourceFile: null,
|
|
264
|
-
// When enabled, parenthesized expressions are represented by
|
|
265
|
-
// (non-standard) ParenthesizedExpression nodes
|
|
266
|
-
preserveParens: !1
|
|
267
|
-
}, Ee = !1;
|
|
268
|
-
function _t(e) {
|
|
269
|
-
var t = {};
|
|
270
|
-
for (var i in xe)
|
|
271
|
-
t[i] = e && W(e, i) ? e[i] : xe[i];
|
|
272
|
-
if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!Ee && typeof console == "object" && console.warn && (Ee = !0, console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
273
|
-
Defaulting to 2020, but this will stop working in the future.`)), t.ecmaVersion = 11) : t.ecmaVersion >= 2015 && (t.ecmaVersion -= 2009), t.allowReserved == null && (t.allowReserved = t.ecmaVersion < 5), (!e || e.allowHashBang == null) && (t.allowHashBang = t.ecmaVersion >= 14), we(t.onToken)) {
|
|
274
|
-
var s = t.onToken;
|
|
275
|
-
t.onToken = function(r) {
|
|
276
|
-
return s.push(r);
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
return we(t.onComment) && (t.onComment = Ct(t, t.onComment)), t;
|
|
280
|
-
}
|
|
281
|
-
function Ct(e, t) {
|
|
282
|
-
return function(i, s, r, n, u, o) {
|
|
283
|
-
var h = {
|
|
284
|
-
type: i ? "Block" : "Line",
|
|
285
|
-
value: s,
|
|
286
|
-
start: r,
|
|
287
|
-
end: n
|
|
288
|
-
};
|
|
289
|
-
e.locations && (h.loc = new re(this, u, o)), e.ranges && (h.range = [r, n]), t.push(h);
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
var Z = 1, z = 2, be = 4, Be = 8, ye = 16, De = 32, ne = 64, Fe = 128, U = 256, J = 512, ue = Z | z | U;
|
|
293
|
-
function _e(e, t) {
|
|
294
|
-
return z | (e ? be : 0) | (t ? Be : 0);
|
|
295
|
-
}
|
|
296
|
-
var te = 0, Ce = 1, B = 2, Me = 3, Ue = 4, qe = 5, y = function(t, i, s) {
|
|
297
|
-
this.options = t = _t(t), this.sourceFile = t.sourceFile, this.keywords = D(ft[t.ecmaVersion >= 6 ? 6 : t.sourceType === "module" ? "5module" : 5]);
|
|
298
|
-
var r = "";
|
|
299
|
-
t.allowReserved !== !0 && (r = pe[t.ecmaVersion >= 6 ? 6 : t.ecmaVersion === 5 ? 5 : 3], t.sourceType === "module" && (r += " await")), this.reservedWords = D(r);
|
|
300
|
-
var n = (r ? r + " " : "") + pe.strict;
|
|
301
|
-
this.reservedWordsStrict = D(n), this.reservedWordsStrictBind = D(n + " " + pe.strictBind), this.input = String(i), this.containsEsc = !1, s ? (this.pos = s, this.lineStart = this.input.lastIndexOf(`
|
|
302
|
-
`, s - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(w).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = a.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = !0, this.inModule = t.sourceType === "module", this.strict = this.inModule || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = !1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = /* @__PURE__ */ Object.create(null), this.pos === 0 && t.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(Z), this.regexpState = null, this.privateNameStack = [];
|
|
303
|
-
}, T = { inFunction: { configurable: !0 }, inGenerator: { configurable: !0 }, inAsync: { configurable: !0 }, canAwait: { configurable: !0 }, allowSuper: { configurable: !0 }, allowDirectSuper: { configurable: !0 }, treatFunctionsAsVar: { configurable: !0 }, allowNewDotTarget: { configurable: !0 }, inClassStaticBlock: { configurable: !0 } };
|
|
304
|
-
y.prototype.parse = function() {
|
|
305
|
-
var t = this.options.program || this.startNode();
|
|
306
|
-
return this.nextToken(), this.parseTopLevel(t);
|
|
307
|
-
};
|
|
308
|
-
T.inFunction.get = function() {
|
|
309
|
-
return (this.currentVarScope().flags & z) > 0;
|
|
310
|
-
};
|
|
311
|
-
T.inGenerator.get = function() {
|
|
312
|
-
return (this.currentVarScope().flags & Be) > 0;
|
|
313
|
-
};
|
|
314
|
-
T.inAsync.get = function() {
|
|
315
|
-
return (this.currentVarScope().flags & be) > 0;
|
|
316
|
-
};
|
|
317
|
-
T.canAwait.get = function() {
|
|
318
|
-
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
319
|
-
var t = this.scopeStack[e], i = t.flags;
|
|
320
|
-
if (i & (U | J))
|
|
321
|
-
return !1;
|
|
322
|
-
if (i & z)
|
|
323
|
-
return (i & be) > 0;
|
|
324
|
-
}
|
|
325
|
-
return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
|
|
326
|
-
};
|
|
327
|
-
T.allowSuper.get = function() {
|
|
328
|
-
var e = this.currentThisScope(), t = e.flags;
|
|
329
|
-
return (t & ne) > 0 || this.options.allowSuperOutsideMethod;
|
|
330
|
-
};
|
|
331
|
-
T.allowDirectSuper.get = function() {
|
|
332
|
-
return (this.currentThisScope().flags & Fe) > 0;
|
|
333
|
-
};
|
|
334
|
-
T.treatFunctionsAsVar.get = function() {
|
|
335
|
-
return this.treatFunctionsAsVarInScope(this.currentScope());
|
|
336
|
-
};
|
|
337
|
-
T.allowNewDotTarget.get = function() {
|
|
338
|
-
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
339
|
-
var t = this.scopeStack[e], i = t.flags;
|
|
340
|
-
if (i & (U | J) || i & z && !(i & ye))
|
|
341
|
-
return !0;
|
|
342
|
-
}
|
|
343
|
-
return !1;
|
|
344
|
-
};
|
|
345
|
-
T.inClassStaticBlock.get = function() {
|
|
346
|
-
return (this.currentVarScope().flags & U) > 0;
|
|
347
|
-
};
|
|
348
|
-
y.extend = function() {
|
|
349
|
-
for (var t = [], i = arguments.length; i--; )
|
|
350
|
-
t[i] = arguments[i];
|
|
351
|
-
for (var s = this, r = 0; r < t.length; r++)
|
|
352
|
-
s = t[r](s);
|
|
353
|
-
return s;
|
|
354
|
-
};
|
|
355
|
-
y.parse = function(t, i) {
|
|
356
|
-
return new this(i, t).parse();
|
|
357
|
-
};
|
|
358
|
-
y.parseExpressionAt = function(t, i, s) {
|
|
359
|
-
var r = new this(s, t, i);
|
|
360
|
-
return r.nextToken(), r.parseExpression();
|
|
361
|
-
};
|
|
362
|
-
y.tokenizer = function(t, i) {
|
|
363
|
-
return new this(i, t);
|
|
364
|
-
};
|
|
365
|
-
Object.defineProperties(y.prototype, T);
|
|
366
|
-
var S = y.prototype, St = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
|
|
367
|
-
S.strictDirective = function(e) {
|
|
368
|
-
if (this.options.ecmaVersion < 5)
|
|
369
|
-
return !1;
|
|
370
|
-
for (; ; ) {
|
|
371
|
-
C.lastIndex = e, e += C.exec(this.input)[0].length;
|
|
372
|
-
var t = St.exec(this.input.slice(e));
|
|
373
|
-
if (!t)
|
|
374
|
-
return !1;
|
|
375
|
-
if ((t[1] || t[2]) === "use strict") {
|
|
376
|
-
C.lastIndex = e + t[0].length;
|
|
377
|
-
var i = C.exec(this.input), s = i.index + i[0].length, r = this.input.charAt(s);
|
|
378
|
-
return r === ";" || r === "}" || w.test(i[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(r) || r === "!" && this.input.charAt(s + 1) === "=");
|
|
379
|
-
}
|
|
380
|
-
e += t[0].length, C.lastIndex = e, e += C.exec(this.input)[0].length, this.input[e] === ";" && e++;
|
|
381
|
-
}
|
|
382
|
-
};
|
|
383
|
-
S.eat = function(e) {
|
|
384
|
-
return this.type === e ? (this.next(), !0) : !1;
|
|
385
|
-
};
|
|
386
|
-
S.isContextual = function(e) {
|
|
387
|
-
return this.type === a.name && this.value === e && !this.containsEsc;
|
|
388
|
-
};
|
|
389
|
-
S.eatContextual = function(e) {
|
|
390
|
-
return this.isContextual(e) ? (this.next(), !0) : !1;
|
|
391
|
-
};
|
|
392
|
-
S.expectContextual = function(e) {
|
|
393
|
-
this.eatContextual(e) || this.unexpected();
|
|
394
|
-
};
|
|
395
|
-
S.canInsertSemicolon = function() {
|
|
396
|
-
return this.type === a.eof || this.type === a.braceR || w.test(this.input.slice(this.lastTokEnd, this.start));
|
|
397
|
-
};
|
|
398
|
-
S.insertSemicolon = function() {
|
|
399
|
-
if (this.canInsertSemicolon())
|
|
400
|
-
return this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), !0;
|
|
401
|
-
};
|
|
402
|
-
S.semicolon = function() {
|
|
403
|
-
!this.eat(a.semi) && !this.insertSemicolon() && this.unexpected();
|
|
404
|
-
};
|
|
405
|
-
S.afterTrailingComma = function(e, t) {
|
|
406
|
-
if (this.type === e)
|
|
407
|
-
return this.options.onTrailingComma && this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc), t || this.next(), !0;
|
|
408
|
-
};
|
|
409
|
-
S.expect = function(e) {
|
|
410
|
-
this.eat(e) || this.unexpected();
|
|
411
|
-
};
|
|
412
|
-
S.unexpected = function(e) {
|
|
413
|
-
this.raise(e ?? this.start, "Unexpected token");
|
|
414
|
-
};
|
|
415
|
-
var oe = function() {
|
|
416
|
-
this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
|
|
417
|
-
};
|
|
418
|
-
S.checkPatternErrors = function(e, t) {
|
|
419
|
-
if (e) {
|
|
420
|
-
e.trailingComma > -1 && this.raiseRecoverable(e.trailingComma, "Comma is not permitted after the rest element");
|
|
421
|
-
var i = t ? e.parenthesizedAssign : e.parenthesizedBind;
|
|
422
|
-
i > -1 && this.raiseRecoverable(i, t ? "Assigning to rvalue" : "Parenthesized pattern");
|
|
423
|
-
}
|
|
424
|
-
};
|
|
425
|
-
S.checkExpressionErrors = function(e, t) {
|
|
426
|
-
if (!e)
|
|
427
|
-
return !1;
|
|
428
|
-
var i = e.shorthandAssign, s = e.doubleProto;
|
|
429
|
-
if (!t)
|
|
430
|
-
return i >= 0 || s >= 0;
|
|
431
|
-
i >= 0 && this.raise(i, "Shorthand property assignments are valid only in destructuring patterns"), s >= 0 && this.raiseRecoverable(s, "Redefinition of __proto__ property");
|
|
432
|
-
};
|
|
433
|
-
S.checkYieldAwaitInDefaultParams = function() {
|
|
434
|
-
this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos) && this.raise(this.yieldPos, "Yield expression cannot be a default value"), this.awaitPos && this.raise(this.awaitPos, "Await expression cannot be a default value");
|
|
435
|
-
};
|
|
436
|
-
S.isSimpleAssignTarget = function(e) {
|
|
437
|
-
return e.type === "ParenthesizedExpression" ? this.isSimpleAssignTarget(e.expression) : e.type === "Identifier" || e.type === "MemberExpression";
|
|
438
|
-
};
|
|
439
|
-
var p = y.prototype;
|
|
440
|
-
p.parseTopLevel = function(e) {
|
|
441
|
-
var t = /* @__PURE__ */ Object.create(null);
|
|
442
|
-
for (e.body || (e.body = []); this.type !== a.eof; ) {
|
|
443
|
-
var i = this.parseStatement(null, !0, t);
|
|
444
|
-
e.body.push(i);
|
|
445
|
-
}
|
|
446
|
-
if (this.inModule)
|
|
447
|
-
for (var s = 0, r = Object.keys(this.undefinedExports); s < r.length; s += 1) {
|
|
448
|
-
var n = r[s];
|
|
449
|
-
this.raiseRecoverable(this.undefinedExports[n].start, "Export '" + n + "' is not defined");
|
|
450
|
-
}
|
|
451
|
-
return this.adaptDirectivePrologue(e.body), this.next(), e.sourceType = this.options.sourceType, this.finishNode(e, "Program");
|
|
452
|
-
};
|
|
453
|
-
var Se = { kind: "loop" }, kt = { kind: "switch" };
|
|
454
|
-
p.isLet = function(e) {
|
|
455
|
-
if (this.options.ecmaVersion < 6 || !this.isContextual("let"))
|
|
456
|
-
return !1;
|
|
457
|
-
C.lastIndex = this.pos;
|
|
458
|
-
var t = C.exec(this.input), i = this.pos + t[0].length, s = this.input.charCodeAt(i);
|
|
459
|
-
if (s === 91 || s === 92)
|
|
460
|
-
return !0;
|
|
461
|
-
if (e)
|
|
462
|
-
return !1;
|
|
463
|
-
if (s === 123 || s > 55295 && s < 56320)
|
|
464
|
-
return !0;
|
|
465
|
-
if (V(s, !0)) {
|
|
466
|
-
for (var r = i + 1; F(s = this.input.charCodeAt(r), !0); )
|
|
467
|
-
++r;
|
|
468
|
-
if (s === 92 || s > 55295 && s < 56320)
|
|
469
|
-
return !0;
|
|
470
|
-
var n = this.input.slice(i, r);
|
|
471
|
-
if (!dt.test(n))
|
|
472
|
-
return !0;
|
|
473
|
-
}
|
|
474
|
-
return !1;
|
|
475
|
-
};
|
|
476
|
-
p.isAsyncFunction = function() {
|
|
477
|
-
if (this.options.ecmaVersion < 8 || !this.isContextual("async"))
|
|
478
|
-
return !1;
|
|
479
|
-
C.lastIndex = this.pos;
|
|
480
|
-
var e = C.exec(this.input), t = this.pos + e[0].length, i;
|
|
481
|
-
return !w.test(this.input.slice(this.pos, t)) && this.input.slice(t, t + 8) === "function" && (t + 8 === this.input.length || !(F(i = this.input.charCodeAt(t + 8)) || i > 55295 && i < 56320));
|
|
482
|
-
};
|
|
483
|
-
p.isUsingKeyword = function(e, t) {
|
|
484
|
-
if (this.options.ecmaVersion < 17 || !this.isContextual(e ? "await" : "using"))
|
|
485
|
-
return !1;
|
|
486
|
-
C.lastIndex = this.pos;
|
|
487
|
-
var i = C.exec(this.input), s = this.pos + i[0].length;
|
|
488
|
-
if (w.test(this.input.slice(this.pos, s)))
|
|
489
|
-
return !1;
|
|
490
|
-
if (e) {
|
|
491
|
-
var r = s + 5, n;
|
|
492
|
-
if (this.input.slice(s, r) !== "using" || r === this.input.length || F(n = this.input.charCodeAt(r)) || n > 55295 && n < 56320)
|
|
493
|
-
return !1;
|
|
494
|
-
C.lastIndex = r;
|
|
495
|
-
var u = C.exec(this.input);
|
|
496
|
-
if (u && w.test(this.input.slice(r, r + u[0].length)))
|
|
497
|
-
return !1;
|
|
498
|
-
}
|
|
499
|
-
if (t) {
|
|
500
|
-
var o = s + 2, h;
|
|
501
|
-
if (this.input.slice(s, o) === "of" && (o === this.input.length || !F(h = this.input.charCodeAt(o)) && !(h > 55295 && h < 56320)))
|
|
502
|
-
return !1;
|
|
503
|
-
}
|
|
504
|
-
var l = this.input.charCodeAt(s);
|
|
505
|
-
return V(l, !0) || l === 92;
|
|
506
|
-
};
|
|
507
|
-
p.isAwaitUsing = function(e) {
|
|
508
|
-
return this.isUsingKeyword(!0, e);
|
|
509
|
-
};
|
|
510
|
-
p.isUsing = function(e) {
|
|
511
|
-
return this.isUsingKeyword(!1, e);
|
|
512
|
-
};
|
|
513
|
-
p.parseStatement = function(e, t, i) {
|
|
514
|
-
var s = this.type, r = this.startNode(), n;
|
|
515
|
-
switch (this.isLet(e) && (s = a._var, n = "let"), s) {
|
|
516
|
-
case a._break:
|
|
517
|
-
case a._continue:
|
|
518
|
-
return this.parseBreakContinueStatement(r, s.keyword);
|
|
519
|
-
case a._debugger:
|
|
520
|
-
return this.parseDebuggerStatement(r);
|
|
521
|
-
case a._do:
|
|
522
|
-
return this.parseDoStatement(r);
|
|
523
|
-
case a._for:
|
|
524
|
-
return this.parseForStatement(r);
|
|
525
|
-
case a._function:
|
|
526
|
-
return e && (this.strict || e !== "if" && e !== "label") && this.options.ecmaVersion >= 6 && this.unexpected(), this.parseFunctionStatement(r, !1, !e);
|
|
527
|
-
case a._class:
|
|
528
|
-
return e && this.unexpected(), this.parseClass(r, !0);
|
|
529
|
-
case a._if:
|
|
530
|
-
return this.parseIfStatement(r);
|
|
531
|
-
case a._return:
|
|
532
|
-
return this.parseReturnStatement(r);
|
|
533
|
-
case a._switch:
|
|
534
|
-
return this.parseSwitchStatement(r);
|
|
535
|
-
case a._throw:
|
|
536
|
-
return this.parseThrowStatement(r);
|
|
537
|
-
case a._try:
|
|
538
|
-
return this.parseTryStatement(r);
|
|
539
|
-
case a._const:
|
|
540
|
-
case a._var:
|
|
541
|
-
return n = n || this.value, e && n !== "var" && this.unexpected(), this.parseVarStatement(r, n);
|
|
542
|
-
case a._while:
|
|
543
|
-
return this.parseWhileStatement(r);
|
|
544
|
-
case a._with:
|
|
545
|
-
return this.parseWithStatement(r);
|
|
546
|
-
case a.braceL:
|
|
547
|
-
return this.parseBlock(!0, r);
|
|
548
|
-
case a.semi:
|
|
549
|
-
return this.parseEmptyStatement(r);
|
|
550
|
-
case a._export:
|
|
551
|
-
case a._import:
|
|
552
|
-
if (this.options.ecmaVersion > 10 && s === a._import) {
|
|
553
|
-
C.lastIndex = this.pos;
|
|
554
|
-
var u = C.exec(this.input), o = this.pos + u[0].length, h = this.input.charCodeAt(o);
|
|
555
|
-
if (h === 40 || h === 46)
|
|
556
|
-
return this.parseExpressionStatement(r, this.parseExpression());
|
|
557
|
-
}
|
|
558
|
-
return this.options.allowImportExportEverywhere || (t || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), s === a._import ? this.parseImport(r) : this.parseExport(r, i);
|
|
559
|
-
default:
|
|
560
|
-
if (this.isAsyncFunction())
|
|
561
|
-
return e && this.unexpected(), this.next(), this.parseFunctionStatement(r, !0, !e);
|
|
562
|
-
var l = this.isAwaitUsing(!1) ? "await using" : this.isUsing(!1) ? "using" : null;
|
|
563
|
-
if (l)
|
|
564
|
-
return t && this.options.sourceType === "script" && this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script`"), l === "await using" && (this.canAwait || this.raise(this.start, "Await using cannot appear outside of async function"), this.next()), this.next(), this.parseVar(r, !1, l), this.semicolon(), this.finishNode(r, "VariableDeclaration");
|
|
565
|
-
var d = this.value, g = this.parseExpression();
|
|
566
|
-
return s === a.name && g.type === "Identifier" && this.eat(a.colon) ? this.parseLabeledStatement(r, d, g, e) : this.parseExpressionStatement(r, g);
|
|
567
|
-
}
|
|
568
|
-
};
|
|
569
|
-
p.parseBreakContinueStatement = function(e, t) {
|
|
570
|
-
var i = t === "break";
|
|
571
|
-
this.next(), this.eat(a.semi) || this.insertSemicolon() ? e.label = null : this.type !== a.name ? this.unexpected() : (e.label = this.parseIdent(), this.semicolon());
|
|
572
|
-
for (var s = 0; s < this.labels.length; ++s) {
|
|
573
|
-
var r = this.labels[s];
|
|
574
|
-
if ((e.label == null || r.name === e.label.name) && (r.kind != null && (i || r.kind === "loop") || e.label && i))
|
|
575
|
-
break;
|
|
576
|
-
}
|
|
577
|
-
return s === this.labels.length && this.raise(e.start, "Unsyntactic " + t), this.finishNode(e, i ? "BreakStatement" : "ContinueStatement");
|
|
578
|
-
};
|
|
579
|
-
p.parseDebuggerStatement = function(e) {
|
|
580
|
-
return this.next(), this.semicolon(), this.finishNode(e, "DebuggerStatement");
|
|
581
|
-
};
|
|
582
|
-
p.parseDoStatement = function(e) {
|
|
583
|
-
return this.next(), this.labels.push(Se), e.body = this.parseStatement("do"), this.labels.pop(), this.expect(a._while), e.test = this.parseParenExpression(), this.options.ecmaVersion >= 6 ? this.eat(a.semi) : this.semicolon(), this.finishNode(e, "DoWhileStatement");
|
|
584
|
-
};
|
|
585
|
-
p.parseForStatement = function(e) {
|
|
586
|
-
this.next();
|
|
587
|
-
var t = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1;
|
|
588
|
-
if (this.labels.push(Se), this.enterScope(0), this.expect(a.parenL), this.type === a.semi)
|
|
589
|
-
return t > -1 && this.unexpected(t), this.parseFor(e, null);
|
|
590
|
-
var i = this.isLet();
|
|
591
|
-
if (this.type === a._var || this.type === a._const || i) {
|
|
592
|
-
var s = this.startNode(), r = i ? "let" : this.value;
|
|
593
|
-
return this.next(), this.parseVar(s, !0, r), this.finishNode(s, "VariableDeclaration"), this.parseForAfterInit(e, s, t);
|
|
594
|
-
}
|
|
595
|
-
var n = this.isContextual("let"), u = !1, o = this.isUsing(!0) ? "using" : this.isAwaitUsing(!0) ? "await using" : null;
|
|
596
|
-
if (o) {
|
|
597
|
-
var h = this.startNode();
|
|
598
|
-
return this.next(), o === "await using" && this.next(), this.parseVar(h, !0, o), this.finishNode(h, "VariableDeclaration"), this.parseForAfterInit(e, h, t);
|
|
599
|
-
}
|
|
600
|
-
var l = this.containsEsc, d = new oe(), g = this.start, _ = t > -1 ? this.parseExprSubscripts(d, "await") : this.parseExpression(!0, d);
|
|
601
|
-
return this.type === a._in || (u = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (t > -1 ? (this.type === a._in && this.unexpected(t), e.await = !0) : u && this.options.ecmaVersion >= 8 && (_.start === g && !l && _.type === "Identifier" && _.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (e.await = !1)), n && u && this.raise(_.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(_, !1, d), this.checkLValPattern(_), this.parseForIn(e, _)) : (this.checkExpressionErrors(d, !0), t > -1 && this.unexpected(t), this.parseFor(e, _));
|
|
602
|
-
};
|
|
603
|
-
p.parseForAfterInit = function(e, t, i) {
|
|
604
|
-
return (this.type === a._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && t.declarations.length === 1 ? (this.options.ecmaVersion >= 9 && (this.type === a._in ? i > -1 && this.unexpected(i) : e.await = i > -1), this.parseForIn(e, t)) : (i > -1 && this.unexpected(i), this.parseFor(e, t));
|
|
605
|
-
};
|
|
606
|
-
p.parseFunctionStatement = function(e, t, i) {
|
|
607
|
-
return this.next(), this.parseFunction(e, Y | (i ? 0 : me), !1, t);
|
|
608
|
-
};
|
|
609
|
-
p.parseIfStatement = function(e) {
|
|
610
|
-
return this.next(), e.test = this.parseParenExpression(), e.consequent = this.parseStatement("if"), e.alternate = this.eat(a._else) ? this.parseStatement("if") : null, this.finishNode(e, "IfStatement");
|
|
611
|
-
};
|
|
612
|
-
p.parseReturnStatement = function(e) {
|
|
613
|
-
return !this.inFunction && !this.options.allowReturnOutsideFunction && this.raise(this.start, "'return' outside of function"), this.next(), this.eat(a.semi) || this.insertSemicolon() ? e.argument = null : (e.argument = this.parseExpression(), this.semicolon()), this.finishNode(e, "ReturnStatement");
|
|
614
|
-
};
|
|
615
|
-
p.parseSwitchStatement = function(e) {
|
|
616
|
-
this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(a.braceL), this.labels.push(kt), this.enterScope(0);
|
|
617
|
-
for (var t, i = !1; this.type !== a.braceR; )
|
|
618
|
-
if (this.type === a._case || this.type === a._default) {
|
|
619
|
-
var s = this.type === a._case;
|
|
620
|
-
t && this.finishNode(t, "SwitchCase"), e.cases.push(t = this.startNode()), t.consequent = [], this.next(), s ? t.test = this.parseExpression() : (i && this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"), i = !0, t.test = null), this.expect(a.colon);
|
|
621
|
-
} else
|
|
622
|
-
t || this.unexpected(), t.consequent.push(this.parseStatement(null));
|
|
623
|
-
return this.exitScope(), t && this.finishNode(t, "SwitchCase"), this.next(), this.labels.pop(), this.finishNode(e, "SwitchStatement");
|
|
624
|
-
};
|
|
625
|
-
p.parseThrowStatement = function(e) {
|
|
626
|
-
return this.next(), w.test(this.input.slice(this.lastTokEnd, this.start)) && this.raise(this.lastTokEnd, "Illegal newline after throw"), e.argument = this.parseExpression(), this.semicolon(), this.finishNode(e, "ThrowStatement");
|
|
627
|
-
};
|
|
628
|
-
var wt = [];
|
|
629
|
-
p.parseCatchClauseParam = function() {
|
|
630
|
-
var e = this.parseBindingAtom(), t = e.type === "Identifier";
|
|
631
|
-
return this.enterScope(t ? De : 0), this.checkLValPattern(e, t ? Ue : B), this.expect(a.parenR), e;
|
|
632
|
-
};
|
|
633
|
-
p.parseTryStatement = function(e) {
|
|
634
|
-
if (this.next(), e.block = this.parseBlock(), e.handler = null, this.type === a._catch) {
|
|
635
|
-
var t = this.startNode();
|
|
636
|
-
this.next(), this.eat(a.parenL) ? t.param = this.parseCatchClauseParam() : (this.options.ecmaVersion < 10 && this.unexpected(), t.param = null, this.enterScope(0)), t.body = this.parseBlock(!1), this.exitScope(), e.handler = this.finishNode(t, "CatchClause");
|
|
637
|
-
}
|
|
638
|
-
return e.finalizer = this.eat(a._finally) ? this.parseBlock() : null, !e.handler && !e.finalizer && this.raise(e.start, "Missing catch or finally clause"), this.finishNode(e, "TryStatement");
|
|
639
|
-
};
|
|
640
|
-
p.parseVarStatement = function(e, t, i) {
|
|
641
|
-
return this.next(), this.parseVar(e, !1, t, i), this.semicolon(), this.finishNode(e, "VariableDeclaration");
|
|
642
|
-
};
|
|
643
|
-
p.parseWhileStatement = function(e) {
|
|
644
|
-
return this.next(), e.test = this.parseParenExpression(), this.labels.push(Se), e.body = this.parseStatement("while"), this.labels.pop(), this.finishNode(e, "WhileStatement");
|
|
645
|
-
};
|
|
646
|
-
p.parseWithStatement = function(e) {
|
|
647
|
-
return this.strict && this.raise(this.start, "'with' in strict mode"), this.next(), e.object = this.parseParenExpression(), e.body = this.parseStatement("with"), this.finishNode(e, "WithStatement");
|
|
648
|
-
};
|
|
649
|
-
p.parseEmptyStatement = function(e) {
|
|
650
|
-
return this.next(), this.finishNode(e, "EmptyStatement");
|
|
651
|
-
};
|
|
652
|
-
p.parseLabeledStatement = function(e, t, i, s) {
|
|
653
|
-
for (var r = 0, n = this.labels; r < n.length; r += 1) {
|
|
654
|
-
var u = n[r];
|
|
655
|
-
u.name === t && this.raise(i.start, "Label '" + t + "' is already declared");
|
|
656
|
-
}
|
|
657
|
-
for (var o = this.type.isLoop ? "loop" : this.type === a._switch ? "switch" : null, h = this.labels.length - 1; h >= 0; h--) {
|
|
658
|
-
var l = this.labels[h];
|
|
659
|
-
if (l.statementStart === e.start)
|
|
660
|
-
l.statementStart = this.start, l.kind = o;
|
|
661
|
-
else
|
|
662
|
-
break;
|
|
663
|
-
}
|
|
664
|
-
return this.labels.push({ name: t, kind: o, statementStart: this.start }), e.body = this.parseStatement(s ? s.indexOf("label") === -1 ? s + "label" : s : "label"), this.labels.pop(), e.label = i, this.finishNode(e, "LabeledStatement");
|
|
665
|
-
};
|
|
666
|
-
p.parseExpressionStatement = function(e, t) {
|
|
667
|
-
return e.expression = t, this.semicolon(), this.finishNode(e, "ExpressionStatement");
|
|
668
|
-
};
|
|
669
|
-
p.parseBlock = function(e, t, i) {
|
|
670
|
-
for (e === void 0 && (e = !0), t === void 0 && (t = this.startNode()), t.body = [], this.expect(a.braceL), e && this.enterScope(0); this.type !== a.braceR; ) {
|
|
671
|
-
var s = this.parseStatement(null);
|
|
672
|
-
t.body.push(s);
|
|
673
|
-
}
|
|
674
|
-
return i && (this.strict = !1), this.next(), e && this.exitScope(), this.finishNode(t, "BlockStatement");
|
|
675
|
-
};
|
|
676
|
-
p.parseFor = function(e, t) {
|
|
677
|
-
return e.init = t, this.expect(a.semi), e.test = this.type === a.semi ? null : this.parseExpression(), this.expect(a.semi), e.update = this.type === a.parenR ? null : this.parseExpression(), this.expect(a.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, "ForStatement");
|
|
678
|
-
};
|
|
679
|
-
p.parseForIn = function(e, t) {
|
|
680
|
-
var i = this.type === a._in;
|
|
681
|
-
return this.next(), t.type === "VariableDeclaration" && t.declarations[0].init != null && (!i || this.options.ecmaVersion < 8 || this.strict || t.kind !== "var" || t.declarations[0].id.type !== "Identifier") && this.raise(
|
|
682
|
-
t.start,
|
|
683
|
-
(i ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"
|
|
684
|
-
), e.left = t, e.right = i ? this.parseExpression() : this.parseMaybeAssign(), this.expect(a.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, i ? "ForInStatement" : "ForOfStatement");
|
|
685
|
-
};
|
|
686
|
-
p.parseVar = function(e, t, i, s) {
|
|
687
|
-
for (e.declarations = [], e.kind = i; ; ) {
|
|
688
|
-
var r = this.startNode();
|
|
689
|
-
if (this.parseVarId(r, i), this.eat(a.eq) ? r.init = this.parseMaybeAssign(t) : !s && i === "const" && !(this.type === a._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) ? this.unexpected() : !s && (i === "using" || i === "await using") && this.options.ecmaVersion >= 17 && this.type !== a._in && !this.isContextual("of") ? this.raise(this.lastTokEnd, "Missing initializer in " + i + " declaration") : !s && r.id.type !== "Identifier" && !(t && (this.type === a._in || this.isContextual("of"))) ? this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value") : r.init = null, e.declarations.push(this.finishNode(r, "VariableDeclarator")), !this.eat(a.comma))
|
|
690
|
-
break;
|
|
691
|
-
}
|
|
692
|
-
return e;
|
|
693
|
-
};
|
|
694
|
-
p.parseVarId = function(e, t) {
|
|
695
|
-
e.id = t === "using" || t === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(e.id, t === "var" ? Ce : B, !1);
|
|
696
|
-
};
|
|
697
|
-
var Y = 1, me = 2, je = 4;
|
|
698
|
-
p.parseFunction = function(e, t, i, s, r) {
|
|
699
|
-
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !s) && (this.type === a.star && t & me && this.unexpected(), e.generator = this.eat(a.star)), this.options.ecmaVersion >= 8 && (e.async = !!s), t & Y && (e.id = t & je && this.type !== a.name ? null : this.parseIdent(), e.id && !(t & me) && this.checkLValSimple(e.id, this.strict || e.generator || e.async ? this.treatFunctionsAsVar ? Ce : B : Me));
|
|
700
|
-
var n = this.yieldPos, u = this.awaitPos, o = this.awaitIdentPos;
|
|
701
|
-
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(_e(e.async, e.generator)), t & Y || (e.id = this.type === a.name ? this.parseIdent() : null), this.parseFunctionParams(e), this.parseFunctionBody(e, i, !1, r), this.yieldPos = n, this.awaitPos = u, this.awaitIdentPos = o, this.finishNode(e, t & Y ? "FunctionDeclaration" : "FunctionExpression");
|
|
702
|
-
};
|
|
703
|
-
p.parseFunctionParams = function(e) {
|
|
704
|
-
this.expect(a.parenL), e.params = this.parseBindingList(a.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
|
|
705
|
-
};
|
|
706
|
-
p.parseClass = function(e, t) {
|
|
707
|
-
this.next();
|
|
708
|
-
var i = this.strict;
|
|
709
|
-
this.strict = !0, this.parseClassId(e, t), this.parseClassSuper(e);
|
|
710
|
-
var s = this.enterClassBody(), r = this.startNode(), n = !1;
|
|
711
|
-
for (r.body = [], this.expect(a.braceL); this.type !== a.braceR; ) {
|
|
712
|
-
var u = this.parseClassElement(e.superClass !== null);
|
|
713
|
-
u && (r.body.push(u), u.type === "MethodDefinition" && u.kind === "constructor" ? (n && this.raiseRecoverable(u.start, "Duplicate constructor in the same class"), n = !0) : u.key && u.key.type === "PrivateIdentifier" && At(s, u) && this.raiseRecoverable(u.key.start, "Identifier '#" + u.key.name + "' has already been declared"));
|
|
714
|
-
}
|
|
715
|
-
return this.strict = i, this.next(), e.body = this.finishNode(r, "ClassBody"), this.exitClassBody(), this.finishNode(e, t ? "ClassDeclaration" : "ClassExpression");
|
|
716
|
-
};
|
|
717
|
-
p.parseClassElement = function(e) {
|
|
718
|
-
if (this.eat(a.semi))
|
|
719
|
-
return null;
|
|
720
|
-
var t = this.options.ecmaVersion, i = this.startNode(), s = "", r = !1, n = !1, u = "method", o = !1;
|
|
721
|
-
if (this.eatContextual("static")) {
|
|
722
|
-
if (t >= 13 && this.eat(a.braceL))
|
|
723
|
-
return this.parseClassStaticBlock(i), i;
|
|
724
|
-
this.isClassElementNameStart() || this.type === a.star ? o = !0 : s = "static";
|
|
725
|
-
}
|
|
726
|
-
if (i.static = o, !s && t >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === a.star) && !this.canInsertSemicolon() ? n = !0 : s = "async"), !s && (t >= 9 || !n) && this.eat(a.star) && (r = !0), !s && !n && !r) {
|
|
727
|
-
var h = this.value;
|
|
728
|
-
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? u = h : s = h);
|
|
729
|
-
}
|
|
730
|
-
if (s ? (i.computed = !1, i.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), i.key.name = s, this.finishNode(i.key, "Identifier")) : this.parseClassElementName(i), t < 13 || this.type === a.parenL || u !== "method" || r || n) {
|
|
731
|
-
var l = !i.static && ie(i, "constructor"), d = l && e;
|
|
732
|
-
l && u !== "method" && this.raise(i.key.start, "Constructor can't have get/set modifier"), i.kind = l ? "constructor" : u, this.parseClassMethod(i, r, n, d);
|
|
733
|
-
} else
|
|
734
|
-
this.parseClassField(i);
|
|
735
|
-
return i;
|
|
736
|
-
};
|
|
737
|
-
p.isClassElementNameStart = function() {
|
|
738
|
-
return this.type === a.name || this.type === a.privateId || this.type === a.num || this.type === a.string || this.type === a.bracketL || this.type.keyword;
|
|
739
|
-
};
|
|
740
|
-
p.parseClassElementName = function(e) {
|
|
741
|
-
this.type === a.privateId ? (this.value === "constructor" && this.raise(this.start, "Classes can't have an element named '#constructor'"), e.computed = !1, e.key = this.parsePrivateIdent()) : this.parsePropertyName(e);
|
|
742
|
-
};
|
|
743
|
-
p.parseClassMethod = function(e, t, i, s) {
|
|
744
|
-
var r = e.key;
|
|
745
|
-
e.kind === "constructor" ? (t && this.raise(r.start, "Constructor can't be a generator"), i && this.raise(r.start, "Constructor can't be an async method")) : e.static && ie(e, "prototype") && this.raise(r.start, "Classes may not have a static property named prototype");
|
|
746
|
-
var n = e.value = this.parseMethod(t, i, s);
|
|
747
|
-
return e.kind === "get" && n.params.length !== 0 && this.raiseRecoverable(n.start, "getter should have no params"), e.kind === "set" && n.params.length !== 1 && this.raiseRecoverable(n.start, "setter should have exactly one param"), e.kind === "set" && n.params[0].type === "RestElement" && this.raiseRecoverable(n.params[0].start, "Setter cannot use rest params"), this.finishNode(e, "MethodDefinition");
|
|
748
|
-
};
|
|
749
|
-
p.parseClassField = function(e) {
|
|
750
|
-
return ie(e, "constructor") ? this.raise(e.key.start, "Classes can't have a field named 'constructor'") : e.static && ie(e, "prototype") && this.raise(e.key.start, "Classes can't have a static field named 'prototype'"), this.eat(a.eq) ? (this.enterScope(J | ne), e.value = this.parseMaybeAssign(), this.exitScope()) : e.value = null, this.semicolon(), this.finishNode(e, "PropertyDefinition");
|
|
751
|
-
};
|
|
752
|
-
p.parseClassStaticBlock = function(e) {
|
|
753
|
-
e.body = [];
|
|
754
|
-
var t = this.labels;
|
|
755
|
-
for (this.labels = [], this.enterScope(U | ne); this.type !== a.braceR; ) {
|
|
756
|
-
var i = this.parseStatement(null);
|
|
757
|
-
e.body.push(i);
|
|
758
|
-
}
|
|
759
|
-
return this.next(), this.exitScope(), this.labels = t, this.finishNode(e, "StaticBlock");
|
|
760
|
-
};
|
|
761
|
-
p.parseClassId = function(e, t) {
|
|
762
|
-
this.type === a.name ? (e.id = this.parseIdent(), t && this.checkLValSimple(e.id, B, !1)) : (t === !0 && this.unexpected(), e.id = null);
|
|
763
|
-
};
|
|
764
|
-
p.parseClassSuper = function(e) {
|
|
765
|
-
e.superClass = this.eat(a._extends) ? this.parseExprSubscripts(null, !1) : null;
|
|
766
|
-
};
|
|
767
|
-
p.enterClassBody = function() {
|
|
768
|
-
var e = { declared: /* @__PURE__ */ Object.create(null), used: [] };
|
|
769
|
-
return this.privateNameStack.push(e), e.declared;
|
|
770
|
-
};
|
|
771
|
-
p.exitClassBody = function() {
|
|
772
|
-
var e = this.privateNameStack.pop(), t = e.declared, i = e.used;
|
|
773
|
-
if (this.options.checkPrivateFields)
|
|
774
|
-
for (var s = this.privateNameStack.length, r = s === 0 ? null : this.privateNameStack[s - 1], n = 0; n < i.length; ++n) {
|
|
775
|
-
var u = i[n];
|
|
776
|
-
W(t, u.name) || (r ? r.used.push(u) : this.raiseRecoverable(u.start, "Private field '#" + u.name + "' must be declared in an enclosing class"));
|
|
777
|
-
}
|
|
778
|
-
};
|
|
779
|
-
function At(e, t) {
|
|
780
|
-
var i = t.key.name, s = e[i], r = "true";
|
|
781
|
-
return t.type === "MethodDefinition" && (t.kind === "get" || t.kind === "set") && (r = (t.static ? "s" : "i") + t.kind), s === "iget" && r === "iset" || s === "iset" && r === "iget" || s === "sget" && r === "sset" || s === "sset" && r === "sget" ? (e[i] = "true", !1) : s ? !0 : (e[i] = r, !1);
|
|
782
|
-
}
|
|
783
|
-
function ie(e, t) {
|
|
784
|
-
var i = e.computed, s = e.key;
|
|
785
|
-
return !i && (s.type === "Identifier" && s.name === t || s.type === "Literal" && s.value === t);
|
|
786
|
-
}
|
|
787
|
-
p.parseExportAllDeclaration = function(e, t) {
|
|
788
|
-
return this.options.ecmaVersion >= 11 && (this.eatContextual("as") ? (e.exported = this.parseModuleExportName(), this.checkExport(t, e.exported, this.lastTokStart)) : e.exported = null), this.expectContextual("from"), this.type !== a.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ExportAllDeclaration");
|
|
789
|
-
};
|
|
790
|
-
p.parseExport = function(e, t) {
|
|
791
|
-
if (this.next(), this.eat(a.star))
|
|
792
|
-
return this.parseExportAllDeclaration(e, t);
|
|
793
|
-
if (this.eat(a._default))
|
|
794
|
-
return this.checkExport(t, "default", this.lastTokStart), e.declaration = this.parseExportDefaultDeclaration(), this.finishNode(e, "ExportDefaultDeclaration");
|
|
795
|
-
if (this.shouldParseExportStatement())
|
|
796
|
-
e.declaration = this.parseExportDeclaration(e), e.declaration.type === "VariableDeclaration" ? this.checkVariableExport(t, e.declaration.declarations) : this.checkExport(t, e.declaration.id, e.declaration.id.start), e.specifiers = [], e.source = null, this.options.ecmaVersion >= 16 && (e.attributes = []);
|
|
797
|
-
else {
|
|
798
|
-
if (e.declaration = null, e.specifiers = this.parseExportSpecifiers(t), this.eatContextual("from"))
|
|
799
|
-
this.type !== a.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause());
|
|
800
|
-
else {
|
|
801
|
-
for (var i = 0, s = e.specifiers; i < s.length; i += 1) {
|
|
802
|
-
var r = s[i];
|
|
803
|
-
this.checkUnreserved(r.local), this.checkLocalExport(r.local), r.local.type === "Literal" && this.raise(r.local.start, "A string literal cannot be used as an exported binding without `from`.");
|
|
804
|
-
}
|
|
805
|
-
e.source = null, this.options.ecmaVersion >= 16 && (e.attributes = []);
|
|
806
|
-
}
|
|
807
|
-
this.semicolon();
|
|
808
|
-
}
|
|
809
|
-
return this.finishNode(e, "ExportNamedDeclaration");
|
|
810
|
-
};
|
|
811
|
-
p.parseExportDeclaration = function(e) {
|
|
812
|
-
return this.parseStatement(null);
|
|
813
|
-
};
|
|
814
|
-
p.parseExportDefaultDeclaration = function() {
|
|
815
|
-
var e;
|
|
816
|
-
if (this.type === a._function || (e = this.isAsyncFunction())) {
|
|
817
|
-
var t = this.startNode();
|
|
818
|
-
return this.next(), e && this.next(), this.parseFunction(t, Y | je, !1, e);
|
|
819
|
-
} else if (this.type === a._class) {
|
|
820
|
-
var i = this.startNode();
|
|
821
|
-
return this.parseClass(i, "nullableID");
|
|
822
|
-
} else {
|
|
823
|
-
var s = this.parseMaybeAssign();
|
|
824
|
-
return this.semicolon(), s;
|
|
825
|
-
}
|
|
826
|
-
};
|
|
827
|
-
p.checkExport = function(e, t, i) {
|
|
828
|
-
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value), W(e, t) && this.raiseRecoverable(i, "Duplicate export '" + t + "'"), e[t] = !0);
|
|
829
|
-
};
|
|
830
|
-
p.checkPatternExport = function(e, t) {
|
|
831
|
-
var i = t.type;
|
|
832
|
-
if (i === "Identifier")
|
|
833
|
-
this.checkExport(e, t, t.start);
|
|
834
|
-
else if (i === "ObjectPattern")
|
|
835
|
-
for (var s = 0, r = t.properties; s < r.length; s += 1) {
|
|
836
|
-
var n = r[s];
|
|
837
|
-
this.checkPatternExport(e, n);
|
|
838
|
-
}
|
|
839
|
-
else if (i === "ArrayPattern")
|
|
840
|
-
for (var u = 0, o = t.elements; u < o.length; u += 1) {
|
|
841
|
-
var h = o[u];
|
|
842
|
-
h && this.checkPatternExport(e, h);
|
|
843
|
-
}
|
|
844
|
-
else
|
|
845
|
-
i === "Property" ? this.checkPatternExport(e, t.value) : i === "AssignmentPattern" ? this.checkPatternExport(e, t.left) : i === "RestElement" && this.checkPatternExport(e, t.argument);
|
|
846
|
-
};
|
|
847
|
-
p.checkVariableExport = function(e, t) {
|
|
848
|
-
if (e)
|
|
849
|
-
for (var i = 0, s = t; i < s.length; i += 1) {
|
|
850
|
-
var r = s[i];
|
|
851
|
-
this.checkPatternExport(e, r.id);
|
|
852
|
-
}
|
|
853
|
-
};
|
|
854
|
-
p.shouldParseExportStatement = function() {
|
|
855
|
-
return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction();
|
|
856
|
-
};
|
|
857
|
-
p.parseExportSpecifier = function(e) {
|
|
858
|
-
var t = this.startNode();
|
|
859
|
-
return t.local = this.parseModuleExportName(), t.exported = this.eatContextual("as") ? this.parseModuleExportName() : t.local, this.checkExport(
|
|
860
|
-
e,
|
|
861
|
-
t.exported,
|
|
862
|
-
t.exported.start
|
|
863
|
-
), this.finishNode(t, "ExportSpecifier");
|
|
864
|
-
};
|
|
865
|
-
p.parseExportSpecifiers = function(e) {
|
|
866
|
-
var t = [], i = !0;
|
|
867
|
-
for (this.expect(a.braceL); !this.eat(a.braceR); ) {
|
|
868
|
-
if (i)
|
|
869
|
-
i = !1;
|
|
870
|
-
else if (this.expect(a.comma), this.afterTrailingComma(a.braceR))
|
|
871
|
-
break;
|
|
872
|
-
t.push(this.parseExportSpecifier(e));
|
|
873
|
-
}
|
|
874
|
-
return t;
|
|
875
|
-
};
|
|
876
|
-
p.parseImport = function(e) {
|
|
877
|
-
return this.next(), this.type === a.string ? (e.specifiers = wt, e.source = this.parseExprAtom()) : (e.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), e.source = this.type === a.string ? this.parseExprAtom() : this.unexpected()), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ImportDeclaration");
|
|
878
|
-
};
|
|
879
|
-
p.parseImportSpecifier = function() {
|
|
880
|
-
var e = this.startNode();
|
|
881
|
-
return e.imported = this.parseModuleExportName(), this.eatContextual("as") ? e.local = this.parseIdent() : (this.checkUnreserved(e.imported), e.local = e.imported), this.checkLValSimple(e.local, B), this.finishNode(e, "ImportSpecifier");
|
|
882
|
-
};
|
|
883
|
-
p.parseImportDefaultSpecifier = function() {
|
|
884
|
-
var e = this.startNode();
|
|
885
|
-
return e.local = this.parseIdent(), this.checkLValSimple(e.local, B), this.finishNode(e, "ImportDefaultSpecifier");
|
|
886
|
-
};
|
|
887
|
-
p.parseImportNamespaceSpecifier = function() {
|
|
888
|
-
var e = this.startNode();
|
|
889
|
-
return this.next(), this.expectContextual("as"), e.local = this.parseIdent(), this.checkLValSimple(e.local, B), this.finishNode(e, "ImportNamespaceSpecifier");
|
|
890
|
-
};
|
|
891
|
-
p.parseImportSpecifiers = function() {
|
|
892
|
-
var e = [], t = !0;
|
|
893
|
-
if (this.type === a.name && (e.push(this.parseImportDefaultSpecifier()), !this.eat(a.comma)))
|
|
894
|
-
return e;
|
|
895
|
-
if (this.type === a.star)
|
|
896
|
-
return e.push(this.parseImportNamespaceSpecifier()), e;
|
|
897
|
-
for (this.expect(a.braceL); !this.eat(a.braceR); ) {
|
|
898
|
-
if (t)
|
|
899
|
-
t = !1;
|
|
900
|
-
else if (this.expect(a.comma), this.afterTrailingComma(a.braceR))
|
|
901
|
-
break;
|
|
902
|
-
e.push(this.parseImportSpecifier());
|
|
903
|
-
}
|
|
904
|
-
return e;
|
|
905
|
-
};
|
|
906
|
-
p.parseWithClause = function() {
|
|
907
|
-
var e = [];
|
|
908
|
-
if (!this.eat(a._with))
|
|
909
|
-
return e;
|
|
910
|
-
this.expect(a.braceL);
|
|
911
|
-
for (var t = {}, i = !0; !this.eat(a.braceR); ) {
|
|
912
|
-
if (i)
|
|
913
|
-
i = !1;
|
|
914
|
-
else if (this.expect(a.comma), this.afterTrailingComma(a.braceR))
|
|
915
|
-
break;
|
|
916
|
-
var s = this.parseImportAttribute(), r = s.key.type === "Identifier" ? s.key.name : s.key.value;
|
|
917
|
-
W(t, r) && this.raiseRecoverable(s.key.start, "Duplicate attribute key '" + r + "'"), t[r] = !0, e.push(s);
|
|
918
|
-
}
|
|
919
|
-
return e;
|
|
920
|
-
};
|
|
921
|
-
p.parseImportAttribute = function() {
|
|
922
|
-
var e = this.startNode();
|
|
923
|
-
return e.key = this.type === a.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"), this.expect(a.colon), this.type !== a.string && this.unexpected(), e.value = this.parseExprAtom(), this.finishNode(e, "ImportAttribute");
|
|
924
|
-
};
|
|
925
|
-
p.parseModuleExportName = function() {
|
|
926
|
-
if (this.options.ecmaVersion >= 13 && this.type === a.string) {
|
|
927
|
-
var e = this.parseLiteral(this.value);
|
|
928
|
-
return yt.test(e.value) && this.raise(e.start, "An export name cannot include a lone surrogate."), e;
|
|
929
|
-
}
|
|
930
|
-
return this.parseIdent(!0);
|
|
931
|
-
};
|
|
932
|
-
p.adaptDirectivePrologue = function(e) {
|
|
933
|
-
for (var t = 0; t < e.length && this.isDirectiveCandidate(e[t]); ++t)
|
|
934
|
-
e[t].directive = e[t].expression.raw.slice(1, -1);
|
|
935
|
-
};
|
|
936
|
-
p.isDirectiveCandidate = function(e) {
|
|
937
|
-
return this.options.ecmaVersion >= 5 && e.type === "ExpressionStatement" && e.expression.type === "Literal" && typeof e.expression.value == "string" && (this.input[e.start] === '"' || this.input[e.start] === "'");
|
|
938
|
-
};
|
|
939
|
-
var P = y.prototype;
|
|
940
|
-
P.toAssignable = function(e, t, i) {
|
|
941
|
-
if (this.options.ecmaVersion >= 6 && e)
|
|
942
|
-
switch (e.type) {
|
|
943
|
-
case "Identifier":
|
|
944
|
-
this.inAsync && e.name === "await" && this.raise(e.start, "Cannot use 'await' as identifier inside an async function");
|
|
945
|
-
break;
|
|
946
|
-
case "ObjectPattern":
|
|
947
|
-
case "ArrayPattern":
|
|
948
|
-
case "AssignmentPattern":
|
|
949
|
-
case "RestElement":
|
|
950
|
-
break;
|
|
951
|
-
case "ObjectExpression":
|
|
952
|
-
e.type = "ObjectPattern", i && this.checkPatternErrors(i, !0);
|
|
953
|
-
for (var s = 0, r = e.properties; s < r.length; s += 1) {
|
|
954
|
-
var n = r[s];
|
|
955
|
-
this.toAssignable(n, t), n.type === "RestElement" && (n.argument.type === "ArrayPattern" || n.argument.type === "ObjectPattern") && this.raise(n.argument.start, "Unexpected token");
|
|
956
|
-
}
|
|
957
|
-
break;
|
|
958
|
-
case "Property":
|
|
959
|
-
e.kind !== "init" && this.raise(e.key.start, "Object pattern can't contain getter or setter"), this.toAssignable(e.value, t);
|
|
960
|
-
break;
|
|
961
|
-
case "ArrayExpression":
|
|
962
|
-
e.type = "ArrayPattern", i && this.checkPatternErrors(i, !0), this.toAssignableList(e.elements, t);
|
|
963
|
-
break;
|
|
964
|
-
case "SpreadElement":
|
|
965
|
-
e.type = "RestElement", this.toAssignable(e.argument, t), e.argument.type === "AssignmentPattern" && this.raise(e.argument.start, "Rest elements cannot have a default value");
|
|
966
|
-
break;
|
|
967
|
-
case "AssignmentExpression":
|
|
968
|
-
e.operator !== "=" && this.raise(e.left.end, "Only '=' operator can be used for specifying default value."), e.type = "AssignmentPattern", delete e.operator, this.toAssignable(e.left, t);
|
|
969
|
-
break;
|
|
970
|
-
case "ParenthesizedExpression":
|
|
971
|
-
this.toAssignable(e.expression, t, i);
|
|
972
|
-
break;
|
|
973
|
-
case "ChainExpression":
|
|
974
|
-
this.raiseRecoverable(e.start, "Optional chaining cannot appear in left-hand side");
|
|
975
|
-
break;
|
|
976
|
-
case "MemberExpression":
|
|
977
|
-
if (!t)
|
|
978
|
-
break;
|
|
979
|
-
default:
|
|
980
|
-
this.raise(e.start, "Assigning to rvalue");
|
|
981
|
-
}
|
|
982
|
-
else
|
|
983
|
-
i && this.checkPatternErrors(i, !0);
|
|
984
|
-
return e;
|
|
985
|
-
};
|
|
986
|
-
P.toAssignableList = function(e, t) {
|
|
987
|
-
for (var i = e.length, s = 0; s < i; s++) {
|
|
988
|
-
var r = e[s];
|
|
989
|
-
r && this.toAssignable(r, t);
|
|
990
|
-
}
|
|
991
|
-
if (i) {
|
|
992
|
-
var n = e[i - 1];
|
|
993
|
-
this.options.ecmaVersion === 6 && t && n && n.type === "RestElement" && n.argument.type !== "Identifier" && this.unexpected(n.argument.start);
|
|
994
|
-
}
|
|
995
|
-
return e;
|
|
996
|
-
};
|
|
997
|
-
P.parseSpread = function(e) {
|
|
998
|
-
var t = this.startNode();
|
|
999
|
-
return this.next(), t.argument = this.parseMaybeAssign(!1, e), this.finishNode(t, "SpreadElement");
|
|
1000
|
-
};
|
|
1001
|
-
P.parseRestBinding = function() {
|
|
1002
|
-
var e = this.startNode();
|
|
1003
|
-
return this.next(), this.options.ecmaVersion === 6 && this.type !== a.name && this.unexpected(), e.argument = this.parseBindingAtom(), this.finishNode(e, "RestElement");
|
|
1004
|
-
};
|
|
1005
|
-
P.parseBindingAtom = function() {
|
|
1006
|
-
if (this.options.ecmaVersion >= 6)
|
|
1007
|
-
switch (this.type) {
|
|
1008
|
-
case a.bracketL:
|
|
1009
|
-
var e = this.startNode();
|
|
1010
|
-
return this.next(), e.elements = this.parseBindingList(a.bracketR, !0, !0), this.finishNode(e, "ArrayPattern");
|
|
1011
|
-
case a.braceL:
|
|
1012
|
-
return this.parseObj(!0);
|
|
1013
|
-
}
|
|
1014
|
-
return this.parseIdent();
|
|
1015
|
-
};
|
|
1016
|
-
P.parseBindingList = function(e, t, i, s) {
|
|
1017
|
-
for (var r = [], n = !0; !this.eat(e); )
|
|
1018
|
-
if (n ? n = !1 : this.expect(a.comma), t && this.type === a.comma)
|
|
1019
|
-
r.push(null);
|
|
1020
|
-
else {
|
|
1021
|
-
if (i && this.afterTrailingComma(e))
|
|
1022
|
-
break;
|
|
1023
|
-
if (this.type === a.ellipsis) {
|
|
1024
|
-
var u = this.parseRestBinding();
|
|
1025
|
-
this.parseBindingListItem(u), r.push(u), this.type === a.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.expect(e);
|
|
1026
|
-
break;
|
|
1027
|
-
} else
|
|
1028
|
-
r.push(this.parseAssignableListItem(s));
|
|
1029
|
-
}
|
|
1030
|
-
return r;
|
|
1031
|
-
};
|
|
1032
|
-
P.parseAssignableListItem = function(e) {
|
|
1033
|
-
var t = this.parseMaybeDefault(this.start, this.startLoc);
|
|
1034
|
-
return this.parseBindingListItem(t), t;
|
|
1035
|
-
};
|
|
1036
|
-
P.parseBindingListItem = function(e) {
|
|
1037
|
-
return e;
|
|
1038
|
-
};
|
|
1039
|
-
P.parseMaybeDefault = function(e, t, i) {
|
|
1040
|
-
if (i = i || this.parseBindingAtom(), this.options.ecmaVersion < 6 || !this.eat(a.eq))
|
|
1041
|
-
return i;
|
|
1042
|
-
var s = this.startNodeAt(e, t);
|
|
1043
|
-
return s.left = i, s.right = this.parseMaybeAssign(), this.finishNode(s, "AssignmentPattern");
|
|
1044
|
-
};
|
|
1045
|
-
P.checkLValSimple = function(e, t, i) {
|
|
1046
|
-
t === void 0 && (t = te);
|
|
1047
|
-
var s = t !== te;
|
|
1048
|
-
switch (e.type) {
|
|
1049
|
-
case "Identifier":
|
|
1050
|
-
this.strict && this.reservedWordsStrictBind.test(e.name) && this.raiseRecoverable(e.start, (s ? "Binding " : "Assigning to ") + e.name + " in strict mode"), s && (t === B && e.name === "let" && this.raiseRecoverable(e.start, "let is disallowed as a lexically bound name"), i && (W(i, e.name) && this.raiseRecoverable(e.start, "Argument name clash"), i[e.name] = !0), t !== qe && this.declareName(e.name, t, e.start));
|
|
1051
|
-
break;
|
|
1052
|
-
case "ChainExpression":
|
|
1053
|
-
this.raiseRecoverable(e.start, "Optional chaining cannot appear in left-hand side");
|
|
1054
|
-
break;
|
|
1055
|
-
case "MemberExpression":
|
|
1056
|
-
s && this.raiseRecoverable(e.start, "Binding member expression");
|
|
1057
|
-
break;
|
|
1058
|
-
case "ParenthesizedExpression":
|
|
1059
|
-
return s && this.raiseRecoverable(e.start, "Binding parenthesized expression"), this.checkLValSimple(e.expression, t, i);
|
|
1060
|
-
default:
|
|
1061
|
-
this.raise(e.start, (s ? "Binding" : "Assigning to") + " rvalue");
|
|
1062
|
-
}
|
|
1063
|
-
};
|
|
1064
|
-
P.checkLValPattern = function(e, t, i) {
|
|
1065
|
-
switch (t === void 0 && (t = te), e.type) {
|
|
1066
|
-
case "ObjectPattern":
|
|
1067
|
-
for (var s = 0, r = e.properties; s < r.length; s += 1) {
|
|
1068
|
-
var n = r[s];
|
|
1069
|
-
this.checkLValInnerPattern(n, t, i);
|
|
1070
|
-
}
|
|
1071
|
-
break;
|
|
1072
|
-
case "ArrayPattern":
|
|
1073
|
-
for (var u = 0, o = e.elements; u < o.length; u += 1) {
|
|
1074
|
-
var h = o[u];
|
|
1075
|
-
h && this.checkLValInnerPattern(h, t, i);
|
|
1076
|
-
}
|
|
1077
|
-
break;
|
|
1078
|
-
default:
|
|
1079
|
-
this.checkLValSimple(e, t, i);
|
|
1080
|
-
}
|
|
1081
|
-
};
|
|
1082
|
-
P.checkLValInnerPattern = function(e, t, i) {
|
|
1083
|
-
switch (t === void 0 && (t = te), e.type) {
|
|
1084
|
-
case "Property":
|
|
1085
|
-
this.checkLValInnerPattern(e.value, t, i);
|
|
1086
|
-
break;
|
|
1087
|
-
case "AssignmentPattern":
|
|
1088
|
-
this.checkLValPattern(e.left, t, i);
|
|
1089
|
-
break;
|
|
1090
|
-
case "RestElement":
|
|
1091
|
-
this.checkLValPattern(e.argument, t, i);
|
|
1092
|
-
break;
|
|
1093
|
-
default:
|
|
1094
|
-
this.checkLValPattern(e, t, i);
|
|
1095
|
-
}
|
|
1096
|
-
};
|
|
1097
|
-
var N = function(t, i, s, r, n) {
|
|
1098
|
-
this.token = t, this.isExpr = !!i, this.preserveSpace = !!s, this.override = r, this.generator = !!n;
|
|
1099
|
-
}, b = {
|
|
1100
|
-
b_stat: new N("{", !1),
|
|
1101
|
-
b_expr: new N("{", !0),
|
|
1102
|
-
b_tmpl: new N("${", !1),
|
|
1103
|
-
p_stat: new N("(", !1),
|
|
1104
|
-
p_expr: new N("(", !0),
|
|
1105
|
-
q_tmpl: new N("`", !0, !0, function(e) {
|
|
1106
|
-
return e.tryReadTemplateToken();
|
|
1107
|
-
}),
|
|
1108
|
-
f_stat: new N("function", !1),
|
|
1109
|
-
f_expr: new N("function", !0),
|
|
1110
|
-
f_expr_gen: new N("function", !0, !1, null, !0),
|
|
1111
|
-
f_gen: new N("function", !1, !1, null, !0)
|
|
1112
|
-
}, K = y.prototype;
|
|
1113
|
-
K.initialContext = function() {
|
|
1114
|
-
return [b.b_stat];
|
|
1115
|
-
};
|
|
1116
|
-
K.curContext = function() {
|
|
1117
|
-
return this.context[this.context.length - 1];
|
|
1118
|
-
};
|
|
1119
|
-
K.braceIsBlock = function(e) {
|
|
1120
|
-
var t = this.curContext();
|
|
1121
|
-
return t === b.f_expr || t === b.f_stat ? !0 : e === a.colon && (t === b.b_stat || t === b.b_expr) ? !t.isExpr : e === a._return || e === a.name && this.exprAllowed ? w.test(this.input.slice(this.lastTokEnd, this.start)) : e === a._else || e === a.semi || e === a.eof || e === a.parenR || e === a.arrow ? !0 : e === a.braceL ? t === b.b_stat : e === a._var || e === a._const || e === a.name ? !1 : !this.exprAllowed;
|
|
1122
|
-
};
|
|
1123
|
-
K.inGeneratorContext = function() {
|
|
1124
|
-
for (var e = this.context.length - 1; e >= 1; e--) {
|
|
1125
|
-
var t = this.context[e];
|
|
1126
|
-
if (t.token === "function")
|
|
1127
|
-
return t.generator;
|
|
1128
|
-
}
|
|
1129
|
-
return !1;
|
|
1130
|
-
};
|
|
1131
|
-
K.updateContext = function(e) {
|
|
1132
|
-
var t, i = this.type;
|
|
1133
|
-
i.keyword && e === a.dot ? this.exprAllowed = !1 : (t = i.updateContext) ? t.call(this, e) : this.exprAllowed = i.beforeExpr;
|
|
1134
|
-
};
|
|
1135
|
-
K.overrideContext = function(e) {
|
|
1136
|
-
this.curContext() !== e && (this.context[this.context.length - 1] = e);
|
|
1137
|
-
};
|
|
1138
|
-
a.parenR.updateContext = a.braceR.updateContext = function() {
|
|
1139
|
-
if (this.context.length === 1) {
|
|
1140
|
-
this.exprAllowed = !0;
|
|
1141
|
-
return;
|
|
1142
|
-
}
|
|
1143
|
-
var e = this.context.pop();
|
|
1144
|
-
e === b.b_stat && this.curContext().token === "function" && (e = this.context.pop()), this.exprAllowed = !e.isExpr;
|
|
1145
|
-
};
|
|
1146
|
-
a.braceL.updateContext = function(e) {
|
|
1147
|
-
this.context.push(this.braceIsBlock(e) ? b.b_stat : b.b_expr), this.exprAllowed = !0;
|
|
1148
|
-
};
|
|
1149
|
-
a.dollarBraceL.updateContext = function() {
|
|
1150
|
-
this.context.push(b.b_tmpl), this.exprAllowed = !0;
|
|
1151
|
-
};
|
|
1152
|
-
a.parenL.updateContext = function(e) {
|
|
1153
|
-
var t = e === a._if || e === a._for || e === a._with || e === a._while;
|
|
1154
|
-
this.context.push(t ? b.p_stat : b.p_expr), this.exprAllowed = !0;
|
|
1155
|
-
};
|
|
1156
|
-
a.incDec.updateContext = function() {
|
|
1157
|
-
};
|
|
1158
|
-
a._function.updateContext = a._class.updateContext = function(e) {
|
|
1159
|
-
e.beforeExpr && e !== a._else && !(e === a.semi && this.curContext() !== b.p_stat) && !(e === a._return && w.test(this.input.slice(this.lastTokEnd, this.start))) && !((e === a.colon || e === a.braceL) && this.curContext() === b.b_stat) ? this.context.push(b.f_expr) : this.context.push(b.f_stat), this.exprAllowed = !1;
|
|
1160
|
-
};
|
|
1161
|
-
a.colon.updateContext = function() {
|
|
1162
|
-
this.curContext().token === "function" && this.context.pop(), this.exprAllowed = !0;
|
|
1163
|
-
};
|
|
1164
|
-
a.backQuote.updateContext = function() {
|
|
1165
|
-
this.curContext() === b.q_tmpl ? this.context.pop() : this.context.push(b.q_tmpl), this.exprAllowed = !1;
|
|
1166
|
-
};
|
|
1167
|
-
a.star.updateContext = function(e) {
|
|
1168
|
-
if (e === a._function) {
|
|
1169
|
-
var t = this.context.length - 1;
|
|
1170
|
-
this.context[t] === b.f_expr ? this.context[t] = b.f_expr_gen : this.context[t] = b.f_gen;
|
|
1171
|
-
}
|
|
1172
|
-
this.exprAllowed = !0;
|
|
1173
|
-
};
|
|
1174
|
-
a.name.updateContext = function(e) {
|
|
1175
|
-
var t = !1;
|
|
1176
|
-
this.options.ecmaVersion >= 6 && e !== a.dot && (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) && (t = !0), this.exprAllowed = t;
|
|
1177
|
-
};
|
|
1178
|
-
var f = y.prototype;
|
|
1179
|
-
f.checkPropClash = function(e, t, i) {
|
|
1180
|
-
if (!(this.options.ecmaVersion >= 9 && e.type === "SpreadElement") && !(this.options.ecmaVersion >= 6 && (e.computed || e.method || e.shorthand))) {
|
|
1181
|
-
var s = e.key, r;
|
|
1182
|
-
switch (s.type) {
|
|
1183
|
-
case "Identifier":
|
|
1184
|
-
r = s.name;
|
|
1185
|
-
break;
|
|
1186
|
-
case "Literal":
|
|
1187
|
-
r = String(s.value);
|
|
1188
|
-
break;
|
|
1189
|
-
default:
|
|
1190
|
-
return;
|
|
1191
|
-
}
|
|
1192
|
-
var n = e.kind;
|
|
1193
|
-
if (this.options.ecmaVersion >= 6) {
|
|
1194
|
-
r === "__proto__" && n === "init" && (t.proto && (i ? i.doubleProto < 0 && (i.doubleProto = s.start) : this.raiseRecoverable(s.start, "Redefinition of __proto__ property")), t.proto = !0);
|
|
1195
|
-
return;
|
|
1196
|
-
}
|
|
1197
|
-
r = "$" + r;
|
|
1198
|
-
var u = t[r];
|
|
1199
|
-
if (u) {
|
|
1200
|
-
var o;
|
|
1201
|
-
n === "init" ? o = this.strict && u.init || u.get || u.set : o = u.init || u[n], o && this.raiseRecoverable(s.start, "Redefinition of property");
|
|
1202
|
-
} else
|
|
1203
|
-
u = t[r] = {
|
|
1204
|
-
init: !1,
|
|
1205
|
-
get: !1,
|
|
1206
|
-
set: !1
|
|
1207
|
-
};
|
|
1208
|
-
u[n] = !0;
|
|
1209
|
-
}
|
|
1210
|
-
};
|
|
1211
|
-
f.parseExpression = function(e, t) {
|
|
1212
|
-
var i = this.start, s = this.startLoc, r = this.parseMaybeAssign(e, t);
|
|
1213
|
-
if (this.type === a.comma) {
|
|
1214
|
-
var n = this.startNodeAt(i, s);
|
|
1215
|
-
for (n.expressions = [r]; this.eat(a.comma); )
|
|
1216
|
-
n.expressions.push(this.parseMaybeAssign(e, t));
|
|
1217
|
-
return this.finishNode(n, "SequenceExpression");
|
|
1218
|
-
}
|
|
1219
|
-
return r;
|
|
1220
|
-
};
|
|
1221
|
-
f.parseMaybeAssign = function(e, t, i) {
|
|
1222
|
-
if (this.isContextual("yield")) {
|
|
1223
|
-
if (this.inGenerator)
|
|
1224
|
-
return this.parseYield(e);
|
|
1225
|
-
this.exprAllowed = !1;
|
|
1226
|
-
}
|
|
1227
|
-
var s = !1, r = -1, n = -1, u = -1;
|
|
1228
|
-
t ? (r = t.parenthesizedAssign, n = t.trailingComma, u = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new oe(), s = !0);
|
|
1229
|
-
var o = this.start, h = this.startLoc;
|
|
1230
|
-
(this.type === a.parenL || this.type === a.name) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = e === "await");
|
|
1231
|
-
var l = this.parseMaybeConditional(e, t);
|
|
1232
|
-
if (i && (l = i.call(this, l, o, h)), this.type.isAssign) {
|
|
1233
|
-
var d = this.startNodeAt(o, h);
|
|
1234
|
-
return d.operator = this.value, this.type === a.eq && (l = this.toAssignable(l, !1, t)), s || (t.parenthesizedAssign = t.trailingComma = t.doubleProto = -1), t.shorthandAssign >= l.start && (t.shorthandAssign = -1), this.type === a.eq ? this.checkLValPattern(l) : this.checkLValSimple(l), d.left = l, this.next(), d.right = this.parseMaybeAssign(e), u > -1 && (t.doubleProto = u), this.finishNode(d, "AssignmentExpression");
|
|
1235
|
-
} else
|
|
1236
|
-
s && this.checkExpressionErrors(t, !0);
|
|
1237
|
-
return r > -1 && (t.parenthesizedAssign = r), n > -1 && (t.trailingComma = n), l;
|
|
1238
|
-
};
|
|
1239
|
-
f.parseMaybeConditional = function(e, t) {
|
|
1240
|
-
var i = this.start, s = this.startLoc, r = this.parseExprOps(e, t);
|
|
1241
|
-
if (this.checkExpressionErrors(t))
|
|
1242
|
-
return r;
|
|
1243
|
-
if (this.eat(a.question)) {
|
|
1244
|
-
var n = this.startNodeAt(i, s);
|
|
1245
|
-
return n.test = r, n.consequent = this.parseMaybeAssign(), this.expect(a.colon), n.alternate = this.parseMaybeAssign(e), this.finishNode(n, "ConditionalExpression");
|
|
1246
|
-
}
|
|
1247
|
-
return r;
|
|
1248
|
-
};
|
|
1249
|
-
f.parseExprOps = function(e, t) {
|
|
1250
|
-
var i = this.start, s = this.startLoc, r = this.parseMaybeUnary(t, !1, !1, e);
|
|
1251
|
-
return this.checkExpressionErrors(t) || r.start === i && r.type === "ArrowFunctionExpression" ? r : this.parseExprOp(r, i, s, -1, e);
|
|
1252
|
-
};
|
|
1253
|
-
f.parseExprOp = function(e, t, i, s, r) {
|
|
1254
|
-
var n = this.type.binop;
|
|
1255
|
-
if (n != null && (!r || this.type !== a._in) && n > s) {
|
|
1256
|
-
var u = this.type === a.logicalOR || this.type === a.logicalAND, o = this.type === a.coalesce;
|
|
1257
|
-
o && (n = a.logicalAND.binop);
|
|
1258
|
-
var h = this.value;
|
|
1259
|
-
this.next();
|
|
1260
|
-
var l = this.start, d = this.startLoc, g = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, r), l, d, n, r), _ = this.buildBinary(t, i, e, g, h, u || o);
|
|
1261
|
-
return (u && this.type === a.coalesce || o && (this.type === a.logicalOR || this.type === a.logicalAND)) && this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"), this.parseExprOp(_, t, i, s, r);
|
|
1262
|
-
}
|
|
1263
|
-
return e;
|
|
1264
|
-
};
|
|
1265
|
-
f.buildBinary = function(e, t, i, s, r, n) {
|
|
1266
|
-
s.type === "PrivateIdentifier" && this.raise(s.start, "Private identifier can only be left side of binary expression");
|
|
1267
|
-
var u = this.startNodeAt(e, t);
|
|
1268
|
-
return u.left = i, u.operator = r, u.right = s, this.finishNode(u, n ? "LogicalExpression" : "BinaryExpression");
|
|
1269
|
-
};
|
|
1270
|
-
f.parseMaybeUnary = function(e, t, i, s) {
|
|
1271
|
-
var r = this.start, n = this.startLoc, u;
|
|
1272
|
-
if (this.isContextual("await") && this.canAwait)
|
|
1273
|
-
u = this.parseAwait(s), t = !0;
|
|
1274
|
-
else if (this.type.prefix) {
|
|
1275
|
-
var o = this.startNode(), h = this.type === a.incDec;
|
|
1276
|
-
o.operator = this.value, o.prefix = !0, this.next(), o.argument = this.parseMaybeUnary(null, !0, h, s), this.checkExpressionErrors(e, !0), h ? this.checkLValSimple(o.argument) : this.strict && o.operator === "delete" && Ge(o.argument) ? this.raiseRecoverable(o.start, "Deleting local variable in strict mode") : o.operator === "delete" && ve(o.argument) ? this.raiseRecoverable(o.start, "Private fields can not be deleted") : t = !0, u = this.finishNode(o, h ? "UpdateExpression" : "UnaryExpression");
|
|
1277
|
-
} else if (!t && this.type === a.privateId)
|
|
1278
|
-
(s || this.privateNameStack.length === 0) && this.options.checkPrivateFields && this.unexpected(), u = this.parsePrivateIdent(), this.type !== a._in && this.unexpected();
|
|
1279
|
-
else {
|
|
1280
|
-
if (u = this.parseExprSubscripts(e, s), this.checkExpressionErrors(e))
|
|
1281
|
-
return u;
|
|
1282
|
-
for (; this.type.postfix && !this.canInsertSemicolon(); ) {
|
|
1283
|
-
var l = this.startNodeAt(r, n);
|
|
1284
|
-
l.operator = this.value, l.prefix = !1, l.argument = u, this.checkLValSimple(u), this.next(), u = this.finishNode(l, "UpdateExpression");
|
|
1285
|
-
}
|
|
1286
|
-
}
|
|
1287
|
-
if (!i && this.eat(a.starstar))
|
|
1288
|
-
if (t)
|
|
1289
|
-
this.unexpected(this.lastTokStart);
|
|
1290
|
-
else
|
|
1291
|
-
return this.buildBinary(r, n, u, this.parseMaybeUnary(null, !1, !1, s), "**", !1);
|
|
1292
|
-
else
|
|
1293
|
-
return u;
|
|
1294
|
-
};
|
|
1295
|
-
function Ge(e) {
|
|
1296
|
-
return e.type === "Identifier" || e.type === "ParenthesizedExpression" && Ge(e.expression);
|
|
1297
|
-
}
|
|
1298
|
-
function ve(e) {
|
|
1299
|
-
return e.type === "MemberExpression" && e.property.type === "PrivateIdentifier" || e.type === "ChainExpression" && ve(e.expression) || e.type === "ParenthesizedExpression" && ve(e.expression);
|
|
1300
|
-
}
|
|
1301
|
-
f.parseExprSubscripts = function(e, t) {
|
|
1302
|
-
var i = this.start, s = this.startLoc, r = this.parseExprAtom(e, t);
|
|
1303
|
-
if (r.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")")
|
|
1304
|
-
return r;
|
|
1305
|
-
var n = this.parseSubscripts(r, i, s, !1, t);
|
|
1306
|
-
return e && n.type === "MemberExpression" && (e.parenthesizedAssign >= n.start && (e.parenthesizedAssign = -1), e.parenthesizedBind >= n.start && (e.parenthesizedBind = -1), e.trailingComma >= n.start && (e.trailingComma = -1)), n;
|
|
1307
|
-
};
|
|
1308
|
-
f.parseSubscripts = function(e, t, i, s, r) {
|
|
1309
|
-
for (var n = this.options.ecmaVersion >= 8 && e.type === "Identifier" && e.name === "async" && this.lastTokEnd === e.end && !this.canInsertSemicolon() && e.end - e.start === 5 && this.potentialArrowAt === e.start, u = !1; ; ) {
|
|
1310
|
-
var o = this.parseSubscript(e, t, i, s, n, u, r);
|
|
1311
|
-
if (o.optional && (u = !0), o === e || o.type === "ArrowFunctionExpression") {
|
|
1312
|
-
if (u) {
|
|
1313
|
-
var h = this.startNodeAt(t, i);
|
|
1314
|
-
h.expression = o, o = this.finishNode(h, "ChainExpression");
|
|
1315
|
-
}
|
|
1316
|
-
return o;
|
|
1317
|
-
}
|
|
1318
|
-
e = o;
|
|
1319
|
-
}
|
|
1320
|
-
};
|
|
1321
|
-
f.shouldParseAsyncArrow = function() {
|
|
1322
|
-
return !this.canInsertSemicolon() && this.eat(a.arrow);
|
|
1323
|
-
};
|
|
1324
|
-
f.parseSubscriptAsyncArrow = function(e, t, i, s) {
|
|
1325
|
-
return this.parseArrowExpression(this.startNodeAt(e, t), i, !0, s);
|
|
1326
|
-
};
|
|
1327
|
-
f.parseSubscript = function(e, t, i, s, r, n, u) {
|
|
1328
|
-
var o = this.options.ecmaVersion >= 11, h = o && this.eat(a.questionDot);
|
|
1329
|
-
s && h && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
1330
|
-
var l = this.eat(a.bracketL);
|
|
1331
|
-
if (l || h && this.type !== a.parenL && this.type !== a.backQuote || this.eat(a.dot)) {
|
|
1332
|
-
var d = this.startNodeAt(t, i);
|
|
1333
|
-
d.object = e, l ? (d.property = this.parseExpression(), this.expect(a.bracketR)) : this.type === a.privateId && e.type !== "Super" ? d.property = this.parsePrivateIdent() : d.property = this.parseIdent(this.options.allowReserved !== "never"), d.computed = !!l, o && (d.optional = h), e = this.finishNode(d, "MemberExpression");
|
|
1334
|
-
} else if (!s && this.eat(a.parenL)) {
|
|
1335
|
-
var g = new oe(), _ = this.yieldPos, Q = this.awaitPos, q = this.awaitIdentPos;
|
|
1336
|
-
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
1337
|
-
var ee = this.parseExprList(a.parenR, this.options.ecmaVersion >= 8, !1, g);
|
|
1338
|
-
if (r && !h && this.shouldParseAsyncArrow())
|
|
1339
|
-
return this.checkPatternErrors(g, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = _, this.awaitPos = Q, this.awaitIdentPos = q, this.parseSubscriptAsyncArrow(t, i, ee, u);
|
|
1340
|
-
this.checkExpressionErrors(g, !0), this.yieldPos = _ || this.yieldPos, this.awaitPos = Q || this.awaitPos, this.awaitIdentPos = q || this.awaitIdentPos;
|
|
1341
|
-
var j = this.startNodeAt(t, i);
|
|
1342
|
-
j.callee = e, j.arguments = ee, o && (j.optional = h), e = this.finishNode(j, "CallExpression");
|
|
1343
|
-
} else if (this.type === a.backQuote) {
|
|
1344
|
-
(h || n) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
1345
|
-
var G = this.startNodeAt(t, i);
|
|
1346
|
-
G.tag = e, G.quasi = this.parseTemplate({ isTagged: !0 }), e = this.finishNode(G, "TaggedTemplateExpression");
|
|
1347
|
-
}
|
|
1348
|
-
return e;
|
|
1349
|
-
};
|
|
1350
|
-
f.parseExprAtom = function(e, t, i) {
|
|
1351
|
-
this.type === a.slash && this.readRegexp();
|
|
1352
|
-
var s, r = this.potentialArrowAt === this.start;
|
|
1353
|
-
switch (this.type) {
|
|
1354
|
-
case a._super:
|
|
1355
|
-
return this.allowSuper || this.raise(this.start, "'super' keyword outside a method"), s = this.startNode(), this.next(), this.type === a.parenL && !this.allowDirectSuper && this.raise(s.start, "super() call outside constructor of a subclass"), this.type !== a.dot && this.type !== a.bracketL && this.type !== a.parenL && this.unexpected(), this.finishNode(s, "Super");
|
|
1356
|
-
case a._this:
|
|
1357
|
-
return s = this.startNode(), this.next(), this.finishNode(s, "ThisExpression");
|
|
1358
|
-
case a.name:
|
|
1359
|
-
var n = this.start, u = this.startLoc, o = this.containsEsc, h = this.parseIdent(!1);
|
|
1360
|
-
if (this.options.ecmaVersion >= 8 && !o && h.name === "async" && !this.canInsertSemicolon() && this.eat(a._function))
|
|
1361
|
-
return this.overrideContext(b.f_expr), this.parseFunction(this.startNodeAt(n, u), 0, !1, !0, t);
|
|
1362
|
-
if (r && !this.canInsertSemicolon()) {
|
|
1363
|
-
if (this.eat(a.arrow))
|
|
1364
|
-
return this.parseArrowExpression(this.startNodeAt(n, u), [h], !1, t);
|
|
1365
|
-
if (this.options.ecmaVersion >= 8 && h.name === "async" && this.type === a.name && !o && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc))
|
|
1366
|
-
return h = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(a.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(n, u), [h], !0, t);
|
|
1367
|
-
}
|
|
1368
|
-
return h;
|
|
1369
|
-
case a.regexp:
|
|
1370
|
-
var l = this.value;
|
|
1371
|
-
return s = this.parseLiteral(l.value), s.regex = { pattern: l.pattern, flags: l.flags }, s;
|
|
1372
|
-
case a.num:
|
|
1373
|
-
case a.string:
|
|
1374
|
-
return this.parseLiteral(this.value);
|
|
1375
|
-
case a._null:
|
|
1376
|
-
case a._true:
|
|
1377
|
-
case a._false:
|
|
1378
|
-
return s = this.startNode(), s.value = this.type === a._null ? null : this.type === a._true, s.raw = this.type.keyword, this.next(), this.finishNode(s, "Literal");
|
|
1379
|
-
case a.parenL:
|
|
1380
|
-
var d = this.start, g = this.parseParenAndDistinguishExpression(r, t);
|
|
1381
|
-
return e && (e.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(g) && (e.parenthesizedAssign = d), e.parenthesizedBind < 0 && (e.parenthesizedBind = d)), g;
|
|
1382
|
-
case a.bracketL:
|
|
1383
|
-
return s = this.startNode(), this.next(), s.elements = this.parseExprList(a.bracketR, !0, !0, e), this.finishNode(s, "ArrayExpression");
|
|
1384
|
-
case a.braceL:
|
|
1385
|
-
return this.overrideContext(b.b_expr), this.parseObj(!1, e);
|
|
1386
|
-
case a._function:
|
|
1387
|
-
return s = this.startNode(), this.next(), this.parseFunction(s, 0);
|
|
1388
|
-
case a._class:
|
|
1389
|
-
return this.parseClass(this.startNode(), !1);
|
|
1390
|
-
case a._new:
|
|
1391
|
-
return this.parseNew();
|
|
1392
|
-
case a.backQuote:
|
|
1393
|
-
return this.parseTemplate();
|
|
1394
|
-
case a._import:
|
|
1395
|
-
return this.options.ecmaVersion >= 11 ? this.parseExprImport(i) : this.unexpected();
|
|
1396
|
-
default:
|
|
1397
|
-
return this.parseExprAtomDefault();
|
|
1398
|
-
}
|
|
1399
|
-
};
|
|
1400
|
-
f.parseExprAtomDefault = function() {
|
|
1401
|
-
this.unexpected();
|
|
1402
|
-
};
|
|
1403
|
-
f.parseExprImport = function(e) {
|
|
1404
|
-
var t = this.startNode();
|
|
1405
|
-
if (this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword import"), this.next(), this.type === a.parenL && !e)
|
|
1406
|
-
return this.parseDynamicImport(t);
|
|
1407
|
-
if (this.type === a.dot) {
|
|
1408
|
-
var i = this.startNodeAt(t.start, t.loc && t.loc.start);
|
|
1409
|
-
return i.name = "import", t.meta = this.finishNode(i, "Identifier"), this.parseImportMeta(t);
|
|
1410
|
-
} else
|
|
1411
|
-
this.unexpected();
|
|
1412
|
-
};
|
|
1413
|
-
f.parseDynamicImport = function(e) {
|
|
1414
|
-
if (this.next(), e.source = this.parseMaybeAssign(), this.options.ecmaVersion >= 16)
|
|
1415
|
-
this.eat(a.parenR) ? e.options = null : (this.expect(a.comma), this.afterTrailingComma(a.parenR) ? e.options = null : (e.options = this.parseMaybeAssign(), this.eat(a.parenR) || (this.expect(a.comma), this.afterTrailingComma(a.parenR) || this.unexpected())));
|
|
1416
|
-
else if (!this.eat(a.parenR)) {
|
|
1417
|
-
var t = this.start;
|
|
1418
|
-
this.eat(a.comma) && this.eat(a.parenR) ? this.raiseRecoverable(t, "Trailing comma is not allowed in import()") : this.unexpected(t);
|
|
1419
|
-
}
|
|
1420
|
-
return this.finishNode(e, "ImportExpression");
|
|
1421
|
-
};
|
|
1422
|
-
f.parseImportMeta = function(e) {
|
|
1423
|
-
this.next();
|
|
1424
|
-
var t = this.containsEsc;
|
|
1425
|
-
return e.property = this.parseIdent(!0), e.property.name !== "meta" && this.raiseRecoverable(e.property.start, "The only valid meta property for import is 'import.meta'"), t && this.raiseRecoverable(e.start, "'import.meta' must not contain escaped characters"), this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere && this.raiseRecoverable(e.start, "Cannot use 'import.meta' outside a module"), this.finishNode(e, "MetaProperty");
|
|
1426
|
-
};
|
|
1427
|
-
f.parseLiteral = function(e) {
|
|
1428
|
-
var t = this.startNode();
|
|
1429
|
-
return t.value = e, t.raw = this.input.slice(this.start, this.end), t.raw.charCodeAt(t.raw.length - 1) === 110 && (t.bigint = t.value != null ? t.value.toString() : t.raw.slice(0, -1).replace(/_/g, "")), this.next(), this.finishNode(t, "Literal");
|
|
1430
|
-
};
|
|
1431
|
-
f.parseParenExpression = function() {
|
|
1432
|
-
this.expect(a.parenL);
|
|
1433
|
-
var e = this.parseExpression();
|
|
1434
|
-
return this.expect(a.parenR), e;
|
|
1435
|
-
};
|
|
1436
|
-
f.shouldParseArrow = function(e) {
|
|
1437
|
-
return !this.canInsertSemicolon();
|
|
1438
|
-
};
|
|
1439
|
-
f.parseParenAndDistinguishExpression = function(e, t) {
|
|
1440
|
-
var i = this.start, s = this.startLoc, r, n = this.options.ecmaVersion >= 8;
|
|
1441
|
-
if (this.options.ecmaVersion >= 6) {
|
|
1442
|
-
this.next();
|
|
1443
|
-
var u = this.start, o = this.startLoc, h = [], l = !0, d = !1, g = new oe(), _ = this.yieldPos, Q = this.awaitPos, q;
|
|
1444
|
-
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== a.parenR; )
|
|
1445
|
-
if (l ? l = !1 : this.expect(a.comma), n && this.afterTrailingComma(a.parenR, !0)) {
|
|
1446
|
-
d = !0;
|
|
1447
|
-
break;
|
|
1448
|
-
} else if (this.type === a.ellipsis) {
|
|
1449
|
-
q = this.start, h.push(this.parseParenItem(this.parseRestBinding())), this.type === a.comma && this.raiseRecoverable(
|
|
1450
|
-
this.start,
|
|
1451
|
-
"Comma is not permitted after the rest element"
|
|
1452
|
-
);
|
|
1453
|
-
break;
|
|
1454
|
-
} else
|
|
1455
|
-
h.push(this.parseMaybeAssign(!1, g, this.parseParenItem));
|
|
1456
|
-
var ee = this.lastTokEnd, j = this.lastTokEndLoc;
|
|
1457
|
-
if (this.expect(a.parenR), e && this.shouldParseArrow(h) && this.eat(a.arrow))
|
|
1458
|
-
return this.checkPatternErrors(g, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = _, this.awaitPos = Q, this.parseParenArrowList(i, s, h, t);
|
|
1459
|
-
(!h.length || d) && this.unexpected(this.lastTokStart), q && this.unexpected(q), this.checkExpressionErrors(g, !0), this.yieldPos = _ || this.yieldPos, this.awaitPos = Q || this.awaitPos, h.length > 1 ? (r = this.startNodeAt(u, o), r.expressions = h, this.finishNodeAt(r, "SequenceExpression", ee, j)) : r = h[0];
|
|
1460
|
-
} else
|
|
1461
|
-
r = this.parseParenExpression();
|
|
1462
|
-
if (this.options.preserveParens) {
|
|
1463
|
-
var G = this.startNodeAt(i, s);
|
|
1464
|
-
return G.expression = r, this.finishNode(G, "ParenthesizedExpression");
|
|
1465
|
-
} else
|
|
1466
|
-
return r;
|
|
1467
|
-
};
|
|
1468
|
-
f.parseParenItem = function(e) {
|
|
1469
|
-
return e;
|
|
1470
|
-
};
|
|
1471
|
-
f.parseParenArrowList = function(e, t, i, s) {
|
|
1472
|
-
return this.parseArrowExpression(this.startNodeAt(e, t), i, !1, s);
|
|
1473
|
-
};
|
|
1474
|
-
var Et = [];
|
|
1475
|
-
f.parseNew = function() {
|
|
1476
|
-
this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
1477
|
-
var e = this.startNode();
|
|
1478
|
-
if (this.next(), this.options.ecmaVersion >= 6 && this.type === a.dot) {
|
|
1479
|
-
var t = this.startNodeAt(e.start, e.loc && e.loc.start);
|
|
1480
|
-
t.name = "new", e.meta = this.finishNode(t, "Identifier"), this.next();
|
|
1481
|
-
var i = this.containsEsc;
|
|
1482
|
-
return e.property = this.parseIdent(!0), e.property.name !== "target" && this.raiseRecoverable(e.property.start, "The only valid meta property for new is 'new.target'"), i && this.raiseRecoverable(e.start, "'new.target' must not contain escaped characters"), this.allowNewDotTarget || this.raiseRecoverable(e.start, "'new.target' can only be used in functions and class static block"), this.finishNode(e, "MetaProperty");
|
|
1483
|
-
}
|
|
1484
|
-
var s = this.start, r = this.startLoc;
|
|
1485
|
-
return e.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), s, r, !0, !1), this.eat(a.parenL) ? e.arguments = this.parseExprList(a.parenR, this.options.ecmaVersion >= 8, !1) : e.arguments = Et, this.finishNode(e, "NewExpression");
|
|
1486
|
-
};
|
|
1487
|
-
f.parseTemplateElement = function(e) {
|
|
1488
|
-
var t = e.isTagged, i = this.startNode();
|
|
1489
|
-
return this.type === a.invalidTemplate ? (t || this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"), i.value = {
|
|
1490
|
-
raw: this.value.replace(/\r\n?/g, `
|
|
1491
|
-
`),
|
|
1492
|
-
cooked: null
|
|
1493
|
-
}) : i.value = {
|
|
1494
|
-
raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, `
|
|
1495
|
-
`),
|
|
1496
|
-
cooked: this.value
|
|
1497
|
-
}, this.next(), i.tail = this.type === a.backQuote, this.finishNode(i, "TemplateElement");
|
|
1498
|
-
};
|
|
1499
|
-
f.parseTemplate = function(e) {
|
|
1500
|
-
e === void 0 && (e = {});
|
|
1501
|
-
var t = e.isTagged;
|
|
1502
|
-
t === void 0 && (t = !1);
|
|
1503
|
-
var i = this.startNode();
|
|
1504
|
-
this.next(), i.expressions = [];
|
|
1505
|
-
var s = this.parseTemplateElement({ isTagged: t });
|
|
1506
|
-
for (i.quasis = [s]; !s.tail; )
|
|
1507
|
-
this.type === a.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(a.dollarBraceL), i.expressions.push(this.parseExpression()), this.expect(a.braceR), i.quasis.push(s = this.parseTemplateElement({ isTagged: t }));
|
|
1508
|
-
return this.next(), this.finishNode(i, "TemplateLiteral");
|
|
1509
|
-
};
|
|
1510
|
-
f.isAsyncProp = function(e) {
|
|
1511
|
-
return !e.computed && e.key.type === "Identifier" && e.key.name === "async" && (this.type === a.name || this.type === a.num || this.type === a.string || this.type === a.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === a.star) && !w.test(this.input.slice(this.lastTokEnd, this.start));
|
|
1512
|
-
};
|
|
1513
|
-
f.parseObj = function(e, t) {
|
|
1514
|
-
var i = this.startNode(), s = !0, r = {};
|
|
1515
|
-
for (i.properties = [], this.next(); !this.eat(a.braceR); ) {
|
|
1516
|
-
if (s)
|
|
1517
|
-
s = !1;
|
|
1518
|
-
else if (this.expect(a.comma), this.options.ecmaVersion >= 5 && this.afterTrailingComma(a.braceR))
|
|
1519
|
-
break;
|
|
1520
|
-
var n = this.parseProperty(e, t);
|
|
1521
|
-
e || this.checkPropClash(n, r, t), i.properties.push(n);
|
|
1522
|
-
}
|
|
1523
|
-
return this.finishNode(i, e ? "ObjectPattern" : "ObjectExpression");
|
|
1524
|
-
};
|
|
1525
|
-
f.parseProperty = function(e, t) {
|
|
1526
|
-
var i = this.startNode(), s, r, n, u;
|
|
1527
|
-
if (this.options.ecmaVersion >= 9 && this.eat(a.ellipsis))
|
|
1528
|
-
return e ? (i.argument = this.parseIdent(!1), this.type === a.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.finishNode(i, "RestElement")) : (i.argument = this.parseMaybeAssign(!1, t), this.type === a.comma && t && t.trailingComma < 0 && (t.trailingComma = this.start), this.finishNode(i, "SpreadElement"));
|
|
1529
|
-
this.options.ecmaVersion >= 6 && (i.method = !1, i.shorthand = !1, (e || t) && (n = this.start, u = this.startLoc), e || (s = this.eat(a.star)));
|
|
1530
|
-
var o = this.containsEsc;
|
|
1531
|
-
return this.parsePropertyName(i), !e && !o && this.options.ecmaVersion >= 8 && !s && this.isAsyncProp(i) ? (r = !0, s = this.options.ecmaVersion >= 9 && this.eat(a.star), this.parsePropertyName(i)) : r = !1, this.parsePropertyValue(i, e, s, r, n, u, t, o), this.finishNode(i, "Property");
|
|
1532
|
-
};
|
|
1533
|
-
f.parseGetterSetter = function(e) {
|
|
1534
|
-
var t = e.key.name;
|
|
1535
|
-
this.parsePropertyName(e), e.value = this.parseMethod(!1), e.kind = t;
|
|
1536
|
-
var i = e.kind === "get" ? 0 : 1;
|
|
1537
|
-
if (e.value.params.length !== i) {
|
|
1538
|
-
var s = e.value.start;
|
|
1539
|
-
e.kind === "get" ? this.raiseRecoverable(s, "getter should have no params") : this.raiseRecoverable(s, "setter should have exactly one param");
|
|
1540
|
-
} else
|
|
1541
|
-
e.kind === "set" && e.value.params[0].type === "RestElement" && this.raiseRecoverable(e.value.params[0].start, "Setter cannot use rest params");
|
|
1542
|
-
};
|
|
1543
|
-
f.parsePropertyValue = function(e, t, i, s, r, n, u, o) {
|
|
1544
|
-
(i || s) && this.type === a.colon && this.unexpected(), this.eat(a.colon) ? (e.value = t ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, u), e.kind = "init") : this.options.ecmaVersion >= 6 && this.type === a.parenL ? (t && this.unexpected(), e.method = !0, e.value = this.parseMethod(i, s), e.kind = "init") : !t && !o && this.options.ecmaVersion >= 5 && !e.computed && e.key.type === "Identifier" && (e.key.name === "get" || e.key.name === "set") && this.type !== a.comma && this.type !== a.braceR && this.type !== a.eq ? ((i || s) && this.unexpected(), this.parseGetterSetter(e)) : this.options.ecmaVersion >= 6 && !e.computed && e.key.type === "Identifier" ? ((i || s) && this.unexpected(), this.checkUnreserved(e.key), e.key.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = r), t ? e.value = this.parseMaybeDefault(r, n, this.copyNode(e.key)) : this.type === a.eq && u ? (u.shorthandAssign < 0 && (u.shorthandAssign = this.start), e.value = this.parseMaybeDefault(r, n, this.copyNode(e.key))) : e.value = this.copyNode(e.key), e.kind = "init", e.shorthand = !0) : this.unexpected();
|
|
1545
|
-
};
|
|
1546
|
-
f.parsePropertyName = function(e) {
|
|
1547
|
-
if (this.options.ecmaVersion >= 6) {
|
|
1548
|
-
if (this.eat(a.bracketL))
|
|
1549
|
-
return e.computed = !0, e.key = this.parseMaybeAssign(), this.expect(a.bracketR), e.key;
|
|
1550
|
-
e.computed = !1;
|
|
1551
|
-
}
|
|
1552
|
-
return e.key = this.type === a.num || this.type === a.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
|
|
1553
|
-
};
|
|
1554
|
-
f.initFunction = function(e) {
|
|
1555
|
-
e.id = null, this.options.ecmaVersion >= 6 && (e.generator = e.expression = !1), this.options.ecmaVersion >= 8 && (e.async = !1);
|
|
1556
|
-
};
|
|
1557
|
-
f.parseMethod = function(e, t, i) {
|
|
1558
|
-
var s = this.startNode(), r = this.yieldPos, n = this.awaitPos, u = this.awaitIdentPos;
|
|
1559
|
-
return this.initFunction(s), this.options.ecmaVersion >= 6 && (s.generator = e), this.options.ecmaVersion >= 8 && (s.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(_e(t, s.generator) | ne | (i ? Fe : 0)), this.expect(a.parenL), s.params = this.parseBindingList(a.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(s, !1, !0, !1), this.yieldPos = r, this.awaitPos = n, this.awaitIdentPos = u, this.finishNode(s, "FunctionExpression");
|
|
1560
|
-
};
|
|
1561
|
-
f.parseArrowExpression = function(e, t, i, s) {
|
|
1562
|
-
var r = this.yieldPos, n = this.awaitPos, u = this.awaitIdentPos;
|
|
1563
|
-
return this.enterScope(_e(i, !1) | ye), this.initFunction(e), this.options.ecmaVersion >= 8 && (e.async = !!i), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, e.params = this.toAssignableList(t, !0), this.parseFunctionBody(e, !0, !1, s), this.yieldPos = r, this.awaitPos = n, this.awaitIdentPos = u, this.finishNode(e, "ArrowFunctionExpression");
|
|
1564
|
-
};
|
|
1565
|
-
f.parseFunctionBody = function(e, t, i, s) {
|
|
1566
|
-
var r = t && this.type !== a.braceL, n = this.strict, u = !1;
|
|
1567
|
-
if (r)
|
|
1568
|
-
e.body = this.parseMaybeAssign(s), e.expression = !0, this.checkParams(e, !1);
|
|
1569
|
-
else {
|
|
1570
|
-
var o = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(e.params);
|
|
1571
|
-
(!n || o) && (u = this.strictDirective(this.end), u && o && this.raiseRecoverable(e.start, "Illegal 'use strict' directive in function with non-simple parameter list"));
|
|
1572
|
-
var h = this.labels;
|
|
1573
|
-
this.labels = [], u && (this.strict = !0), this.checkParams(e, !n && !u && !t && !i && this.isSimpleParamList(e.params)), this.strict && e.id && this.checkLValSimple(e.id, qe), e.body = this.parseBlock(!1, void 0, u && !n), e.expression = !1, this.adaptDirectivePrologue(e.body.body), this.labels = h;
|
|
1574
|
-
}
|
|
1575
|
-
this.exitScope();
|
|
1576
|
-
};
|
|
1577
|
-
f.isSimpleParamList = function(e) {
|
|
1578
|
-
for (var t = 0, i = e; t < i.length; t += 1) {
|
|
1579
|
-
var s = i[t];
|
|
1580
|
-
if (s.type !== "Identifier")
|
|
1581
|
-
return !1;
|
|
1582
|
-
}
|
|
1583
|
-
return !0;
|
|
1584
|
-
};
|
|
1585
|
-
f.checkParams = function(e, t) {
|
|
1586
|
-
for (var i = /* @__PURE__ */ Object.create(null), s = 0, r = e.params; s < r.length; s += 1) {
|
|
1587
|
-
var n = r[s];
|
|
1588
|
-
this.checkLValInnerPattern(n, Ce, t ? null : i);
|
|
1589
|
-
}
|
|
1590
|
-
};
|
|
1591
|
-
f.parseExprList = function(e, t, i, s) {
|
|
1592
|
-
for (var r = [], n = !0; !this.eat(e); ) {
|
|
1593
|
-
if (n)
|
|
1594
|
-
n = !1;
|
|
1595
|
-
else if (this.expect(a.comma), t && this.afterTrailingComma(e))
|
|
1596
|
-
break;
|
|
1597
|
-
var u = void 0;
|
|
1598
|
-
i && this.type === a.comma ? u = null : this.type === a.ellipsis ? (u = this.parseSpread(s), s && this.type === a.comma && s.trailingComma < 0 && (s.trailingComma = this.start)) : u = this.parseMaybeAssign(!1, s), r.push(u);
|
|
1599
|
-
}
|
|
1600
|
-
return r;
|
|
1601
|
-
};
|
|
1602
|
-
f.checkUnreserved = function(e) {
|
|
1603
|
-
var t = e.start, i = e.end, s = e.name;
|
|
1604
|
-
if (this.inGenerator && s === "yield" && this.raiseRecoverable(t, "Cannot use 'yield' as identifier inside a generator"), this.inAsync && s === "await" && this.raiseRecoverable(t, "Cannot use 'await' as identifier inside an async function"), !(this.currentThisScope().flags & ue) && s === "arguments" && this.raiseRecoverable(t, "Cannot use 'arguments' in class field initializer"), this.inClassStaticBlock && (s === "arguments" || s === "await") && this.raise(t, "Cannot use " + s + " in class static initialization block"), this.keywords.test(s) && this.raise(t, "Unexpected keyword '" + s + "'"), !(this.options.ecmaVersion < 6 && this.input.slice(t, i).indexOf("\\") !== -1)) {
|
|
1605
|
-
var r = this.strict ? this.reservedWordsStrict : this.reservedWords;
|
|
1606
|
-
r.test(s) && (!this.inAsync && s === "await" && this.raiseRecoverable(t, "Cannot use keyword 'await' outside an async function"), this.raiseRecoverable(t, "The keyword '" + s + "' is reserved"));
|
|
1607
|
-
}
|
|
1608
|
-
};
|
|
1609
|
-
f.parseIdent = function(e) {
|
|
1610
|
-
var t = this.parseIdentNode();
|
|
1611
|
-
return this.next(!!e), this.finishNode(t, "Identifier"), e || (this.checkUnreserved(t), t.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = t.start)), t;
|
|
1612
|
-
};
|
|
1613
|
-
f.parseIdentNode = function() {
|
|
1614
|
-
var e = this.startNode();
|
|
1615
|
-
return this.type === a.name ? e.name = this.value : this.type.keyword ? (e.name = this.type.keyword, (e.name === "class" || e.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46) && this.context.pop(), this.type = a.name) : this.unexpected(), e;
|
|
1616
|
-
};
|
|
1617
|
-
f.parsePrivateIdent = function() {
|
|
1618
|
-
var e = this.startNode();
|
|
1619
|
-
return this.type === a.privateId ? e.name = this.value : this.unexpected(), this.next(), this.finishNode(e, "PrivateIdentifier"), this.options.checkPrivateFields && (this.privateNameStack.length === 0 ? this.raise(e.start, "Private field '#" + e.name + "' must be declared in an enclosing class") : this.privateNameStack[this.privateNameStack.length - 1].used.push(e)), e;
|
|
1620
|
-
};
|
|
1621
|
-
f.parseYield = function(e) {
|
|
1622
|
-
this.yieldPos || (this.yieldPos = this.start);
|
|
1623
|
-
var t = this.startNode();
|
|
1624
|
-
return this.next(), this.type === a.semi || this.canInsertSemicolon() || this.type !== a.star && !this.type.startsExpr ? (t.delegate = !1, t.argument = null) : (t.delegate = this.eat(a.star), t.argument = this.parseMaybeAssign(e)), this.finishNode(t, "YieldExpression");
|
|
1625
|
-
};
|
|
1626
|
-
f.parseAwait = function(e) {
|
|
1627
|
-
this.awaitPos || (this.awaitPos = this.start);
|
|
1628
|
-
var t = this.startNode();
|
|
1629
|
-
return this.next(), t.argument = this.parseMaybeUnary(null, !0, !1, e), this.finishNode(t, "AwaitExpression");
|
|
1630
|
-
};
|
|
1631
|
-
var se = y.prototype;
|
|
1632
|
-
se.raise = function(e, t) {
|
|
1633
|
-
var i = Oe(this.input, e);
|
|
1634
|
-
t += " (" + i.line + ":" + i.column + ")", this.sourceFile && (t += " in " + this.sourceFile);
|
|
1635
|
-
var s = new SyntaxError(t);
|
|
1636
|
-
throw s.pos = e, s.loc = i, s.raisedAt = this.pos, s;
|
|
1637
|
-
};
|
|
1638
|
-
se.raiseRecoverable = se.raise;
|
|
1639
|
-
se.curPosition = function() {
|
|
1640
|
-
if (this.options.locations)
|
|
1641
|
-
return new X(this.curLine, this.pos - this.lineStart);
|
|
1642
|
-
};
|
|
1643
|
-
var M = y.prototype, It = function(t) {
|
|
1644
|
-
this.flags = t, this.var = [], this.lexical = [], this.functions = [];
|
|
1645
|
-
};
|
|
1646
|
-
M.enterScope = function(e) {
|
|
1647
|
-
this.scopeStack.push(new It(e));
|
|
1648
|
-
};
|
|
1649
|
-
M.exitScope = function() {
|
|
1650
|
-
this.scopeStack.pop();
|
|
1651
|
-
};
|
|
1652
|
-
M.treatFunctionsAsVarInScope = function(e) {
|
|
1653
|
-
return e.flags & z || !this.inModule && e.flags & Z;
|
|
1654
|
-
};
|
|
1655
|
-
M.declareName = function(e, t, i) {
|
|
1656
|
-
var s = !1;
|
|
1657
|
-
if (t === B) {
|
|
1658
|
-
var r = this.currentScope();
|
|
1659
|
-
s = r.lexical.indexOf(e) > -1 || r.functions.indexOf(e) > -1 || r.var.indexOf(e) > -1, r.lexical.push(e), this.inModule && r.flags & Z && delete this.undefinedExports[e];
|
|
1660
|
-
} else if (t === Ue) {
|
|
1661
|
-
var n = this.currentScope();
|
|
1662
|
-
n.lexical.push(e);
|
|
1663
|
-
} else if (t === Me) {
|
|
1664
|
-
var u = this.currentScope();
|
|
1665
|
-
this.treatFunctionsAsVar ? s = u.lexical.indexOf(e) > -1 : s = u.lexical.indexOf(e) > -1 || u.var.indexOf(e) > -1, u.functions.push(e);
|
|
1666
|
-
} else
|
|
1667
|
-
for (var o = this.scopeStack.length - 1; o >= 0; --o) {
|
|
1668
|
-
var h = this.scopeStack[o];
|
|
1669
|
-
if (h.lexical.indexOf(e) > -1 && !(h.flags & De && h.lexical[0] === e) || !this.treatFunctionsAsVarInScope(h) && h.functions.indexOf(e) > -1) {
|
|
1670
|
-
s = !0;
|
|
1671
|
-
break;
|
|
1672
|
-
}
|
|
1673
|
-
if (h.var.push(e), this.inModule && h.flags & Z && delete this.undefinedExports[e], h.flags & ue)
|
|
1674
|
-
break;
|
|
1675
|
-
}
|
|
1676
|
-
s && this.raiseRecoverable(i, "Identifier '" + e + "' has already been declared");
|
|
1677
|
-
};
|
|
1678
|
-
M.checkLocalExport = function(e) {
|
|
1679
|
-
this.scopeStack[0].lexical.indexOf(e.name) === -1 && this.scopeStack[0].var.indexOf(e.name) === -1 && (this.undefinedExports[e.name] = e);
|
|
1680
|
-
};
|
|
1681
|
-
M.currentScope = function() {
|
|
1682
|
-
return this.scopeStack[this.scopeStack.length - 1];
|
|
1683
|
-
};
|
|
1684
|
-
M.currentVarScope = function() {
|
|
1685
|
-
for (var e = this.scopeStack.length - 1; ; e--) {
|
|
1686
|
-
var t = this.scopeStack[e];
|
|
1687
|
-
if (t.flags & (ue | J | U))
|
|
1688
|
-
return t;
|
|
1689
|
-
}
|
|
1690
|
-
};
|
|
1691
|
-
M.currentThisScope = function() {
|
|
1692
|
-
for (var e = this.scopeStack.length - 1; ; e--) {
|
|
1693
|
-
var t = this.scopeStack[e];
|
|
1694
|
-
if (t.flags & (ue | J | U) && !(t.flags & ye))
|
|
1695
|
-
return t;
|
|
1696
|
-
}
|
|
1697
|
-
};
|
|
1698
|
-
var he = function(t, i, s) {
|
|
1699
|
-
this.type = "", this.start = i, this.end = 0, t.options.locations && (this.loc = new re(t, s)), t.options.directSourceFile && (this.sourceFile = t.options.directSourceFile), t.options.ranges && (this.range = [i, 0]);
|
|
1700
|
-
}, $ = y.prototype;
|
|
1701
|
-
$.startNode = function() {
|
|
1702
|
-
return new he(this, this.start, this.startLoc);
|
|
1703
|
-
};
|
|
1704
|
-
$.startNodeAt = function(e, t) {
|
|
1705
|
-
return new he(this, e, t);
|
|
1706
|
-
};
|
|
1707
|
-
function He(e, t, i, s) {
|
|
1708
|
-
return e.type = t, e.end = i, this.options.locations && (e.loc.end = s), this.options.ranges && (e.range[1] = i), e;
|
|
1709
|
-
}
|
|
1710
|
-
$.finishNode = function(e, t) {
|
|
1711
|
-
return He.call(this, e, t, this.lastTokEnd, this.lastTokEndLoc);
|
|
1712
|
-
};
|
|
1713
|
-
$.finishNodeAt = function(e, t, i, s) {
|
|
1714
|
-
return He.call(this, e, t, i, s);
|
|
1715
|
-
};
|
|
1716
|
-
$.copyNode = function(e) {
|
|
1717
|
-
var t = new he(this, e.start, this.startLoc);
|
|
1718
|
-
for (var i in e)
|
|
1719
|
-
t[i] = e[i];
|
|
1720
|
-
return t;
|
|
1721
|
-
};
|
|
1722
|
-
var Pt = "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz", We = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS", ze = We + " Extended_Pictographic", Ke = ze, Qe = Ke + " EBase EComp EMod EPres ExtPict", Ye = Qe, Nt = Ye, Vt = {
|
|
1723
|
-
9: We,
|
|
1724
|
-
10: ze,
|
|
1725
|
-
11: Ke,
|
|
1726
|
-
12: Qe,
|
|
1727
|
-
13: Ye,
|
|
1728
|
-
14: Nt
|
|
1729
|
-
}, Tt = "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji", Lt = {
|
|
1730
|
-
9: "",
|
|
1731
|
-
10: "",
|
|
1732
|
-
11: "",
|
|
1733
|
-
12: "",
|
|
1734
|
-
13: "",
|
|
1735
|
-
14: Tt
|
|
1736
|
-
}, Ie = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu", Xe = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb", Ze = Xe + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd", Je = Ze + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho", $e = Je + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", et = $e + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith", Rt = et + " " + Pt, Ot = {
|
|
1737
|
-
9: Xe,
|
|
1738
|
-
10: Ze,
|
|
1739
|
-
11: Je,
|
|
1740
|
-
12: $e,
|
|
1741
|
-
13: et,
|
|
1742
|
-
14: Rt
|
|
1743
|
-
}, tt = {};
|
|
1744
|
-
function Bt(e) {
|
|
1745
|
-
var t = tt[e] = {
|
|
1746
|
-
binary: D(Vt[e] + " " + Ie),
|
|
1747
|
-
binaryOfStrings: D(Lt[e]),
|
|
1748
|
-
nonBinary: {
|
|
1749
|
-
General_Category: D(Ie),
|
|
1750
|
-
Script: D(Ot[e])
|
|
1751
|
-
}
|
|
1752
|
-
};
|
|
1753
|
-
t.nonBinary.Script_Extensions = t.nonBinary.Script, t.nonBinary.gc = t.nonBinary.General_Category, t.nonBinary.sc = t.nonBinary.Script, t.nonBinary.scx = t.nonBinary.Script_Extensions;
|
|
1754
|
-
}
|
|
1755
|
-
for (var fe = 0, Pe = [9, 10, 11, 12, 13, 14]; fe < Pe.length; fe += 1) {
|
|
1756
|
-
var Dt = Pe[fe];
|
|
1757
|
-
Bt(Dt);
|
|
1758
|
-
}
|
|
1759
|
-
var c = y.prototype, ae = function(t, i) {
|
|
1760
|
-
this.parent = t, this.base = i || this;
|
|
1761
|
-
};
|
|
1762
|
-
ae.prototype.separatedFrom = function(t) {
|
|
1763
|
-
for (var i = this; i; i = i.parent)
|
|
1764
|
-
for (var s = t; s; s = s.parent)
|
|
1765
|
-
if (i.base === s.base && i !== s)
|
|
1766
|
-
return !0;
|
|
1767
|
-
return !1;
|
|
1768
|
-
};
|
|
1769
|
-
ae.prototype.sibling = function() {
|
|
1770
|
-
return new ae(this.parent, this.base);
|
|
1771
|
-
};
|
|
1772
|
-
var L = function(t) {
|
|
1773
|
-
this.parser = t, this.validFlags = "gim" + (t.options.ecmaVersion >= 6 ? "uy" : "") + (t.options.ecmaVersion >= 9 ? "s" : "") + (t.options.ecmaVersion >= 13 ? "d" : "") + (t.options.ecmaVersion >= 15 ? "v" : ""), this.unicodeProperties = tt[t.options.ecmaVersion >= 14 ? 14 : t.options.ecmaVersion], this.source = "", this.flags = "", this.start = 0, this.switchU = !1, this.switchV = !1, this.switchN = !1, this.pos = 0, this.lastIntValue = 0, this.lastStringValue = "", this.lastAssertionIsQuantifiable = !1, this.numCapturingParens = 0, this.maxBackReference = 0, this.groupNames = /* @__PURE__ */ Object.create(null), this.backReferenceNames = [], this.branchID = null;
|
|
1774
|
-
};
|
|
1775
|
-
L.prototype.reset = function(t, i, s) {
|
|
1776
|
-
var r = s.indexOf("v") !== -1, n = s.indexOf("u") !== -1;
|
|
1777
|
-
this.start = t | 0, this.source = i + "", this.flags = s, r && this.parser.options.ecmaVersion >= 15 ? (this.switchU = !0, this.switchV = !0, this.switchN = !0) : (this.switchU = n && this.parser.options.ecmaVersion >= 6, this.switchV = !1, this.switchN = n && this.parser.options.ecmaVersion >= 9);
|
|
1778
|
-
};
|
|
1779
|
-
L.prototype.raise = function(t) {
|
|
1780
|
-
this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + t);
|
|
1781
|
-
};
|
|
1782
|
-
L.prototype.at = function(t, i) {
|
|
1783
|
-
i === void 0 && (i = !1);
|
|
1784
|
-
var s = this.source, r = s.length;
|
|
1785
|
-
if (t >= r)
|
|
1786
|
-
return -1;
|
|
1787
|
-
var n = s.charCodeAt(t);
|
|
1788
|
-
if (!(i || this.switchU) || n <= 55295 || n >= 57344 || t + 1 >= r)
|
|
1789
|
-
return n;
|
|
1790
|
-
var u = s.charCodeAt(t + 1);
|
|
1791
|
-
return u >= 56320 && u <= 57343 ? (n << 10) + u - 56613888 : n;
|
|
1792
|
-
};
|
|
1793
|
-
L.prototype.nextIndex = function(t, i) {
|
|
1794
|
-
i === void 0 && (i = !1);
|
|
1795
|
-
var s = this.source, r = s.length;
|
|
1796
|
-
if (t >= r)
|
|
1797
|
-
return r;
|
|
1798
|
-
var n = s.charCodeAt(t), u;
|
|
1799
|
-
return !(i || this.switchU) || n <= 55295 || n >= 57344 || t + 1 >= r || (u = s.charCodeAt(t + 1)) < 56320 || u > 57343 ? t + 1 : t + 2;
|
|
1800
|
-
};
|
|
1801
|
-
L.prototype.current = function(t) {
|
|
1802
|
-
return t === void 0 && (t = !1), this.at(this.pos, t);
|
|
1803
|
-
};
|
|
1804
|
-
L.prototype.lookahead = function(t) {
|
|
1805
|
-
return t === void 0 && (t = !1), this.at(this.nextIndex(this.pos, t), t);
|
|
1806
|
-
};
|
|
1807
|
-
L.prototype.advance = function(t) {
|
|
1808
|
-
t === void 0 && (t = !1), this.pos = this.nextIndex(this.pos, t);
|
|
1809
|
-
};
|
|
1810
|
-
L.prototype.eat = function(t, i) {
|
|
1811
|
-
return i === void 0 && (i = !1), this.current(i) === t ? (this.advance(i), !0) : !1;
|
|
1812
|
-
};
|
|
1813
|
-
L.prototype.eatChars = function(t, i) {
|
|
1814
|
-
i === void 0 && (i = !1);
|
|
1815
|
-
for (var s = this.pos, r = 0, n = t; r < n.length; r += 1) {
|
|
1816
|
-
var u = n[r], o = this.at(s, i);
|
|
1817
|
-
if (o === -1 || o !== u)
|
|
1818
|
-
return !1;
|
|
1819
|
-
s = this.nextIndex(s, i);
|
|
1820
|
-
}
|
|
1821
|
-
return this.pos = s, !0;
|
|
1822
|
-
};
|
|
1823
|
-
c.validateRegExpFlags = function(e) {
|
|
1824
|
-
for (var t = e.validFlags, i = e.flags, s = !1, r = !1, n = 0; n < i.length; n++) {
|
|
1825
|
-
var u = i.charAt(n);
|
|
1826
|
-
t.indexOf(u) === -1 && this.raise(e.start, "Invalid regular expression flag"), i.indexOf(u, n + 1) > -1 && this.raise(e.start, "Duplicate regular expression flag"), u === "u" && (s = !0), u === "v" && (r = !0);
|
|
1827
|
-
}
|
|
1828
|
-
this.options.ecmaVersion >= 15 && s && r && this.raise(e.start, "Invalid regular expression flag");
|
|
1829
|
-
};
|
|
1830
|
-
function Ft(e) {
|
|
1831
|
-
for (var t in e)
|
|
1832
|
-
return !0;
|
|
1833
|
-
return !1;
|
|
1834
|
-
}
|
|
1835
|
-
c.validateRegExpPattern = function(e) {
|
|
1836
|
-
this.regexp_pattern(e), !e.switchN && this.options.ecmaVersion >= 9 && Ft(e.groupNames) && (e.switchN = !0, this.regexp_pattern(e));
|
|
1837
|
-
};
|
|
1838
|
-
c.regexp_pattern = function(e) {
|
|
1839
|
-
e.pos = 0, e.lastIntValue = 0, e.lastStringValue = "", e.lastAssertionIsQuantifiable = !1, e.numCapturingParens = 0, e.maxBackReference = 0, e.groupNames = /* @__PURE__ */ Object.create(null), e.backReferenceNames.length = 0, e.branchID = null, this.regexp_disjunction(e), e.pos !== e.source.length && (e.eat(
|
|
1840
|
-
41
|
|
1841
|
-
/* ) */
|
|
1842
|
-
) && e.raise("Unmatched ')'"), (e.eat(
|
|
1843
|
-
93
|
|
1844
|
-
/* ] */
|
|
1845
|
-
) || e.eat(
|
|
1846
|
-
125
|
|
1847
|
-
/* } */
|
|
1848
|
-
)) && e.raise("Lone quantifier brackets")), e.maxBackReference > e.numCapturingParens && e.raise("Invalid escape");
|
|
1849
|
-
for (var t = 0, i = e.backReferenceNames; t < i.length; t += 1) {
|
|
1850
|
-
var s = i[t];
|
|
1851
|
-
e.groupNames[s] || e.raise("Invalid named capture referenced");
|
|
1852
|
-
}
|
|
1853
|
-
};
|
|
1854
|
-
c.regexp_disjunction = function(e) {
|
|
1855
|
-
var t = this.options.ecmaVersion >= 16;
|
|
1856
|
-
for (t && (e.branchID = new ae(e.branchID, null)), this.regexp_alternative(e); e.eat(
|
|
1857
|
-
124
|
|
1858
|
-
/* | */
|
|
1859
|
-
); )
|
|
1860
|
-
t && (e.branchID = e.branchID.sibling()), this.regexp_alternative(e);
|
|
1861
|
-
t && (e.branchID = e.branchID.parent), this.regexp_eatQuantifier(e, !0) && e.raise("Nothing to repeat"), e.eat(
|
|
1862
|
-
123
|
|
1863
|
-
/* { */
|
|
1864
|
-
) && e.raise("Lone quantifier brackets");
|
|
1865
|
-
};
|
|
1866
|
-
c.regexp_alternative = function(e) {
|
|
1867
|
-
for (; e.pos < e.source.length && this.regexp_eatTerm(e); )
|
|
1868
|
-
;
|
|
1869
|
-
};
|
|
1870
|
-
c.regexp_eatTerm = function(e) {
|
|
1871
|
-
return this.regexp_eatAssertion(e) ? (e.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(e) && e.switchU && e.raise("Invalid quantifier"), !0) : (e.switchU ? this.regexp_eatAtom(e) : this.regexp_eatExtendedAtom(e)) ? (this.regexp_eatQuantifier(e), !0) : !1;
|
|
1872
|
-
};
|
|
1873
|
-
c.regexp_eatAssertion = function(e) {
|
|
1874
|
-
var t = e.pos;
|
|
1875
|
-
if (e.lastAssertionIsQuantifiable = !1, e.eat(
|
|
1876
|
-
94
|
|
1877
|
-
/* ^ */
|
|
1878
|
-
) || e.eat(
|
|
1879
|
-
36
|
|
1880
|
-
/* $ */
|
|
1881
|
-
))
|
|
1882
|
-
return !0;
|
|
1883
|
-
if (e.eat(
|
|
1884
|
-
92
|
|
1885
|
-
/* \ */
|
|
1886
|
-
)) {
|
|
1887
|
-
if (e.eat(
|
|
1888
|
-
66
|
|
1889
|
-
/* B */
|
|
1890
|
-
) || e.eat(
|
|
1891
|
-
98
|
|
1892
|
-
/* b */
|
|
1893
|
-
))
|
|
1894
|
-
return !0;
|
|
1895
|
-
e.pos = t;
|
|
1896
|
-
}
|
|
1897
|
-
if (e.eat(
|
|
1898
|
-
40
|
|
1899
|
-
/* ( */
|
|
1900
|
-
) && e.eat(
|
|
1901
|
-
63
|
|
1902
|
-
/* ? */
|
|
1903
|
-
)) {
|
|
1904
|
-
var i = !1;
|
|
1905
|
-
if (this.options.ecmaVersion >= 9 && (i = e.eat(
|
|
1906
|
-
60
|
|
1907
|
-
/* < */
|
|
1908
|
-
)), e.eat(
|
|
1909
|
-
61
|
|
1910
|
-
/* = */
|
|
1911
|
-
) || e.eat(
|
|
1912
|
-
33
|
|
1913
|
-
/* ! */
|
|
1914
|
-
))
|
|
1915
|
-
return this.regexp_disjunction(e), e.eat(
|
|
1916
|
-
41
|
|
1917
|
-
/* ) */
|
|
1918
|
-
) || e.raise("Unterminated group"), e.lastAssertionIsQuantifiable = !i, !0;
|
|
1919
|
-
}
|
|
1920
|
-
return e.pos = t, !1;
|
|
1921
|
-
};
|
|
1922
|
-
c.regexp_eatQuantifier = function(e, t) {
|
|
1923
|
-
return t === void 0 && (t = !1), this.regexp_eatQuantifierPrefix(e, t) ? (e.eat(
|
|
1924
|
-
63
|
|
1925
|
-
/* ? */
|
|
1926
|
-
), !0) : !1;
|
|
1927
|
-
};
|
|
1928
|
-
c.regexp_eatQuantifierPrefix = function(e, t) {
|
|
1929
|
-
return e.eat(
|
|
1930
|
-
42
|
|
1931
|
-
/* * */
|
|
1932
|
-
) || e.eat(
|
|
1933
|
-
43
|
|
1934
|
-
/* + */
|
|
1935
|
-
) || e.eat(
|
|
1936
|
-
63
|
|
1937
|
-
/* ? */
|
|
1938
|
-
) || this.regexp_eatBracedQuantifier(e, t);
|
|
1939
|
-
};
|
|
1940
|
-
c.regexp_eatBracedQuantifier = function(e, t) {
|
|
1941
|
-
var i = e.pos;
|
|
1942
|
-
if (e.eat(
|
|
1943
|
-
123
|
|
1944
|
-
/* { */
|
|
1945
|
-
)) {
|
|
1946
|
-
var s = 0, r = -1;
|
|
1947
|
-
if (this.regexp_eatDecimalDigits(e) && (s = e.lastIntValue, e.eat(
|
|
1948
|
-
44
|
|
1949
|
-
/* , */
|
|
1950
|
-
) && this.regexp_eatDecimalDigits(e) && (r = e.lastIntValue), e.eat(
|
|
1951
|
-
125
|
|
1952
|
-
/* } */
|
|
1953
|
-
)))
|
|
1954
|
-
return r !== -1 && r < s && !t && e.raise("numbers out of order in {} quantifier"), !0;
|
|
1955
|
-
e.switchU && !t && e.raise("Incomplete quantifier"), e.pos = i;
|
|
1956
|
-
}
|
|
1957
|
-
return !1;
|
|
1958
|
-
};
|
|
1959
|
-
c.regexp_eatAtom = function(e) {
|
|
1960
|
-
return this.regexp_eatPatternCharacters(e) || e.eat(
|
|
1961
|
-
46
|
|
1962
|
-
/* . */
|
|
1963
|
-
) || this.regexp_eatReverseSolidusAtomEscape(e) || this.regexp_eatCharacterClass(e) || this.regexp_eatUncapturingGroup(e) || this.regexp_eatCapturingGroup(e);
|
|
1964
|
-
};
|
|
1965
|
-
c.regexp_eatReverseSolidusAtomEscape = function(e) {
|
|
1966
|
-
var t = e.pos;
|
|
1967
|
-
if (e.eat(
|
|
1968
|
-
92
|
|
1969
|
-
/* \ */
|
|
1970
|
-
)) {
|
|
1971
|
-
if (this.regexp_eatAtomEscape(e))
|
|
1972
|
-
return !0;
|
|
1973
|
-
e.pos = t;
|
|
1974
|
-
}
|
|
1975
|
-
return !1;
|
|
1976
|
-
};
|
|
1977
|
-
c.regexp_eatUncapturingGroup = function(e) {
|
|
1978
|
-
var t = e.pos;
|
|
1979
|
-
if (e.eat(
|
|
1980
|
-
40
|
|
1981
|
-
/* ( */
|
|
1982
|
-
)) {
|
|
1983
|
-
if (e.eat(
|
|
1984
|
-
63
|
|
1985
|
-
/* ? */
|
|
1986
|
-
)) {
|
|
1987
|
-
if (this.options.ecmaVersion >= 16) {
|
|
1988
|
-
var i = this.regexp_eatModifiers(e), s = e.eat(
|
|
1989
|
-
45
|
|
1990
|
-
/* - */
|
|
1991
|
-
);
|
|
1992
|
-
if (i || s) {
|
|
1993
|
-
for (var r = 0; r < i.length; r++) {
|
|
1994
|
-
var n = i.charAt(r);
|
|
1995
|
-
i.indexOf(n, r + 1) > -1 && e.raise("Duplicate regular expression modifiers");
|
|
1996
|
-
}
|
|
1997
|
-
if (s) {
|
|
1998
|
-
var u = this.regexp_eatModifiers(e);
|
|
1999
|
-
!i && !u && e.current() === 58 && e.raise("Invalid regular expression modifiers");
|
|
2000
|
-
for (var o = 0; o < u.length; o++) {
|
|
2001
|
-
var h = u.charAt(o);
|
|
2002
|
-
(u.indexOf(h, o + 1) > -1 || i.indexOf(h) > -1) && e.raise("Duplicate regular expression modifiers");
|
|
2003
|
-
}
|
|
2004
|
-
}
|
|
2005
|
-
}
|
|
2006
|
-
}
|
|
2007
|
-
if (e.eat(
|
|
2008
|
-
58
|
|
2009
|
-
/* : */
|
|
2010
|
-
)) {
|
|
2011
|
-
if (this.regexp_disjunction(e), e.eat(
|
|
2012
|
-
41
|
|
2013
|
-
/* ) */
|
|
2014
|
-
))
|
|
2015
|
-
return !0;
|
|
2016
|
-
e.raise("Unterminated group");
|
|
2017
|
-
}
|
|
2018
|
-
}
|
|
2019
|
-
e.pos = t;
|
|
2020
|
-
}
|
|
2021
|
-
return !1;
|
|
2022
|
-
};
|
|
2023
|
-
c.regexp_eatCapturingGroup = function(e) {
|
|
2024
|
-
if (e.eat(
|
|
2025
|
-
40
|
|
2026
|
-
/* ( */
|
|
2027
|
-
)) {
|
|
2028
|
-
if (this.options.ecmaVersion >= 9 ? this.regexp_groupSpecifier(e) : e.current() === 63 && e.raise("Invalid group"), this.regexp_disjunction(e), e.eat(
|
|
2029
|
-
41
|
|
2030
|
-
/* ) */
|
|
2031
|
-
))
|
|
2032
|
-
return e.numCapturingParens += 1, !0;
|
|
2033
|
-
e.raise("Unterminated group");
|
|
2034
|
-
}
|
|
2035
|
-
return !1;
|
|
2036
|
-
};
|
|
2037
|
-
c.regexp_eatModifiers = function(e) {
|
|
2038
|
-
for (var t = "", i = 0; (i = e.current()) !== -1 && Mt(i); )
|
|
2039
|
-
t += R(i), e.advance();
|
|
2040
|
-
return t;
|
|
2041
|
-
};
|
|
2042
|
-
function Mt(e) {
|
|
2043
|
-
return e === 105 || e === 109 || e === 115;
|
|
2044
|
-
}
|
|
2045
|
-
c.regexp_eatExtendedAtom = function(e) {
|
|
2046
|
-
return e.eat(
|
|
2047
|
-
46
|
|
2048
|
-
/* . */
|
|
2049
|
-
) || this.regexp_eatReverseSolidusAtomEscape(e) || this.regexp_eatCharacterClass(e) || this.regexp_eatUncapturingGroup(e) || this.regexp_eatCapturingGroup(e) || this.regexp_eatInvalidBracedQuantifier(e) || this.regexp_eatExtendedPatternCharacter(e);
|
|
2050
|
-
};
|
|
2051
|
-
c.regexp_eatInvalidBracedQuantifier = function(e) {
|
|
2052
|
-
return this.regexp_eatBracedQuantifier(e, !0) && e.raise("Nothing to repeat"), !1;
|
|
2053
|
-
};
|
|
2054
|
-
c.regexp_eatSyntaxCharacter = function(e) {
|
|
2055
|
-
var t = e.current();
|
|
2056
|
-
return it(t) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
2057
|
-
};
|
|
2058
|
-
function it(e) {
|
|
2059
|
-
return e === 36 || e >= 40 && e <= 43 || e === 46 || e === 63 || e >= 91 && e <= 94 || e >= 123 && e <= 125;
|
|
2060
|
-
}
|
|
2061
|
-
c.regexp_eatPatternCharacters = function(e) {
|
|
2062
|
-
for (var t = e.pos, i = 0; (i = e.current()) !== -1 && !it(i); )
|
|
2063
|
-
e.advance();
|
|
2064
|
-
return e.pos !== t;
|
|
2065
|
-
};
|
|
2066
|
-
c.regexp_eatExtendedPatternCharacter = function(e) {
|
|
2067
|
-
var t = e.current();
|
|
2068
|
-
return t !== -1 && t !== 36 && !(t >= 40 && t <= 43) && t !== 46 && t !== 63 && t !== 91 && t !== 94 && t !== 124 ? (e.advance(), !0) : !1;
|
|
2069
|
-
};
|
|
2070
|
-
c.regexp_groupSpecifier = function(e) {
|
|
2071
|
-
if (e.eat(
|
|
2072
|
-
63
|
|
2073
|
-
/* ? */
|
|
2074
|
-
)) {
|
|
2075
|
-
this.regexp_eatGroupName(e) || e.raise("Invalid group");
|
|
2076
|
-
var t = this.options.ecmaVersion >= 16, i = e.groupNames[e.lastStringValue];
|
|
2077
|
-
if (i)
|
|
2078
|
-
if (t)
|
|
2079
|
-
for (var s = 0, r = i; s < r.length; s += 1) {
|
|
2080
|
-
var n = r[s];
|
|
2081
|
-
n.separatedFrom(e.branchID) || e.raise("Duplicate capture group name");
|
|
2082
|
-
}
|
|
2083
|
-
else
|
|
2084
|
-
e.raise("Duplicate capture group name");
|
|
2085
|
-
t ? (i || (e.groupNames[e.lastStringValue] = [])).push(e.branchID) : e.groupNames[e.lastStringValue] = !0;
|
|
2086
|
-
}
|
|
2087
|
-
};
|
|
2088
|
-
c.regexp_eatGroupName = function(e) {
|
|
2089
|
-
if (e.lastStringValue = "", e.eat(
|
|
2090
|
-
60
|
|
2091
|
-
/* < */
|
|
2092
|
-
)) {
|
|
2093
|
-
if (this.regexp_eatRegExpIdentifierName(e) && e.eat(
|
|
2094
|
-
62
|
|
2095
|
-
/* > */
|
|
2096
|
-
))
|
|
2097
|
-
return !0;
|
|
2098
|
-
e.raise("Invalid capture group name");
|
|
2099
|
-
}
|
|
2100
|
-
return !1;
|
|
2101
|
-
};
|
|
2102
|
-
c.regexp_eatRegExpIdentifierName = function(e) {
|
|
2103
|
-
if (e.lastStringValue = "", this.regexp_eatRegExpIdentifierStart(e)) {
|
|
2104
|
-
for (e.lastStringValue += R(e.lastIntValue); this.regexp_eatRegExpIdentifierPart(e); )
|
|
2105
|
-
e.lastStringValue += R(e.lastIntValue);
|
|
2106
|
-
return !0;
|
|
2107
|
-
}
|
|
2108
|
-
return !1;
|
|
2109
|
-
};
|
|
2110
|
-
c.regexp_eatRegExpIdentifierStart = function(e) {
|
|
2111
|
-
var t = e.pos, i = this.options.ecmaVersion >= 11, s = e.current(i);
|
|
2112
|
-
return e.advance(i), s === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, i) && (s = e.lastIntValue), Ut(s) ? (e.lastIntValue = s, !0) : (e.pos = t, !1);
|
|
2113
|
-
};
|
|
2114
|
-
function Ut(e) {
|
|
2115
|
-
return V(e, !0) || e === 36 || e === 95;
|
|
2116
|
-
}
|
|
2117
|
-
c.regexp_eatRegExpIdentifierPart = function(e) {
|
|
2118
|
-
var t = e.pos, i = this.options.ecmaVersion >= 11, s = e.current(i);
|
|
2119
|
-
return e.advance(i), s === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, i) && (s = e.lastIntValue), qt(s) ? (e.lastIntValue = s, !0) : (e.pos = t, !1);
|
|
2120
|
-
};
|
|
2121
|
-
function qt(e) {
|
|
2122
|
-
return F(e, !0) || e === 36 || e === 95 || e === 8204 || e === 8205;
|
|
2123
|
-
}
|
|
2124
|
-
c.regexp_eatAtomEscape = function(e) {
|
|
2125
|
-
return this.regexp_eatBackReference(e) || this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e) || e.switchN && this.regexp_eatKGroupName(e) ? !0 : (e.switchU && (e.current() === 99 && e.raise("Invalid unicode escape"), e.raise("Invalid escape")), !1);
|
|
2126
|
-
};
|
|
2127
|
-
c.regexp_eatBackReference = function(e) {
|
|
2128
|
-
var t = e.pos;
|
|
2129
|
-
if (this.regexp_eatDecimalEscape(e)) {
|
|
2130
|
-
var i = e.lastIntValue;
|
|
2131
|
-
if (e.switchU)
|
|
2132
|
-
return i > e.maxBackReference && (e.maxBackReference = i), !0;
|
|
2133
|
-
if (i <= e.numCapturingParens)
|
|
2134
|
-
return !0;
|
|
2135
|
-
e.pos = t;
|
|
2136
|
-
}
|
|
2137
|
-
return !1;
|
|
2138
|
-
};
|
|
2139
|
-
c.regexp_eatKGroupName = function(e) {
|
|
2140
|
-
if (e.eat(
|
|
2141
|
-
107
|
|
2142
|
-
/* k */
|
|
2143
|
-
)) {
|
|
2144
|
-
if (this.regexp_eatGroupName(e))
|
|
2145
|
-
return e.backReferenceNames.push(e.lastStringValue), !0;
|
|
2146
|
-
e.raise("Invalid named reference");
|
|
2147
|
-
}
|
|
2148
|
-
return !1;
|
|
2149
|
-
};
|
|
2150
|
-
c.regexp_eatCharacterEscape = function(e) {
|
|
2151
|
-
return this.regexp_eatControlEscape(e) || this.regexp_eatCControlLetter(e) || this.regexp_eatZero(e) || this.regexp_eatHexEscapeSequence(e) || this.regexp_eatRegExpUnicodeEscapeSequence(e, !1) || !e.switchU && this.regexp_eatLegacyOctalEscapeSequence(e) || this.regexp_eatIdentityEscape(e);
|
|
2152
|
-
};
|
|
2153
|
-
c.regexp_eatCControlLetter = function(e) {
|
|
2154
|
-
var t = e.pos;
|
|
2155
|
-
if (e.eat(
|
|
2156
|
-
99
|
|
2157
|
-
/* c */
|
|
2158
|
-
)) {
|
|
2159
|
-
if (this.regexp_eatControlLetter(e))
|
|
2160
|
-
return !0;
|
|
2161
|
-
e.pos = t;
|
|
2162
|
-
}
|
|
2163
|
-
return !1;
|
|
2164
|
-
};
|
|
2165
|
-
c.regexp_eatZero = function(e) {
|
|
2166
|
-
return e.current() === 48 && !ce(e.lookahead()) ? (e.lastIntValue = 0, e.advance(), !0) : !1;
|
|
2167
|
-
};
|
|
2168
|
-
c.regexp_eatControlEscape = function(e) {
|
|
2169
|
-
var t = e.current();
|
|
2170
|
-
return t === 116 ? (e.lastIntValue = 9, e.advance(), !0) : t === 110 ? (e.lastIntValue = 10, e.advance(), !0) : t === 118 ? (e.lastIntValue = 11, e.advance(), !0) : t === 102 ? (e.lastIntValue = 12, e.advance(), !0) : t === 114 ? (e.lastIntValue = 13, e.advance(), !0) : !1;
|
|
2171
|
-
};
|
|
2172
|
-
c.regexp_eatControlLetter = function(e) {
|
|
2173
|
-
var t = e.current();
|
|
2174
|
-
return st(t) ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
|
|
2175
|
-
};
|
|
2176
|
-
function st(e) {
|
|
2177
|
-
return e >= 65 && e <= 90 || e >= 97 && e <= 122;
|
|
2178
|
-
}
|
|
2179
|
-
c.regexp_eatRegExpUnicodeEscapeSequence = function(e, t) {
|
|
2180
|
-
t === void 0 && (t = !1);
|
|
2181
|
-
var i = e.pos, s = t || e.switchU;
|
|
2182
|
-
if (e.eat(
|
|
2183
|
-
117
|
|
2184
|
-
/* u */
|
|
2185
|
-
)) {
|
|
2186
|
-
if (this.regexp_eatFixedHexDigits(e, 4)) {
|
|
2187
|
-
var r = e.lastIntValue;
|
|
2188
|
-
if (s && r >= 55296 && r <= 56319) {
|
|
2189
|
-
var n = e.pos;
|
|
2190
|
-
if (e.eat(
|
|
2191
|
-
92
|
|
2192
|
-
/* \ */
|
|
2193
|
-
) && e.eat(
|
|
2194
|
-
117
|
|
2195
|
-
/* u */
|
|
2196
|
-
) && this.regexp_eatFixedHexDigits(e, 4)) {
|
|
2197
|
-
var u = e.lastIntValue;
|
|
2198
|
-
if (u >= 56320 && u <= 57343)
|
|
2199
|
-
return e.lastIntValue = (r - 55296) * 1024 + (u - 56320) + 65536, !0;
|
|
2200
|
-
}
|
|
2201
|
-
e.pos = n, e.lastIntValue = r;
|
|
2202
|
-
}
|
|
2203
|
-
return !0;
|
|
2204
|
-
}
|
|
2205
|
-
if (s && e.eat(
|
|
2206
|
-
123
|
|
2207
|
-
/* { */
|
|
2208
|
-
) && this.regexp_eatHexDigits(e) && e.eat(
|
|
2209
|
-
125
|
|
2210
|
-
/* } */
|
|
2211
|
-
) && jt(e.lastIntValue))
|
|
2212
|
-
return !0;
|
|
2213
|
-
s && e.raise("Invalid unicode escape"), e.pos = i;
|
|
2214
|
-
}
|
|
2215
|
-
return !1;
|
|
2216
|
-
};
|
|
2217
|
-
function jt(e) {
|
|
2218
|
-
return e >= 0 && e <= 1114111;
|
|
2219
|
-
}
|
|
2220
|
-
c.regexp_eatIdentityEscape = function(e) {
|
|
2221
|
-
if (e.switchU)
|
|
2222
|
-
return this.regexp_eatSyntaxCharacter(e) ? !0 : e.eat(
|
|
2223
|
-
47
|
|
2224
|
-
/* / */
|
|
2225
|
-
) ? (e.lastIntValue = 47, !0) : !1;
|
|
2226
|
-
var t = e.current();
|
|
2227
|
-
return t !== 99 && (!e.switchN || t !== 107) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
2228
|
-
};
|
|
2229
|
-
c.regexp_eatDecimalEscape = function(e) {
|
|
2230
|
-
e.lastIntValue = 0;
|
|
2231
|
-
var t = e.current();
|
|
2232
|
-
if (t >= 49 && t <= 57) {
|
|
2233
|
-
do
|
|
2234
|
-
e.lastIntValue = 10 * e.lastIntValue + (t - 48), e.advance();
|
|
2235
|
-
while ((t = e.current()) >= 48 && t <= 57);
|
|
2236
|
-
return !0;
|
|
2237
|
-
}
|
|
2238
|
-
return !1;
|
|
2239
|
-
};
|
|
2240
|
-
var at = 0, O = 1, I = 2;
|
|
2241
|
-
c.regexp_eatCharacterClassEscape = function(e) {
|
|
2242
|
-
var t = e.current();
|
|
2243
|
-
if (Gt(t))
|
|
2244
|
-
return e.lastIntValue = -1, e.advance(), O;
|
|
2245
|
-
var i = !1;
|
|
2246
|
-
if (e.switchU && this.options.ecmaVersion >= 9 && ((i = t === 80) || t === 112)) {
|
|
2247
|
-
e.lastIntValue = -1, e.advance();
|
|
2248
|
-
var s;
|
|
2249
|
-
if (e.eat(
|
|
2250
|
-
123
|
|
2251
|
-
/* { */
|
|
2252
|
-
) && (s = this.regexp_eatUnicodePropertyValueExpression(e)) && e.eat(
|
|
2253
|
-
125
|
|
2254
|
-
/* } */
|
|
2255
|
-
))
|
|
2256
|
-
return i && s === I && e.raise("Invalid property name"), s;
|
|
2257
|
-
e.raise("Invalid property name");
|
|
2258
|
-
}
|
|
2259
|
-
return at;
|
|
2260
|
-
};
|
|
2261
|
-
function Gt(e) {
|
|
2262
|
-
return e === 100 || e === 68 || e === 115 || e === 83 || e === 119 || e === 87;
|
|
2263
|
-
}
|
|
2264
|
-
c.regexp_eatUnicodePropertyValueExpression = function(e) {
|
|
2265
|
-
var t = e.pos;
|
|
2266
|
-
if (this.regexp_eatUnicodePropertyName(e) && e.eat(
|
|
2267
|
-
61
|
|
2268
|
-
/* = */
|
|
2269
|
-
)) {
|
|
2270
|
-
var i = e.lastStringValue;
|
|
2271
|
-
if (this.regexp_eatUnicodePropertyValue(e)) {
|
|
2272
|
-
var s = e.lastStringValue;
|
|
2273
|
-
return this.regexp_validateUnicodePropertyNameAndValue(e, i, s), O;
|
|
2274
|
-
}
|
|
2275
|
-
}
|
|
2276
|
-
if (e.pos = t, this.regexp_eatLoneUnicodePropertyNameOrValue(e)) {
|
|
2277
|
-
var r = e.lastStringValue;
|
|
2278
|
-
return this.regexp_validateUnicodePropertyNameOrValue(e, r);
|
|
2279
|
-
}
|
|
2280
|
-
return at;
|
|
2281
|
-
};
|
|
2282
|
-
c.regexp_validateUnicodePropertyNameAndValue = function(e, t, i) {
|
|
2283
|
-
W(e.unicodeProperties.nonBinary, t) || e.raise("Invalid property name"), e.unicodeProperties.nonBinary[t].test(i) || e.raise("Invalid property value");
|
|
2284
|
-
};
|
|
2285
|
-
c.regexp_validateUnicodePropertyNameOrValue = function(e, t) {
|
|
2286
|
-
if (e.unicodeProperties.binary.test(t))
|
|
2287
|
-
return O;
|
|
2288
|
-
if (e.switchV && e.unicodeProperties.binaryOfStrings.test(t))
|
|
2289
|
-
return I;
|
|
2290
|
-
e.raise("Invalid property name");
|
|
2291
|
-
};
|
|
2292
|
-
c.regexp_eatUnicodePropertyName = function(e) {
|
|
2293
|
-
var t = 0;
|
|
2294
|
-
for (e.lastStringValue = ""; rt(t = e.current()); )
|
|
2295
|
-
e.lastStringValue += R(t), e.advance();
|
|
2296
|
-
return e.lastStringValue !== "";
|
|
2297
|
-
};
|
|
2298
|
-
function rt(e) {
|
|
2299
|
-
return st(e) || e === 95;
|
|
2300
|
-
}
|
|
2301
|
-
c.regexp_eatUnicodePropertyValue = function(e) {
|
|
2302
|
-
var t = 0;
|
|
2303
|
-
for (e.lastStringValue = ""; Ht(t = e.current()); )
|
|
2304
|
-
e.lastStringValue += R(t), e.advance();
|
|
2305
|
-
return e.lastStringValue !== "";
|
|
2306
|
-
};
|
|
2307
|
-
function Ht(e) {
|
|
2308
|
-
return rt(e) || ce(e);
|
|
2309
|
-
}
|
|
2310
|
-
c.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
2311
|
-
return this.regexp_eatUnicodePropertyValue(e);
|
|
2312
|
-
};
|
|
2313
|
-
c.regexp_eatCharacterClass = function(e) {
|
|
2314
|
-
if (e.eat(
|
|
2315
|
-
91
|
|
2316
|
-
/* [ */
|
|
2317
|
-
)) {
|
|
2318
|
-
var t = e.eat(
|
|
2319
|
-
94
|
|
2320
|
-
/* ^ */
|
|
2321
|
-
), i = this.regexp_classContents(e);
|
|
2322
|
-
return e.eat(
|
|
2323
|
-
93
|
|
2324
|
-
/* ] */
|
|
2325
|
-
) || e.raise("Unterminated character class"), t && i === I && e.raise("Negated character class may contain strings"), !0;
|
|
2326
|
-
}
|
|
2327
|
-
return !1;
|
|
2328
|
-
};
|
|
2329
|
-
c.regexp_classContents = function(e) {
|
|
2330
|
-
return e.current() === 93 ? O : e.switchV ? this.regexp_classSetExpression(e) : (this.regexp_nonEmptyClassRanges(e), O);
|
|
2331
|
-
};
|
|
2332
|
-
c.regexp_nonEmptyClassRanges = function(e) {
|
|
2333
|
-
for (; this.regexp_eatClassAtom(e); ) {
|
|
2334
|
-
var t = e.lastIntValue;
|
|
2335
|
-
if (e.eat(
|
|
2336
|
-
45
|
|
2337
|
-
/* - */
|
|
2338
|
-
) && this.regexp_eatClassAtom(e)) {
|
|
2339
|
-
var i = e.lastIntValue;
|
|
2340
|
-
e.switchU && (t === -1 || i === -1) && e.raise("Invalid character class"), t !== -1 && i !== -1 && t > i && e.raise("Range out of order in character class");
|
|
2341
|
-
}
|
|
2342
|
-
}
|
|
2343
|
-
};
|
|
2344
|
-
c.regexp_eatClassAtom = function(e) {
|
|
2345
|
-
var t = e.pos;
|
|
2346
|
-
if (e.eat(
|
|
2347
|
-
92
|
|
2348
|
-
/* \ */
|
|
2349
|
-
)) {
|
|
2350
|
-
if (this.regexp_eatClassEscape(e))
|
|
2351
|
-
return !0;
|
|
2352
|
-
if (e.switchU) {
|
|
2353
|
-
var i = e.current();
|
|
2354
|
-
(i === 99 || ot(i)) && e.raise("Invalid class escape"), e.raise("Invalid escape");
|
|
2355
|
-
}
|
|
2356
|
-
e.pos = t;
|
|
2357
|
-
}
|
|
2358
|
-
var s = e.current();
|
|
2359
|
-
return s !== 93 ? (e.lastIntValue = s, e.advance(), !0) : !1;
|
|
2360
|
-
};
|
|
2361
|
-
c.regexp_eatClassEscape = function(e) {
|
|
2362
|
-
var t = e.pos;
|
|
2363
|
-
if (e.eat(
|
|
2364
|
-
98
|
|
2365
|
-
/* b */
|
|
2366
|
-
))
|
|
2367
|
-
return e.lastIntValue = 8, !0;
|
|
2368
|
-
if (e.switchU && e.eat(
|
|
2369
|
-
45
|
|
2370
|
-
/* - */
|
|
2371
|
-
))
|
|
2372
|
-
return e.lastIntValue = 45, !0;
|
|
2373
|
-
if (!e.switchU && e.eat(
|
|
2374
|
-
99
|
|
2375
|
-
/* c */
|
|
2376
|
-
)) {
|
|
2377
|
-
if (this.regexp_eatClassControlLetter(e))
|
|
2378
|
-
return !0;
|
|
2379
|
-
e.pos = t;
|
|
2380
|
-
}
|
|
2381
|
-
return this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e);
|
|
2382
|
-
};
|
|
2383
|
-
c.regexp_classSetExpression = function(e) {
|
|
2384
|
-
var t = O, i;
|
|
2385
|
-
if (!this.regexp_eatClassSetRange(e))
|
|
2386
|
-
if (i = this.regexp_eatClassSetOperand(e)) {
|
|
2387
|
-
i === I && (t = I);
|
|
2388
|
-
for (var s = e.pos; e.eatChars(
|
|
2389
|
-
[38, 38]
|
|
2390
|
-
/* && */
|
|
2391
|
-
); ) {
|
|
2392
|
-
if (e.current() !== 38 && (i = this.regexp_eatClassSetOperand(e))) {
|
|
2393
|
-
i !== I && (t = O);
|
|
2394
|
-
continue;
|
|
2395
|
-
}
|
|
2396
|
-
e.raise("Invalid character in character class");
|
|
2397
|
-
}
|
|
2398
|
-
if (s !== e.pos)
|
|
2399
|
-
return t;
|
|
2400
|
-
for (; e.eatChars(
|
|
2401
|
-
[45, 45]
|
|
2402
|
-
/* -- */
|
|
2403
|
-
); )
|
|
2404
|
-
this.regexp_eatClassSetOperand(e) || e.raise("Invalid character in character class");
|
|
2405
|
-
if (s !== e.pos)
|
|
2406
|
-
return t;
|
|
2407
|
-
} else
|
|
2408
|
-
e.raise("Invalid character in character class");
|
|
2409
|
-
for (; ; )
|
|
2410
|
-
if (!this.regexp_eatClassSetRange(e)) {
|
|
2411
|
-
if (i = this.regexp_eatClassSetOperand(e), !i)
|
|
2412
|
-
return t;
|
|
2413
|
-
i === I && (t = I);
|
|
2414
|
-
}
|
|
2415
|
-
};
|
|
2416
|
-
c.regexp_eatClassSetRange = function(e) {
|
|
2417
|
-
var t = e.pos;
|
|
2418
|
-
if (this.regexp_eatClassSetCharacter(e)) {
|
|
2419
|
-
var i = e.lastIntValue;
|
|
2420
|
-
if (e.eat(
|
|
2421
|
-
45
|
|
2422
|
-
/* - */
|
|
2423
|
-
) && this.regexp_eatClassSetCharacter(e)) {
|
|
2424
|
-
var s = e.lastIntValue;
|
|
2425
|
-
return i !== -1 && s !== -1 && i > s && e.raise("Range out of order in character class"), !0;
|
|
2426
|
-
}
|
|
2427
|
-
e.pos = t;
|
|
2428
|
-
}
|
|
2429
|
-
return !1;
|
|
2430
|
-
};
|
|
2431
|
-
c.regexp_eatClassSetOperand = function(e) {
|
|
2432
|
-
return this.regexp_eatClassSetCharacter(e) ? O : this.regexp_eatClassStringDisjunction(e) || this.regexp_eatNestedClass(e);
|
|
2433
|
-
};
|
|
2434
|
-
c.regexp_eatNestedClass = function(e) {
|
|
2435
|
-
var t = e.pos;
|
|
2436
|
-
if (e.eat(
|
|
2437
|
-
91
|
|
2438
|
-
/* [ */
|
|
2439
|
-
)) {
|
|
2440
|
-
var i = e.eat(
|
|
2441
|
-
94
|
|
2442
|
-
/* ^ */
|
|
2443
|
-
), s = this.regexp_classContents(e);
|
|
2444
|
-
if (e.eat(
|
|
2445
|
-
93
|
|
2446
|
-
/* ] */
|
|
2447
|
-
))
|
|
2448
|
-
return i && s === I && e.raise("Negated character class may contain strings"), s;
|
|
2449
|
-
e.pos = t;
|
|
2450
|
-
}
|
|
2451
|
-
if (e.eat(
|
|
2452
|
-
92
|
|
2453
|
-
/* \ */
|
|
2454
|
-
)) {
|
|
2455
|
-
var r = this.regexp_eatCharacterClassEscape(e);
|
|
2456
|
-
if (r)
|
|
2457
|
-
return r;
|
|
2458
|
-
e.pos = t;
|
|
2459
|
-
}
|
|
2460
|
-
return null;
|
|
2461
|
-
};
|
|
2462
|
-
c.regexp_eatClassStringDisjunction = function(e) {
|
|
2463
|
-
var t = e.pos;
|
|
2464
|
-
if (e.eatChars(
|
|
2465
|
-
[92, 113]
|
|
2466
|
-
/* \q */
|
|
2467
|
-
)) {
|
|
2468
|
-
if (e.eat(
|
|
2469
|
-
123
|
|
2470
|
-
/* { */
|
|
2471
|
-
)) {
|
|
2472
|
-
var i = this.regexp_classStringDisjunctionContents(e);
|
|
2473
|
-
if (e.eat(
|
|
2474
|
-
125
|
|
2475
|
-
/* } */
|
|
2476
|
-
))
|
|
2477
|
-
return i;
|
|
2478
|
-
} else
|
|
2479
|
-
e.raise("Invalid escape");
|
|
2480
|
-
e.pos = t;
|
|
2481
|
-
}
|
|
2482
|
-
return null;
|
|
2483
|
-
};
|
|
2484
|
-
c.regexp_classStringDisjunctionContents = function(e) {
|
|
2485
|
-
for (var t = this.regexp_classString(e); e.eat(
|
|
2486
|
-
124
|
|
2487
|
-
/* | */
|
|
2488
|
-
); )
|
|
2489
|
-
this.regexp_classString(e) === I && (t = I);
|
|
2490
|
-
return t;
|
|
2491
|
-
};
|
|
2492
|
-
c.regexp_classString = function(e) {
|
|
2493
|
-
for (var t = 0; this.regexp_eatClassSetCharacter(e); )
|
|
2494
|
-
t++;
|
|
2495
|
-
return t === 1 ? O : I;
|
|
2496
|
-
};
|
|
2497
|
-
c.regexp_eatClassSetCharacter = function(e) {
|
|
2498
|
-
var t = e.pos;
|
|
2499
|
-
if (e.eat(
|
|
2500
|
-
92
|
|
2501
|
-
/* \ */
|
|
2502
|
-
))
|
|
2503
|
-
return this.regexp_eatCharacterEscape(e) || this.regexp_eatClassSetReservedPunctuator(e) ? !0 : e.eat(
|
|
2504
|
-
98
|
|
2505
|
-
/* b */
|
|
2506
|
-
) ? (e.lastIntValue = 8, !0) : (e.pos = t, !1);
|
|
2507
|
-
var i = e.current();
|
|
2508
|
-
return i < 0 || i === e.lookahead() && Wt(i) || zt(i) ? !1 : (e.advance(), e.lastIntValue = i, !0);
|
|
2509
|
-
};
|
|
2510
|
-
function Wt(e) {
|
|
2511
|
-
return e === 33 || e >= 35 && e <= 38 || e >= 42 && e <= 44 || e === 46 || e >= 58 && e <= 64 || e === 94 || e === 96 || e === 126;
|
|
2512
|
-
}
|
|
2513
|
-
function zt(e) {
|
|
2514
|
-
return e === 40 || e === 41 || e === 45 || e === 47 || e >= 91 && e <= 93 || e >= 123 && e <= 125;
|
|
2515
|
-
}
|
|
2516
|
-
c.regexp_eatClassSetReservedPunctuator = function(e) {
|
|
2517
|
-
var t = e.current();
|
|
2518
|
-
return Kt(t) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
2519
|
-
};
|
|
2520
|
-
function Kt(e) {
|
|
2521
|
-
return e === 33 || e === 35 || e === 37 || e === 38 || e === 44 || e === 45 || e >= 58 && e <= 62 || e === 64 || e === 96 || e === 126;
|
|
2522
|
-
}
|
|
2523
|
-
c.regexp_eatClassControlLetter = function(e) {
|
|
2524
|
-
var t = e.current();
|
|
2525
|
-
return ce(t) || t === 95 ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
|
|
2526
|
-
};
|
|
2527
|
-
c.regexp_eatHexEscapeSequence = function(e) {
|
|
2528
|
-
var t = e.pos;
|
|
2529
|
-
if (e.eat(
|
|
2530
|
-
120
|
|
2531
|
-
/* x */
|
|
2532
|
-
)) {
|
|
2533
|
-
if (this.regexp_eatFixedHexDigits(e, 2))
|
|
2534
|
-
return !0;
|
|
2535
|
-
e.switchU && e.raise("Invalid escape"), e.pos = t;
|
|
2536
|
-
}
|
|
2537
|
-
return !1;
|
|
2538
|
-
};
|
|
2539
|
-
c.regexp_eatDecimalDigits = function(e) {
|
|
2540
|
-
var t = e.pos, i = 0;
|
|
2541
|
-
for (e.lastIntValue = 0; ce(i = e.current()); )
|
|
2542
|
-
e.lastIntValue = 10 * e.lastIntValue + (i - 48), e.advance();
|
|
2543
|
-
return e.pos !== t;
|
|
2544
|
-
};
|
|
2545
|
-
function ce(e) {
|
|
2546
|
-
return e >= 48 && e <= 57;
|
|
2547
|
-
}
|
|
2548
|
-
c.regexp_eatHexDigits = function(e) {
|
|
2549
|
-
var t = e.pos, i = 0;
|
|
2550
|
-
for (e.lastIntValue = 0; nt(i = e.current()); )
|
|
2551
|
-
e.lastIntValue = 16 * e.lastIntValue + ut(i), e.advance();
|
|
2552
|
-
return e.pos !== t;
|
|
2553
|
-
};
|
|
2554
|
-
function nt(e) {
|
|
2555
|
-
return e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102;
|
|
2556
|
-
}
|
|
2557
|
-
function ut(e) {
|
|
2558
|
-
return e >= 65 && e <= 70 ? 10 + (e - 65) : e >= 97 && e <= 102 ? 10 + (e - 97) : e - 48;
|
|
2559
|
-
}
|
|
2560
|
-
c.regexp_eatLegacyOctalEscapeSequence = function(e) {
|
|
2561
|
-
if (this.regexp_eatOctalDigit(e)) {
|
|
2562
|
-
var t = e.lastIntValue;
|
|
2563
|
-
if (this.regexp_eatOctalDigit(e)) {
|
|
2564
|
-
var i = e.lastIntValue;
|
|
2565
|
-
t <= 3 && this.regexp_eatOctalDigit(e) ? e.lastIntValue = t * 64 + i * 8 + e.lastIntValue : e.lastIntValue = t * 8 + i;
|
|
2566
|
-
} else
|
|
2567
|
-
e.lastIntValue = t;
|
|
2568
|
-
return !0;
|
|
2569
|
-
}
|
|
2570
|
-
return !1;
|
|
2571
|
-
};
|
|
2572
|
-
c.regexp_eatOctalDigit = function(e) {
|
|
2573
|
-
var t = e.current();
|
|
2574
|
-
return ot(t) ? (e.lastIntValue = t - 48, e.advance(), !0) : (e.lastIntValue = 0, !1);
|
|
2575
|
-
};
|
|
2576
|
-
function ot(e) {
|
|
2577
|
-
return e >= 48 && e <= 55;
|
|
2578
|
-
}
|
|
2579
|
-
c.regexp_eatFixedHexDigits = function(e, t) {
|
|
2580
|
-
var i = e.pos;
|
|
2581
|
-
e.lastIntValue = 0;
|
|
2582
|
-
for (var s = 0; s < t; ++s) {
|
|
2583
|
-
var r = e.current();
|
|
2584
|
-
if (!nt(r))
|
|
2585
|
-
return e.pos = i, !1;
|
|
2586
|
-
e.lastIntValue = 16 * e.lastIntValue + ut(r), e.advance();
|
|
2587
|
-
}
|
|
2588
|
-
return !0;
|
|
2589
|
-
};
|
|
2590
|
-
var ke = function(t) {
|
|
2591
|
-
this.type = t.type, this.value = t.value, this.start = t.start, this.end = t.end, t.options.locations && (this.loc = new re(t, t.startLoc, t.endLoc)), t.options.ranges && (this.range = [t.start, t.end]);
|
|
2592
|
-
}, x = y.prototype;
|
|
2593
|
-
x.next = function(e) {
|
|
2594
|
-
!e && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new ke(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken();
|
|
2595
|
-
};
|
|
2596
|
-
x.getToken = function() {
|
|
2597
|
-
return this.next(), new ke(this);
|
|
2598
|
-
};
|
|
2599
|
-
typeof Symbol < "u" && (x[Symbol.iterator] = function() {
|
|
2600
|
-
var e = this;
|
|
2601
|
-
return {
|
|
2602
|
-
next: function() {
|
|
2603
|
-
var t = e.getToken();
|
|
2604
|
-
return {
|
|
2605
|
-
done: t.type === a.eof,
|
|
2606
|
-
value: t
|
|
2607
|
-
};
|
|
2608
|
-
}
|
|
2609
|
-
};
|
|
2610
|
-
});
|
|
2611
|
-
x.nextToken = function() {
|
|
2612
|
-
var e = this.curContext();
|
|
2613
|
-
if ((!e || !e.preserveSpace) && this.skipSpace(), this.start = this.pos, this.options.locations && (this.startLoc = this.curPosition()), this.pos >= this.input.length)
|
|
2614
|
-
return this.finishToken(a.eof);
|
|
2615
|
-
if (e.override)
|
|
2616
|
-
return e.override(this);
|
|
2617
|
-
this.readToken(this.fullCharCodeAtPos());
|
|
2618
|
-
};
|
|
2619
|
-
x.readToken = function(e) {
|
|
2620
|
-
return V(e, this.options.ecmaVersion >= 6) || e === 92 ? this.readWord() : this.getTokenFromCode(e);
|
|
2621
|
-
};
|
|
2622
|
-
x.fullCharCodeAtPos = function() {
|
|
2623
|
-
var e = this.input.charCodeAt(this.pos);
|
|
2624
|
-
if (e <= 55295 || e >= 56320)
|
|
2625
|
-
return e;
|
|
2626
|
-
var t = this.input.charCodeAt(this.pos + 1);
|
|
2627
|
-
return t <= 56319 || t >= 57344 ? e : (e << 10) + t - 56613888;
|
|
2628
|
-
};
|
|
2629
|
-
x.skipBlockComment = function() {
|
|
2630
|
-
var e = this.options.onComment && this.curPosition(), t = this.pos, i = this.input.indexOf("*/", this.pos += 2);
|
|
2631
|
-
if (i === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = i + 2, this.options.locations)
|
|
2632
|
-
for (var s = void 0, r = t; (s = Te(this.input, r, this.pos)) > -1; )
|
|
2633
|
-
++this.curLine, r = this.lineStart = s;
|
|
2634
|
-
this.options.onComment && this.options.onComment(
|
|
2635
|
-
!0,
|
|
2636
|
-
this.input.slice(t + 2, i),
|
|
2637
|
-
t,
|
|
2638
|
-
this.pos,
|
|
2639
|
-
e,
|
|
2640
|
-
this.curPosition()
|
|
2641
|
-
);
|
|
2642
|
-
};
|
|
2643
|
-
x.skipLineComment = function(e) {
|
|
2644
|
-
for (var t = this.pos, i = this.options.onComment && this.curPosition(), s = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !H(s); )
|
|
2645
|
-
s = this.input.charCodeAt(++this.pos);
|
|
2646
|
-
this.options.onComment && this.options.onComment(
|
|
2647
|
-
!1,
|
|
2648
|
-
this.input.slice(t + e, this.pos),
|
|
2649
|
-
t,
|
|
2650
|
-
this.pos,
|
|
2651
|
-
i,
|
|
2652
|
-
this.curPosition()
|
|
2653
|
-
);
|
|
2654
|
-
};
|
|
2655
|
-
x.skipSpace = function() {
|
|
2656
|
-
e:
|
|
2657
|
-
for (; this.pos < this.input.length; ) {
|
|
2658
|
-
var e = this.input.charCodeAt(this.pos);
|
|
2659
|
-
switch (e) {
|
|
2660
|
-
case 32:
|
|
2661
|
-
case 160:
|
|
2662
|
-
++this.pos;
|
|
2663
|
-
break;
|
|
2664
|
-
case 13:
|
|
2665
|
-
this.input.charCodeAt(this.pos + 1) === 10 && ++this.pos;
|
|
2666
|
-
case 10:
|
|
2667
|
-
case 8232:
|
|
2668
|
-
case 8233:
|
|
2669
|
-
++this.pos, this.options.locations && (++this.curLine, this.lineStart = this.pos);
|
|
2670
|
-
break;
|
|
2671
|
-
case 47:
|
|
2672
|
-
switch (this.input.charCodeAt(this.pos + 1)) {
|
|
2673
|
-
case 42:
|
|
2674
|
-
this.skipBlockComment();
|
|
2675
|
-
break;
|
|
2676
|
-
case 47:
|
|
2677
|
-
this.skipLineComment(2);
|
|
2678
|
-
break;
|
|
2679
|
-
default:
|
|
2680
|
-
break e;
|
|
2681
|
-
}
|
|
2682
|
-
break;
|
|
2683
|
-
default:
|
|
2684
|
-
if (e > 8 && e < 14 || e >= 5760 && Le.test(String.fromCharCode(e)))
|
|
2685
|
-
++this.pos;
|
|
2686
|
-
else
|
|
2687
|
-
break e;
|
|
2688
|
-
}
|
|
2689
|
-
}
|
|
2690
|
-
};
|
|
2691
|
-
x.finishToken = function(e, t) {
|
|
2692
|
-
this.end = this.pos, this.options.locations && (this.endLoc = this.curPosition());
|
|
2693
|
-
var i = this.type;
|
|
2694
|
-
this.type = e, this.value = t, this.updateContext(i);
|
|
2695
|
-
};
|
|
2696
|
-
x.readToken_dot = function() {
|
|
2697
|
-
var e = this.input.charCodeAt(this.pos + 1);
|
|
2698
|
-
if (e >= 48 && e <= 57)
|
|
2699
|
-
return this.readNumber(!0);
|
|
2700
|
-
var t = this.input.charCodeAt(this.pos + 2);
|
|
2701
|
-
return this.options.ecmaVersion >= 6 && e === 46 && t === 46 ? (this.pos += 3, this.finishToken(a.ellipsis)) : (++this.pos, this.finishToken(a.dot));
|
|
2702
|
-
};
|
|
2703
|
-
x.readToken_slash = function() {
|
|
2704
|
-
var e = this.input.charCodeAt(this.pos + 1);
|
|
2705
|
-
return this.exprAllowed ? (++this.pos, this.readRegexp()) : e === 61 ? this.finishOp(a.assign, 2) : this.finishOp(a.slash, 1);
|
|
2706
|
-
};
|
|
2707
|
-
x.readToken_mult_modulo_exp = function(e) {
|
|
2708
|
-
var t = this.input.charCodeAt(this.pos + 1), i = 1, s = e === 42 ? a.star : a.modulo;
|
|
2709
|
-
return this.options.ecmaVersion >= 7 && e === 42 && t === 42 && (++i, s = a.starstar, t = this.input.charCodeAt(this.pos + 2)), t === 61 ? this.finishOp(a.assign, i + 1) : this.finishOp(s, i);
|
|
2710
|
-
};
|
|
2711
|
-
x.readToken_pipe_amp = function(e) {
|
|
2712
|
-
var t = this.input.charCodeAt(this.pos + 1);
|
|
2713
|
-
if (t === e) {
|
|
2714
|
-
if (this.options.ecmaVersion >= 12) {
|
|
2715
|
-
var i = this.input.charCodeAt(this.pos + 2);
|
|
2716
|
-
if (i === 61)
|
|
2717
|
-
return this.finishOp(a.assign, 3);
|
|
2718
|
-
}
|
|
2719
|
-
return this.finishOp(e === 124 ? a.logicalOR : a.logicalAND, 2);
|
|
2720
|
-
}
|
|
2721
|
-
return t === 61 ? this.finishOp(a.assign, 2) : this.finishOp(e === 124 ? a.bitwiseOR : a.bitwiseAND, 1);
|
|
2722
|
-
};
|
|
2723
|
-
x.readToken_caret = function() {
|
|
2724
|
-
var e = this.input.charCodeAt(this.pos + 1);
|
|
2725
|
-
return e === 61 ? this.finishOp(a.assign, 2) : this.finishOp(a.bitwiseXOR, 1);
|
|
2726
|
-
};
|
|
2727
|
-
x.readToken_plus_min = function(e) {
|
|
2728
|
-
var t = this.input.charCodeAt(this.pos + 1);
|
|
2729
|
-
return t === e ? t === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || w.test(this.input.slice(this.lastTokEnd, this.pos))) ? (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : this.finishOp(a.incDec, 2) : t === 61 ? this.finishOp(a.assign, 2) : this.finishOp(a.plusMin, 1);
|
|
2730
|
-
};
|
|
2731
|
-
x.readToken_lt_gt = function(e) {
|
|
2732
|
-
var t = this.input.charCodeAt(this.pos + 1), i = 1;
|
|
2733
|
-
return t === e ? (i = e === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2, this.input.charCodeAt(this.pos + i) === 61 ? this.finishOp(a.assign, i + 1) : this.finishOp(a.bitShift, i)) : t === 33 && e === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45 ? (this.skipLineComment(4), this.skipSpace(), this.nextToken()) : (t === 61 && (i = 2), this.finishOp(a.relational, i));
|
|
2734
|
-
};
|
|
2735
|
-
x.readToken_eq_excl = function(e) {
|
|
2736
|
-
var t = this.input.charCodeAt(this.pos + 1);
|
|
2737
|
-
return t === 61 ? this.finishOp(a.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) : e === 61 && t === 62 && this.options.ecmaVersion >= 6 ? (this.pos += 2, this.finishToken(a.arrow)) : this.finishOp(e === 61 ? a.eq : a.prefix, 1);
|
|
2738
|
-
};
|
|
2739
|
-
x.readToken_question = function() {
|
|
2740
|
-
var e = this.options.ecmaVersion;
|
|
2741
|
-
if (e >= 11) {
|
|
2742
|
-
var t = this.input.charCodeAt(this.pos + 1);
|
|
2743
|
-
if (t === 46) {
|
|
2744
|
-
var i = this.input.charCodeAt(this.pos + 2);
|
|
2745
|
-
if (i < 48 || i > 57)
|
|
2746
|
-
return this.finishOp(a.questionDot, 2);
|
|
2747
|
-
}
|
|
2748
|
-
if (t === 63) {
|
|
2749
|
-
if (e >= 12) {
|
|
2750
|
-
var s = this.input.charCodeAt(this.pos + 2);
|
|
2751
|
-
if (s === 61)
|
|
2752
|
-
return this.finishOp(a.assign, 3);
|
|
2753
|
-
}
|
|
2754
|
-
return this.finishOp(a.coalesce, 2);
|
|
2755
|
-
}
|
|
2756
|
-
}
|
|
2757
|
-
return this.finishOp(a.question, 1);
|
|
2758
|
-
};
|
|
2759
|
-
x.readToken_numberSign = function() {
|
|
2760
|
-
var e = this.options.ecmaVersion, t = 35;
|
|
2761
|
-
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(), V(t, !0) || t === 92))
|
|
2762
|
-
return this.finishToken(a.privateId, this.readWord1());
|
|
2763
|
-
this.raise(this.pos, "Unexpected character '" + R(t) + "'");
|
|
2764
|
-
};
|
|
2765
|
-
x.getTokenFromCode = function(e) {
|
|
2766
|
-
switch (e) {
|
|
2767
|
-
case 46:
|
|
2768
|
-
return this.readToken_dot();
|
|
2769
|
-
case 40:
|
|
2770
|
-
return ++this.pos, this.finishToken(a.parenL);
|
|
2771
|
-
case 41:
|
|
2772
|
-
return ++this.pos, this.finishToken(a.parenR);
|
|
2773
|
-
case 59:
|
|
2774
|
-
return ++this.pos, this.finishToken(a.semi);
|
|
2775
|
-
case 44:
|
|
2776
|
-
return ++this.pos, this.finishToken(a.comma);
|
|
2777
|
-
case 91:
|
|
2778
|
-
return ++this.pos, this.finishToken(a.bracketL);
|
|
2779
|
-
case 93:
|
|
2780
|
-
return ++this.pos, this.finishToken(a.bracketR);
|
|
2781
|
-
case 123:
|
|
2782
|
-
return ++this.pos, this.finishToken(a.braceL);
|
|
2783
|
-
case 125:
|
|
2784
|
-
return ++this.pos, this.finishToken(a.braceR);
|
|
2785
|
-
case 58:
|
|
2786
|
-
return ++this.pos, this.finishToken(a.colon);
|
|
2787
|
-
case 96:
|
|
2788
|
-
if (this.options.ecmaVersion < 6)
|
|
2789
|
-
break;
|
|
2790
|
-
return ++this.pos, this.finishToken(a.backQuote);
|
|
2791
|
-
case 48:
|
|
2792
|
-
var t = this.input.charCodeAt(this.pos + 1);
|
|
2793
|
-
if (t === 120 || t === 88)
|
|
2794
|
-
return this.readRadixNumber(16);
|
|
2795
|
-
if (this.options.ecmaVersion >= 6) {
|
|
2796
|
-
if (t === 111 || t === 79)
|
|
2797
|
-
return this.readRadixNumber(8);
|
|
2798
|
-
if (t === 98 || t === 66)
|
|
2799
|
-
return this.readRadixNumber(2);
|
|
2800
|
-
}
|
|
2801
|
-
case 49:
|
|
2802
|
-
case 50:
|
|
2803
|
-
case 51:
|
|
2804
|
-
case 52:
|
|
2805
|
-
case 53:
|
|
2806
|
-
case 54:
|
|
2807
|
-
case 55:
|
|
2808
|
-
case 56:
|
|
2809
|
-
case 57:
|
|
2810
|
-
return this.readNumber(!1);
|
|
2811
|
-
case 34:
|
|
2812
|
-
case 39:
|
|
2813
|
-
return this.readString(e);
|
|
2814
|
-
case 47:
|
|
2815
|
-
return this.readToken_slash();
|
|
2816
|
-
case 37:
|
|
2817
|
-
case 42:
|
|
2818
|
-
return this.readToken_mult_modulo_exp(e);
|
|
2819
|
-
case 124:
|
|
2820
|
-
case 38:
|
|
2821
|
-
return this.readToken_pipe_amp(e);
|
|
2822
|
-
case 94:
|
|
2823
|
-
return this.readToken_caret();
|
|
2824
|
-
case 43:
|
|
2825
|
-
case 45:
|
|
2826
|
-
return this.readToken_plus_min(e);
|
|
2827
|
-
case 60:
|
|
2828
|
-
case 62:
|
|
2829
|
-
return this.readToken_lt_gt(e);
|
|
2830
|
-
case 61:
|
|
2831
|
-
case 33:
|
|
2832
|
-
return this.readToken_eq_excl(e);
|
|
2833
|
-
case 63:
|
|
2834
|
-
return this.readToken_question();
|
|
2835
|
-
case 126:
|
|
2836
|
-
return this.finishOp(a.prefix, 1);
|
|
2837
|
-
case 35:
|
|
2838
|
-
return this.readToken_numberSign();
|
|
2839
|
-
}
|
|
2840
|
-
this.raise(this.pos, "Unexpected character '" + R(e) + "'");
|
|
2841
|
-
};
|
|
2842
|
-
x.finishOp = function(e, t) {
|
|
2843
|
-
var i = this.input.slice(this.pos, this.pos + t);
|
|
2844
|
-
return this.pos += t, this.finishToken(e, i);
|
|
2845
|
-
};
|
|
2846
|
-
x.readRegexp = function() {
|
|
2847
|
-
for (var e, t, i = this.pos; ; ) {
|
|
2848
|
-
this.pos >= this.input.length && this.raise(i, "Unterminated regular expression");
|
|
2849
|
-
var s = this.input.charAt(this.pos);
|
|
2850
|
-
if (w.test(s) && this.raise(i, "Unterminated regular expression"), e)
|
|
2851
|
-
e = !1;
|
|
2852
|
-
else {
|
|
2853
|
-
if (s === "[")
|
|
2854
|
-
t = !0;
|
|
2855
|
-
else if (s === "]" && t)
|
|
2856
|
-
t = !1;
|
|
2857
|
-
else if (s === "/" && !t)
|
|
2858
|
-
break;
|
|
2859
|
-
e = s === "\\";
|
|
2860
|
-
}
|
|
2861
|
-
++this.pos;
|
|
2862
|
-
}
|
|
2863
|
-
var r = this.input.slice(i, this.pos);
|
|
2864
|
-
++this.pos;
|
|
2865
|
-
var n = this.pos, u = this.readWord1();
|
|
2866
|
-
this.containsEsc && this.unexpected(n);
|
|
2867
|
-
var o = this.regexpState || (this.regexpState = new L(this));
|
|
2868
|
-
o.reset(i, r, u), this.validateRegExpFlags(o), this.validateRegExpPattern(o);
|
|
2869
|
-
var h = null;
|
|
2870
|
-
try {
|
|
2871
|
-
h = new RegExp(r, u);
|
|
2872
|
-
} catch {
|
|
2873
|
-
}
|
|
2874
|
-
return this.finishToken(a.regexp, { pattern: r, flags: u, value: h });
|
|
2875
|
-
};
|
|
2876
|
-
x.readInt = function(e, t, i) {
|
|
2877
|
-
for (var s = this.options.ecmaVersion >= 12 && t === void 0, r = i && this.input.charCodeAt(this.pos) === 48, n = this.pos, u = 0, o = 0, h = 0, l = t ?? 1 / 0; h < l; ++h, ++this.pos) {
|
|
2878
|
-
var d = this.input.charCodeAt(this.pos), g = void 0;
|
|
2879
|
-
if (s && d === 95) {
|
|
2880
|
-
r && this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"), o === 95 && this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"), h === 0 && this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"), o = d;
|
|
2881
|
-
continue;
|
|
2882
|
-
}
|
|
2883
|
-
if (d >= 97 ? g = d - 97 + 10 : d >= 65 ? g = d - 65 + 10 : d >= 48 && d <= 57 ? g = d - 48 : g = 1 / 0, g >= e)
|
|
2884
|
-
break;
|
|
2885
|
-
o = d, u = u * e + g;
|
|
2886
|
-
}
|
|
2887
|
-
return s && o === 95 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos === n || t != null && this.pos - n !== t ? null : u;
|
|
2888
|
-
};
|
|
2889
|
-
function Qt(e, t) {
|
|
2890
|
-
return t ? parseInt(e, 8) : parseFloat(e.replace(/_/g, ""));
|
|
2891
|
-
}
|
|
2892
|
-
function ht(e) {
|
|
2893
|
-
return typeof BigInt != "function" ? null : BigInt(e.replace(/_/g, ""));
|
|
2894
|
-
}
|
|
2895
|
-
x.readRadixNumber = function(e) {
|
|
2896
|
-
var t = this.pos;
|
|
2897
|
-
this.pos += 2;
|
|
2898
|
-
var i = this.readInt(e);
|
|
2899
|
-
return i == null && this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (i = ht(this.input.slice(t, this.pos)), ++this.pos) : V(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(a.num, i);
|
|
2900
|
-
};
|
|
2901
|
-
x.readNumber = function(e) {
|
|
2902
|
-
var t = this.pos;
|
|
2903
|
-
!e && this.readInt(10, void 0, !0) === null && this.raise(t, "Invalid number");
|
|
2904
|
-
var i = this.pos - t >= 2 && this.input.charCodeAt(t) === 48;
|
|
2905
|
-
i && this.strict && this.raise(t, "Invalid number");
|
|
2906
|
-
var s = this.input.charCodeAt(this.pos);
|
|
2907
|
-
if (!i && !e && this.options.ecmaVersion >= 11 && s === 110) {
|
|
2908
|
-
var r = ht(this.input.slice(t, this.pos));
|
|
2909
|
-
return ++this.pos, V(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(a.num, r);
|
|
2910
|
-
}
|
|
2911
|
-
i && /[89]/.test(this.input.slice(t, this.pos)) && (i = !1), s === 46 && !i && (++this.pos, this.readInt(10), s = this.input.charCodeAt(this.pos)), (s === 69 || s === 101) && !i && (s = this.input.charCodeAt(++this.pos), (s === 43 || s === 45) && ++this.pos, this.readInt(10) === null && this.raise(t, "Invalid number")), V(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number");
|
|
2912
|
-
var n = Qt(this.input.slice(t, this.pos), i);
|
|
2913
|
-
return this.finishToken(a.num, n);
|
|
2914
|
-
};
|
|
2915
|
-
x.readCodePoint = function() {
|
|
2916
|
-
var e = this.input.charCodeAt(this.pos), t;
|
|
2917
|
-
if (e === 123) {
|
|
2918
|
-
this.options.ecmaVersion < 6 && this.unexpected();
|
|
2919
|
-
var i = ++this.pos;
|
|
2920
|
-
t = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos), ++this.pos, t > 1114111 && this.invalidStringToken(i, "Code point out of bounds");
|
|
2921
|
-
} else
|
|
2922
|
-
t = this.readHexChar(4);
|
|
2923
|
-
return t;
|
|
2924
|
-
};
|
|
2925
|
-
x.readString = function(e) {
|
|
2926
|
-
for (var t = "", i = ++this.pos; ; ) {
|
|
2927
|
-
this.pos >= this.input.length && this.raise(this.start, "Unterminated string constant");
|
|
2928
|
-
var s = this.input.charCodeAt(this.pos);
|
|
2929
|
-
if (s === e)
|
|
2930
|
-
break;
|
|
2931
|
-
s === 92 ? (t += this.input.slice(i, this.pos), t += this.readEscapedChar(!1), i = this.pos) : s === 8232 || s === 8233 ? (this.options.ecmaVersion < 10 && this.raise(this.start, "Unterminated string constant"), ++this.pos, this.options.locations && (this.curLine++, this.lineStart = this.pos)) : (H(s) && this.raise(this.start, "Unterminated string constant"), ++this.pos);
|
|
2932
|
-
}
|
|
2933
|
-
return t += this.input.slice(i, this.pos++), this.finishToken(a.string, t);
|
|
2934
|
-
};
|
|
2935
|
-
var ct = {};
|
|
2936
|
-
x.tryReadTemplateToken = function() {
|
|
2937
|
-
this.inTemplateElement = !0;
|
|
2938
|
-
try {
|
|
2939
|
-
this.readTmplToken();
|
|
2940
|
-
} catch (e) {
|
|
2941
|
-
if (e === ct)
|
|
2942
|
-
this.readInvalidTemplateToken();
|
|
2943
|
-
else
|
|
2944
|
-
throw e;
|
|
2945
|
-
}
|
|
2946
|
-
this.inTemplateElement = !1;
|
|
2947
|
-
};
|
|
2948
|
-
x.invalidStringToken = function(e, t) {
|
|
2949
|
-
if (this.inTemplateElement && this.options.ecmaVersion >= 9)
|
|
2950
|
-
throw ct;
|
|
2951
|
-
this.raise(e, t);
|
|
2952
|
-
};
|
|
2953
|
-
x.readTmplToken = function() {
|
|
2954
|
-
for (var e = "", t = this.pos; ; ) {
|
|
2955
|
-
this.pos >= this.input.length && this.raise(this.start, "Unterminated template");
|
|
2956
|
-
var i = this.input.charCodeAt(this.pos);
|
|
2957
|
-
if (i === 96 || i === 36 && this.input.charCodeAt(this.pos + 1) === 123)
|
|
2958
|
-
return this.pos === this.start && (this.type === a.template || this.type === a.invalidTemplate) ? i === 36 ? (this.pos += 2, this.finishToken(a.dollarBraceL)) : (++this.pos, this.finishToken(a.backQuote)) : (e += this.input.slice(t, this.pos), this.finishToken(a.template, e));
|
|
2959
|
-
if (i === 92)
|
|
2960
|
-
e += this.input.slice(t, this.pos), e += this.readEscapedChar(!0), t = this.pos;
|
|
2961
|
-
else if (H(i)) {
|
|
2962
|
-
switch (e += this.input.slice(t, this.pos), ++this.pos, i) {
|
|
2963
|
-
case 13:
|
|
2964
|
-
this.input.charCodeAt(this.pos) === 10 && ++this.pos;
|
|
2965
|
-
case 10:
|
|
2966
|
-
e += `
|
|
2967
|
-
`;
|
|
2968
|
-
break;
|
|
2969
|
-
default:
|
|
2970
|
-
e += String.fromCharCode(i);
|
|
2971
|
-
break;
|
|
2972
|
-
}
|
|
2973
|
-
this.options.locations && (++this.curLine, this.lineStart = this.pos), t = this.pos;
|
|
2974
|
-
} else
|
|
2975
|
-
++this.pos;
|
|
2976
|
-
}
|
|
2977
|
-
};
|
|
2978
|
-
x.readInvalidTemplateToken = function() {
|
|
2979
|
-
for (; this.pos < this.input.length; this.pos++)
|
|
2980
|
-
switch (this.input[this.pos]) {
|
|
2981
|
-
case "\\":
|
|
2982
|
-
++this.pos;
|
|
2983
|
-
break;
|
|
2984
|
-
case "$":
|
|
2985
|
-
if (this.input[this.pos + 1] !== "{")
|
|
2986
|
-
break;
|
|
2987
|
-
case "`":
|
|
2988
|
-
return this.finishToken(a.invalidTemplate, this.input.slice(this.start, this.pos));
|
|
2989
|
-
case "\r":
|
|
2990
|
-
this.input[this.pos + 1] === `
|
|
2991
|
-
` && ++this.pos;
|
|
2992
|
-
case `
|
|
2993
|
-
`:
|
|
2994
|
-
case "\u2028":
|
|
2995
|
-
case "\u2029":
|
|
2996
|
-
++this.curLine, this.lineStart = this.pos + 1;
|
|
2997
|
-
break;
|
|
2998
|
-
}
|
|
2999
|
-
this.raise(this.start, "Unterminated template");
|
|
3000
|
-
};
|
|
3001
|
-
x.readEscapedChar = function(e) {
|
|
3002
|
-
var t = this.input.charCodeAt(++this.pos);
|
|
3003
|
-
switch (++this.pos, t) {
|
|
3004
|
-
case 110:
|
|
3005
|
-
return `
|
|
3006
|
-
`;
|
|
3007
|
-
case 114:
|
|
3008
|
-
return "\r";
|
|
3009
|
-
case 120:
|
|
3010
|
-
return String.fromCharCode(this.readHexChar(2));
|
|
3011
|
-
case 117:
|
|
3012
|
-
return R(this.readCodePoint());
|
|
3013
|
-
case 116:
|
|
3014
|
-
return " ";
|
|
3015
|
-
case 98:
|
|
3016
|
-
return "\b";
|
|
3017
|
-
case 118:
|
|
3018
|
-
return "\v";
|
|
3019
|
-
case 102:
|
|
3020
|
-
return "\f";
|
|
3021
|
-
case 13:
|
|
3022
|
-
this.input.charCodeAt(this.pos) === 10 && ++this.pos;
|
|
3023
|
-
case 10:
|
|
3024
|
-
return this.options.locations && (this.lineStart = this.pos, ++this.curLine), "";
|
|
3025
|
-
case 56:
|
|
3026
|
-
case 57:
|
|
3027
|
-
if (this.strict && this.invalidStringToken(
|
|
3028
|
-
this.pos - 1,
|
|
3029
|
-
"Invalid escape sequence"
|
|
3030
|
-
), e) {
|
|
3031
|
-
var i = this.pos - 1;
|
|
3032
|
-
this.invalidStringToken(
|
|
3033
|
-
i,
|
|
3034
|
-
"Invalid escape sequence in template string"
|
|
3035
|
-
);
|
|
3036
|
-
}
|
|
3037
|
-
default:
|
|
3038
|
-
if (t >= 48 && t <= 55) {
|
|
3039
|
-
var s = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0], r = parseInt(s, 8);
|
|
3040
|
-
return r > 255 && (s = s.slice(0, -1), r = parseInt(s, 8)), this.pos += s.length - 1, t = this.input.charCodeAt(this.pos), (s !== "0" || t === 56 || t === 57) && (this.strict || e) && this.invalidStringToken(
|
|
3041
|
-
this.pos - 1 - s.length,
|
|
3042
|
-
e ? "Octal literal in template string" : "Octal literal in strict mode"
|
|
3043
|
-
), String.fromCharCode(r);
|
|
3044
|
-
}
|
|
3045
|
-
return H(t) ? (this.options.locations && (this.lineStart = this.pos, ++this.curLine), "") : String.fromCharCode(t);
|
|
3046
|
-
}
|
|
3047
|
-
};
|
|
3048
|
-
x.readHexChar = function(e) {
|
|
3049
|
-
var t = this.pos, i = this.readInt(16, e);
|
|
3050
|
-
return i === null && this.invalidStringToken(t, "Bad character escape sequence"), i;
|
|
3051
|
-
};
|
|
3052
|
-
x.readWord1 = function() {
|
|
3053
|
-
this.containsEsc = !1;
|
|
3054
|
-
for (var e = "", t = !0, i = this.pos, s = this.options.ecmaVersion >= 6; this.pos < this.input.length; ) {
|
|
3055
|
-
var r = this.fullCharCodeAtPos();
|
|
3056
|
-
if (F(r, s))
|
|
3057
|
-
this.pos += r <= 65535 ? 1 : 2;
|
|
3058
|
-
else if (r === 92) {
|
|
3059
|
-
this.containsEsc = !0, e += this.input.slice(i, this.pos);
|
|
3060
|
-
var n = this.pos;
|
|
3061
|
-
this.input.charCodeAt(++this.pos) !== 117 && this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"), ++this.pos;
|
|
3062
|
-
var u = this.readCodePoint();
|
|
3063
|
-
(t ? V : F)(u, s) || this.invalidStringToken(n, "Invalid Unicode escape"), e += R(u), i = this.pos;
|
|
3064
|
-
} else
|
|
3065
|
-
break;
|
|
3066
|
-
t = !1;
|
|
3067
|
-
}
|
|
3068
|
-
return e + this.input.slice(i, this.pos);
|
|
3069
|
-
};
|
|
3070
|
-
x.readWord = function() {
|
|
3071
|
-
var e = this.readWord1(), t = a.name;
|
|
3072
|
-
return this.keywords.test(e) && (t = ge[e]), this.finishToken(t, e);
|
|
3073
|
-
};
|
|
3074
|
-
var Yt = "8.15.0";
|
|
3075
|
-
y.acorn = {
|
|
3076
|
-
Parser: y,
|
|
3077
|
-
version: Yt,
|
|
3078
|
-
defaultOptions: xe,
|
|
3079
|
-
Position: X,
|
|
3080
|
-
SourceLocation: re,
|
|
3081
|
-
getLineInfo: Oe,
|
|
3082
|
-
Node: he,
|
|
3083
|
-
TokenType: v,
|
|
3084
|
-
tokTypes: a,
|
|
3085
|
-
keywordTypes: ge,
|
|
3086
|
-
TokContext: N,
|
|
3087
|
-
tokContexts: b,
|
|
3088
|
-
isIdentifierChar: F,
|
|
3089
|
-
isIdentifierStart: V,
|
|
3090
|
-
Token: ke,
|
|
3091
|
-
isNewLine: H,
|
|
3092
|
-
lineBreak: w,
|
|
3093
|
-
lineBreakG: vt,
|
|
3094
|
-
nonASCIIwhitespace: Le
|
|
3095
|
-
};
|
|
3096
|
-
function Xt(e, t) {
|
|
3097
|
-
return y.parse(e, t);
|
|
3098
|
-
}
|
|
3099
|
-
function Zt(e, t, i) {
|
|
3100
|
-
return y.parseExpressionAt(e, t, i);
|
|
3101
|
-
}
|
|
3102
|
-
function Jt(e, t) {
|
|
3103
|
-
return y.tokenizer(e, t);
|
|
3104
|
-
}
|
|
3105
|
-
export {
|
|
3106
|
-
he as Node,
|
|
3107
|
-
y as Parser,
|
|
3108
|
-
X as Position,
|
|
3109
|
-
re as SourceLocation,
|
|
3110
|
-
N as TokContext,
|
|
3111
|
-
ke as Token,
|
|
3112
|
-
v as TokenType,
|
|
3113
|
-
xe as defaultOptions,
|
|
3114
|
-
Oe as getLineInfo,
|
|
3115
|
-
F as isIdentifierChar,
|
|
3116
|
-
V as isIdentifierStart,
|
|
3117
|
-
H as isNewLine,
|
|
3118
|
-
ge as keywordTypes,
|
|
3119
|
-
w as lineBreak,
|
|
3120
|
-
vt as lineBreakG,
|
|
3121
|
-
Le as nonASCIIwhitespace,
|
|
3122
|
-
Xt as parse,
|
|
3123
|
-
Zt as parseExpressionAt,
|
|
3124
|
-
b as tokContexts,
|
|
3125
|
-
a as tokTypes,
|
|
3126
|
-
Jt as tokenizer,
|
|
3127
|
-
Yt as version
|
|
3128
|
-
};
|