From cd87d965f35155748ec0e3b22deae3d8a5ebdb5b Mon Sep 17 00:00:00 2001 From: Alexander Akait <4567934+alexander-akait@users.noreply.github.com> Date: Sun, 6 Feb 2022 07:24:51 +0300 Subject: [PATCH] refactor(css/ast): Refactor types related to selectors (#3460) --- crates/swc_css_ast/src/selector.rs | 147 +- crates/swc_css_codegen/src/lib.rs | 102 +- crates/swc_css_parser/src/parser/at_rule.rs | 2 +- .../swc_css_parser/src/parser/selector/mod.rs | 884 +++-- .../swc_css_parser/src/parser/style_rule.rs | 2 +- crates/swc_css_parser/src/parser/util.rs | 10 +- crates/swc_css_parser/tests/fixture.rs | 30 +- .../tests/fixture/at-rule/layer/output.json | 124 +- .../fixture/at-rule/layer/span.rust-debug | 80 +- .../fixture/at-rule/supports/output.json | 54 +- .../fixture/at-rule/supports/span.rust-debug | 36 + .../tests/fixture/bom/output.json | 18 +- .../tests/fixture/bom/span.rust-debug | 12 + .../tests/fixture/comment/output.json | 54 +- .../tests/fixture/comment/span.rust-debug | 36 + .../tests/fixture/dashed-ident/output.json | 18 +- .../fixture/dashed-ident/span.rust-debug | 12 + .../fixture/declaration-list/output.json | 18 +- .../fixture/declaration-list/span.rust-debug | 12 + .../tests/fixture/declaration/output.json | 18 +- .../tests/fixture/declaration/span.rust-debug | 12 + .../tests/fixture/delim/backslash/output.json | 18 +- .../fixture/delim/backslash/span.rust-debug | 12 + .../tests/fixture/dimension/basic/output.json | 18 +- .../fixture/dimension/basic/span.rust-debug | 12 + .../misc/-4j83DwgJa0nPQIjlb0RIA/output.json | 18 +- .../-4j83DwgJa0nPQIjlb0RIA/span.rust-debug | 12 + .../misc/-8o_H6sq86TDAHqF7YO0hg/output.json | 18 +- .../-8o_H6sq86TDAHqF7YO0hg/span.rust-debug | 12 + .../misc/-GZJfOA9TK6La2KGGNgCkg/output.json | 18 +- .../-GZJfOA9TK6La2KGGNgCkg/span.rust-debug | 12 + .../misc/-JoxoRcnA-zaaEC7RjXKvQ/output.json | 18 +- .../-JoxoRcnA-zaaEC7RjXKvQ/span.rust-debug | 12 + .../misc/-edvtxlXMemv5jnGeyueBA/output.json | 18 +- .../-edvtxlXMemv5jnGeyueBA/span.rust-debug | 12 + .../misc/-gboAEi1zyjFW5mtEM24Rg/output.json | 18 +- .../-gboAEi1zyjFW5mtEM24Rg/span.rust-debug | 12 + .../misc/-shTP60AAG6a4mCJUpV1cQ/output.json | 44 +- .../-shTP60AAG6a4mCJUpV1cQ/span.rust-debug | 14 +- .../misc/07tvJxvZrgDeTmptOclErA/output.json | 18 +- .../07tvJxvZrgDeTmptOclErA/span.rust-debug | 12 + .../misc/0LKvnY2GhG7ss8EXa0t6tQ/output.json | 18 +- .../0LKvnY2GhG7ss8EXa0t6tQ/span.rust-debug | 12 + .../misc/0Zlgi2sdsFfTrdnWOHUqeg/output.json | 26 +- .../0Zlgi2sdsFfTrdnWOHUqeg/span.rust-debug | 20 +- .../misc/0yo6flt6jo-UA8rUEFjrWA/output.json | 18 +- .../0yo6flt6jo-UA8rUEFjrWA/span.rust-debug | 12 + .../misc/10VLLYwNo7xaTisP9r9Kfg/output.json | 18 +- .../10VLLYwNo7xaTisP9r9Kfg/span.rust-debug | 12 + .../misc/12EwJCu6DsfOEJubQW9jLg/output.json | 18 +- .../12EwJCu6DsfOEJubQW9jLg/span.rust-debug | 12 + .../misc/1naykwaIKZc6zuHRNIccLQ/output.json | 18 +- .../1naykwaIKZc6zuHRNIccLQ/span.rust-debug | 12 + .../misc/2nNBhRWO2cNcBJf09zDxjw/output.json | 18 +- .../2nNBhRWO2cNcBJf09zDxjw/span.rust-debug | 12 + .../misc/36qnNuIUvbIrMnJKDxwE5A/output.json | 18 +- .../36qnNuIUvbIrMnJKDxwE5A/span.rust-debug | 12 + .../misc/39pbt1sIeFh8WWhCalZS4g/output.json | 18 +- .../39pbt1sIeFh8WWhCalZS4g/span.rust-debug | 12 + .../misc/3EgMpLwjJNG0ht4U_r6cnw/output.json | 18 +- .../3EgMpLwjJNG0ht4U_r6cnw/span.rust-debug | 12 + .../misc/3JGye8AhworwNFoUL1gKbg/output.json | 18 +- .../3JGye8AhworwNFoUL1gKbg/span.rust-debug | 12 + .../misc/3OV2jH0hrt2_2jOv6t4wvA/output.json | 18 +- .../3OV2jH0hrt2_2jOv6t4wvA/span.rust-debug | 12 + .../misc/485Ns9qQHa89OJU5Lhjx-Q/output.json | 18 +- .../485Ns9qQHa89OJU5Lhjx-Q/span.rust-debug | 12 + .../misc/486QvEO8dmLFsXYp6xgKVw/output.json | 18 +- .../486QvEO8dmLFsXYp6xgKVw/span.rust-debug | 12 + .../misc/4Tjjgepnha63E4UiXXDNEA/output.json | 18 +- .../4Tjjgepnha63E4UiXXDNEA/span.rust-debug | 12 + .../misc/4UaOTazLwrr9gd5xkBBlnw/output.json | 18 +- .../4UaOTazLwrr9gd5xkBBlnw/span.rust-debug | 12 + .../misc/4WSp4-HbKB-f1GLF00sf6A/output.json | 18 +- .../4WSp4-HbKB-f1GLF00sf6A/span.rust-debug | 12 + .../misc/52obp49U0CyYOskQAEoIJw/output.json | 18 +- .../52obp49U0CyYOskQAEoIJw/span.rust-debug | 12 + .../misc/53OltIbJ-YBXtSKedVvYwA/output.json | 18 +- .../53OltIbJ-YBXtSKedVvYwA/span.rust-debug | 12 + .../misc/54mhLGCwQMwsuiVkiTzAAQ/output.json | 26 +- .../54mhLGCwQMwsuiVkiTzAAQ/span.rust-debug | 20 +- .../misc/5al65IRQbw_x4yG3ke74fQ/output.json | 18 +- .../5al65IRQbw_x4yG3ke74fQ/span.rust-debug | 12 + .../misc/5cnGKjYPm1XBeqTmw3oCag/output.json | 18 +- .../5cnGKjYPm1XBeqTmw3oCag/span.rust-debug | 12 + .../misc/5nNFwUYmVb5_MMMzIvIeQg/output.json | 36 +- .../5nNFwUYmVb5_MMMzIvIeQg/span.rust-debug | 24 + .../misc/5yer6GUWydidDHrfgacUkA/output.json | 18 +- .../5yer6GUWydidDHrfgacUkA/span.rust-debug | 12 + .../misc/62BQJI-uDjHXNJ7kyL8HiA/output.json | 26 +- .../62BQJI-uDjHXNJ7kyL8HiA/span.rust-debug | 20 +- .../misc/6IWHWiWjsuGkPiPAp2KmoA/output.json | 26 +- .../6IWHWiWjsuGkPiPAp2KmoA/span.rust-debug | 20 +- .../misc/6WYwXsqP1SJOa-6oDBobzQ/output.json | 18 +- .../6WYwXsqP1SJOa-6oDBobzQ/span.rust-debug | 12 + .../misc/6aNPFn_YOBL4koYvV-g8pQ/output.json | 18 +- .../6aNPFn_YOBL4koYvV-g8pQ/span.rust-debug | 12 + .../misc/6fufNZ3PA6_-pNwY-IP61Q/output.json | 36 +- .../6fufNZ3PA6_-pNwY-IP61Q/span.rust-debug | 24 + .../misc/6kUhG0W7hwZxIuaCsZ7pHg/output.json | 18 +- .../6kUhG0W7hwZxIuaCsZ7pHg/span.rust-debug | 12 + .../misc/7CK6ZYt4CWz7Ge5KWLKBYg/output.json | 18 +- .../7CK6ZYt4CWz7Ge5KWLKBYg/span.rust-debug | 12 + .../misc/7Wto7epgdmJCos0XkrnMww/output.json | 36 +- .../7Wto7epgdmJCos0XkrnMww/span.rust-debug | 24 + .../misc/7YGXOizztR38f8fGB1DRaQ/output.json | 18 +- .../7YGXOizztR38f8fGB1DRaQ/span.rust-debug | 12 + .../misc/866Law8W0FQas7QMxFjUbw/output.json | 18 +- .../866Law8W0FQas7QMxFjUbw/span.rust-debug | 12 + .../misc/8Gs_Q4kYqijbgIQ6xIW8qw/output.json | 18 +- .../8Gs_Q4kYqijbgIQ6xIW8qw/span.rust-debug | 12 + .../misc/9IIa-42s3YQFw8ilk39GdQ/output.json | 18 +- .../9IIa-42s3YQFw8ilk39GdQ/span.rust-debug | 12 + .../misc/9aSeJQPn4WHMexejaMQQoQ/output.json | 44 +- .../9aSeJQPn4WHMexejaMQQoQ/span.rust-debug | 14 +- .../misc/A3jvzrmJH_MIf_Uilsy4sg/output.json | 18 +- .../A3jvzrmJH_MIf_Uilsy4sg/span.rust-debug | 12 + .../misc/ACQUsGVQAmGzhMqBRmS6Mw/output.json | 18 +- .../ACQUsGVQAmGzhMqBRmS6Mw/span.rust-debug | 12 + .../misc/AVaQlt9z0lhJC6bHHDPVeA/output.json | 18 +- .../AVaQlt9z0lhJC6bHHDPVeA/span.rust-debug | 12 + .../misc/Ae5_auBp274oaSQ0kls9sw/output.json | 26 +- .../Ae5_auBp274oaSQ0kls9sw/span.rust-debug | 20 +- .../misc/Afm91-TMNbzd52HsPrCCNA/output.json | 18 +- .../Afm91-TMNbzd52HsPrCCNA/span.rust-debug | 12 + .../misc/AigZ338AGwCqF4M9a3Quqw/output.json | 18 +- .../AigZ338AGwCqF4M9a3Quqw/span.rust-debug | 12 + .../misc/AocxkR5Gt30Hu6JV7J56Wg/output.json | 18 +- .../AocxkR5Gt30Hu6JV7J56Wg/span.rust-debug | 12 + .../misc/AwZM5l5vBlyrbgG-Fk0_EQ/output.json | 18 +- .../AwZM5l5vBlyrbgG-Fk0_EQ/span.rust-debug | 12 + .../misc/BKyQWW5j9vRP-kr41nqcjg/output.json | 18 +- .../BKyQWW5j9vRP-kr41nqcjg/span.rust-debug | 12 + .../misc/BltaGv1fY5VvJahyCRNxqQ/output.json | 36 +- .../BltaGv1fY5VvJahyCRNxqQ/span.rust-debug | 24 + .../misc/C419dJQ48QjmgKufnQhNVw/output.json | 36 +- .../C419dJQ48QjmgKufnQhNVw/span.rust-debug | 24 + .../misc/C4I0cdQcSbpaGOS-V8fwew/output.json | 18 +- .../C4I0cdQcSbpaGOS-V8fwew/span.rust-debug | 12 + .../misc/C6gS3Kl0KEwGsFaUUGXzFg/output.json | 18 +- .../C6gS3Kl0KEwGsFaUUGXzFg/span.rust-debug | 12 + .../misc/C9nXM9jBTT9WvCQHrwH24Q/output.json | 16 +- .../C9nXM9jBTT9WvCQHrwH24Q/span.rust-debug | 8 +- .../misc/CQiowK9DjojqKtlpQifemA/output.json | 18 +- .../CQiowK9DjojqKtlpQifemA/span.rust-debug | 12 + .../misc/CqrYlHva8qUNgSPb8EwWjg/output.json | 18 +- .../CqrYlHva8qUNgSPb8EwWjg/span.rust-debug | 12 + .../misc/Cz4vXE_NaBs6qNXE1kUyqQ/output.json | 18 +- .../Cz4vXE_NaBs6qNXE1kUyqQ/span.rust-debug | Bin 1818 -> 2065 bytes .../misc/D5Oyf1ABeS8lie5Lg-5pqg/output.json | 18 +- .../D5Oyf1ABeS8lie5Lg-5pqg/span.rust-debug | 12 + .../misc/Drl1Excz8WEwlfIfA2oRQg/output.json | 45 +- .../Drl1Excz8WEwlfIfA2oRQg/span.rust-debug | 32 +- .../misc/DrlXteRB-ppLVxi4_N4dhA/output.json | 18 +- .../DrlXteRB-ppLVxi4_N4dhA/span.rust-debug | 12 + .../misc/DstCRLR-k3tqe3B46li15Q/output.json | 35 +- .../DstCRLR-k3tqe3B46li15Q/span.rust-debug | 10 +- .../misc/EB1IJLfMRoP0XwlJOGLTPA/output.json | 18 +- .../EB1IJLfMRoP0XwlJOGLTPA/span.rust-debug | 12 + .../misc/EC04FJYJG-jwsR3Sbo9Rfg/output.json | 18 +- .../EC04FJYJG-jwsR3Sbo9Rfg/span.rust-debug | 12 + .../misc/EJ3xE2oHAiQiiAA6TOFfLA/output.json | 16 +- .../EJ3xE2oHAiQiiAA6TOFfLA/span.rust-debug | 8 +- .../misc/EJPa4WhTn_fRRrDiA2bczg/output.json | 18 +- .../EJPa4WhTn_fRRrDiA2bczg/span.rust-debug | 12 + .../misc/EX6W7U27ut-K7x8AfSlQSg/output.json | 36 +- .../EX6W7U27ut-K7x8AfSlQSg/span.rust-debug | 24 + .../misc/EYFn-trzBus37dDEvK1jUQ/output.json | 18 +- .../EYFn-trzBus37dDEvK1jUQ/span.rust-debug | 12 + .../misc/ElFW4lY06Cb-VFYtK0WX4A/output.json | 18 +- .../ElFW4lY06Cb-VFYtK0WX4A/span.rust-debug | 12 + .../misc/EmvZzoCy9JnSP70AqHmNNA/output.json | 36 +- .../EmvZzoCy9JnSP70AqHmNNA/span.rust-debug | 24 + .../misc/F-AbRDwG_3dGLhE7pzr5aA/output.json | 18 +- .../F-AbRDwG_3dGLhE7pzr5aA/span.rust-debug | 12 + .../misc/FlqjDLebWxQvNIxKppBllw/output.json | 18 +- .../FlqjDLebWxQvNIxKppBllw/span.rust-debug | 12 + .../misc/Fm7gvlx7uRyvrfzUC7rJxg/output.json | 18 +- .../Fm7gvlx7uRyvrfzUC7rJxg/span.rust-debug | 12 + .../misc/GC0pcFQY1xSlq9QsgSvEVg/output.json | 18 +- .../GC0pcFQY1xSlq9QsgSvEVg/span.rust-debug | 12 + .../misc/GI1rffTXev-78n9ei_53wQ/output.json | 18 +- .../GI1rffTXev-78n9ei_53wQ/span.rust-debug | 12 + .../misc/GNiHtd4OPiZDQlN5KGAmRQ/output.json | 18 +- .../GNiHtd4OPiZDQlN5KGAmRQ/span.rust-debug | 12 + .../misc/GVqeF3thmlPBqLweHlqIJQ/output.json | 36 +- .../GVqeF3thmlPBqLweHlqIJQ/span.rust-debug | 24 + .../misc/GjvJfQVAaNQonYJwt8QRDQ/output.json | 26 +- .../GjvJfQVAaNQonYJwt8QRDQ/span.rust-debug | 20 +- .../misc/GpePX8ZJM8IP14hXFTKKxQ/output.json | 18 +- .../GpePX8ZJM8IP14hXFTKKxQ/span.rust-debug | 12 + .../misc/HBQJEriDrHgN_kXjKrVW9g/output.json | 44 +- .../HBQJEriDrHgN_kXjKrVW9g/span.rust-debug | 14 +- .../misc/HDNE73X9waUrBkTAzz-20g/output.json | 18 +- .../HDNE73X9waUrBkTAzz-20g/span.rust-debug | 12 + .../misc/HGH4crVp9Whp_G0PY6BaQA/output.json | 34 +- .../HGH4crVp9Whp_G0PY6BaQA/span.rust-debug | 20 +- .../misc/HWU09nmB9oZX7WY8zUbrnA/output.json | 18 +- .../HWU09nmB9oZX7WY8zUbrnA/span.rust-debug | 12 + .../misc/I33LxmnLDtSRSbNrHmoNRA/output.json | 36 +- .../I33LxmnLDtSRSbNrHmoNRA/span.rust-debug | 24 + .../misc/LoeMqdekBkn3XKYHQFHOZA/output.json | 18 +- .../LoeMqdekBkn3XKYHQFHOZA/span.rust-debug | 12 + .../misc/Loy9sX2qaylR2OySt7N-BQ/output.json | 28 +- .../Loy9sX2qaylR2OySt7N-BQ/span.rust-debug | 18 +- .../misc/MCJc58-6bYzpgizSxt8jQg/output.json | 44 +- .../MCJc58-6bYzpgizSxt8jQg/span.rust-debug | 14 +- .../misc/MHzCL6d2nAk4bByQ_ja7xg/output.json | 18 +- .../MHzCL6d2nAk4bByQ_ja7xg/span.rust-debug | 12 + .../misc/MK5PGiCFMf7RHDp05gnDCw/output.json | 18 +- .../MK5PGiCFMf7RHDp05gnDCw/span.rust-debug | 12 + .../misc/MMBANlJKeKQw886fHOYiHA/output.json | 18 +- .../MMBANlJKeKQw886fHOYiHA/span.rust-debug | 12 + .../misc/MU8JgGd_-h5ocqkfawNxeQ/output.json | 18 +- .../MU8JgGd_-h5ocqkfawNxeQ/span.rust-debug | 12 + .../misc/Mdtiu_Fpfso6gXZMciRJgw/output.json | 18 +- .../Mdtiu_Fpfso6gXZMciRJgw/span.rust-debug | 12 + .../misc/MmOsa9XFdPMS9x4ITbWSzg/output.json | 18 +- .../MmOsa9XFdPMS9x4ITbWSzg/span.rust-debug | 12 + .../misc/MxxFvoxSpp02tFmpbNdA8g/output.json | 18 +- .../MxxFvoxSpp02tFmpbNdA8g/span.rust-debug | 12 + .../misc/NGFFzFWLONNmgWPM_FpiZg/output.json | 18 +- .../NGFFzFWLONNmgWPM_FpiZg/span.rust-debug | 12 + .../misc/O2EvcnNp_CVyX3xq5-eM-g/output.json | 18 +- .../O2EvcnNp_CVyX3xq5-eM-g/span.rust-debug | 12 + .../misc/Oc6Obl7mbH-MlFllIoAbdg/output.json | 18 +- .../Oc6Obl7mbH-MlFllIoAbdg/span.rust-debug | 12 + .../misc/OjiW46YAJSt_cq_MHhs2Bw/output.json | 18 +- .../OjiW46YAJSt_cq_MHhs2Bw/span.rust-debug | 12 + .../misc/OtM9lGhbFLqI-r3dvNTUjQ/output.json | 18 +- .../OtM9lGhbFLqI-r3dvNTUjQ/span.rust-debug | 12 + .../misc/PRqD5VDViUThMCxIEmwIcg/output.json | 18 +- .../PRqD5VDViUThMCxIEmwIcg/span.rust-debug | 12 + .../misc/PSncmPJMuHC-CjpwiYtkDw/output.json | 18 +- .../PSncmPJMuHC-CjpwiYtkDw/span.rust-debug | 12 + .../misc/Pkkf0GfuA1VzI7L4dGjS-A/output.json | 46 +- .../Pkkf0GfuA1VzI7L4dGjS-A/span.rust-debug | 18 + .../misc/Q42FDvG6_mtoeI7PoHqgQw/output.json | 34 +- .../Q42FDvG6_mtoeI7PoHqgQw/span.rust-debug | 20 +- .../misc/QLHVnSGDdGN_iDeP3OAXfQ/output.json | 26 +- .../QLHVnSGDdGN_iDeP3OAXfQ/span.rust-debug | 20 +- .../misc/Q_wA-fPw3o2m3R7gyWNxbQ/output.json | 18 +- .../Q_wA-fPw3o2m3R7gyWNxbQ/span.rust-debug | 12 + .../misc/R6OYU1g_sB_euLV8Yzjw6w/output.json | 18 +- .../R6OYU1g_sB_euLV8Yzjw6w/span.rust-debug | 12 + .../misc/RmGccmub1dooAN8WPKTwhQ/output.json | 18 +- .../RmGccmub1dooAN8WPKTwhQ/span.rust-debug | 12 + .../misc/Rq1DOaNCa5Dl2jaozalLXQ/output.json | 18 +- .../Rq1DOaNCa5Dl2jaozalLXQ/span.rust-debug | 12 + .../misc/S2Mhk5rU2YxQPgm9rtF9WA/output.json | 18 +- .../S2Mhk5rU2YxQPgm9rtF9WA/span.rust-debug | 12 + .../misc/SFBgyV9jnFbMzWZoo9VbSQ/output.json | 18 +- .../SFBgyV9jnFbMzWZoo9VbSQ/span.rust-debug | 12 + .../misc/Ssg_Qhdw7h_c6ZtY52Qe4A/output.json | 18 +- .../Ssg_Qhdw7h_c6ZtY52Qe4A/span.rust-debug | 12 + .../misc/Sy2aOxINv1bvZmbK_Pc5Mg/output.json | 28 +- .../Sy2aOxINv1bvZmbK_Pc5Mg/span.rust-debug | 18 +- .../misc/T1SOp4KXmIb1WNsyPFEKqg/output.json | 18 +- .../T1SOp4KXmIb1WNsyPFEKqg/span.rust-debug | 12 + .../misc/TdBn3uBF54mw96CCUwpgew/output.json | 44 +- .../TdBn3uBF54mw96CCUwpgew/span.rust-debug | 14 +- .../misc/TyMkoZpPOEhvUBOmUhGOXQ/output.json | 18 +- .../TyMkoZpPOEhvUBOmUhGOXQ/span.rust-debug | 12 + .../misc/U-MOOs2vmQ3m-i8XisYj8w/output.json | 26 +- .../U-MOOs2vmQ3m-i8XisYj8w/span.rust-debug | 20 +- .../misc/U2nuhvtnEWZ_kMd6i7EDWA/output.json | 18 +- .../U2nuhvtnEWZ_kMd6i7EDWA/span.rust-debug | 12 + .../misc/UeHn9b5w6R3dVjrtRCGxkA/output.json | 19 +- .../UeHn9b5w6R3dVjrtRCGxkA/span.rust-debug | 14 +- .../misc/Uuvi9sS4YR_ILpKl0xpfOg/output.json | 18 +- .../Uuvi9sS4YR_ILpKl0xpfOg/span.rust-debug | 12 + .../misc/V6ATfoZsbJDwKWSnlREl-w/output.json | 26 +- .../V6ATfoZsbJDwKWSnlREl-w/span.rust-debug | 20 +- .../misc/W3R-c5DPSkhG9QWYdcFdFg/output.json | 18 +- .../W3R-c5DPSkhG9QWYdcFdFg/span.rust-debug | 12 + .../misc/WQWdwW4B4hm60AQgxTU08Q/output.json | 18 +- .../WQWdwW4B4hm60AQgxTU08Q/span.rust-debug | 12 + .../misc/Wb-aVu7CEQfCy1QL2yUrEw/output.json | 18 +- .../Wb-aVu7CEQfCy1QL2yUrEw/span.rust-debug | 12 + .../misc/WnrbfdZnESKVnJxygl6yYA/output.json | 36 +- .../WnrbfdZnESKVnJxygl6yYA/span.rust-debug | 24 + .../misc/Wplrqmb_IDjNC-o-eqLw4A/output.json | 18 +- .../Wplrqmb_IDjNC-o-eqLw4A/span.rust-debug | 12 + .../misc/X-yuwO0x1B-l1Js4JkKJZg/output.json | 18 +- .../X-yuwO0x1B-l1Js4JkKJZg/span.rust-debug | 12 + .../misc/XVtQeQIEHAyQlpmKRigHcg/output.json | 36 +- .../XVtQeQIEHAyQlpmKRigHcg/span.rust-debug | 24 + .../misc/YIW6UUMmxrTYJjJ3JSL3uQ/output.json | 18 +- .../YIW6UUMmxrTYJjJ3JSL3uQ/span.rust-debug | 12 + .../misc/Yc70giIIGDIddrjD858dDw/output.json | 18 +- .../Yc70giIIGDIddrjD858dDw/span.rust-debug | 12 + .../misc/Ys7z8C2qi5O_HM9ElZQrUQ/output.json | 18 +- .../Ys7z8C2qi5O_HM9ElZQrUQ/span.rust-debug | 12 + .../misc/Z4J4sVA4UnGhTMiN5tdMMQ/output.json | 18 +- .../Z4J4sVA4UnGhTMiN5tdMMQ/span.rust-debug | 12 + .../misc/_APxY5Pe47Bb71-CwD1nhw/output.json | 18 +- .../_APxY5Pe47Bb71-CwD1nhw/span.rust-debug | 12 + .../misc/_U4zAUbS93Xo7_tJOolGuA/output.json | 18 +- .../_U4zAUbS93Xo7_tJOolGuA/span.rust-debug | 12 + .../misc/_XB1oeHz4bZ49LCE2cBI6g/output.json | 44 +- .../_XB1oeHz4bZ49LCE2cBI6g/span.rust-debug | 14 +- .../misc/_d22bZcPKDgNEKSyJ2NRsQ/output.json | 14 +- .../_d22bZcPKDgNEKSyJ2NRsQ/span.rust-debug | 2 +- .../misc/_qcmYeHAxw35hMnF2IST8A/output.json | 26 +- .../_qcmYeHAxw35hMnF2IST8A/span.rust-debug | 20 +- .../misc/a0Yurt7E7InOYieD7nMCXg/output.json | 18 +- .../a0Yurt7E7InOYieD7nMCXg/span.rust-debug | 12 + .../misc/a7KElWOMF9ilrSsoliHkcg/output.json | 18 +- .../a7KElWOMF9ilrSsoliHkcg/span.rust-debug | 12 + .../misc/aEF_NRb2u-g7UzHxaKpOfA/output.json | 34 +- .../aEF_NRb2u-g7UzHxaKpOfA/span.rust-debug | 20 +- .../misc/aVG5R30iWKuuw8iOGrgVmw/output.json | 46 +- .../aVG5R30iWKuuw8iOGrgVmw/span.rust-debug | 18 + .../misc/axTS8OYqxbJ3cRQm9h4ZYA/output.json | 18 +- .../axTS8OYqxbJ3cRQm9h4ZYA/span.rust-debug | 12 + .../misc/b102IE1MrM3aGTKCRrSU6Q/output.json | 18 +- .../b102IE1MrM3aGTKCRrSU6Q/span.rust-debug | 12 + .../misc/b2m1STf0F5CKity6Nd4vmQ/output.json | 18 +- .../b2m1STf0F5CKity6Nd4vmQ/span.rust-debug | 12 + .../misc/bdiLSVQWZCfQNNwD_OM6qA/output.json | 18 +- .../bdiLSVQWZCfQNNwD_OM6qA/span.rust-debug | 12 + .../misc/biImEvafuG5pEuEW8LgCCw/output.json | 18 +- .../biImEvafuG5pEuEW8LgCCw/span.rust-debug | 12 + .../misc/btdQp-3m090Q73vMHSpKgw/output.json | 46 +- .../btdQp-3m090Q73vMHSpKgw/span.rust-debug | 18 + .../misc/cFk0V1dktTRk2wWOux0Y9A/output.json | 18 +- .../cFk0V1dktTRk2wWOux0Y9A/span.rust-debug | 12 + .../misc/cGdUJvMcb_06jPxvv8lGkg/output.json | 18 +- .../cGdUJvMcb_06jPxvv8lGkg/span.rust-debug | 12 + .../misc/ccwWSeXA2f9cTFtUANZA8Q/output.json | 18 +- .../ccwWSeXA2f9cTFtUANZA8Q/span.rust-debug | 12 + .../misc/cfNrGQbCQ18L8pQmD7lBZQ/output.json | 18 +- .../cfNrGQbCQ18L8pQmD7lBZQ/span.rust-debug | 12 + .../misc/coHEK8Dkb2Zflw3JwafU5Q/output.json | 26 +- .../coHEK8Dkb2Zflw3JwafU5Q/span.rust-debug | 20 +- .../misc/cpoL0JfVO7TLrlcAga939A/output.json | 26 +- .../cpoL0JfVO7TLrlcAga939A/span.rust-debug | 20 +- .../misc/cxYYDM0_rXbkvaqi8UPWOg/output.json | 18 +- .../cxYYDM0_rXbkvaqi8UPWOg/span.rust-debug | 12 + .../misc/d1BWbOHfSbCE8-_qEz-luA/output.json | 18 +- .../d1BWbOHfSbCE8-_qEz-luA/span.rust-debug | 12 + .../misc/d6iTYxGk5HHi4hIZcn73Bw/output.json | 18 +- .../d6iTYxGk5HHi4hIZcn73Bw/span.rust-debug | 12 + .../misc/dCIAD8Ab98J4V9rGaJvZlw/output.json | 18 +- .../dCIAD8Ab98J4V9rGaJvZlw/span.rust-debug | 12 + .../misc/dVUzkh7NtbXySLzWGW0t9g/output.json | 54 +- .../dVUzkh7NtbXySLzWGW0t9g/span.rust-debug | 36 + .../misc/dnJiFdC_77rVfPM-yerzTQ/output.json | 16 +- .../dnJiFdC_77rVfPM-yerzTQ/span.rust-debug | 8 +- .../misc/eBC_tv-_FNqjWVMq-no99A/output.json | 14 +- .../eBC_tv-_FNqjWVMq-no99A/span.rust-debug | 2 +- .../misc/eHdhrm6W2iHKQegxH7uEgw/output.json | 18 +- .../eHdhrm6W2iHKQegxH7uEgw/span.rust-debug | 12 + .../misc/eVSpM_pYsIvyyewUkjTa2A/output.json | 18 +- .../eVSpM_pYsIvyyewUkjTa2A/span.rust-debug | 12 + .../misc/eWp7_8m3btY6p4erQ5c2JQ/output.json | 18 +- .../eWp7_8m3btY6p4erQ5c2JQ/span.rust-debug | 12 + .../misc/e_FDMPgmGFzIY3W0EbjxHA/output.json | 44 +- .../e_FDMPgmGFzIY3W0EbjxHA/span.rust-debug | 14 +- .../misc/egyt9Hk9xnn2Xfbi3Ckfrg/output.json | 18 +- .../egyt9Hk9xnn2Xfbi3Ckfrg/span.rust-debug | 12 + .../misc/eivsIn6ub-xYiqErLqd8oA/output.json | 18 +- .../eivsIn6ub-xYiqErLqd8oA/span.rust-debug | 12 + .../misc/fTZzFds73kLZoyY9Y2gZdQ/output.json | 18 +- .../fTZzFds73kLZoyY9Y2gZdQ/span.rust-debug | 12 + .../misc/fYJdtIZOdQKTLI8JJC2b_g/output.json | 54 +- .../fYJdtIZOdQKTLI8JJC2b_g/span.rust-debug | 26 +- .../misc/fe2WQQLV9qt16pYQLzZrpw/output.json | 26 +- .../fe2WQQLV9qt16pYQLzZrpw/span.rust-debug | 20 +- .../misc/fmt94qCRfRXbpej5kzLZUw/output.json | 18 +- .../fmt94qCRfRXbpej5kzLZUw/span.rust-debug | 12 + .../misc/fp9AcaoyGYHGTzXDXcy_ZQ/output.json | 26 +- .../fp9AcaoyGYHGTzXDXcy_ZQ/span.rust-debug | 20 +- .../misc/ftc5-zf_sliOrFRRBGGS-g/output.json | 18 +- .../ftc5-zf_sliOrFRRBGGS-g/span.rust-debug | 12 + .../misc/fxosM7xcuYbDyErN-ODVbw/output.json | 26 +- .../fxosM7xcuYbDyErN-ODVbw/span.rust-debug | 20 +- .../misc/gPpnAqOuxEdLAEJjFaUEkg/output.json | 18 +- .../gPpnAqOuxEdLAEJjFaUEkg/span.rust-debug | 12 + .../misc/gVzUgfEllenh46I3Psx-uQ/output.json | 18 +- .../gVzUgfEllenh46I3Psx-uQ/span.rust-debug | 12 + .../misc/gxBoWO36fKxIuYwPzrWyKQ/output.json | 18 +- .../gxBoWO36fKxIuYwPzrWyKQ/span.rust-debug | 12 + .../misc/hYoP2sEvEyLualMll8L_RQ/output.json | 14 +- .../hYoP2sEvEyLualMll8L_RQ/span.rust-debug | 2 +- .../misc/hfprsTDi2yEOOmPdjb8Cew/output.json | 18 +- .../hfprsTDi2yEOOmPdjb8Cew/span.rust-debug | 12 + .../misc/i7oy_7cYzOxuhIPcZo1yow/output.json | 26 +- .../i7oy_7cYzOxuhIPcZo1yow/span.rust-debug | 20 +- .../misc/inMW5rttJFPDfH0aKVFg_Q/output.json | 18 +- .../inMW5rttJFPDfH0aKVFg_Q/span.rust-debug | 12 + .../misc/isfWm5W8qb6_aJSz_bdwDw/output.json | 18 +- .../isfWm5W8qb6_aJSz_bdwDw/span.rust-debug | 12 + .../misc/j9dr5-Ih68VDH1exMwsmZA/output.json | 18 +- .../j9dr5-Ih68VDH1exMwsmZA/span.rust-debug | 12 + .../misc/jD_IvFQVk8LtCrictrWpxw/output.json | 18 +- .../jD_IvFQVk8LtCrictrWpxw/span.rust-debug | 12 + .../misc/jdLujY0rTP02e0KuCnvbvg/output.json | 18 +- .../jdLujY0rTP02e0KuCnvbvg/span.rust-debug | 12 + .../misc/jzpj5gTOBgKB1ITBDfJiNA/output.json | 46 +- .../jzpj5gTOBgKB1ITBDfJiNA/span.rust-debug | 18 + .../misc/kVdd5WJZqKSou4cGvcL40g/output.json | 18 +- .../kVdd5WJZqKSou4cGvcL40g/span.rust-debug | 12 + .../misc/kubgOdBUY3iT30KfPRcbsA/output.json | 54 +- .../kubgOdBUY3iT30KfPRcbsA/span.rust-debug | 26 +- .../misc/lFIVvsKPgxD4lJlULqKluw/output.json | 16 +- .../lFIVvsKPgxD4lJlULqKluw/span.rust-debug | 8 +- .../misc/mJEhy0k_dxoszsTVHb3x_Q/output.json | 18 +- .../mJEhy0k_dxoszsTVHb3x_Q/span.rust-debug | 12 + .../misc/mnQPy45Xrp2Ze7IdrwV0Ow/output.json | 14 +- .../mnQPy45Xrp2Ze7IdrwV0Ow/span.rust-debug | 2 +- .../misc/mx296i8q4HfA0IzZ055Xpw/output.json | 18 +- .../mx296i8q4HfA0IzZ055Xpw/span.rust-debug | 12 + .../misc/nTOoTMumkTvMLx_Y_al5RQ/output.json | 18 +- .../nTOoTMumkTvMLx_Y_al5RQ/span.rust-debug | 12 + .../misc/niufyVEBI4s-ZqSXdfhptA/output.json | 18 +- .../niufyVEBI4s-ZqSXdfhptA/span.rust-debug | 12 + .../misc/nlYSjWzJfpf38YhsJNbwmA/output.json | 18 +- .../nlYSjWzJfpf38YhsJNbwmA/span.rust-debug | 12 + .../misc/oNUbYW5wdxqAQR8cAY1YBA/output.json | 26 +- .../oNUbYW5wdxqAQR8cAY1YBA/span.rust-debug | 20 +- .../misc/oj5Yn0RxnGFEbVphKqrL2Q/output.json | 18 +- .../oj5Yn0RxnGFEbVphKqrL2Q/span.rust-debug | 12 + .../misc/ottVCVON2IlQB3WCD-lu_A/output.json | 18 +- .../ottVCVON2IlQB3WCD-lu_A/span.rust-debug | Bin 1837 -> 2086 bytes .../misc/p4k8Aj2Nw7Pd4QNaHfLCyg/output.json | 26 +- .../p4k8Aj2Nw7Pd4QNaHfLCyg/span.rust-debug | 20 +- .../misc/pJGP-gxqsiFs_ruNrpY3bw/output.json | 18 +- .../pJGP-gxqsiFs_ruNrpY3bw/span.rust-debug | 12 + .../misc/pO8ANIJaeZDUsUBCBMKErg/output.json | 18 +- .../pO8ANIJaeZDUsUBCBMKErg/span.rust-debug | 12 + .../misc/pOZgFOB3GdVvQ0hiAsWfpQ/output.json | 45 +- .../pOZgFOB3GdVvQ0hiAsWfpQ/span.rust-debug | 32 +- .../misc/pQWwEpWgxuUS6-uSAJR0nQ/output.json | 18 +- .../pQWwEpWgxuUS6-uSAJR0nQ/span.rust-debug | 12 + .../misc/pRKMU9FUvZ77y9hGWxYQnw/output.json | 26 +- .../pRKMU9FUvZ77y9hGWxYQnw/span.rust-debug | 20 +- .../misc/pTW2Z7kJ0nR_yQzsOsjAwQ/output.json | 18 +- .../pTW2Z7kJ0nR_yQzsOsjAwQ/span.rust-debug | 12 + .../misc/pUymwoCxUAxDqtaTC7CaOQ/output.json | 46 +- .../pUymwoCxUAxDqtaTC7CaOQ/span.rust-debug | 18 + .../misc/prqRW0qUpem2SVAI9WN-5w/output.json | 37 +- .../prqRW0qUpem2SVAI9WN-5w/span.rust-debug | 18 +- .../misc/ptR_ezJzwIRsP3geOEZI5A/output.json | 18 +- .../ptR_ezJzwIRsP3geOEZI5A/span.rust-debug | 12 + .../misc/qgkE_nOj4HtPukMzEjCY5w/output.json | 18 +- .../qgkE_nOj4HtPukMzEjCY5w/span.rust-debug | 12 + .../misc/qmXSF9N8euK5gfPoFGmV_Q/output.json | 18 +- .../qmXSF9N8euK5gfPoFGmV_Q/span.rust-debug | 12 + .../misc/qsC9vwnhYfmqVreVrA1SEg/output.json | 26 +- .../qsC9vwnhYfmqVreVrA1SEg/span.rust-debug | 20 +- .../misc/rAzJtA56igpCO-gN3gRrYw/output.json | 18 +- .../rAzJtA56igpCO-gN3gRrYw/span.rust-debug | 12 + .../misc/rPWYt0NoxD_TvsI8Xrhvyg/output.json | 18 +- .../rPWYt0NoxD_TvsI8Xrhvyg/span.rust-debug | 12 + .../misc/rZIFO-RMBeLmmQK8U6nNmQ/output.json | 18 +- .../rZIFO-RMBeLmmQK8U6nNmQ/span.rust-debug | 12 + .../misc/sAlB53zm7iv9WuhRVKadHQ/output.json | 18 +- .../sAlB53zm7iv9WuhRVKadHQ/span.rust-debug | 12 + .../misc/sEqPCrxONsC0GxTLw0X7IA/output.json | 44 +- .../sEqPCrxONsC0GxTLw0X7IA/span.rust-debug | 14 +- .../misc/sI7kJsMAHm4ehV5Ec9i9hg/output.json | 26 +- .../sI7kJsMAHm4ehV5Ec9i9hg/span.rust-debug | 20 +- .../misc/sNuIucY7tsVtjkcMTIXaGw/output.json | 16 +- .../sNuIucY7tsVtjkcMTIXaGw/span.rust-debug | 8 +- .../misc/sPEO1vW1kIUNhCVdR2d7fg/output.json | 18 +- .../sPEO1vW1kIUNhCVdR2d7fg/span.rust-debug | 12 + .../misc/tJNGkqEMVKFfOWjyOm5TSg/output.json | 18 +- .../tJNGkqEMVKFfOWjyOm5TSg/span.rust-debug | 12 + .../misc/tr7rB0yt-SnlIRotrT7uFA/output.json | 18 +- .../tr7rB0yt-SnlIRotrT7uFA/span.rust-debug | 12 + .../misc/uxHrqNkMo_2PTuF8sIRQxA/output.json | 18 +- .../uxHrqNkMo_2PTuF8sIRQxA/span.rust-debug | 12 + .../misc/vCiwe_ipn8ReAa4wyU52Ng/output.json | 18 +- .../vCiwe_ipn8ReAa4wyU52Ng/span.rust-debug | 12 + .../misc/vFNgwFW2EHA0WTOoSWhSTg/output.json | 18 +- .../vFNgwFW2EHA0WTOoSWhSTg/span.rust-debug | 12 + .../misc/vIco-E1oKlSzuggLOcviNg/output.json | 18 +- .../vIco-E1oKlSzuggLOcviNg/span.rust-debug | 12 + .../misc/vJrDZy-xgYNUTNK3uei3cg/output.json | 16 +- .../vJrDZy-xgYNUTNK3uei3cg/span.rust-debug | 8 +- .../misc/vN7xRB9YekSqanW68eIoNA/output.json | 18 +- .../vN7xRB9YekSqanW68eIoNA/span.rust-debug | 12 + .../misc/wEB80kxMinK4EZaPb3My1A/output.json | 18 +- .../wEB80kxMinK4EZaPb3My1A/span.rust-debug | 12 + .../misc/wwLEw52LUKMFH3Wp5CaBAQ/output.json | 18 +- .../wwLEw52LUKMFH3Wp5CaBAQ/span.rust-debug | 12 + .../misc/xc1mD3YfHByTKL-N-FL49A/output.json | 18 +- .../xc1mD3YfHByTKL-N-FL49A/span.rust-debug | 12 + .../misc/xdJ7w6fdV3po3r2aWrgPdA/output.json | 18 +- .../xdJ7w6fdV3po3r2aWrgPdA/span.rust-debug | 12 + .../misc/yOHW3TOE35U7DAf9Hn7-Ew/output.json | 18 +- .../yOHW3TOE35U7DAf9Hn7-Ew/span.rust-debug | 12 + .../misc/yVqdwpiB7OK23Te5mXKdFw/output.json | 18 +- .../yVqdwpiB7OK23Te5mXKdFw/span.rust-debug | 12 + .../misc/yboE7Tr5zjKHy9-m10AZTg/output.json | 18 +- .../yboE7Tr5zjKHy9-m10AZTg/span.rust-debug | 12 + .../misc/zUuWz4A8Y6yZO8JMLAe2fQ/output.json | 18 +- .../zUuWz4A8Y6yZO8JMLAe2fQ/span.rust-debug | 12 + .../misc/zz_B6vK87VUHpkOMFR_R1g/output.json | 18 +- .../zz_B6vK87VUHpkOMFR_R1g/span.rust-debug | 12 + .../value/mixed-separator-01/output.json | 18 +- .../value/mixed-separator-01/span.rust-debug | 12 + .../tests/fixture/function/calc/output.json | 72 +- .../fixture/function/calc/span.rust-debug | 48 + .../tests/fixture/function/url/output.json | 18 +- .../fixture/function/url/span.rust-debug | 12 + .../tests/fixture/hacks/output.json | 72 +- .../tests/fixture/hacks/span.rust-debug | 48 + .../tests/fixture/hex-colors/output.json | 18 +- .../tests/fixture/hex-colors/span.rust-debug | 12 + .../tests/fixture/number/output.json | 18 +- .../tests/fixture/number/span.rust-debug | 12 + .../fixture/property/escaped/output.json | 18 +- .../fixture/property/escaped/span.rust-debug | 12 + .../tests/fixture/rome/comment/output.json | 54 +- .../fixture/rome/comment/span.rust-debug | 36 + .../fixture/rome/media/condition/output.json | 36 +- .../rome/media/condition/span.rust-debug | 24 + .../tests/fixture/rome/selectors/output.json | 334 +- .../fixture/rome/selectors/span.rust-debug | 222 +- .../tests/fixture/rome/smoke/output.json | 18 +- .../tests/fixture/rome/smoke/span.rust-debug | 12 + .../tests/fixture/rome/values/output.json | 54 +- .../tests/fixture/rome/values/span.rust-debug | 36 + .../fixture/selector/attribute/output.json | 1261 +++++-- .../selector/attribute/span.rust-debug | 784 +++- .../tests/fixture/selector/class/output.json | 86 +- .../fixture/selector/class/span.rust-debug | 52 +- .../fixture/selector/comments/output.json | 576 ++- .../fixture/selector/comments/span.rust-debug | 384 ++ .../tests/fixture/selector/complex/input.css | 6 + .../fixture/selector/complex/output.json | 3307 ++++++++++++----- .../fixture/selector/complex/span.rust-debug | 2184 ++++++++++- .../fixture/selector/compound/output.json | 204 +- .../fixture/selector/compound/span.rust-debug | 126 +- .../tests/fixture/selector/id/output.json | 96 +- .../tests/fixture/selector/id/span.rust-debug | 64 +- .../tests/fixture/selector/list/output.json | 828 +++-- .../fixture/selector/list/span.rust-debug | 530 ++- .../selector/pseudo-class/basic/output.json | 230 +- .../pseudo-class/basic/span.rust-debug | 146 +- .../selector/pseudo-element/basic/output.json | 248 +- .../pseudo-element/basic/span.rust-debug | 158 +- .../pseudo-element/escaped/output.json | 18 +- .../pseudo-element/escaped/span.rust-debug | 12 + .../tests/fixture/selector/type/output.json | 527 +-- .../fixture/selector/type/span.rust-debug | 236 +- .../fixture/styled-jsx/selector/2/output.json | 18 +- .../styled-jsx/selector/2/span.rust-debug | 12 + .../tests/fixture/stylis/comma/01/output.json | 18 +- .../fixture/stylis/comma/01/span.rust-debug | 12 + .../tests/fixture/value/escaped/output.json | 18 +- .../fixture/value/escaped/span.rust-debug | 12 + .../fixture/value/percentage/output.json | 36 +- .../fixture/value/percentage/span.rust-debug | 24 + .../tests/fixture/value/quotes/output.json | 106 +- .../fixture/value/quotes/span.rust-debug | 78 +- .../fixture/value/square-brackets/output.json | 18 +- .../value/square-brackets/span.rust-debug | 12 + .../tests/fixture/value/url/output.json | 18 +- .../tests/fixture/value/url/span.rust-debug | 12 + .../line-comment/css-in-js/1/output.json | 18 +- .../line-comment/css-in-js/2/output.json | 18 +- .../line-comment/css-in-js/3/output.json | 18 +- .../line-comment/css-in-js/4/output.json | 18 +- .../line-comment/css-in-js/5/output.json | 18 +- .../line-comment/css-in-js/6/output.json | 18 +- .../layer/string-name-block/output.json | 36 +- .../bad-url-token/double-quotes/output.json | 18 +- .../bad-url-token/invalid-escape/output.json | 18 +- .../left-parenthesis/output.json | 18 +- .../bad-url-token/single-quotes/output.json | 18 +- .../whitespace-in-middle/output.json | 18 +- .../bad-url-token/whitespace/output.json | 18 +- .../tests/recovery/comments/output.json | 18 +- .../delim-token/ampersand/output.json | 18 +- .../recovery/delim-token/asterisk/output.json | 18 +- .../recovery/delim-token/at-sign/output.json | 18 +- .../recovery/delim-token/bang/output.json | 18 +- .../recovery/delim-token/bar/output.json | 18 +- .../recovery/delim-token/caret/output.json | 18 +- .../recovery/delim-token/dollar/output.json | 18 +- .../recovery/delim-token/equals/output.json | 18 +- .../delim-token/greater-than/output.json | 18 +- .../recovery/delim-token/hash/output.json | 18 +- .../delim-token/less-than/output.json | 18 +- .../recovery/delim-token/minus/output.json | 18 +- .../recovery/delim-token/percent/output.json | 18 +- .../recovery/delim-token/plus/output.json | 18 +- .../delim-token/question-mark/output.json | 18 +- .../recovery/delim-token/star/output.json | 18 +- .../recovery/delim-token/tilde/output.json | 18 +- .../tests/recovery/function-token/output.json | 18 +- .../tests/recovery/function/output.json | 18 +- .../tests/recovery/number/output.json | 18 +- .../recovery/value/at-keyword/1/output.json | 18 +- .../recovery/value/at-keyword/2/output.json | 18 +- .../recovery/value/at-keyword/3/output.json | 18 +- .../recovery/value/at-keyword/4/output.json | 18 +- .../recovery/value/at-keyword/5/output.json | 18 +- .../recovery/value/at-keyword/6/output.json | 18 +- .../recovery/value/at-keyword/7/output.json | 18 +- .../tests/recovery/value/quotes/output.json | 18 +- .../tests/recovery/value/url/output.json | 18 +- .../tests/recovery/whitespaces/output.json | 18 +- crates/swc_css_visit/src/lib.rs | 59 +- 607 files changed, 19925 insertions(+), 4843 deletions(-) diff --git a/crates/swc_css_ast/src/selector.rs b/crates/swc_css_ast/src/selector.rs index 7544001023a..dafc4eb2827 100644 --- a/crates/swc_css_ast/src/selector.rs +++ b/crates/swc_css_ast/src/selector.rs @@ -54,6 +54,9 @@ pub enum CombinatorValue { /// `~` LaterSibling, + + /// `||` + Column, } #[ast_node("NestingSelector")] @@ -61,18 +64,40 @@ pub struct NestingSelector { pub span: Span, } -#[ast_node("TypeSelector")] -pub struct TypeSelector { +#[ast_node] +pub enum TypeSelector { + #[tag("TagNameSelector")] + TagName(TagNameSelector), + #[tag("UniversalSelector")] + Universal(UniversalSelector), +} + +#[ast_node("TagNameSelector")] +pub struct TagNameSelector { + pub span: Span, + pub name: WqName, +} + +#[ast_node("UniversalSelector")] +pub struct UniversalSelector { + pub span: Span, + pub prefix: Option, +} + +#[ast_node("NsPrefix")] +pub struct NsPrefix { pub span: Span, - /// If present, this is an identifier or "*" and is followed by a "|" - /// character pub prefix: Option, - /// This is an identifier or "*". - pub name: Ident, +} + +#[ast_node("WqName")] +pub struct WqName { + pub span: Span, + pub prefix: Option, + pub value: Ident, } #[ast_node] -#[derive(Is)] pub enum SubclassSelector { #[tag("IdSelector")] Id(IdSelector), @@ -81,7 +106,7 @@ pub enum SubclassSelector { Class(ClassSelector), #[tag("AttributeSelector")] - Attr(AttrSelector), + Attribute(AttributeSelector), #[tag("PseudoClassSelector")] PseudoClass(PseudoClassSelector), @@ -93,8 +118,31 @@ pub enum SubclassSelector { At(AtSelector), } +#[ast_node("IdSelector")] +pub struct IdSelector { + pub span: Span, + /// Does not include `#` + pub text: Ident, +} + +#[ast_node("ClassSelector")] +pub struct ClassSelector { + pub span: Span, + /// Does not include `.` + pub text: Ident, +} + +#[ast_node("AttributeSelector")] +pub struct AttributeSelector { + pub span: Span, + pub name: WqName, + pub matcher: Option, + pub value: Option, + pub modifier: Option, +} + #[derive(StringEnum, Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Hash, EqIgnoreSpan)] -pub enum AttrSelectorMatcher { +pub enum AttributeSelectorMatcherValue { /// `=` Equals, @@ -114,9 +162,14 @@ pub enum AttrSelectorMatcher { Asterisk, } +#[ast_node("AttributeSelectorMatcher")] +pub struct AttributeSelectorMatcher { + pub span: Span, + pub value: AttributeSelectorMatcherValue, +} + #[ast_node] -#[derive(Is)] -pub enum AttrSelectorValue { +pub enum AttributeSelectorValue { #[tag("String")] Str(Str), @@ -124,18 +177,34 @@ pub enum AttrSelectorValue { Ident(Ident), } -#[ast_node("AttributeSelector")] -pub struct AttrSelector { +#[ast_node("AttributeSelectorModifier")] +pub struct AttributeSelectorModifier { + pub span: Span, + pub value: Ident, +} + +#[ast_node("PseudoClassSelector")] +pub struct PseudoClassSelector { pub span: Span, - pub prefix: Option, pub name: Ident, - pub matcher: Option, - pub value: Option, - pub modifier: Option, + pub children: Option, +} + +#[ast_node("PseudoElementSelector")] +pub struct PseudoElementSelector { + pub span: Span, + pub name: Ident, + pub children: Option, +} + +/// Type for `@top-center`. Allowwed in only some contexts. +#[ast_node("AtSelector")] +pub struct AtSelector { + pub span: Span, + pub text: Ident, } #[ast_node] -#[derive(Is)] pub enum PseudoSelectorChildren { #[tag("Nth")] Nth(Nth), @@ -161,7 +230,6 @@ pub struct AnPlusB { } #[ast_node] -#[derive(Is)] pub enum NthValue { #[tag("AnPlusB")] AnPlusB(AnPlusB), @@ -169,44 +237,3 @@ pub enum NthValue { #[tag("Ident")] Ident(Ident), } - -#[ast_node("PseudoClassSelector")] -pub struct PseudoClassSelector { - pub span: Span, - pub name: Ident, - pub children: Option, -} - -#[ast_node("PseudoElementSelector")] -pub struct PseudoElementSelector { - pub span: Span, - pub name: Ident, - pub children: Option, -} - -#[ast_node("IdSelector")] -pub struct IdSelector { - pub span: Span, - /// Does not include `#` - pub text: Ident, -} - -#[ast_node("ClassSelector")] -pub struct ClassSelector { - pub span: Span, - /// Does not include `.` - pub text: Ident, -} - -#[ast_node("TagSelector")] -pub struct TagSelector { - pub span: Span, - pub text: Ident, -} - -/// Type for `@top-center`. Allowwed in only some contexts. -#[ast_node("AtSelector")] -pub struct AtSelector { - pub span: Span, - pub text: Ident, -} diff --git a/crates/swc_css_codegen/src/lib.rs b/crates/swc_css_codegen/src/lib.rs index f963a5886a0..9f552a3b021 100644 --- a/crates/swc_css_codegen/src/lib.rs +++ b/crates/swc_css_codegen/src/lib.rs @@ -1276,7 +1276,7 @@ where match n { SubclassSelector::Id(n) => emit!(self, n), SubclassSelector::Class(n) => emit!(self, n), - SubclassSelector::Attr(n) => emit!(self, n), + SubclassSelector::Attribute(n) => emit!(self, n), SubclassSelector::PseudoClass(n) => emit!(self, n), SubclassSelector::PseudoElement(n) => emit!(self, n), SubclassSelector::At(n) => emit!(self, n), @@ -1285,70 +1285,98 @@ where #[emitter] fn emit_type_selector(&mut self, n: &TypeSelector) -> Result { + match n { + TypeSelector::TagName(n) => emit!(self, n), + TypeSelector::Universal(n) => emit!(self, n), + } + } + + #[emitter] + fn emit_tag_name_selector(&mut self, n: &TagNameSelector) -> Result { + emit!(self, n.name); + } + + #[emitter] + fn emit_universal_selector(&mut self, n: &UniversalSelector) -> Result { if let Some(prefix) = &n.prefix { emit!(self, prefix); - punct!(self, "|"); } - emit!(self, n.name); + punct!(self, "*"); + } + + #[emitter] + fn emit_ns_prefix(&mut self, n: &NsPrefix) -> Result { + emit!(self, n.prefix); + punct!(self, "|"); + } + + #[emitter] + fn emit_wq_name(&mut self, n: &WqName) -> Result { + if n.prefix.is_some() { + emit!(self, n.prefix); + } + + emit!(self, n.value); } #[emitter] fn emit_id_selector(&mut self, n: &IdSelector) -> Result { punct!(self, "#"); - let ctx = Ctx { ..self.ctx }; - emit!(&mut *self.with_ctx(ctx), n.text); + emit!(self, n.text); } #[emitter] fn emit_class_selector(&mut self, n: &ClassSelector) -> Result { punct!(self, "."); - let ctx = Ctx { ..self.ctx }; - emit!(&mut *self.with_ctx(ctx), n.text); + emit!(self, n.text); } #[emitter] - fn emit_attr_selector_value(&mut self, n: &AttrSelectorValue) -> Result { - match n { - AttrSelectorValue::Str(n) => emit!(self, n), - AttrSelectorValue::Ident(n) => emit!(self, n), - } - } - - #[emitter] - fn emit_attr_selector(&mut self, n: &AttrSelector) -> Result { + fn emit_attribute_selector(&mut self, n: &AttributeSelector) -> Result { punct!(self, "["); - - if let Some(prefix) = &n.prefix { - emit!(self, prefix); - punct!(self, "|"); - } - emit!(self, n.name); - if let Some(matcher) = n.matcher { - self.wr.write_punct(None, matcher.as_str())?; - } + if n.matcher.is_some() { + emit!(self, n.matcher); + emit!(self, n.value); - emit!(self, n.value); + if n.modifier.is_some() { + match n.value { + Some(AttributeSelectorValue::Str(_)) => { + formatting_space!(self); + } + Some(AttributeSelectorValue::Ident(_)) => { + space!(self); + } + _ => {} + } - if let Some(m) = &n.modifier { - match n.value { - Some(AttrSelectorValue::Str(_)) => { - formatting_space!(self); - } - Some(AttrSelectorValue::Ident(_)) => { - space!(self); - } - _ => {} + emit!(self, n.modifier); } - - self.wr.write_raw_char(None, *m)?; } punct!(self, "]"); } + #[emitter] + fn emit_attribute_selector_matcher(&mut self, n: &AttributeSelectorMatcher) -> Result { + self.wr.write_punct(None, n.value.as_str())?; + } + + #[emitter] + fn emit_attribute_selector_value(&mut self, n: &AttributeSelectorValue) -> Result { + match n { + AttributeSelectorValue::Str(n) => emit!(self, n), + AttributeSelectorValue::Ident(n) => emit!(self, n), + } + } + + #[emitter] + fn emit_attribute_selector_modifier(&mut self, n: &AttributeSelectorModifier) -> Result { + emit!(self, n.value); + } + #[emitter] fn emit_nth(&mut self, n: &Nth) -> Result { emit!(self, n.nth); diff --git a/crates/swc_css_parser/src/parser/at_rule.rs b/crates/swc_css_parser/src/parser/at_rule.rs index e6ccd27025a..87f8796bfb8 100644 --- a/crates/swc_css_parser/src/parser/at_rule.rs +++ b/crates/swc_css_parser/src/parser/at_rule.rs @@ -1483,7 +1483,7 @@ where allow_at_selector: true, ..self.ctx }; - let prelude = self.with_ctx(ctx).parse_selectors()?; + let prelude = self.with_ctx(ctx).parse_as::()?; let block = self.parse()?; Ok(NestedPageRule { diff --git a/crates/swc_css_parser/src/parser/selector/mod.rs b/crates/swc_css_parser/src/parser/selector/mod.rs index ef7851c1ab2..355bef5aa42 100644 --- a/crates/swc_css_parser/src/parser/selector/mod.rs +++ b/crates/swc_css_parser/src/parser/selector/mod.rs @@ -3,18 +3,18 @@ use crate::{ error::{Error, ErrorKind}, Parse, }; -use swc_atoms::{js_word, JsWord}; +use swc_atoms::JsWord; use swc_common::{BytePos, Span}; use swc_css_ast::*; -impl Parser +impl Parse for Parser where I: ParserInput, { - pub(super) fn parse_selectors(&mut self) -> PResult { + fn parse(&mut self) -> PResult { self.input.skip_ws()?; - let child = self.parse_complex_selector()?; + let child = self.parse()?; let mut children = vec![child]; loop { @@ -26,7 +26,7 @@ where self.input.skip_ws()?; - let child = self.parse_complex_selector()?; + let child = self.parse()?; children.push(child); } @@ -49,9 +49,14 @@ where children, }) } +} - fn parse_complex_selector(&mut self) -> PResult { - let child = ComplexSelectorChildren::CompoundSelector(self.parse_compound_selector()?); +impl Parse for Parser +where + I: ParserInput, +{ + fn parse(&mut self) -> PResult { + let child = ComplexSelectorChildren::CompoundSelector(self.parse()?); let mut children = vec![child]; loop { @@ -63,7 +68,7 @@ where break; } - let mut combinator = self.parse_combinator()?; + let mut combinator: Combinator = self.parse()?; if combinator.value == CombinatorValue::Descendant { combinator.span = span; @@ -73,7 +78,7 @@ where children.push(ComplexSelectorChildren::Combinator(combinator)); - let child = self.parse_compound_selector()?; + let child = self.parse()?; children.push(ComplexSelectorChildren::CompoundSelector(child)); } @@ -96,8 +101,13 @@ where children, }) } +} - fn parse_combinator(&mut self) -> PResult { +impl Parse for Parser +where + I: ParserInput, +{ + fn parse(&mut self) -> PResult { let span = self.input.cur_span()?; if eat!(self, ">") { @@ -115,6 +125,13 @@ where span, value: CombinatorValue::LaterSibling, }); + } else if eat!(self, "|") { + expect!(self, "|"); + + return Ok(Combinator { + span: span!(self, span.lo), + value: CombinatorValue::Column, + }); } Ok(Combinator { @@ -122,50 +139,177 @@ where value: CombinatorValue::Descendant, }) } +} - fn parse_ns_prefix(&mut self) -> PResult> { +impl Parse for Parser +where + I: ParserInput, +{ + fn parse(&mut self) -> PResult { let span = self.input.cur_span()?; + let start_pos = span.lo; - if is!(self, Ident) && peeked_is!(self, "|") { - let ident = self.parse()?; + let mut nesting_selector = None; + // TODO: move under option, because it is draft + // This is an extension: https://drafts.csswg.org/css-nesting-1/ + if eat!(self, "&") { + nesting_selector = Some(NestingSelector { + span: span!(self, start_pos), + }); + } + + let type_selector = if is_one_of!(self, Ident, "*", "|") { + Some(self.parse()?) + } else { + None + }; + let mut subclass_selectors = vec![]; + + loop { + if !(is!(self, "#") + || is!(self, ".") + || is!(self, "[") + || (is!(self, ":") && !peeked_is!(self, ":")) + // TODO remove `@` + || is!(self, "@")) + { + break; + } + + let subclass_selector = self.parse()?; + + subclass_selectors.push(subclass_selector); + } + + loop { + if !(is!(self, ":") && peeked_is!(self, ":")) { + break; + } + + // TODO pseudo element is not subclass selector + let pseudo_element = SubclassSelector::PseudoElement(self.parse()?); + + subclass_selectors.push(pseudo_element); + + loop { + if !(is!(self, ":") && !peeked_is!(self, ":")) { + break; + } + + let pseudo_element = SubclassSelector::PseudoClass(self.parse()?); + + subclass_selectors.push(pseudo_element); + } + } + + let span = span!(self, start_pos); + + if nesting_selector.is_none() && type_selector.is_none() && subclass_selectors.is_empty() { + return Err(Error::new(span, ErrorKind::InvalidSelector)); + } + + Ok(CompoundSelector { + span, + nesting_selector, + type_selector, + subclass_selectors, + }) + } +} + +impl Parse for Parser +where + I: ParserInput, +{ + fn parse(&mut self) -> PResult { + let span = self.input.cur_span()?; + let prefix = if (is!(self, Ident) && peeked_is!(self, "|")) + || (is!(self, "*") && peeked_is!(self, "|")) + || is!(self, "|") + { + Some(self.parse()?) + } else { + None + }; + + if is!(self, Ident) { + let value = self.parse()?; + + return Ok(TypeSelector::TagName(TagNameSelector { + span: span!(self, span.lo), + name: WqName { + span: span!(self, span.lo), + prefix, + value, + }, + })); + } else if is!(self, "*") { bump!(self); - return Ok(Some(ident)); - } else if is!(self, "*") && peeked_is!(self, "|") { - bump!(self); + return Ok(TypeSelector::Universal(UniversalSelector { + span: span!(self, span.lo), + prefix, + })); + } + + return Err(Error::new( + span, + ErrorKind::Expected("ident, '*' or '|' delim tokens"), + )); + } +} + +impl Parse for Parser +where + I: ParserInput, +{ + fn parse(&mut self) -> PResult { + let span = self.input.cur_span()?; + let mut prefix = None; + + if is!(self, Ident) { + prefix = Some(self.parse()?); + } else if is!(self, "*") { bump!(self); let value: JsWord = "*".into(); let raw = value.clone(); - return Ok(Some(Ident { span, value, raw })); - } else if is!(self, "|") { - bump!(self); - - return Ok(Some(Ident { - span: Span::new(span.lo, span.lo, Default::default()), - value: js_word!(""), - raw: js_word!(""), - })); + prefix = Some(Ident { span, value, raw }); } - Ok(None) - } + expect!(self, "|"); - fn parse_wq_name(&mut self) -> PResult<(Option, Option)> { + return Ok(NsPrefix { + span: span!(self, span.lo), + prefix, + }); + } +} + +impl Parse> for Parser +where + I: ParserInput, +{ + fn parse(&mut self) -> PResult> { + let span = self.input.cur_span()?; let state = self.input.state(); if is!(self, Ident) && peeked_is!(self, "|") || is!(self, "*") && peeked_is!(self, "|") || is!(self, "|") { - let prefix = self.parse_ns_prefix()?; + let prefix = Some(self.parse()?); if is!(self, Ident) { - let name = self.parse()?; + let value = self.parse()?; - return Ok((prefix, Some(name))); + return Ok(Some(WqName { + span: span!(self, span.lo), + prefix, + value, + })); } else { // TODO: implement `peeked_ahead_is` for perf self.input.reset(&state); @@ -173,55 +317,66 @@ where } if is!(self, Ident) { - let name = self.parse()?; + let value = self.parse()?; - return Ok((None, Some(name))); - } - - Ok((None, None)) - } - - fn parse_type_selector(&mut self) -> PResult> { - let span = self.input.cur_span()?; - - let mut prefix = None; - - if let Ok(result) = self.parse_ns_prefix() { - prefix = result; - } - - if is!(self, Ident) { - let name = self.parse()?; - - return Ok(Some(TypeSelector { + return Ok(Some(WqName { span: span!(self, span.lo), - prefix, - name, - })); - } else if is!(self, "*") { - let name_span = self.input.cur_span()?; - - bump!(self); - - let value: JsWord = "*".into(); - let raw = value.clone(); - let name = Ident { - span: name_span, + prefix: None, value, - raw, - }; - - return Ok(Some(TypeSelector { - span: span!(self, span.lo), - prefix, - name, })); } Ok(None) } +} - fn parse_id_selector(&mut self) -> PResult { +impl Parse for Parser +where + I: ParserInput, +{ + fn parse(&mut self) -> PResult { + match cur!(self) { + tok!("#") => Ok(SubclassSelector::Id(self.parse()?)), + tok!(".") => Ok(SubclassSelector::Class(self.parse()?)), + tok!("[") => Ok(SubclassSelector::Attribute(self.parse()?)), + tok!(":") => Ok(SubclassSelector::PseudoClass(self.parse()?)), + // TODO remove me from here + Token::AtKeyword { .. } if self.ctx.allow_at_selector => { + let span = self.input.cur_span()?; + + let values = match bump!(self) { + Token::AtKeyword { value, raw } => (value, raw), + _ => { + unreachable!() + } + }; + + Ok(SubclassSelector::At(AtSelector { + span, + text: Ident { + span, + value: values.0, + raw: values.1, + }, + })) + } + _ => { + let span = self.input.cur_span()?; + + return Err(Error::new( + span, + ErrorKind::Expected("id, class, attribute or pseudo-class selector"), + )); + } + } + } +} + +impl Parse for Parser +where + I: ParserInput, +{ + fn parse(&mut self) -> PResult { let span = self.input.cur_span()?; let text = match bump!(self) { Token::Hash { @@ -246,46 +401,49 @@ where text, }) } +} - fn parse_class_selector(&mut self) -> PResult { - let start_pos = self.input.cur_span()?.lo; - - bump!(self); - +impl Parse for Parser +where + I: ParserInput, +{ + fn parse(&mut self) -> PResult { let span = self.input.cur_span()?; - match cur!(self) { - Token::Ident { .. } => {} - _ => Err(Error::new(span, ErrorKind::ExpectedSelectorText))?, - } + expect!(self, "."); let text = self.parse()?; Ok(ClassSelector { - span: span!(self, start_pos), + span: span!(self, span.lo), text, }) } +} - fn parse_attribute_selector(&mut self) -> PResult { - let start_pos = self.input.cur_span()?.lo; +impl Parse for Parser +where + I: ParserInput, +{ + fn parse(&mut self) -> PResult { + let span = self.input.cur_span()?; expect!(self, "["); self.input.skip_ws()?; - let prefix; let name; - let mut attr_matcher = None; - let mut matcher_value = None; - let mut matcher_modifier = None; + let mut matcher = None; + let mut value = None; + let mut modifier = None; - if let Ok((p, Some(n))) = self.parse_wq_name() { - prefix = p; - name = n; + if let Ok(Some(wq_name)) = self.parse() { + name = wq_name; } else { + let span = self.input.cur_span()?; + return Err(Error::new( - span!(self, start_pos), + span!(self, span.lo), ErrorKind::InvalidAttrSelectorName, )); } @@ -293,77 +451,16 @@ where self.input.skip_ws()?; if !is!(self, "]") { - let span = self.input.cur_span()?; - - attr_matcher = match cur!(self) { - tok!("~") | tok!("|") | tok!("^") | tok!("$") | tok!("*") => { - let tok = bump!(self); - - expect!(self, "="); - - Some(match tok { - tok!("~") => AttrSelectorMatcher::Tilde, - tok!("|") => AttrSelectorMatcher::Bar, - tok!("^") => AttrSelectorMatcher::Caret, - tok!("$") => AttrSelectorMatcher::Dollar, - tok!("*") => AttrSelectorMatcher::Asterisk, - _ => { - unreachable!() - } - }) - } - tok!("=") => { - let tok = bump!(self); - - Some(match tok { - tok!("=") => AttrSelectorMatcher::Equals, - _ => { - unreachable!() - } - }) - } - _ => Err(Error::new(span, ErrorKind::InvalidAttrSelectorMatcher))?, - }; + matcher = Some(self.parse()?); self.input.skip_ws()?; - let span = self.input.cur_span()?; - - matcher_value = match cur!(self) { - Token::Ident { .. } => { - let ident = self.parse()?; - - Some(AttrSelectorValue::Ident(ident)) - } - Token::Str { .. } => { - let value = bump!(self); - let str = match value { - Token::Str { value, raw } => (value, raw), - _ => unreachable!(), - }; - - Some(AttrSelectorValue::Str(Str { - span, - value: str.0, - raw: str.1, - })) - } - _ => return Err(Error::new(span, ErrorKind::InvalidAttrSelectorMatcherValue)), - }; + value = Some(self.parse()?); self.input.skip_ws()?; if is!(self, Ident) { - let span = self.input.cur_span()?; - - match self.input.cur()? { - Some(Token::Ident { value, .. }) => { - matcher_modifier = value.chars().next(); - - bump!(self); - } - _ => return Err(Error::new(span, ErrorKind::InvalidAttrSelectorModifier)), - } + modifier = Some(self.parse()?); } self.input.skip_ws()?; @@ -371,30 +468,254 @@ where expect!(self, "]"); - Ok(AttrSelector { - span: span!(self, start_pos), - prefix, + Ok(AttributeSelector { + span: span!(self, span.lo), name, - matcher: attr_matcher, - value: matcher_value, - modifier: matcher_modifier, + matcher, + value, + modifier, }) } +} - fn parse_nth(&mut self) -> PResult { +impl Parse for Parser +where + I: ParserInput, +{ + fn parse(&mut self) -> PResult { + let span = self.input.cur_span()?; + + match cur!(self) { + tok!("~") => { + bump!(self); + expect!(self, "="); + + Ok(AttributeSelectorMatcher { + span: span!(self, span.lo), + value: AttributeSelectorMatcherValue::Tilde, + }) + } + tok!("|") => { + bump!(self); + expect!(self, "="); + + Ok(AttributeSelectorMatcher { + span: span!(self, span.lo), + value: AttributeSelectorMatcherValue::Bar, + }) + } + tok!("^") => { + bump!(self); + expect!(self, "="); + + Ok(AttributeSelectorMatcher { + span: span!(self, span.lo), + value: AttributeSelectorMatcherValue::Caret, + }) + } + tok!("$") => { + bump!(self); + expect!(self, "="); + + Ok(AttributeSelectorMatcher { + span: span!(self, span.lo), + value: AttributeSelectorMatcherValue::Dollar, + }) + } + tok!("*") => { + bump!(self); + expect!(self, "="); + + Ok(AttributeSelectorMatcher { + span: span!(self, span.lo), + value: AttributeSelectorMatcherValue::Asterisk, + }) + } + tok!("=") => { + bump!(self); + + Ok(AttributeSelectorMatcher { + span: span!(self, span.lo), + value: AttributeSelectorMatcherValue::Equals, + }) + } + _ => Err(Error::new(span, ErrorKind::InvalidAttrSelectorMatcher))?, + } + } +} + +impl Parse for Parser +where + I: ParserInput, +{ + fn parse(&mut self) -> PResult { + match cur!(self) { + tok!("ident") => { + let ident = self.parse()?; + + Ok(AttributeSelectorValue::Ident(ident)) + } + tok!("str") => { + let string = self.parse()?; + + Ok(AttributeSelectorValue::Str(string)) + } + _ => { + let span = self.input.cur_span()?; + + return Err(Error::new(span, ErrorKind::InvalidAttrSelectorMatcherValue)); + } + } + } +} + +impl Parse for Parser +where + I: ParserInput, +{ + fn parse(&mut self) -> PResult { + let span = self.input.cur_span()?; + + match cur!(self) { + tok!("ident") => { + let value = self.parse()?; + + Ok(AttributeSelectorModifier { + span: span!(self, span.lo), + value, + }) + } + _ => return Err(Error::new(span, ErrorKind::InvalidAttrSelectorModifier)), + } + } +} + +impl Parse for Parser +where + I: ParserInput, +{ + fn parse(&mut self) -> PResult { + let span = self.input.cur_span()?; + + expect!(self, ":"); + + if is!(self, Function) { + let fn_span = self.input.cur_span()?; + let name = bump!(self); + let names = match name { + Token::Function { value, raw } => (value, raw), + _ => unreachable!(), + }; + + let children = match &*names.0.to_ascii_lowercase() { + "nth-child" | "nth-last-child" | "nth-of-type" | "nth-last-of-type" => { + let state = self.input.state(); + let nth = self.parse(); + + match nth { + Ok(nth) => PseudoSelectorChildren::Nth(nth), + Err(_) => { + self.input.reset(&state); + + PseudoSelectorChildren::Tokens(self.parse_any_value()?) + } + } + } + _ => PseudoSelectorChildren::Tokens(self.parse_any_value()?), + }; + + expect!(self, ")"); + + return Ok(PseudoClassSelector { + span: span!(self, span.lo), + name: Ident { + span: Span::new(fn_span.lo, fn_span.hi - BytePos(1), Default::default()), + value: names.0, + raw: names.1, + }, + children: Some(children), + }); + } else if is!(self, Ident) { + let name = self.parse()?; + + return Ok(PseudoClassSelector { + span: span!(self, span.lo), + name, + children: None, + }); + } + + let span = self.input.cur_span()?; + + return Err(Error::new(span, ErrorKind::InvalidSelector)); + } +} + +impl Parse for Parser +where + I: ParserInput, +{ + fn parse(&mut self) -> PResult { + let span = self.input.cur_span()?; + + expect!(self, ":"); + expect!(self, ":"); + + if is!(self, Function) { + let fn_span = self.input.cur_span()?; + let name = bump!(self); + let names = match name { + Token::Function { value, raw } => (value, raw), + _ => unreachable!(), + }; + + let children = self.parse_any_value()?; + + expect!(self, ")"); + + return Ok(PseudoElementSelector { + span: span!(self, span.lo), + name: Ident { + span: Span::new(fn_span.lo, fn_span.hi - BytePos(1), Default::default()), + value: names.0, + raw: names.1, + }, + children: Some(children), + }); + } else if is!(self, Ident) { + let name = self.parse()?; + + return Ok(PseudoElementSelector { + span: span!(self, span.lo), + name, + children: None, + }); + } + + let span = self.input.cur_span()?; + + return Err(Error::new(span, ErrorKind::InvalidSelector)); + } +} + +impl Parse for Parser +where + I: ParserInput, +{ + fn parse(&mut self) -> PResult { self.input.skip_ws()?; let span = self.input.cur_span()?; let nth = match cur!(self) { // odd | even Token::Ident { value, .. } - if &(*value).to_ascii_lowercase() == "odd" - || &(*value).to_ascii_lowercase() == "even" => - { - let ident = self.parse()?; + if &(*value).to_ascii_lowercase() == "odd" + || &(*value).to_ascii_lowercase() == "even" => + { + let ident = self.parse()?; - NthValue::Ident(ident) - } + NthValue::Ident(ident) + } // Token::Num { .. } => { let num = match bump!(self) { @@ -633,7 +954,7 @@ where // self.input.skip_ws()?; // // // TODO: fix me - // selector_list = Some(self.parse_selectors()?); + // selector_list = Some(self.parse()?); // } // _ => {} // } @@ -643,229 +964,4 @@ where Ok(nth) } - - fn parse_pseudo_class_selector(&mut self) -> PResult { - let span = self.input.cur_span()?; - - expect!(self, ":"); // `:` - - if is!(self, Function) { - let fn_span = self.input.cur_span()?; - let name = bump!(self); - let names = match name { - Token::Function { value, raw } => (value, raw), - _ => unreachable!(), - }; - - let children = match &*names.0.to_ascii_lowercase() { - "nth-child" | "nth-last-child" | "nth-of-type" | "nth-last-of-type" => { - let state = self.input.state(); - let nth = self.parse_nth(); - - match nth { - Ok(nth) => PseudoSelectorChildren::Nth(nth), - Err(_) => { - self.input.reset(&state); - - PseudoSelectorChildren::Tokens(self.parse_any_value()?) - } - } - } - _ => PseudoSelectorChildren::Tokens(self.parse_any_value()?), - }; - - expect!(self, ")"); - - return Ok(PseudoClassSelector { - span: span!(self, span.lo), - name: Ident { - span: Span::new(fn_span.lo, fn_span.hi - BytePos(1), Default::default()), - value: names.0, - raw: names.1, - }, - children: Some(children), - }); - } else if is!(self, Ident) { - let name = self.parse()?; - - return Ok(PseudoClassSelector { - span: span!(self, span.lo), - name, - children: None, - }); - } - - let span = self.input.cur_span()?; - - return Err(Error::new(span, ErrorKind::InvalidSelector)); - } - - fn parse_pseudo_element_selector(&mut self) -> PResult { - let span = self.input.cur_span()?; - - expect!(self, ":"); // `:` - expect!(self, ":"); // `:` - - if is!(self, Function) { - let fn_span = self.input.cur_span()?; - let name = bump!(self); - let names = match name { - Token::Function { value, raw } => (value, raw), - _ => unreachable!(), - }; - - let children = self.parse_any_value()?; - - expect!(self, ")"); - - return Ok(PseudoElementSelector { - span: span!(self, span.lo), - name: Ident { - span: Span::new(fn_span.lo, fn_span.hi - BytePos(1), Default::default()), - value: names.0, - raw: names.1, - }, - children: Some(children), - }); - } else if is!(self, Ident) { - let name = self.parse()?; - - return Ok(PseudoElementSelector { - span: span!(self, span.lo), - name, - children: None, - }); - } - - let span = self.input.cur_span()?; - - return Err(Error::new(span, ErrorKind::InvalidSelector)); - } - - fn parse_subclass_selector(&mut self) -> PResult { - match cur!(self) { - tok!("#") => Ok(SubclassSelector::Id(self.parse_id_selector()?)), - tok!(".") => Ok(SubclassSelector::Class(self.parse_class_selector()?)), - tok!("[") => Ok(SubclassSelector::Attr(self.parse_attribute_selector()?)), - tok!(":") => Ok(SubclassSelector::PseudoClass( - self.parse_pseudo_class_selector()?, - )), - // TODO remove me from here - Token::AtKeyword { .. } if self.ctx.allow_at_selector => { - let span = self.input.cur_span()?; - - let values = match bump!(self) { - Token::AtKeyword { value, raw } => (value, raw), - _ => { - unreachable!() - } - }; - - Ok(SubclassSelector::At(AtSelector { - span, - text: Ident { - span, - value: values.0, - raw: values.1, - }, - })) - } - _ => { - let span = self.input.cur_span()?; - - return Err(Error::new( - span, - ErrorKind::Expected("id, class, attribute or pseudo-class selector"), - )); - } - } - } - - fn parse_compound_selector(&mut self) -> PResult { - let span = self.input.cur_span()?; - let start_pos = span.lo; - - let mut nesting_selector = None; - - // TODO: move under option, because it is draft - // This is an extension: https://drafts.csswg.org/css-nesting-1/ - if eat!(self, "&") { - nesting_selector = Some(NestingSelector { - span: span!(self, start_pos), - }); - } - - let type_selector = self.parse_type_selector()?; - let mut subclass_selectors = vec![]; - - loop { - if !(is!(self, "#") - || is!(self, ".") - || is!(self, "[") - || (is!(self, ":") && !peeked_is!(self, ":")) - // TODO remove `@` - || is!(self, "@")) - { - break; - } - - let subclass_selector = self.parse_subclass_selector()?; - - subclass_selectors.push(subclass_selector); - } - - loop { - if !(is!(self, ":") && peeked_is!(self, ":")) { - break; - } - - // TODO pseudo element is not subclass selector - let pseudo_element = - SubclassSelector::PseudoElement(self.parse_pseudo_element_selector()?); - - subclass_selectors.push(pseudo_element); - - loop { - if !(is!(self, ":") && !peeked_is!(self, ":")) { - break; - } - - let pseudo_element = - SubclassSelector::PseudoClass(self.parse_pseudo_class_selector()?); - - subclass_selectors.push(pseudo_element); - } - } - - let span = span!(self, start_pos); - - if nesting_selector.is_none() && type_selector.is_none() && subclass_selectors.is_empty() { - return Err(Error::new(span, ErrorKind::InvalidSelector)); - } - - Ok(CompoundSelector { - span, - nesting_selector, - type_selector, - subclass_selectors, - }) - } -} - -impl Parse for Parser -where - I: ParserInput, -{ - fn parse(&mut self) -> PResult { - self.parse_selectors() - } -} - -impl Parse for Parser -where - I: ParserInput, -{ - fn parse(&mut self) -> PResult { - self.parse_complex_selector() - } } diff --git a/crates/swc_css_parser/src/parser/style_rule.rs b/crates/swc_css_parser/src/parser/style_rule.rs index 25268b7a654..db42f3318f2 100644 --- a/crates/swc_css_parser/src/parser/style_rule.rs +++ b/crates/swc_css_parser/src/parser/style_rule.rs @@ -61,7 +61,7 @@ where let start_pos = self.input.cur_span()?.lo; let start_state = self.input.state(); - let prelude = self.parse_selectors(); + let prelude = self.parse(); let prelude = match prelude { Ok(v) => v, Err(err) => { diff --git a/crates/swc_css_parser/src/parser/util.rs b/crates/swc_css_parser/src/parser/util.rs index 63d805abc15..5f1c9d24700 100644 --- a/crates/swc_css_parser/src/parser/util.rs +++ b/crates/swc_css_parser/src/parser/util.rs @@ -1,4 +1,4 @@ -use super::{input::ParserInput, Ctx, Parser}; +use super::{input::ParserInput, Ctx, PResult, Parse, Parser}; use std::ops::{Deref, DerefMut}; use swc_common::Span; @@ -22,6 +22,14 @@ where inner: self, } } + + #[inline] + pub(super) fn parse_as(&mut self) -> PResult + where + Self: Parse, + { + self.parse() + } } pub(super) struct WithCtx<'w, I: 'w + ParserInput> { diff --git a/crates/swc_css_parser/tests/fixture.rs b/crates/swc_css_parser/tests/fixture.rs index 4da45688bfb..3724b49d183 100644 --- a/crates/swc_css_parser/tests/fixture.rs +++ b/crates/swc_css_parser/tests/fixture.rs @@ -281,20 +281,32 @@ macro_rules! mtd { impl Visit for SpanVisualizer<'_> { mtd!(AtRule, visit_at_rule); mtd!(AtSelector, visit_at_selector); - mtd!(AttrSelector, visit_attr_selector); mtd!(BinValue, visit_bin_value); - mtd!(ClassSelector, visit_class_selector); - mtd!(Delimiter, visit_delimiter); + mtd!(SelectorList, visit_selector_list); mtd!(ComplexSelector, visit_complex_selector); mtd!(Combinator, visit_combinator); mtd!(CompoundSelector, visit_compound_selector); + mtd!(TypeSelector, visit_type_selector); + mtd!(TagNameSelector, visit_tag_name_selector); + mtd!(NsPrefix, visit_ns_prefix); + mtd!(WqName, visit_wq_name); + mtd!(UniversalSelector, visit_universal_selector); + mtd!(IdSelector, visit_id_selector); + mtd!(ClassSelector, visit_class_selector); + mtd!(AttributeSelector, visit_attribute_selector); + mtd!(AttributeSelectorMatcher, visit_attribute_selector_matcher); + mtd!(AttributeSelectorValue, visit_attribute_selector_value); + mtd!(AttributeSelectorModifier, visit_attribute_selector_modifier); + mtd!(SubclassSelector, visit_subclass_selector); + mtd!(NestingSelector, visit_nesting_selector); + mtd!(PseudoClassSelector, visit_pseudo_class_selector); + mtd!(PseudoElementSelector, visit_pseudo_element_selector); + mtd!(AnPlusB, visit_an_plus_b); + mtd!(Delimiter, visit_delimiter); mtd!(Block, visit_block); mtd!(SimpleBlock, visit_simple_block); mtd!(Function, visit_function); mtd!(HexColor, visit_hex_color); - mtd!(NestingSelector, visit_nesting_selector); - mtd!(IdSelector, visit_id_selector); - mtd!(TypeSelector, visit_type_selector); mtd!(Number, visit_number); mtd!(Ratio, visit_ratio); mtd!(Percent, visit_percent); @@ -302,16 +314,10 @@ impl Visit for SpanVisualizer<'_> { mtd!(DeclarationName, visit_declaration_name); mtd!(ImportantFlag, visit_important_flag); mtd!(Nth, visit_nth); - mtd!(AnPlusB, visit_an_plus_b); - mtd!(PseudoClassSelector, visit_pseudo_class_selector); - mtd!(PseudoElementSelector, visit_pseudo_element_selector); mtd!(Rule, visit_rule); mtd!(Str, visit_str); mtd!(QualifiedRule, visit_qualified_rule); mtd!(Stylesheet, visit_stylesheet); - mtd!(SelectorList, visit_selector_list); - mtd!(SubclassSelector, visit_subclass_selector); - mtd!(TagSelector, visit_tag_selector); mtd!(Ident, visit_ident); mtd!(CustomIdent, visit_custom_ident); mtd!(DashedIdent, visit_dashed_ident); diff --git a/crates/swc_css_parser/tests/fixture/at-rule/layer/output.json b/crates/swc_css_parser/tests/fixture/at-rule/layer/output.json index a08536faa2e..12c2a0bb660 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/layer/output.json +++ b/crates/swc_css_parser/tests/fixture/at-rule/layer/output.json @@ -698,22 +698,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 417, "end": 423, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 417, "end": 423, "ctxt": 0 }, - "value": "strong", - "raw": "strong" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 417, + "end": 423, + "ctxt": 0 + }, + "value": "strong", + "raw": "strong" + } } }, "subclassSelectors": [] @@ -953,22 +961,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 530, "end": 532, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 530, "end": 532, "ctxt": 0 }, - "value": "h1", - "raw": "h1" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 530, + "end": 532, + "ctxt": 0 + }, + "value": "h1", + "raw": "h1" + } } }, "subclassSelectors": [] @@ -992,22 +1008,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 534, "end": 536, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 534, "end": 536, "ctxt": 0 }, - "value": "h2", - "raw": "h2" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 534, + "end": 536, + "ctxt": 0 + }, + "value": "h2", + "raw": "h2" + } } }, "subclassSelectors": [] @@ -1130,16 +1154,24 @@ "end": 592, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 585, "end": 591, "ctxt": 0 }, - "value": "hidden", - "raw": "hidden" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 585, + "end": 591, + "ctxt": 0 + }, + "value": "hidden", + "raw": "hidden" + } }, "matcher": null, "value": null, @@ -1283,22 +1315,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 663, "end": 664, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 663, "end": 664, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 663, + "end": 664, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -1429,22 +1469,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 725, "end": 726, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 725, "end": 726, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 725, + "end": 726, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -1569,22 +1617,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 865, "end": 875, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 865, "end": 875, "ctxt": 0 }, - "value": "blockquote", - "raw": "blockquote" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 865, + "end": 875, + "ctxt": 0 + }, + "value": "blockquote", + "raw": "blockquote" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/at-rule/layer/span.rust-debug b/crates/swc_css_parser/tests/fixture/at-rule/layer/span.rust-debug index 3fc33311296..9308647473d 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/layer/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/at-rule/layer/span.rust-debug @@ -730,6 +730,18 @@ error: TypeSelector 23 | strong { font-weight: bold; } | ^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/at-rule/layer/input.css:23:5 + | +23 | strong { font-weight: bold; } + | ^^^^^^ + +error: WqName + --> $DIR/tests/fixture/at-rule/layer/input.css:23:5 + | +23 | strong { font-weight: bold; } + | ^^^^^^ + error: Ident --> $DIR/tests/fixture/at-rule/layer/input.css:23:5 | @@ -988,6 +1000,18 @@ error: TypeSelector 30 | h1, h2 { color: maroon; } | ^^ +error: TagNameSelector + --> $DIR/tests/fixture/at-rule/layer/input.css:30:9 + | +30 | h1, h2 { color: maroon; } + | ^^ + +error: WqName + --> $DIR/tests/fixture/at-rule/layer/input.css:30:9 + | +30 | h1, h2 { color: maroon; } + | ^^ + error: Ident --> $DIR/tests/fixture/at-rule/layer/input.css:30:9 | @@ -1012,6 +1036,18 @@ error: TypeSelector 30 | h1, h2 { color: maroon; } | ^^ +error: TagNameSelector + --> $DIR/tests/fixture/at-rule/layer/input.css:30:13 + | +30 | h1, h2 { color: maroon; } + | ^^ + +error: WqName + --> $DIR/tests/fixture/at-rule/layer/input.css:30:13 + | +30 | h1, h2 { color: maroon; } + | ^^ + error: Ident --> $DIR/tests/fixture/at-rule/layer/input.css:30:13 | @@ -1132,12 +1168,18 @@ error: SubclassSelector 35 | [hidden] { display: none; } | ^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/at-rule/layer/input.css:35:5 | 35 | [hidden] { display: none; } | ^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/at-rule/layer/input.css:35:6 + | +35 | [hidden] { display: none; } + | ^^^^^^ + error: Ident --> $DIR/tests/fixture/at-rule/layer/input.css:35:6 | @@ -1312,6 +1354,18 @@ error: TypeSelector 40 | p { margin-block: 0.75em; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/at-rule/layer/input.css:40:9 + | +40 | p { margin-block: 0.75em; } + | ^ + +error: WqName + --> $DIR/tests/fixture/at-rule/layer/input.css:40:9 + | +40 | p { margin-block: 0.75em; } + | ^ + error: Ident --> $DIR/tests/fixture/at-rule/layer/input.css:40:9 | @@ -1444,6 +1498,18 @@ error: TypeSelector 44 | p { color: #222; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/at-rule/layer/input.css:44:9 + | +44 | p { color: #222; } + | ^ + +error: WqName + --> $DIR/tests/fixture/at-rule/layer/input.css:44:9 + | +44 | p { color: #222; } + | ^ + error: Ident --> $DIR/tests/fixture/at-rule/layer/input.css:44:9 | @@ -1573,6 +1639,18 @@ error: TypeSelector 50 | blockquote { color: rebeccapurple; } | ^^^^^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/at-rule/layer/input.css:50:5 + | +50 | blockquote { color: rebeccapurple; } + | ^^^^^^^^^^ + +error: WqName + --> $DIR/tests/fixture/at-rule/layer/input.css:50:5 + | +50 | blockquote { color: rebeccapurple; } + | ^^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/at-rule/layer/input.css:50:5 | diff --git a/crates/swc_css_parser/tests/fixture/at-rule/supports/output.json b/crates/swc_css_parser/tests/fixture/at-rule/supports/output.json index fb6a9b7e4c9..366accbe3c3 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/supports/output.json +++ b/crates/swc_css_parser/tests/fixture/at-rule/supports/output.json @@ -87,22 +87,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 32, "end": 35, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 32, "end": 35, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 32, + "end": 35, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -236,22 +244,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 102, "end": 106, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 102, "end": 106, "ctxt": 0 }, - "value": "body", - "raw": "body" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 102, + "end": 106, + "ctxt": 0 + }, + "value": "body", + "raw": "body" + } } }, "subclassSelectors": [] @@ -427,22 +443,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 188, "end": 195, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 188, "end": 195, "ctxt": 0 }, - "value": "article", - "raw": "article" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 188, + "end": 195, + "ctxt": 0 + }, + "value": "article", + "raw": "article" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/at-rule/supports/span.rust-debug b/crates/swc_css_parser/tests/fixture/at-rule/supports/span.rust-debug index b974629a820..c4d2bbf2b4b 100644 --- a/crates/swc_css_parser/tests/fixture/at-rule/supports/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/at-rule/supports/span.rust-debug @@ -134,6 +134,18 @@ error: TypeSelector 2 | div { | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/at-rule/supports/input.css:2:5 + | +2 | div { + | ^^^ + +error: WqName + --> $DIR/tests/fixture/at-rule/supports/input.css:2:5 + | +2 | div { + | ^^^ + error: Ident --> $DIR/tests/fixture/at-rule/supports/input.css:2:5 | @@ -309,6 +321,18 @@ error: TypeSelector 8 | body { | ^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/at-rule/supports/input.css:8:5 + | +8 | body { + | ^^^^ + +error: WqName + --> $DIR/tests/fixture/at-rule/supports/input.css:8:5 + | +8 | body { + | ^^^^ + error: Ident --> $DIR/tests/fixture/at-rule/supports/input.css:8:5 | @@ -508,6 +532,18 @@ error: TypeSelector 13 | article { | ^^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/at-rule/supports/input.css:13:9 + | +13 | article { + | ^^^^^^^ + +error: WqName + --> $DIR/tests/fixture/at-rule/supports/input.css:13:9 + | +13 | article { + | ^^^^^^^ + error: Ident --> $DIR/tests/fixture/at-rule/supports/input.css:13:9 | diff --git a/crates/swc_css_parser/tests/fixture/bom/output.json b/crates/swc_css_parser/tests/fixture/bom/output.json index 602d9a4d30d..fb0e29a1a1a 100644 --- a/crates/swc_css_parser/tests/fixture/bom/output.json +++ b/crates/swc_css_parser/tests/fixture/bom/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/bom/span.rust-debug b/crates/swc_css_parser/tests/fixture/bom/span.rust-debug index 054eae2b7f6..30b1762a7e7 100644 --- a/crates/swc_css_parser/tests/fixture/bom/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/bom/span.rust-debug @@ -46,6 +46,18 @@ error: TypeSelector 1 | a { | ^ +error: TagNameSelector + --> $DIR/tests/fixture/bom/input.css:1:1 + | +1 | a { + | ^ + +error: WqName + --> $DIR/tests/fixture/bom/input.css:1:1 + | +1 | a { + | ^ + error: Ident --> $DIR/tests/fixture/bom/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/comment/output.json b/crates/swc_css_parser/tests/fixture/comment/output.json index 3e2e0b9f015..18cd4eb2a10 100644 --- a/crates/swc_css_parser/tests/fixture/comment/output.json +++ b/crates/swc_css_parser/tests/fixture/comment/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 13, "end": 14, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 13, "end": 14, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 13, + "end": 14, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -136,22 +144,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 132, "end": 135, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 132, "end": 135, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 132, + "end": 135, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -265,22 +281,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 237, "end": 238, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 237, "end": 238, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 237, + "end": 238, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/comment/span.rust-debug b/crates/swc_css_parser/tests/fixture/comment/span.rust-debug index ea2123aec49..f4068d5a8e3 100644 --- a/crates/swc_css_parser/tests/fixture/comment/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/comment/span.rust-debug @@ -55,6 +55,18 @@ error: TypeSelector 1 | /* comment */a/* comment */ | ^ +error: TagNameSelector + --> $DIR/tests/fixture/comment/input.css:1:14 + | +1 | /* comment */a/* comment */ + | ^ + +error: WqName + --> $DIR/tests/fixture/comment/input.css:1:14 + | +1 | /* comment */a/* comment */ + | ^ + error: Ident --> $DIR/tests/fixture/comment/input.css:1:14 | @@ -147,6 +159,18 @@ error: TypeSelector 9 | div { | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/comment/input.css:9:1 + | +9 | div { + | ^^^ + +error: WqName + --> $DIR/tests/fixture/comment/input.css:9:1 + | +9 | div { + | ^^^ + error: Ident --> $DIR/tests/fixture/comment/input.css:9:1 | @@ -268,6 +292,18 @@ error: TypeSelector 18 | a { | ^ +error: TagNameSelector + --> $DIR/tests/fixture/comment/input.css:18:1 + | +18 | a { + | ^ + +error: WqName + --> $DIR/tests/fixture/comment/input.css:18:1 + | +18 | a { + | ^ + error: Ident --> $DIR/tests/fixture/comment/input.css:18:1 | diff --git a/crates/swc_css_parser/tests/fixture/dashed-ident/output.json b/crates/swc_css_parser/tests/fixture/dashed-ident/output.json index ec069431a58..6c663603e71 100644 --- a/crates/swc_css_parser/tests/fixture/dashed-ident/output.json +++ b/crates/swc_css_parser/tests/fixture/dashed-ident/output.json @@ -348,22 +348,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 98, "end": 100, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 98, "end": 100, "ctxt": 0 }, - "value": "h1", - "raw": "h1" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 98, + "end": 100, + "ctxt": 0 + }, + "value": "h1", + "raw": "h1" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/dashed-ident/span.rust-debug b/crates/swc_css_parser/tests/fixture/dashed-ident/span.rust-debug index 42ab13aea01..7ae35ddccf1 100644 --- a/crates/swc_css_parser/tests/fixture/dashed-ident/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/dashed-ident/span.rust-debug @@ -313,6 +313,18 @@ error: TypeSelector 10 | #foo h1 { | ^^ +error: TagNameSelector + --> $DIR/tests/fixture/dashed-ident/input.css:10:6 + | +10 | #foo h1 { + | ^^ + +error: WqName + --> $DIR/tests/fixture/dashed-ident/input.css:10:6 + | +10 | #foo h1 { + | ^^ + error: Ident --> $DIR/tests/fixture/dashed-ident/input.css:10:6 | diff --git a/crates/swc_css_parser/tests/fixture/declaration-list/output.json b/crates/swc_css_parser/tests/fixture/declaration-list/output.json index 4d1edd03f0e..e2601af6e1a 100644 --- a/crates/swc_css_parser/tests/fixture/declaration-list/output.json +++ b/crates/swc_css_parser/tests/fixture/declaration-list/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/declaration-list/span.rust-debug b/crates/swc_css_parser/tests/fixture/declaration-list/span.rust-debug index 9567930f576..45cbce0a3dc 100644 --- a/crates/swc_css_parser/tests/fixture/declaration-list/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/declaration-list/span.rust-debug @@ -49,6 +49,18 @@ error: TypeSelector 1 | a { | ^ +error: TagNameSelector + --> $DIR/tests/fixture/declaration-list/input.css:1:1 + | +1 | a { + | ^ + +error: WqName + --> $DIR/tests/fixture/declaration-list/input.css:1:1 + | +1 | a { + | ^ + error: Ident --> $DIR/tests/fixture/declaration-list/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/declaration/output.json b/crates/swc_css_parser/tests/fixture/declaration/output.json index f97977dceec..70ab181af93 100644 --- a/crates/swc_css_parser/tests/fixture/declaration/output.json +++ b/crates/swc_css_parser/tests/fixture/declaration/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/declaration/span.rust-debug b/crates/swc_css_parser/tests/fixture/declaration/span.rust-debug index a79595789ca..270df2a495c 100644 --- a/crates/swc_css_parser/tests/fixture/declaration/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/declaration/span.rust-debug @@ -58,6 +58,18 @@ error: TypeSelector 1 | div { | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/declaration/input.css:1:1 + | +1 | div { + | ^^^ + +error: WqName + --> $DIR/tests/fixture/declaration/input.css:1:1 + | +1 | div { + | ^^^ + error: Ident --> $DIR/tests/fixture/declaration/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/delim/backslash/output.json b/crates/swc_css_parser/tests/fixture/delim/backslash/output.json index 60385d071b9..9d1c53ef1ce 100644 --- a/crates/swc_css_parser/tests/fixture/delim/backslash/output.json +++ b/crates/swc_css_parser/tests/fixture/delim/backslash/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/delim/backslash/span.rust-debug b/crates/swc_css_parser/tests/fixture/delim/backslash/span.rust-debug index 912133b0815..c548438f487 100644 --- a/crates/swc_css_parser/tests/fixture/delim/backslash/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/delim/backslash/span.rust-debug @@ -46,6 +46,18 @@ error: TypeSelector 1 | a { | ^ +error: TagNameSelector + --> $DIR/tests/fixture/delim/backslash/input.css:1:1 + | +1 | a { + | ^ + +error: WqName + --> $DIR/tests/fixture/delim/backslash/input.css:1:1 + | +1 | a { + | ^ + error: Ident --> $DIR/tests/fixture/delim/backslash/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/dimension/basic/output.json b/crates/swc_css_parser/tests/fixture/dimension/basic/output.json index 3804d7ccf58..42c05a5ff2f 100644 --- a/crates/swc_css_parser/tests/fixture/dimension/basic/output.json +++ b/crates/swc_css_parser/tests/fixture/dimension/basic/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/dimension/basic/span.rust-debug b/crates/swc_css_parser/tests/fixture/dimension/basic/span.rust-debug index 6d2b695a3c6..f3ff4ce6314 100644 --- a/crates/swc_css_parser/tests/fixture/dimension/basic/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/dimension/basic/span.rust-debug @@ -58,6 +58,18 @@ error: TypeSelector 1 | a { | ^ +error: TagNameSelector + --> $DIR/tests/fixture/dimension/basic/input.css:1:1 + | +1 | a { + | ^ + +error: WqName + --> $DIR/tests/fixture/dimension/basic/input.css:1:1 + | +1 | a { + | ^ + error: Ident --> $DIR/tests/fixture/dimension/basic/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/-4j83DwgJa0nPQIjlb0RIA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/-4j83DwgJa0nPQIjlb0RIA/output.json index 218976ebb3d..133afb7d46e 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/-4j83DwgJa0nPQIjlb0RIA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/-4j83DwgJa0nPQIjlb0RIA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/-4j83DwgJa0nPQIjlb0RIA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/-4j83DwgJa0nPQIjlb0RIA/span.rust-debug index ef22101d235..9e13ab81b26 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/-4j83DwgJa0nPQIjlb0RIA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/-4j83DwgJa0nPQIjlb0RIA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #112333 } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/-4j83DwgJa0nPQIjlb0RIA/input.css:1:1 + | +1 | a { color: #112333 } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/-4j83DwgJa0nPQIjlb0RIA/input.css:1:1 + | +1 | a { color: #112333 } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/-4j83DwgJa0nPQIjlb0RIA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/-8o_H6sq86TDAHqF7YO0hg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/-8o_H6sq86TDAHqF7YO0hg/output.json index 397f624caab..37c53c0121c 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/-8o_H6sq86TDAHqF7YO0hg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/-8o_H6sq86TDAHqF7YO0hg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 4, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 4, "ctxt": 0 }, - "value": "-", - "raw": "\\2d " + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 4, + "ctxt": 0 + }, + "value": "-", + "raw": "\\2d " + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/-8o_H6sq86TDAHqF7YO0hg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/-8o_H6sq86TDAHqF7YO0hg/span.rust-debug index 1f8ddeb50e1..e7fa0bddf8c 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/-8o_H6sq86TDAHqF7YO0hg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/-8o_H6sq86TDAHqF7YO0hg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | \2d {} | ^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/-8o_H6sq86TDAHqF7YO0hg/input.css:1:1 + | +1 | \2d {} + | ^^^^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/-8o_H6sq86TDAHqF7YO0hg/input.css:1:1 + | +1 | \2d {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/-8o_H6sq86TDAHqF7YO0hg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/-GZJfOA9TK6La2KGGNgCkg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/-GZJfOA9TK6La2KGGNgCkg/output.json index bb08fd6b7b5..f98bfc5ef13 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/-GZJfOA9TK6La2KGGNgCkg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/-GZJfOA9TK6La2KGGNgCkg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [ diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/-GZJfOA9TK6La2KGGNgCkg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/-GZJfOA9TK6La2KGGNgCkg/span.rust-debug index 772af5b22fd..de883b86863 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/-GZJfOA9TK6La2KGGNgCkg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/-GZJfOA9TK6La2KGGNgCkg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | div::before::after::selection::first-line::first-letter {color:red} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/-GZJfOA9TK6La2KGGNgCkg/input.css:1:1 + | +1 | div::before::after::selection::first-line::first-letter {color:red} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/-GZJfOA9TK6La2KGGNgCkg/input.css:1:1 + | +1 | div::before::after::selection::first-line::first-letter {color:red} + | ^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/-GZJfOA9TK6La2KGGNgCkg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/-JoxoRcnA-zaaEC7RjXKvQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/-JoxoRcnA-zaaEC7RjXKvQ/output.json index 2ba426e2b02..7529ce9f7ec 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/-JoxoRcnA-zaaEC7RjXKvQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/-JoxoRcnA-zaaEC7RjXKvQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/-JoxoRcnA-zaaEC7RjXKvQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/-JoxoRcnA-zaaEC7RjXKvQ/span.rust-debug index b808c1d9620..0162c0f216d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/-JoxoRcnA-zaaEC7RjXKvQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/-JoxoRcnA-zaaEC7RjXKvQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: +.10; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/-JoxoRcnA-zaaEC7RjXKvQ/input.css:1:1 + | +1 | a { width: +.10; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/-JoxoRcnA-zaaEC7RjXKvQ/input.css:1:1 + | +1 | a { width: +.10; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/-JoxoRcnA-zaaEC7RjXKvQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/-edvtxlXMemv5jnGeyueBA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/-edvtxlXMemv5jnGeyueBA/output.json index bfc2e0af62b..6f51ccc13c9 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/-edvtxlXMemv5jnGeyueBA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/-edvtxlXMemv5jnGeyueBA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/-edvtxlXMemv5jnGeyueBA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/-edvtxlXMemv5jnGeyueBA/span.rust-debug index a75043333ce..1a9e942969c 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/-edvtxlXMemv5jnGeyueBA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/-edvtxlXMemv5jnGeyueBA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: -.10%; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/-edvtxlXMemv5jnGeyueBA/input.css:1:1 + | +1 | a { width: -.10%; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/-edvtxlXMemv5jnGeyueBA/input.css:1:1 + | +1 | a { width: -.10%; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/-edvtxlXMemv5jnGeyueBA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/-gboAEi1zyjFW5mtEM24Rg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/-gboAEi1zyjFW5mtEM24Rg/output.json index d5aaaa16cf5..cfe7f4c478a 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/-gboAEi1zyjFW5mtEM24Rg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/-gboAEi1zyjFW5mtEM24Rg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/-gboAEi1zyjFW5mtEM24Rg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/-gboAEi1zyjFW5mtEM24Rg/span.rust-debug index a338931f940..01067d606f2 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/-gboAEi1zyjFW5mtEM24Rg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/-gboAEi1zyjFW5mtEM24Rg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { box-shadow: rgb(255, 0, 17) 0 0 1 inset } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/-gboAEi1zyjFW5mtEM24Rg/input.css:1:1 + | +1 | a { box-shadow: rgb(255, 0, 17) 0 0 1 inset } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/-gboAEi1zyjFW5mtEM24Rg/input.css:1:1 + | +1 | a { box-shadow: rgb(255, 0, 17) 0 0 1 inset } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/-gboAEi1zyjFW5mtEM24Rg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/-shTP60AAG6a4mCJUpV1cQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/-shTP60AAG6a4mCJUpV1cQ/output.json index 6ee422ebec5..abb84c9429f 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/-shTP60AAG6a4mCJUpV1cQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/-shTP60AAG6a4mCJUpV1cQ/output.json @@ -46,25 +46,41 @@ "end": 5, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 1, - "end": 2, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - }, - "name": { - "type": "Identifier", - "span": { - "start": 3, "end": 4, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 1, + "end": 3, + "ctxt": 0 + }, + "prefix": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "*", + "raw": "*" + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 3, + "end": 4, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } }, "matcher": null, "value": null, diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/-shTP60AAG6a4mCJUpV1cQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/-shTP60AAG6a4mCJUpV1cQ/span.rust-debug index 2cbf09cab87..788ba9d271d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/-shTP60AAG6a4mCJUpV1cQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/-shTP60AAG6a4mCJUpV1cQ/span.rust-debug @@ -40,12 +40,24 @@ error: SubclassSelector 1 | [*|b]{} | ^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/-shTP60AAG6a4mCJUpV1cQ/input.css:1:1 | 1 | [*|b]{} | ^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/-shTP60AAG6a4mCJUpV1cQ/input.css:1:2 + | +1 | [*|b]{} + | ^^^ + +error: NsPrefix + --> $DIR/tests/fixture/esbuild/misc/-shTP60AAG6a4mCJUpV1cQ/input.css:1:2 + | +1 | [*|b]{} + | ^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/-shTP60AAG6a4mCJUpV1cQ/input.css:1:2 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/07tvJxvZrgDeTmptOclErA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/07tvJxvZrgDeTmptOclErA/output.json index f3190b6c823..6bfe41276bd 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/07tvJxvZrgDeTmptOclErA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/07tvJxvZrgDeTmptOclErA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/07tvJxvZrgDeTmptOclErA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/07tvJxvZrgDeTmptOclErA/span.rust-debug index 783c47f1af1..194f6931369 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/07tvJxvZrgDeTmptOclErA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/07tvJxvZrgDeTmptOclErA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { margin: 0 1 0 1 } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/07tvJxvZrgDeTmptOclErA/input.css:1:1 + | +1 | a { margin: 0 1 0 1 } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/07tvJxvZrgDeTmptOclErA/input.css:1:1 + | +1 | a { margin: 0 1 0 1 } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/07tvJxvZrgDeTmptOclErA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/0LKvnY2GhG7ss8EXa0t6tQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/0LKvnY2GhG7ss8EXa0t6tQ/output.json index 231f43c7849..8c2384b42a5 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/0LKvnY2GhG7ss8EXa0t6tQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/0LKvnY2GhG7ss8EXa0t6tQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/0LKvnY2GhG7ss8EXa0t6tQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/0LKvnY2GhG7ss8EXa0t6tQ/span.rust-debug index 39c94690e52..9779a80897f 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/0LKvnY2GhG7ss8EXa0t6tQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/0LKvnY2GhG7ss8EXa0t6tQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: 10p\32x } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/0LKvnY2GhG7ss8EXa0t6tQ/input.css:1:1 + | +1 | a { value: 10p\32x } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/0LKvnY2GhG7ss8EXa0t6tQ/input.css:1:1 + | +1 | a { value: 10p\32x } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/0LKvnY2GhG7ss8EXa0t6tQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/0Zlgi2sdsFfTrdnWOHUqeg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/0Zlgi2sdsFfTrdnWOHUqeg/output.json index 1e82abd189b..ff180e2b71b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/0Zlgi2sdsFfTrdnWOHUqeg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/0Zlgi2sdsFfTrdnWOHUqeg/output.json @@ -46,18 +46,34 @@ "end": 8, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 2, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 2, + "end": 3, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/0Zlgi2sdsFfTrdnWOHUqeg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/0Zlgi2sdsFfTrdnWOHUqeg/span.rust-debug index d36e13f79b0..fbefacbd7aa 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/0Zlgi2sdsFfTrdnWOHUqeg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/0Zlgi2sdsFfTrdnWOHUqeg/span.rust-debug @@ -40,18 +40,36 @@ error: SubclassSelector 1 | [b="0c"] {} | ^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/0Zlgi2sdsFfTrdnWOHUqeg/input.css:1:1 | 1 | [b="0c"] {} | ^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/0Zlgi2sdsFfTrdnWOHUqeg/input.css:1:2 + | +1 | [b="0c"] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/0Zlgi2sdsFfTrdnWOHUqeg/input.css:1:2 | 1 | [b="0c"] {} | ^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/0Zlgi2sdsFfTrdnWOHUqeg/input.css:1:3 + | +1 | [b="0c"] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/0Zlgi2sdsFfTrdnWOHUqeg/input.css:1:4 + | +1 | [b="0c"] {} + | ^^^^ + error: Str --> $DIR/tests/fixture/esbuild/misc/0Zlgi2sdsFfTrdnWOHUqeg/input.css:1:4 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/0yo6flt6jo-UA8rUEFjrWA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/0yo6flt6jo-UA8rUEFjrWA/output.json index 6596569a2fb..b447471cbe4 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/0yo6flt6jo-UA8rUEFjrWA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/0yo6flt6jo-UA8rUEFjrWA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 5, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 5, "ctxt": 0 }, - "value": "--", - "raw": "-\\2d " + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 5, + "ctxt": 0 + }, + "value": "--", + "raw": "-\\2d " + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/0yo6flt6jo-UA8rUEFjrWA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/0yo6flt6jo-UA8rUEFjrWA/span.rust-debug index 595276b559c..deea12f5d9a 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/0yo6flt6jo-UA8rUEFjrWA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/0yo6flt6jo-UA8rUEFjrWA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | -\2d {} | ^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/0yo6flt6jo-UA8rUEFjrWA/input.css:1:1 + | +1 | -\2d {} + | ^^^^^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/0yo6flt6jo-UA8rUEFjrWA/input.css:1:1 + | +1 | -\2d {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/0yo6flt6jo-UA8rUEFjrWA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/10VLLYwNo7xaTisP9r9Kfg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/10VLLYwNo7xaTisP9r9Kfg/output.json index 4c326f7af0b..7ff0746eb78 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/10VLLYwNo7xaTisP9r9Kfg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/10VLLYwNo7xaTisP9r9Kfg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [ diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/10VLLYwNo7xaTisP9r9Kfg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/10VLLYwNo7xaTisP9r9Kfg/span.rust-debug index 1f8be19f23a..4d1cd554eb8 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/10VLLYwNo7xaTisP9r9Kfg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/10VLLYwNo7xaTisP9r9Kfg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | div#id {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/10VLLYwNo7xaTisP9r9Kfg/input.css:1:1 + | +1 | div#id {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/10VLLYwNo7xaTisP9r9Kfg/input.css:1:1 + | +1 | div#id {} + | ^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/10VLLYwNo7xaTisP9r9Kfg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/12EwJCu6DsfOEJubQW9jLg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/12EwJCu6DsfOEJubQW9jLg/output.json index 4f2fbf30fc9..b479160d2e4 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/12EwJCu6DsfOEJubQW9jLg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/12EwJCu6DsfOEJubQW9jLg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/12EwJCu6DsfOEJubQW9jLg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/12EwJCu6DsfOEJubQW9jLg/span.rust-debug index 01a78db5342..1fb014bac2f 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/12EwJCu6DsfOEJubQW9jLg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/12EwJCu6DsfOEJubQW9jLg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { border-radius: 1 2 3 4; border-top-right-radius: 5 6; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/12EwJCu6DsfOEJubQW9jLg/input.css:1:1 + | +1 | a { border-radius: 1 2 3 4; border-top-right-radius: 5 6; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/12EwJCu6DsfOEJubQW9jLg/input.css:1:1 + | +1 | a { border-radius: 1 2 3 4; border-top-right-radius: 5 6; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/12EwJCu6DsfOEJubQW9jLg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/1naykwaIKZc6zuHRNIccLQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/1naykwaIKZc6zuHRNIccLQ/output.json index a5d17a85f84..2e61b9fe6d1 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/1naykwaIKZc6zuHRNIccLQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/1naykwaIKZc6zuHRNIccLQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/1naykwaIKZc6zuHRNIccLQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/1naykwaIKZc6zuHRNIccLQ/span.rust-debug index 6df3b74d936..4088174ee2d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/1naykwaIKZc6zuHRNIccLQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/1naykwaIKZc6zuHRNIccLQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: id\65nt } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/1naykwaIKZc6zuHRNIccLQ/input.css:1:1 + | +1 | a { value: id\65nt } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/1naykwaIKZc6zuHRNIccLQ/input.css:1:1 + | +1 | a { value: id\65nt } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/1naykwaIKZc6zuHRNIccLQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/2nNBhRWO2cNcBJf09zDxjw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/2nNBhRWO2cNcBJf09zDxjw/output.json index d2bbe8e55fd..812eb0e3a7f 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/2nNBhRWO2cNcBJf09zDxjw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/2nNBhRWO2cNcBJf09zDxjw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/2nNBhRWO2cNcBJf09zDxjw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/2nNBhRWO2cNcBJf09zDxjw/span.rust-debug index 1ecda7ff2aa..d7bf2539507 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/2nNBhRWO2cNcBJf09zDxjw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/2nNBhRWO2cNcBJf09zDxjw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a:after { content: 'a\ b' } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/2nNBhRWO2cNcBJf09zDxjw/input.css:1:1 + | +1 | a:after { content: 'a\ b' } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/2nNBhRWO2cNcBJf09zDxjw/input.css:1:1 + | +1 | a:after { content: 'a\ b' } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/2nNBhRWO2cNcBJf09zDxjw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/36qnNuIUvbIrMnJKDxwE5A/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/36qnNuIUvbIrMnJKDxwE5A/output.json index ad9fcae52ef..6e52a56fc6f 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/36qnNuIUvbIrMnJKDxwE5A/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/36qnNuIUvbIrMnJKDxwE5A/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/36qnNuIUvbIrMnJKDxwE5A/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/36qnNuIUvbIrMnJKDxwE5A/span.rust-debug index 6d417c28869..2dd2178663b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/36qnNuIUvbIrMnJKDxwE5A/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/36qnNuIUvbIrMnJKDxwE5A/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: \66n() } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/36qnNuIUvbIrMnJKDxwE5A/input.css:1:1 + | +1 | a { value: \66n() } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/36qnNuIUvbIrMnJKDxwE5A/input.css:1:1 + | +1 | a { value: \66n() } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/36qnNuIUvbIrMnJKDxwE5A/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/39pbt1sIeFh8WWhCalZS4g/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/39pbt1sIeFh8WWhCalZS4g/output.json index 6048f50bc82..13d64cf00d5 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/39pbt1sIeFh8WWhCalZS4g/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/39pbt1sIeFh8WWhCalZS4g/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/39pbt1sIeFh8WWhCalZS4g/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/39pbt1sIeFh8WWhCalZS4g/span.rust-debug index baab9caca8d..1176ff6303d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/39pbt1sIeFh8WWhCalZS4g/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/39pbt1sIeFh8WWhCalZS4g/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #ABCD } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/39pbt1sIeFh8WWhCalZS4g/input.css:1:1 + | +1 | a { color: #ABCD } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/39pbt1sIeFh8WWhCalZS4g/input.css:1:1 + | +1 | a { color: #ABCD } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/39pbt1sIeFh8WWhCalZS4g/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/3EgMpLwjJNG0ht4U_r6cnw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/3EgMpLwjJNG0ht4U_r6cnw/output.json index 55b0bb10d1a..a5d813c9de3 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/3EgMpLwjJNG0ht4U_r6cnw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/3EgMpLwjJNG0ht4U_r6cnw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/3EgMpLwjJNG0ht4U_r6cnw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/3EgMpLwjJNG0ht4U_r6cnw/span.rust-debug index e64f11e4ea8..f44be87a17f 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/3EgMpLwjJNG0ht4U_r6cnw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/3EgMpLwjJNG0ht4U_r6cnw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #ABBBCCDD } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/3EgMpLwjJNG0ht4U_r6cnw/input.css:1:1 + | +1 | a { color: #ABBBCCDD } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/3EgMpLwjJNG0ht4U_r6cnw/input.css:1:1 + | +1 | a { color: #ABBBCCDD } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/3EgMpLwjJNG0ht4U_r6cnw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/3JGye8AhworwNFoUL1gKbg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/3JGye8AhworwNFoUL1gKbg/output.json index d72b9c0b32f..bd0079492d0 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/3JGye8AhworwNFoUL1gKbg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/3JGye8AhworwNFoUL1gKbg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/3JGye8AhworwNFoUL1gKbg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/3JGye8AhworwNFoUL1gKbg/span.rust-debug index ad2f88bed2b..7e2687ab7b0 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/3JGye8AhworwNFoUL1gKbg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/3JGye8AhworwNFoUL1gKbg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #abcf } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/3JGye8AhworwNFoUL1gKbg/input.css:1:1 + | +1 | a { color: #abcf } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/3JGye8AhworwNFoUL1gKbg/input.css:1:1 + | +1 | a { color: #abcf } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/3JGye8AhworwNFoUL1gKbg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/3OV2jH0hrt2_2jOv6t4wvA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/3OV2jH0hrt2_2jOv6t4wvA/output.json index d58f72ab776..c70159a615d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/3OV2jH0hrt2_2jOv6t4wvA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/3OV2jH0hrt2_2jOv6t4wvA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/3OV2jH0hrt2_2jOv6t4wvA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/3OV2jH0hrt2_2jOv6t4wvA/span.rust-debug index 995016e7fd1..645d7478cfd 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/3OV2jH0hrt2_2jOv6t4wvA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/3OV2jH0hrt2_2jOv6t4wvA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: 0.1%; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/3OV2jH0hrt2_2jOv6t4wvA/input.css:1:1 + | +1 | a { width: 0.1%; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/3OV2jH0hrt2_2jOv6t4wvA/input.css:1:1 + | +1 | a { width: 0.1%; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/3OV2jH0hrt2_2jOv6t4wvA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/485Ns9qQHa89OJU5Lhjx-Q/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/485Ns9qQHa89OJU5Lhjx-Q/output.json index 5f092b7530c..60f80338346 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/485Ns9qQHa89OJU5Lhjx-Q/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/485Ns9qQHa89OJU5Lhjx-Q/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/485Ns9qQHa89OJU5Lhjx-Q/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/485Ns9qQHa89OJU5Lhjx-Q/span.rust-debug index d5b00232411..f24b5d8e4dd 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/485Ns9qQHa89OJU5Lhjx-Q/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/485Ns9qQHa89OJU5Lhjx-Q/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: \69 dent } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/485Ns9qQHa89OJU5Lhjx-Q/input.css:1:1 + | +1 | a { value: \69 dent } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/485Ns9qQHa89OJU5Lhjx-Q/input.css:1:1 + | +1 | a { value: \69 dent } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/485Ns9qQHa89OJU5Lhjx-Q/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/486QvEO8dmLFsXYp6xgKVw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/486QvEO8dmLFsXYp6xgKVw/output.json index 56db40642f3..1bdbf5a2ea3 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/486QvEO8dmLFsXYp6xgKVw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/486QvEO8dmLFsXYp6xgKVw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/486QvEO8dmLFsXYp6xgKVw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/486QvEO8dmLFsXYp6xgKVw/span.rust-debug index 3f276156f99..35520ffc0c2 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/486QvEO8dmLFsXYp6xgKVw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/486QvEO8dmLFsXYp6xgKVw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: #\30hash } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/486QvEO8dmLFsXYp6xgKVw/input.css:1:1 + | +1 | a { value: #\30hash } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/486QvEO8dmLFsXYp6xgKVw/input.css:1:1 + | +1 | a { value: #\30hash } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/486QvEO8dmLFsXYp6xgKVw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/4Tjjgepnha63E4UiXXDNEA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/4Tjjgepnha63E4UiXXDNEA/output.json index 29b64c9398a..f0fd66e93ed 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/4Tjjgepnha63E4UiXXDNEA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/4Tjjgepnha63E4UiXXDNEA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/4Tjjgepnha63E4UiXXDNEA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/4Tjjgepnha63E4UiXXDNEA/span.rust-debug index 70597b66c17..49b770b0b93 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/4Tjjgepnha63E4UiXXDNEA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/4Tjjgepnha63E4UiXXDNEA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: 0.0; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/4Tjjgepnha63E4UiXXDNEA/input.css:1:1 + | +1 | a { width: 0.0; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/4Tjjgepnha63E4UiXXDNEA/input.css:1:1 + | +1 | a { width: 0.0; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/4Tjjgepnha63E4UiXXDNEA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/4UaOTazLwrr9gd5xkBBlnw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/4UaOTazLwrr9gd5xkBBlnw/output.json index b5aa7f97b76..4f7dfb10e75 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/4UaOTazLwrr9gd5xkBBlnw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/4UaOTazLwrr9gd5xkBBlnw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/4UaOTazLwrr9gd5xkBBlnw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/4UaOTazLwrr9gd5xkBBlnw/span.rust-debug index 40cd6987be3..5053c4e85c2 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/4UaOTazLwrr9gd5xkBBlnw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/4UaOTazLwrr9gd5xkBBlnw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a/**/.b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/4UaOTazLwrr9gd5xkBBlnw/input.css:1:1 + | +1 | a/**/.b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/4UaOTazLwrr9gd5xkBBlnw/input.css:1:1 + | +1 | a/**/.b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/4UaOTazLwrr9gd5xkBBlnw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/4WSp4-HbKB-f1GLF00sf6A/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/4WSp4-HbKB-f1GLF00sf6A/output.json index d650f37e087..28ccc3f385d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/4WSp4-HbKB-f1GLF00sf6A/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/4WSp4-HbKB-f1GLF00sf6A/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/4WSp4-HbKB-f1GLF00sf6A/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/4WSp4-HbKB-f1GLF00sf6A/span.rust-debug index c669df57b55..67f4ebf29d4 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/4WSp4-HbKB-f1GLF00sf6A/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/4WSp4-HbKB-f1GLF00sf6A/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { padding: 0 1 0px 1px } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/4WSp4-HbKB-f1GLF00sf6A/input.css:1:1 + | +1 | a { padding: 0 1 0px 1px } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/4WSp4-HbKB-f1GLF00sf6A/input.css:1:1 + | +1 | a { padding: 0 1 0px 1px } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/4WSp4-HbKB-f1GLF00sf6A/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/52obp49U0CyYOskQAEoIJw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/52obp49U0CyYOskQAEoIJw/output.json index 0b4b6f9bcdb..cf42a042e01 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/52obp49U0CyYOskQAEoIJw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/52obp49U0CyYOskQAEoIJw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [ diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/52obp49U0CyYOskQAEoIJw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/52obp49U0CyYOskQAEoIJw/span.rust-debug index a026a99e378..9f85a241096 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/52obp49U0CyYOskQAEoIJw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/52obp49U0CyYOskQAEoIJw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | div#--0 {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/52obp49U0CyYOskQAEoIJw/input.css:1:1 + | +1 | div#--0 {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/52obp49U0CyYOskQAEoIJw/input.css:1:1 + | +1 | div#--0 {} + | ^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/52obp49U0CyYOskQAEoIJw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/53OltIbJ-YBXtSKedVvYwA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/53OltIbJ-YBXtSKedVvYwA/output.json index 40934fd52ff..1cb9b35beec 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/53OltIbJ-YBXtSKedVvYwA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/53OltIbJ-YBXtSKedVvYwA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/53OltIbJ-YBXtSKedVvYwA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/53OltIbJ-YBXtSKedVvYwA/span.rust-debug index a35425276d3..6686c20c440 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/53OltIbJ-YBXtSKedVvYwA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/53OltIbJ-YBXtSKedVvYwA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: 10\2cx } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/53OltIbJ-YBXtSKedVvYwA/input.css:1:1 + | +1 | a { value: 10\2cx } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/53OltIbJ-YBXtSKedVvYwA/input.css:1:1 + | +1 | a { value: 10\2cx } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/53OltIbJ-YBXtSKedVvYwA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/54mhLGCwQMwsuiVkiTzAAQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/54mhLGCwQMwsuiVkiTzAAQ/output.json index d4a99aa8f76..b409bcd2f40 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/54mhLGCwQMwsuiVkiTzAAQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/54mhLGCwQMwsuiVkiTzAAQ/output.json @@ -46,18 +46,34 @@ "end": 11, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 5, "ctxt": 0 }, - "value": "attr", - "raw": "attr" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 5, + "ctxt": 0 + }, + "value": "attr", + "raw": "attr" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 5, + "end": 6, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/54mhLGCwQMwsuiVkiTzAAQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/54mhLGCwQMwsuiVkiTzAAQ/span.rust-debug index a1ed240af5e..3f7ece5c630 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/54mhLGCwQMwsuiVkiTzAAQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/54mhLGCwQMwsuiVkiTzAAQ/span.rust-debug @@ -40,18 +40,36 @@ error: SubclassSelector 1 | [attr="-a"] {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/54mhLGCwQMwsuiVkiTzAAQ/input.css:1:1 | 1 | [attr="-a"] {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/54mhLGCwQMwsuiVkiTzAAQ/input.css:1:2 + | +1 | [attr="-a"] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/54mhLGCwQMwsuiVkiTzAAQ/input.css:1:2 | 1 | [attr="-a"] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/54mhLGCwQMwsuiVkiTzAAQ/input.css:1:6 + | +1 | [attr="-a"] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/54mhLGCwQMwsuiVkiTzAAQ/input.css:1:7 + | +1 | [attr="-a"] {} + | ^^^^ + error: Str --> $DIR/tests/fixture/esbuild/misc/54mhLGCwQMwsuiVkiTzAAQ/input.css:1:7 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/5al65IRQbw_x4yG3ke74fQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/5al65IRQbw_x4yG3ke74fQ/output.json index 7fb7aff456e..19f9ced6993 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/5al65IRQbw_x4yG3ke74fQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/5al65IRQbw_x4yG3ke74fQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/5al65IRQbw_x4yG3ke74fQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/5al65IRQbw_x4yG3ke74fQ/span.rust-debug index 5b2f490555b..478af4a3509 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/5al65IRQbw_x4yG3ke74fQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/5al65IRQbw_x4yG3ke74fQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: +0.1; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/5al65IRQbw_x4yG3ke74fQ/input.css:1:1 + | +1 | a { width: +0.1; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/5al65IRQbw_x4yG3ke74fQ/input.css:1:1 + | +1 | a { width: +0.1; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/5al65IRQbw_x4yG3ke74fQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/5cnGKjYPm1XBeqTmw3oCag/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/5cnGKjYPm1XBeqTmw3oCag/output.json index e490afdd102..c221816d7ba 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/5cnGKjYPm1XBeqTmw3oCag/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/5cnGKjYPm1XBeqTmw3oCag/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/5cnGKjYPm1XBeqTmw3oCag/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/5cnGKjYPm1XBeqTmw3oCag/span.rust-debug index a0c755bd2f4..faf2da03864 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/5cnGKjYPm1XBeqTmw3oCag/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/5cnGKjYPm1XBeqTmw3oCag/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: x\, } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/5cnGKjYPm1XBeqTmw3oCag/input.css:1:1 + | +1 | a { value: x\, } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/5cnGKjYPm1XBeqTmw3oCag/input.css:1:1 + | +1 | a { value: x\, } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/5cnGKjYPm1XBeqTmw3oCag/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/5nNFwUYmVb5_MMMzIvIeQg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/5nNFwUYmVb5_MMMzIvIeQg/output.json index 104c1745372..b0faddb73d1 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/5nNFwUYmVb5_MMMzIvIeQg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/5nNFwUYmVb5_MMMzIvIeQg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -76,22 +84,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 6, "end": 7, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 6, "end": 7, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 6, + "end": 7, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/5nNFwUYmVb5_MMMzIvIeQg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/5nNFwUYmVb5_MMMzIvIeQg/span.rust-debug index 47bdc7e45a9..f9900ddb64e 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/5nNFwUYmVb5_MMMzIvIeQg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/5nNFwUYmVb5_MMMzIvIeQg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a~/**/b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/5nNFwUYmVb5_MMMzIvIeQg/input.css:1:1 + | +1 | a~/**/b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/5nNFwUYmVb5_MMMzIvIeQg/input.css:1:1 + | +1 | a~/**/b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/5nNFwUYmVb5_MMMzIvIeQg/input.css:1:1 | @@ -64,6 +76,18 @@ error: TypeSelector 1 | a~/**/b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/5nNFwUYmVb5_MMMzIvIeQg/input.css:1:7 + | +1 | a~/**/b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/5nNFwUYmVb5_MMMzIvIeQg/input.css:1:7 + | +1 | a~/**/b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/5nNFwUYmVb5_MMMzIvIeQg/input.css:1:7 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/5yer6GUWydidDHrfgacUkA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/5yer6GUWydidDHrfgacUkA/output.json index 42cbe407483..55ac8b0c3a0 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/5yer6GUWydidDHrfgacUkA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/5yer6GUWydidDHrfgacUkA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/5yer6GUWydidDHrfgacUkA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/5yer6GUWydidDHrfgacUkA/span.rust-debug index 613b4ee0ca0..118f272191d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/5yer6GUWydidDHrfgacUkA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/5yer6GUWydidDHrfgacUkA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #1234 } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/5yer6GUWydidDHrfgacUkA/input.css:1:1 + | +1 | a { color: #1234 } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/5yer6GUWydidDHrfgacUkA/input.css:1:1 + | +1 | a { color: #1234 } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/5yer6GUWydidDHrfgacUkA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/62BQJI-uDjHXNJ7kyL8HiA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/62BQJI-uDjHXNJ7kyL8HiA/output.json index b4c080aa369..45eb708b96c 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/62BQJI-uDjHXNJ7kyL8HiA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/62BQJI-uDjHXNJ7kyL8HiA/output.json @@ -46,18 +46,34 @@ "end": 11, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 8, "ctxt": 0 }, - "value": "attr~", - "raw": "attr\\7e" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 8, + "ctxt": 0 + }, + "value": "attr~", + "raw": "attr\\7e" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 8, + "end": 9, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "Identifier", "span": { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/62BQJI-uDjHXNJ7kyL8HiA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/62BQJI-uDjHXNJ7kyL8HiA/span.rust-debug index b08c1efd77d..375c2909a4e 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/62BQJI-uDjHXNJ7kyL8HiA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/62BQJI-uDjHXNJ7kyL8HiA/span.rust-debug @@ -40,18 +40,36 @@ error: SubclassSelector 1 | [attr\7e=x] {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/62BQJI-uDjHXNJ7kyL8HiA/input.css:1:1 | 1 | [attr\7e=x] {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/62BQJI-uDjHXNJ7kyL8HiA/input.css:1:2 + | +1 | [attr\7e=x] {} + | ^^^^^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/62BQJI-uDjHXNJ7kyL8HiA/input.css:1:2 | 1 | [attr\7e=x] {} | ^^^^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/62BQJI-uDjHXNJ7kyL8HiA/input.css:1:9 + | +1 | [attr\7e=x] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/62BQJI-uDjHXNJ7kyL8HiA/input.css:1:10 + | +1 | [attr\7e=x] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/62BQJI-uDjHXNJ7kyL8HiA/input.css:1:10 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/6IWHWiWjsuGkPiPAp2KmoA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/6IWHWiWjsuGkPiPAp2KmoA/output.json index a68cd24f14e..687adc71145 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/6IWHWiWjsuGkPiPAp2KmoA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/6IWHWiWjsuGkPiPAp2KmoA/output.json @@ -46,18 +46,34 @@ "end": 10, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 2, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 3, + "end": 5, + "ctxt": 0 + }, + "value": "$=" }, - "matcher": "$=", "value": { "type": "String", "span": { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/6IWHWiWjsuGkPiPAp2KmoA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/6IWHWiWjsuGkPiPAp2KmoA/span.rust-debug index a070f586cc8..a398d97b421 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/6IWHWiWjsuGkPiPAp2KmoA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/6IWHWiWjsuGkPiPAp2KmoA/span.rust-debug @@ -40,18 +40,36 @@ error: SubclassSelector 1 | [b $= "c"] {} | ^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/6IWHWiWjsuGkPiPAp2KmoA/input.css:1:1 | 1 | [b $= "c"] {} | ^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/6IWHWiWjsuGkPiPAp2KmoA/input.css:1:2 + | +1 | [b $= "c"] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/6IWHWiWjsuGkPiPAp2KmoA/input.css:1:2 | 1 | [b $= "c"] {} | ^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/6IWHWiWjsuGkPiPAp2KmoA/input.css:1:4 + | +1 | [b $= "c"] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/6IWHWiWjsuGkPiPAp2KmoA/input.css:1:7 + | +1 | [b $= "c"] {} + | ^^^ + error: Str --> $DIR/tests/fixture/esbuild/misc/6IWHWiWjsuGkPiPAp2KmoA/input.css:1:7 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/6WYwXsqP1SJOa-6oDBobzQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/6WYwXsqP1SJOa-6oDBobzQ/output.json index 9c62be1cae1..7433c039583 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/6WYwXsqP1SJOa-6oDBobzQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/6WYwXsqP1SJOa-6oDBobzQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/6WYwXsqP1SJOa-6oDBobzQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/6WYwXsqP1SJOa-6oDBobzQ/span.rust-debug index 274d417a092..454a0e64c0a 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/6WYwXsqP1SJOa-6oDBobzQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/6WYwXsqP1SJOa-6oDBobzQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: white } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/6WYwXsqP1SJOa-6oDBobzQ/input.css:1:1 + | +1 | a { color: white } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/6WYwXsqP1SJOa-6oDBobzQ/input.css:1:1 + | +1 | a { color: white } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/6WYwXsqP1SJOa-6oDBobzQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/6aNPFn_YOBL4koYvV-g8pQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/6aNPFn_YOBL4koYvV-g8pQ/output.json index b3424c52183..d43dd2f749b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/6aNPFn_YOBL4koYvV-g8pQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/6aNPFn_YOBL4koYvV-g8pQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/6aNPFn_YOBL4koYvV-g8pQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/6aNPFn_YOBL4koYvV-g8pQ/span.rust-debug index 72ff806f93a..656d26b0a82 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/6aNPFn_YOBL4koYvV-g8pQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/6aNPFn_YOBL4koYvV-g8pQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: .0%; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/6aNPFn_YOBL4koYvV-g8pQ/input.css:1:1 + | +1 | a { width: .0%; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/6aNPFn_YOBL4koYvV-g8pQ/input.css:1:1 + | +1 | a { width: .0%; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/6aNPFn_YOBL4koYvV-g8pQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/6fufNZ3PA6_-pNwY-IP61Q/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/6fufNZ3PA6_-pNwY-IP61Q/output.json index 31067d0b647..a99c028b6fb 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/6fufNZ3PA6_-pNwY-IP61Q/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/6fufNZ3PA6_-pNwY-IP61Q/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -76,22 +84,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 2, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 2, "end": 3, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 2, + "end": 3, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/6fufNZ3PA6_-pNwY-IP61Q/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/6fufNZ3PA6_-pNwY-IP61Q/span.rust-debug index 5cb281860ff..d41f52f855d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/6fufNZ3PA6_-pNwY-IP61Q/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/6fufNZ3PA6_-pNwY-IP61Q/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a+b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/6fufNZ3PA6_-pNwY-IP61Q/input.css:1:1 + | +1 | a+b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/6fufNZ3PA6_-pNwY-IP61Q/input.css:1:1 + | +1 | a+b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/6fufNZ3PA6_-pNwY-IP61Q/input.css:1:1 | @@ -64,6 +76,18 @@ error: TypeSelector 1 | a+b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/6fufNZ3PA6_-pNwY-IP61Q/input.css:1:3 + | +1 | a+b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/6fufNZ3PA6_-pNwY-IP61Q/input.css:1:3 + | +1 | a+b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/6fufNZ3PA6_-pNwY-IP61Q/input.css:1:3 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/6kUhG0W7hwZxIuaCsZ7pHg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/6kUhG0W7hwZxIuaCsZ7pHg/output.json index 2dc5f37b14c..f92518f95a5 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/6kUhG0W7hwZxIuaCsZ7pHg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/6kUhG0W7hwZxIuaCsZ7pHg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/6kUhG0W7hwZxIuaCsZ7pHg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/6kUhG0W7hwZxIuaCsZ7pHg/span.rust-debug index a41f85c31fa..5567ce8fdb1 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/6kUhG0W7hwZxIuaCsZ7pHg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/6kUhG0W7hwZxIuaCsZ7pHg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a:after { content: 'a\62 c' } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/6kUhG0W7hwZxIuaCsZ7pHg/input.css:1:1 + | +1 | a:after { content: 'a\62 c' } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/6kUhG0W7hwZxIuaCsZ7pHg/input.css:1:1 + | +1 | a:after { content: 'a\62 c' } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/6kUhG0W7hwZxIuaCsZ7pHg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/7CK6ZYt4CWz7Ge5KWLKBYg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/7CK6ZYt4CWz7Ge5KWLKBYg/output.json index d1e129539c5..2a708be369b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/7CK6ZYt4CWz7Ge5KWLKBYg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/7CK6ZYt4CWz7Ge5KWLKBYg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/7CK6ZYt4CWz7Ge5KWLKBYg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/7CK6ZYt4CWz7Ge5KWLKBYg/span.rust-debug index 08fc8efa944..be3d9abde60 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/7CK6ZYt4CWz7Ge5KWLKBYg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/7CK6ZYt4CWz7Ge5KWLKBYg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #aabbccef } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/7CK6ZYt4CWz7Ge5KWLKBYg/input.css:1:1 + | +1 | a { color: #aabbccef } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/7CK6ZYt4CWz7Ge5KWLKBYg/input.css:1:1 + | +1 | a { color: #aabbccef } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/7CK6ZYt4CWz7Ge5KWLKBYg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/7Wto7epgdmJCos0XkrnMww/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/7Wto7epgdmJCos0XkrnMww/output.json index dc41441bc00..9c8bfd966e6 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/7Wto7epgdmJCos0XkrnMww/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/7Wto7epgdmJCos0XkrnMww/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -76,22 +84,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 6, "end": 7, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 6, "end": 7, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 6, + "end": 7, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/7Wto7epgdmJCos0XkrnMww/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/7Wto7epgdmJCos0XkrnMww/span.rust-debug index 2f7b28064d4..ccd5df41fa8 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/7Wto7epgdmJCos0XkrnMww/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/7Wto7epgdmJCos0XkrnMww/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a+/**/b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/7Wto7epgdmJCos0XkrnMww/input.css:1:1 + | +1 | a+/**/b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/7Wto7epgdmJCos0XkrnMww/input.css:1:1 + | +1 | a+/**/b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/7Wto7epgdmJCos0XkrnMww/input.css:1:1 | @@ -64,6 +76,18 @@ error: TypeSelector 1 | a+/**/b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/7Wto7epgdmJCos0XkrnMww/input.css:1:7 + | +1 | a+/**/b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/7Wto7epgdmJCos0XkrnMww/input.css:1:7 + | +1 | a+/**/b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/7Wto7epgdmJCos0XkrnMww/input.css:1:7 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/7YGXOizztR38f8fGB1DRaQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/7YGXOizztR38f8fGB1DRaQ/output.json index 78932ea5977..7c172293a69 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/7YGXOizztR38f8fGB1DRaQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/7YGXOizztR38f8fGB1DRaQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/7YGXOizztR38f8fGB1DRaQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/7YGXOizztR38f8fGB1DRaQ/span.rust-debug index fd354694dc5..4ba5db59614 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/7YGXOizztR38f8fGB1DRaQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/7YGXOizztR38f8fGB1DRaQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: -.00%; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/7YGXOizztR38f8fGB1DRaQ/input.css:1:1 + | +1 | a { width: -.00%; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/7YGXOizztR38f8fGB1DRaQ/input.css:1:1 + | +1 | a { width: -.00%; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/7YGXOizztR38f8fGB1DRaQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/866Law8W0FQas7QMxFjUbw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/866Law8W0FQas7QMxFjUbw/output.json index 55c348473c2..5c6bcf0acc4 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/866Law8W0FQas7QMxFjUbw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/866Law8W0FQas7QMxFjUbw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/866Law8W0FQas7QMxFjUbw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/866Law8W0FQas7QMxFjUbw/span.rust-debug index 03fe8bf6d69..2bd4511f283 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/866Law8W0FQas7QMxFjUbw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/866Law8W0FQas7QMxFjUbw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: 10x\2c } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/866Law8W0FQas7QMxFjUbw/input.css:1:1 + | +1 | a { value: 10x\2c } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/866Law8W0FQas7QMxFjUbw/input.css:1:1 + | +1 | a { value: 10x\2c } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/866Law8W0FQas7QMxFjUbw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/8Gs_Q4kYqijbgIQ6xIW8qw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/8Gs_Q4kYqijbgIQ6xIW8qw/output.json index c19455cf329..5e136b4cf1d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/8Gs_Q4kYqijbgIQ6xIW8qw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/8Gs_Q4kYqijbgIQ6xIW8qw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/8Gs_Q4kYqijbgIQ6xIW8qw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/8Gs_Q4kYqijbgIQ6xIW8qw/span.rust-debug index 358e00ec545..bf34fb1d96d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/8Gs_Q4kYqijbgIQ6xIW8qw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/8Gs_Q4kYqijbgIQ6xIW8qw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: url(a\62c) } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/8Gs_Q4kYqijbgIQ6xIW8qw/input.css:1:1 + | +1 | a { value: url(a\62c) } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/8Gs_Q4kYqijbgIQ6xIW8qw/input.css:1:1 + | +1 | a { value: url(a\62c) } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/8Gs_Q4kYqijbgIQ6xIW8qw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/9IIa-42s3YQFw8ilk39GdQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/9IIa-42s3YQFw8ilk39GdQ/output.json index 72cbbc859fb..bd0dcfd1fbd 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/9IIa-42s3YQFw8ilk39GdQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/9IIa-42s3YQFw8ilk39GdQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/9IIa-42s3YQFw8ilk39GdQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/9IIa-42s3YQFw8ilk39GdQ/span.rust-debug index 78d35a6b470..eca2902f503 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/9IIa-42s3YQFw8ilk39GdQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/9IIa-42s3YQFw8ilk39GdQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #AABBCCFF } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/9IIa-42s3YQFw8ilk39GdQ/input.css:1:1 + | +1 | a { color: #AABBCCFF } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/9IIa-42s3YQFw8ilk39GdQ/input.css:1:1 + | +1 | a { color: #AABBCCFF } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/9IIa-42s3YQFw8ilk39GdQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/9aSeJQPn4WHMexejaMQQoQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/9aSeJQPn4WHMexejaMQQoQ/output.json index ef11b2412a9..2fec71d8f1a 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/9aSeJQPn4WHMexejaMQQoQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/9aSeJQPn4WHMexejaMQQoQ/output.json @@ -46,25 +46,41 @@ "end": 10, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 1, - "end": 4, - "ctxt": 0 - }, - "value": "*", - "raw": "\\2a" - }, - "name": { - "type": "Identifier", - "span": { - "start": 5, "end": 9, "ctxt": 0 }, - "value": "attr", - "raw": "attr" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 1, + "end": 5, + "ctxt": 0 + }, + "prefix": { + "type": "Identifier", + "span": { + "start": 1, + "end": 4, + "ctxt": 0 + }, + "value": "*", + "raw": "\\2a" + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 5, + "end": 9, + "ctxt": 0 + }, + "value": "attr", + "raw": "attr" + } }, "matcher": null, "value": null, diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/9aSeJQPn4WHMexejaMQQoQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/9aSeJQPn4WHMexejaMQQoQ/span.rust-debug index 4ccc7272b61..9f72ed00f92 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/9aSeJQPn4WHMexejaMQQoQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/9aSeJQPn4WHMexejaMQQoQ/span.rust-debug @@ -40,12 +40,24 @@ error: SubclassSelector 1 | [\2a|attr] {} | ^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/9aSeJQPn4WHMexejaMQQoQ/input.css:1:1 | 1 | [\2a|attr] {} | ^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/9aSeJQPn4WHMexejaMQQoQ/input.css:1:2 + | +1 | [\2a|attr] {} + | ^^^^^^^^ + +error: NsPrefix + --> $DIR/tests/fixture/esbuild/misc/9aSeJQPn4WHMexejaMQQoQ/input.css:1:2 + | +1 | [\2a|attr] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/9aSeJQPn4WHMexejaMQQoQ/input.css:1:2 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/A3jvzrmJH_MIf_Uilsy4sg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/A3jvzrmJH_MIf_Uilsy4sg/output.json index e0f8ac0582e..3bb437fecd8 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/A3jvzrmJH_MIf_Uilsy4sg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/A3jvzrmJH_MIf_Uilsy4sg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/A3jvzrmJH_MIf_Uilsy4sg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/A3jvzrmJH_MIf_Uilsy4sg/span.rust-debug index 16e6e4fa520..1d246357088 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/A3jvzrmJH_MIf_Uilsy4sg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/A3jvzrmJH_MIf_Uilsy4sg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: +0.1%; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/A3jvzrmJH_MIf_Uilsy4sg/input.css:1:1 + | +1 | a { width: +0.1%; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/A3jvzrmJH_MIf_Uilsy4sg/input.css:1:1 + | +1 | a { width: +0.1%; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/A3jvzrmJH_MIf_Uilsy4sg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/ACQUsGVQAmGzhMqBRmS6Mw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/ACQUsGVQAmGzhMqBRmS6Mw/output.json index 8b4fc1aff10..ebffa7b7653 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/ACQUsGVQAmGzhMqBRmS6Mw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/ACQUsGVQAmGzhMqBRmS6Mw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/ACQUsGVQAmGzhMqBRmS6Mw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/ACQUsGVQAmGzhMqBRmS6Mw/span.rust-debug index f2cd02da2c4..d3e3ada2d71 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/ACQUsGVQAmGzhMqBRmS6Mw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/ACQUsGVQAmGzhMqBRmS6Mw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: .10; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/ACQUsGVQAmGzhMqBRmS6Mw/input.css:1:1 + | +1 | a { width: .10; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/ACQUsGVQAmGzhMqBRmS6Mw/input.css:1:1 + | +1 | a { width: .10; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/ACQUsGVQAmGzhMqBRmS6Mw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/AVaQlt9z0lhJC6bHHDPVeA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/AVaQlt9z0lhJC6bHHDPVeA/output.json index 680d3502932..4fc38bfea53 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/AVaQlt9z0lhJC6bHHDPVeA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/AVaQlt9z0lhJC6bHHDPVeA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/AVaQlt9z0lhJC6bHHDPVeA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/AVaQlt9z0lhJC6bHHDPVeA/span.rust-debug index 7cf00438f1b..f3a27d2bf1e 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/AVaQlt9z0lhJC6bHHDPVeA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/AVaQlt9z0lhJC6bHHDPVeA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: x\2c() } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/AVaQlt9z0lhJC6bHHDPVeA/input.css:1:1 + | +1 | a { value: x\2c() } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/AVaQlt9z0lhJC6bHHDPVeA/input.css:1:1 + | +1 | a { value: x\2c() } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/AVaQlt9z0lhJC6bHHDPVeA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Ae5_auBp274oaSQ0kls9sw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/Ae5_auBp274oaSQ0kls9sw/output.json index b321af1025e..ebfdae99b61 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Ae5_auBp274oaSQ0kls9sw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Ae5_auBp274oaSQ0kls9sw/output.json @@ -46,18 +46,34 @@ "end": 7, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 2, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 2, + "end": 3, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Ae5_auBp274oaSQ0kls9sw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/Ae5_auBp274oaSQ0kls9sw/span.rust-debug index 7dfde8dd217..ee85d9850b6 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Ae5_auBp274oaSQ0kls9sw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Ae5_auBp274oaSQ0kls9sw/span.rust-debug @@ -40,18 +40,36 @@ error: SubclassSelector 1 | [b="c"] {} | ^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/Ae5_auBp274oaSQ0kls9sw/input.css:1:1 | 1 | [b="c"] {} | ^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/Ae5_auBp274oaSQ0kls9sw/input.css:1:2 + | +1 | [b="c"] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/Ae5_auBp274oaSQ0kls9sw/input.css:1:2 | 1 | [b="c"] {} | ^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/Ae5_auBp274oaSQ0kls9sw/input.css:1:3 + | +1 | [b="c"] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/Ae5_auBp274oaSQ0kls9sw/input.css:1:4 + | +1 | [b="c"] {} + | ^^^ + error: Str --> $DIR/tests/fixture/esbuild/misc/Ae5_auBp274oaSQ0kls9sw/input.css:1:4 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Afm91-TMNbzd52HsPrCCNA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/Afm91-TMNbzd52HsPrCCNA/output.json index 696474ff6c6..c2b9467abe8 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Afm91-TMNbzd52HsPrCCNA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Afm91-TMNbzd52HsPrCCNA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Afm91-TMNbzd52HsPrCCNA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/Afm91-TMNbzd52HsPrCCNA/span.rust-debug index f01b5a7473f..296da356bf2 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Afm91-TMNbzd52HsPrCCNA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Afm91-TMNbzd52HsPrCCNA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #abbbccff } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/Afm91-TMNbzd52HsPrCCNA/input.css:1:1 + | +1 | a { color: #abbbccff } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/Afm91-TMNbzd52HsPrCCNA/input.css:1:1 + | +1 | a { color: #abbbccff } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/Afm91-TMNbzd52HsPrCCNA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/AigZ338AGwCqF4M9a3Quqw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/AigZ338AGwCqF4M9a3Quqw/output.json index b09e750940c..fc3af862a40 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/AigZ338AGwCqF4M9a3Quqw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/AigZ338AGwCqF4M9a3Quqw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/AigZ338AGwCqF4M9a3Quqw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/AigZ338AGwCqF4M9a3Quqw/span.rust-debug index 9ba66bc8acf..2a5ffcbcce7 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/AigZ338AGwCqF4M9a3Quqw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/AigZ338AGwCqF4M9a3Quqw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #AABCCCDD } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/AigZ338AGwCqF4M9a3Quqw/input.css:1:1 + | +1 | a { color: #AABCCCDD } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/AigZ338AGwCqF4M9a3Quqw/input.css:1:1 + | +1 | a { color: #AABCCCDD } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/AigZ338AGwCqF4M9a3Quqw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/AocxkR5Gt30Hu6JV7J56Wg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/AocxkR5Gt30Hu6JV7J56Wg/output.json index 0cbf3186629..140ee53dc1c 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/AocxkR5Gt30Hu6JV7J56Wg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/AocxkR5Gt30Hu6JV7J56Wg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/AocxkR5Gt30Hu6JV7J56Wg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/AocxkR5Gt30Hu6JV7J56Wg/span.rust-debug index 20ff9e8ec5d..e8b8d179d77 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/AocxkR5Gt30Hu6JV7J56Wg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/AocxkR5Gt30Hu6JV7J56Wg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #aabccc } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/AocxkR5Gt30Hu6JV7J56Wg/input.css:1:1 + | +1 | a { color: #aabccc } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/AocxkR5Gt30Hu6JV7J56Wg/input.css:1:1 + | +1 | a { color: #aabccc } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/AocxkR5Gt30Hu6JV7J56Wg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/AwZM5l5vBlyrbgG-Fk0_EQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/AwZM5l5vBlyrbgG-Fk0_EQ/output.json index 9ad28d5ddca..6c85ed41cb3 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/AwZM5l5vBlyrbgG-Fk0_EQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/AwZM5l5vBlyrbgG-Fk0_EQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/AwZM5l5vBlyrbgG-Fk0_EQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/AwZM5l5vBlyrbgG-Fk0_EQ/span.rust-debug index 5046db92112..e76dc28164a 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/AwZM5l5vBlyrbgG-Fk0_EQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/AwZM5l5vBlyrbgG-Fk0_EQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: x\2c } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/AwZM5l5vBlyrbgG-Fk0_EQ/input.css:1:1 + | +1 | a { value: x\2c } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/AwZM5l5vBlyrbgG-Fk0_EQ/input.css:1:1 + | +1 | a { value: x\2c } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/AwZM5l5vBlyrbgG-Fk0_EQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/BKyQWW5j9vRP-kr41nqcjg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/BKyQWW5j9vRP-kr41nqcjg/output.json index 91f7e411c9d..976aa3c431e 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/BKyQWW5j9vRP-kr41nqcjg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/BKyQWW5j9vRP-kr41nqcjg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/BKyQWW5j9vRP-kr41nqcjg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/BKyQWW5j9vRP-kr41nqcjg/span.rust-debug index 33cfdeac721..19d4f118c3c 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/BKyQWW5j9vRP-kr41nqcjg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/BKyQWW5j9vRP-kr41nqcjg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: #\68 ash } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/BKyQWW5j9vRP-kr41nqcjg/input.css:1:1 + | +1 | a { value: #\68 ash } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/BKyQWW5j9vRP-kr41nqcjg/input.css:1:1 + | +1 | a { value: #\68 ash } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/BKyQWW5j9vRP-kr41nqcjg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/BltaGv1fY5VvJahyCRNxqQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/BltaGv1fY5VvJahyCRNxqQ/output.json index b825c3fb9c7..5205ae4c43d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/BltaGv1fY5VvJahyCRNxqQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/BltaGv1fY5VvJahyCRNxqQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -76,22 +84,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 2, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 2, "end": 3, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 2, + "end": 3, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/BltaGv1fY5VvJahyCRNxqQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/BltaGv1fY5VvJahyCRNxqQ/span.rust-debug index 5a6666ca4ad..82e610444c3 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/BltaGv1fY5VvJahyCRNxqQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/BltaGv1fY5VvJahyCRNxqQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a~b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/BltaGv1fY5VvJahyCRNxqQ/input.css:1:1 + | +1 | a~b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/BltaGv1fY5VvJahyCRNxqQ/input.css:1:1 + | +1 | a~b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/BltaGv1fY5VvJahyCRNxqQ/input.css:1:1 | @@ -64,6 +76,18 @@ error: TypeSelector 1 | a~b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/BltaGv1fY5VvJahyCRNxqQ/input.css:1:3 + | +1 | a~b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/BltaGv1fY5VvJahyCRNxqQ/input.css:1:3 + | +1 | a~b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/BltaGv1fY5VvJahyCRNxqQ/input.css:1:3 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/C419dJQ48QjmgKufnQhNVw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/C419dJQ48QjmgKufnQhNVw/output.json index ce9ec7ef379..66e670b2f71 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/C419dJQ48QjmgKufnQhNVw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/C419dJQ48QjmgKufnQhNVw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -76,22 +84,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 4, "end": 5, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 4, "end": 5, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 4, + "end": 5, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/C419dJQ48QjmgKufnQhNVw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/C419dJQ48QjmgKufnQhNVw/span.rust-debug index 2c498dd194c..44b366ec514 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/C419dJQ48QjmgKufnQhNVw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/C419dJQ48QjmgKufnQhNVw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a > b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/C419dJQ48QjmgKufnQhNVw/input.css:1:1 + | +1 | a > b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/C419dJQ48QjmgKufnQhNVw/input.css:1:1 + | +1 | a > b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/C419dJQ48QjmgKufnQhNVw/input.css:1:1 | @@ -64,6 +76,18 @@ error: TypeSelector 1 | a > b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/C419dJQ48QjmgKufnQhNVw/input.css:1:5 + | +1 | a > b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/C419dJQ48QjmgKufnQhNVw/input.css:1:5 + | +1 | a > b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/C419dJQ48QjmgKufnQhNVw/input.css:1:5 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/C4I0cdQcSbpaGOS-V8fwew/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/C4I0cdQcSbpaGOS-V8fwew/output.json index bea8b40fb2a..c3d3cc7ba27 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/C4I0cdQcSbpaGOS-V8fwew/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/C4I0cdQcSbpaGOS-V8fwew/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/C4I0cdQcSbpaGOS-V8fwew/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/C4I0cdQcSbpaGOS-V8fwew/span.rust-debug index d9907e42af8..78723ef0e85 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/C4I0cdQcSbpaGOS-V8fwew/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/C4I0cdQcSbpaGOS-V8fwew/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: #0h\61sh } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/C4I0cdQcSbpaGOS-V8fwew/input.css:1:1 + | +1 | a { value: #0h\61sh } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/C4I0cdQcSbpaGOS-V8fwew/input.css:1:1 + | +1 | a { value: #0h\61sh } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/C4I0cdQcSbpaGOS-V8fwew/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/C6gS3Kl0KEwGsFaUUGXzFg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/C6gS3Kl0KEwGsFaUUGXzFg/output.json index b9799536f04..86a5391f342 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/C6gS3Kl0KEwGsFaUUGXzFg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/C6gS3Kl0KEwGsFaUUGXzFg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/C6gS3Kl0KEwGsFaUUGXzFg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/C6gS3Kl0KEwGsFaUUGXzFg/span.rust-debug index 33dac11a097..0debce26c9b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/C6gS3Kl0KEwGsFaUUGXzFg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/C6gS3Kl0KEwGsFaUUGXzFg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #112234ff } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/C6gS3Kl0KEwGsFaUUGXzFg/input.css:1:1 + | +1 | a { color: #112234ff } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/C6gS3Kl0KEwGsFaUUGXzFg/input.css:1:1 + | +1 | a { color: #112234ff } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/C6gS3Kl0KEwGsFaUUGXzFg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/C9nXM9jBTT9WvCQHrwH24Q/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/C9nXM9jBTT9WvCQHrwH24Q/output.json index e0e4c18ede6..90a79279148 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/C9nXM9jBTT9WvCQHrwH24Q/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/C9nXM9jBTT9WvCQHrwH24Q/output.json @@ -53,16 +53,24 @@ "end": 4, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 2, "end": 3, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 2, + "end": 3, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } }, "matcher": null, "value": null, diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/C9nXM9jBTT9WvCQHrwH24Q/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/C9nXM9jBTT9WvCQHrwH24Q/span.rust-debug index dbd9b681df4..8deea2ff13f 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/C9nXM9jBTT9WvCQHrwH24Q/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/C9nXM9jBTT9WvCQHrwH24Q/span.rust-debug @@ -46,12 +46,18 @@ error: SubclassSelector 1 | &[a] {} | ^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/C9nXM9jBTT9WvCQHrwH24Q/input.css:1:2 | 1 | &[a] {} | ^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/C9nXM9jBTT9WvCQHrwH24Q/input.css:1:3 + | +1 | &[a] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/C9nXM9jBTT9WvCQHrwH24Q/input.css:1:3 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/CQiowK9DjojqKtlpQifemA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/CQiowK9DjojqKtlpQifemA/output.json index 8fe6f0b0d33..c8830442aff 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/CQiowK9DjojqKtlpQifemA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/CQiowK9DjojqKtlpQifemA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/CQiowK9DjojqKtlpQifemA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/CQiowK9DjojqKtlpQifemA/span.rust-debug index 6c7b572a1aa..bbdef0c4d28 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/CQiowK9DjojqKtlpQifemA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/CQiowK9DjojqKtlpQifemA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #ABBBCC } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/CQiowK9DjojqKtlpQifemA/input.css:1:1 + | +1 | a { color: #ABBBCC } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/CQiowK9DjojqKtlpQifemA/input.css:1:1 + | +1 | a { color: #ABBBCC } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/CQiowK9DjojqKtlpQifemA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/CqrYlHva8qUNgSPb8EwWjg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/CqrYlHva8qUNgSPb8EwWjg/output.json index a256db83d2c..24099362fc0 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/CqrYlHva8qUNgSPb8EwWjg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/CqrYlHva8qUNgSPb8EwWjg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/CqrYlHva8qUNgSPb8EwWjg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/CqrYlHva8qUNgSPb8EwWjg/span.rust-debug index 2fec07b118b..3034b7dcf0a 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/CqrYlHva8qUNgSPb8EwWjg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/CqrYlHva8qUNgSPb8EwWjg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: 'a\62 c' } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/CqrYlHva8qUNgSPb8EwWjg/input.css:1:1 + | +1 | a { value: 'a\62 c' } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/CqrYlHva8qUNgSPb8EwWjg/input.css:1:1 + | +1 | a { value: 'a\62 c' } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/CqrYlHva8qUNgSPb8EwWjg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Cz4vXE_NaBs6qNXE1kUyqQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/Cz4vXE_NaBs6qNXE1kUyqQ/output.json index ebd474ee321..cd15ce414b9 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Cz4vXE_NaBs6qNXE1kUyqQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Cz4vXE_NaBs6qNXE1kUyqQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Cz4vXE_NaBs6qNXE1kUyqQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/Cz4vXE_NaBs6qNXE1kUyqQ/span.rust-debug index 6c9f44f301c23fc3440a188fd912d2508c6aa219..f548b57809ce6fe011781381b1496918e96418ca 100644 GIT binary patch delta 34 pcmbQmH&I~2bY}LD#B{&J+| $DIR/tests/fixture/esbuild/misc/D5Oyf1ABeS8lie5Lg-5pqg/input.css:1:1 + | +1 | a { value: x\0 } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/D5Oyf1ABeS8lie5Lg-5pqg/input.css:1:1 + | +1 | a { value: x\0 } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/D5Oyf1ABeS8lie5Lg-5pqg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Drl1Excz8WEwlfIfA2oRQg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/Drl1Excz8WEwlfIfA2oRQg/output.json index 88f155350e0..223beca2aa6 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Drl1Excz8WEwlfIfA2oRQg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Drl1Excz8WEwlfIfA2oRQg/output.json @@ -46,18 +46,34 @@ "end": 11, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 2, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 3, + "end": 4, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { @@ -68,7 +84,24 @@ "value": "c", "raw": "\"c\"" }, - "modifier": "i" + "modifier": { + "type": "AttributeSelectorModifier", + "span": { + "start": 9, + "end": 10, + "ctxt": 0 + }, + "value": { + "type": "Identifier", + "span": { + "start": 9, + "end": 10, + "ctxt": 0 + }, + "value": "i", + "raw": "i" + } + } } ] } diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Drl1Excz8WEwlfIfA2oRQg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/Drl1Excz8WEwlfIfA2oRQg/span.rust-debug index 2cd27dad597..5bd95a5785e 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Drl1Excz8WEwlfIfA2oRQg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Drl1Excz8WEwlfIfA2oRQg/span.rust-debug @@ -40,24 +40,54 @@ error: SubclassSelector 1 | [b = "c" i] {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/Drl1Excz8WEwlfIfA2oRQg/input.css:1:1 | 1 | [b = "c" i] {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/Drl1Excz8WEwlfIfA2oRQg/input.css:1:2 + | +1 | [b = "c" i] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/Drl1Excz8WEwlfIfA2oRQg/input.css:1:2 | 1 | [b = "c" i] {} | ^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/Drl1Excz8WEwlfIfA2oRQg/input.css:1:4 + | +1 | [b = "c" i] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/Drl1Excz8WEwlfIfA2oRQg/input.css:1:6 + | +1 | [b = "c" i] {} + | ^^^ + error: Str --> $DIR/tests/fixture/esbuild/misc/Drl1Excz8WEwlfIfA2oRQg/input.css:1:6 | 1 | [b = "c" i] {} | ^^^ +error: AttributeSelectorModifier + --> $DIR/tests/fixture/esbuild/misc/Drl1Excz8WEwlfIfA2oRQg/input.css:1:10 + | +1 | [b = "c" i] {} + | ^ + +error: Ident + --> $DIR/tests/fixture/esbuild/misc/Drl1Excz8WEwlfIfA2oRQg/input.css:1:10 + | +1 | [b = "c" i] {} + | ^ + error: Block --> $DIR/tests/fixture/esbuild/misc/Drl1Excz8WEwlfIfA2oRQg/input.css:1:13 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/DrlXteRB-ppLVxi4_N4dhA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/DrlXteRB-ppLVxi4_N4dhA/output.json index 8c8ab027e85..e6a68bd5783 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/DrlXteRB-ppLVxi4_N4dhA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/DrlXteRB-ppLVxi4_N4dhA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/DrlXteRB-ppLVxi4_N4dhA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/DrlXteRB-ppLVxi4_N4dhA/span.rust-debug index c79dbaa2109..3e374c6a630 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/DrlXteRB-ppLVxi4_N4dhA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/DrlXteRB-ppLVxi4_N4dhA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: \2cx } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/DrlXteRB-ppLVxi4_N4dhA/input.css:1:1 + | +1 | a { value: \2cx } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/DrlXteRB-ppLVxi4_N4dhA/input.css:1:1 + | +1 | a { value: \2cx } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/DrlXteRB-ppLVxi4_N4dhA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/DstCRLR-k3tqe3B46li15Q/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/DstCRLR-k3tqe3B46li15Q/output.json index bb7b49f8506..1d9a416ff08 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/DstCRLR-k3tqe3B46li15Q/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/DstCRLR-k3tqe3B46li15Q/output.json @@ -46,25 +46,32 @@ "end": 4, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 1, - "end": 1, - "ctxt": 0 - }, - "value": "", - "raw": "" - }, - "name": { - "type": "Identifier", - "span": { - "start": 2, "end": 3, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "prefix": null + }, + "value": { + "type": "Identifier", + "span": { + "start": 2, + "end": 3, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } }, "matcher": null, "value": null, diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/DstCRLR-k3tqe3B46li15Q/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/DstCRLR-k3tqe3B46li15Q/span.rust-debug index 12cb757dc20..0de27a271de 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/DstCRLR-k3tqe3B46li15Q/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/DstCRLR-k3tqe3B46li15Q/span.rust-debug @@ -40,13 +40,19 @@ error: SubclassSelector 1 | [|b]{} | ^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/DstCRLR-k3tqe3B46li15Q/input.css:1:1 | 1 | [|b]{} | ^^^^ -error: Ident +error: WqName + --> $DIR/tests/fixture/esbuild/misc/DstCRLR-k3tqe3B46li15Q/input.css:1:2 + | +1 | [|b]{} + | ^^ + +error: NsPrefix --> $DIR/tests/fixture/esbuild/misc/DstCRLR-k3tqe3B46li15Q/input.css:1:2 | 1 | [|b]{} diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/EB1IJLfMRoP0XwlJOGLTPA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/EB1IJLfMRoP0XwlJOGLTPA/output.json index 251c4893cbc..741f074a354 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/EB1IJLfMRoP0XwlJOGLTPA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/EB1IJLfMRoP0XwlJOGLTPA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/EB1IJLfMRoP0XwlJOGLTPA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/EB1IJLfMRoP0XwlJOGLTPA/span.rust-debug index bd2f8ab01d1..4792bcfdf78 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/EB1IJLfMRoP0XwlJOGLTPA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/EB1IJLfMRoP0XwlJOGLTPA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | div {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/EB1IJLfMRoP0XwlJOGLTPA/input.css:1:1 + | +1 | div {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/EB1IJLfMRoP0XwlJOGLTPA/input.css:1:1 + | +1 | div {} + | ^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/EB1IJLfMRoP0XwlJOGLTPA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/EC04FJYJG-jwsR3Sbo9Rfg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/EC04FJYJG-jwsR3Sbo9Rfg/output.json index 17692072ef4..1cadcd43982 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/EC04FJYJG-jwsR3Sbo9Rfg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/EC04FJYJG-jwsR3Sbo9Rfg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [ diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/EC04FJYJG-jwsR3Sbo9Rfg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/EC04FJYJG-jwsR3Sbo9Rfg/span.rust-debug index 680bb67bfa7..6aa69eb6dbf 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/EC04FJYJG-jwsR3Sbo9Rfg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/EC04FJYJG-jwsR3Sbo9Rfg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | div#\-0 {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/EC04FJYJG-jwsR3Sbo9Rfg/input.css:1:1 + | +1 | div#\-0 {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/EC04FJYJG-jwsR3Sbo9Rfg/input.css:1:1 + | +1 | div#\-0 {} + | ^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/EC04FJYJG-jwsR3Sbo9Rfg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/EJ3xE2oHAiQiiAA6TOFfLA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/EJ3xE2oHAiQiiAA6TOFfLA/output.json index 7b532b5842a..f085ff6e333 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/EJ3xE2oHAiQiiAA6TOFfLA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/EJ3xE2oHAiQiiAA6TOFfLA/output.json @@ -46,16 +46,24 @@ "end": 8, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 7, "ctxt": 0 }, - "value": ",attr", - "raw": "\\,attr" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 7, + "ctxt": 0 + }, + "value": ",attr", + "raw": "\\,attr" + } }, "matcher": null, "value": null, diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/EJ3xE2oHAiQiiAA6TOFfLA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/EJ3xE2oHAiQiiAA6TOFfLA/span.rust-debug index a66ba9b72cb..4ea1d013372 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/EJ3xE2oHAiQiiAA6TOFfLA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/EJ3xE2oHAiQiiAA6TOFfLA/span.rust-debug @@ -40,12 +40,18 @@ error: SubclassSelector 1 | [\,attr] {} | ^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/EJ3xE2oHAiQiiAA6TOFfLA/input.css:1:1 | 1 | [\,attr] {} | ^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/EJ3xE2oHAiQiiAA6TOFfLA/input.css:1:2 + | +1 | [\,attr] {} + | ^^^^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/EJ3xE2oHAiQiiAA6TOFfLA/input.css:1:2 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/EJPa4WhTn_fRRrDiA2bczg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/EJPa4WhTn_fRRrDiA2bczg/output.json index 5cdb3693e34..e8f5d483d1f 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/EJPa4WhTn_fRRrDiA2bczg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/EJPa4WhTn_fRRrDiA2bczg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/EJPa4WhTn_fRRrDiA2bczg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/EJPa4WhTn_fRRrDiA2bczg/span.rust-debug index 88e3a4ceb1f..0973073b2ce 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/EJPa4WhTn_fRRrDiA2bczg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/EJPa4WhTn_fRRrDiA2bczg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #aabbcc } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/EJPa4WhTn_fRRrDiA2bczg/input.css:1:1 + | +1 | a { color: #aabbcc } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/EJPa4WhTn_fRRrDiA2bczg/input.css:1:1 + | +1 | a { color: #aabbcc } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/EJPa4WhTn_fRRrDiA2bczg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/EX6W7U27ut-K7x8AfSlQSg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/EX6W7U27ut-K7x8AfSlQSg/output.json index 9468d38ac31..fca105f402b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/EX6W7U27ut-K7x8AfSlQSg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/EX6W7U27ut-K7x8AfSlQSg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -76,22 +84,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 2, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 2, "end": 3, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 2, + "end": 3, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/EX6W7U27ut-K7x8AfSlQSg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/EX6W7U27ut-K7x8AfSlQSg/span.rust-debug index e3bf4d709a5..c90f9ab3cbf 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/EX6W7U27ut-K7x8AfSlQSg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/EX6W7U27ut-K7x8AfSlQSg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a>b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/EX6W7U27ut-K7x8AfSlQSg/input.css:1:1 + | +1 | a>b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/EX6W7U27ut-K7x8AfSlQSg/input.css:1:1 + | +1 | a>b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/EX6W7U27ut-K7x8AfSlQSg/input.css:1:1 | @@ -64,6 +76,18 @@ error: TypeSelector 1 | a>b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/EX6W7U27ut-K7x8AfSlQSg/input.css:1:3 + | +1 | a>b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/EX6W7U27ut-K7x8AfSlQSg/input.css:1:3 + | +1 | a>b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/EX6W7U27ut-K7x8AfSlQSg/input.css:1:3 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/EYFn-trzBus37dDEvK1jUQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/EYFn-trzBus37dDEvK1jUQ/output.json index 11865daf0cc..2e5e8755636 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/EYFn-trzBus37dDEvK1jUQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/EYFn-trzBus37dDEvK1jUQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/EYFn-trzBus37dDEvK1jUQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/EYFn-trzBus37dDEvK1jUQ/span.rust-debug index bd2019af68b..e184b79a878 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/EYFn-trzBus37dDEvK1jUQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/EYFn-trzBus37dDEvK1jUQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #122233 } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/EYFn-trzBus37dDEvK1jUQ/input.css:1:1 + | +1 | a { color: #122233 } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/EYFn-trzBus37dDEvK1jUQ/input.css:1:1 + | +1 | a { color: #122233 } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/EYFn-trzBus37dDEvK1jUQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/ElFW4lY06Cb-VFYtK0WX4A/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/ElFW4lY06Cb-VFYtK0WX4A/output.json index 257775257c9..ec3243ba38b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/ElFW4lY06Cb-VFYtK0WX4A/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/ElFW4lY06Cb-VFYtK0WX4A/output.json @@ -67,22 +67,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 30, "end": 32, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 30, "end": 32, "ctxt": 0 }, - "value": "h1", - "raw": "h1" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 30, + "end": 32, + "ctxt": 0 + }, + "value": "h1", + "raw": "h1" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/ElFW4lY06Cb-VFYtK0WX4A/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/ElFW4lY06Cb-VFYtK0WX4A/span.rust-debug index e8cbe952ae7..9dce94e8fd7 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/ElFW4lY06Cb-VFYtK0WX4A/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/ElFW4lY06Cb-VFYtK0WX4A/span.rust-debug @@ -70,6 +70,18 @@ error: TypeSelector 1 | @-moz-document url-prefix() { h1 { color: green } } | ^^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/ElFW4lY06Cb-VFYtK0WX4A/input.css:1:31 + | +1 | @-moz-document url-prefix() { h1 { color: green } } + | ^^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/ElFW4lY06Cb-VFYtK0WX4A/input.css:1:31 + | +1 | @-moz-document url-prefix() { h1 { color: green } } + | ^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/ElFW4lY06Cb-VFYtK0WX4A/input.css:1:31 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/EmvZzoCy9JnSP70AqHmNNA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/EmvZzoCy9JnSP70AqHmNNA/output.json index 621b1cad212..e17337d0ad7 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/EmvZzoCy9JnSP70AqHmNNA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/EmvZzoCy9JnSP70AqHmNNA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -76,22 +84,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 2, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 2, "end": 3, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 2, + "end": 3, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/EmvZzoCy9JnSP70AqHmNNA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/EmvZzoCy9JnSP70AqHmNNA/span.rust-debug index 0f3c076a56c..5236161f2dd 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/EmvZzoCy9JnSP70AqHmNNA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/EmvZzoCy9JnSP70AqHmNNA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/EmvZzoCy9JnSP70AqHmNNA/input.css:1:1 + | +1 | a b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/EmvZzoCy9JnSP70AqHmNNA/input.css:1:1 + | +1 | a b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/EmvZzoCy9JnSP70AqHmNNA/input.css:1:1 | @@ -64,6 +76,18 @@ error: TypeSelector 1 | a b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/EmvZzoCy9JnSP70AqHmNNA/input.css:1:3 + | +1 | a b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/EmvZzoCy9JnSP70AqHmNNA/input.css:1:3 + | +1 | a b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/EmvZzoCy9JnSP70AqHmNNA/input.css:1:3 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/F-AbRDwG_3dGLhE7pzr5aA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/F-AbRDwG_3dGLhE7pzr5aA/output.json index b4f4627ec42..e775a2f0b70 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/F-AbRDwG_3dGLhE7pzr5aA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/F-AbRDwG_3dGLhE7pzr5aA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/F-AbRDwG_3dGLhE7pzr5aA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/F-AbRDwG_3dGLhE7pzr5aA/span.rust-debug index 966b323c2d4..fb0b1a9efeb 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/F-AbRDwG_3dGLhE7pzr5aA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/F-AbRDwG_3dGLhE7pzr5aA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: x\1 } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/F-AbRDwG_3dGLhE7pzr5aA/input.css:1:1 + | +1 | a { value: x\1 } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/F-AbRDwG_3dGLhE7pzr5aA/input.css:1:1 + | +1 | a { value: x\1 } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/F-AbRDwG_3dGLhE7pzr5aA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/FlqjDLebWxQvNIxKppBllw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/FlqjDLebWxQvNIxKppBllw/output.json index 3daf0cf2924..49b3b95fde9 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/FlqjDLebWxQvNIxKppBllw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/FlqjDLebWxQvNIxKppBllw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/FlqjDLebWxQvNIxKppBllw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/FlqjDLebWxQvNIxKppBllw/span.rust-debug index c009d51b247..97be259eec3 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/FlqjDLebWxQvNIxKppBllw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/FlqjDLebWxQvNIxKppBllw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #aabbcd } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/FlqjDLebWxQvNIxKppBllw/input.css:1:1 + | +1 | a { color: #aabbcd } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/FlqjDLebWxQvNIxKppBllw/input.css:1:1 + | +1 | a { color: #aabbcd } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/FlqjDLebWxQvNIxKppBllw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Fm7gvlx7uRyvrfzUC7rJxg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/Fm7gvlx7uRyvrfzUC7rJxg/output.json index 30af4df6599..1d8691069f3 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Fm7gvlx7uRyvrfzUC7rJxg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Fm7gvlx7uRyvrfzUC7rJxg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Fm7gvlx7uRyvrfzUC7rJxg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/Fm7gvlx7uRyvrfzUC7rJxg/span.rust-debug index e56ec6f4e86..a4bac2f91f2 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Fm7gvlx7uRyvrfzUC7rJxg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Fm7gvlx7uRyvrfzUC7rJxg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: #x\, } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/Fm7gvlx7uRyvrfzUC7rJxg/input.css:1:1 + | +1 | a { value: #x\, } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/Fm7gvlx7uRyvrfzUC7rJxg/input.css:1:1 + | +1 | a { value: #x\, } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/Fm7gvlx7uRyvrfzUC7rJxg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/GC0pcFQY1xSlq9QsgSvEVg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/GC0pcFQY1xSlq9QsgSvEVg/output.json index 8f488d1c5e3..4fb3c506169 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/GC0pcFQY1xSlq9QsgSvEVg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/GC0pcFQY1xSlq9QsgSvEVg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/GC0pcFQY1xSlq9QsgSvEVg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/GC0pcFQY1xSlq9QsgSvEVg/span.rust-debug index 8d8db057278..2f4c9f58b54 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/GC0pcFQY1xSlq9QsgSvEVg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/GC0pcFQY1xSlq9QsgSvEVg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: -.0; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/GC0pcFQY1xSlq9QsgSvEVg/input.css:1:1 + | +1 | a { width: -.0; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/GC0pcFQY1xSlq9QsgSvEVg/input.css:1:1 + | +1 | a { width: -.0; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/GC0pcFQY1xSlq9QsgSvEVg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/GI1rffTXev-78n9ei_53wQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/GI1rffTXev-78n9ei_53wQ/output.json index b5b0d61cd33..67e60c2204b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/GI1rffTXev-78n9ei_53wQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/GI1rffTXev-78n9ei_53wQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/GI1rffTXev-78n9ei_53wQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/GI1rffTXev-78n9ei_53wQ/span.rust-debug index 353b5569426..4f61fe10597 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/GI1rffTXev-78n9ei_53wQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/GI1rffTXev-78n9ei_53wQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: '\1' } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/GI1rffTXev-78n9ei_53wQ/input.css:1:1 + | +1 | a { value: '\1' } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/GI1rffTXev-78n9ei_53wQ/input.css:1:1 + | +1 | a { value: '\1' } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/GI1rffTXev-78n9ei_53wQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/GNiHtd4OPiZDQlN5KGAmRQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/GNiHtd4OPiZDQlN5KGAmRQ/output.json index 56ff659cba3..3a94e61a1df 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/GNiHtd4OPiZDQlN5KGAmRQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/GNiHtd4OPiZDQlN5KGAmRQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 4, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 4, "ctxt": 0 }, - "value": "*", - "raw": "\\2a " + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 4, + "ctxt": 0 + }, + "value": "*", + "raw": "\\2a " + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/GNiHtd4OPiZDQlN5KGAmRQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/GNiHtd4OPiZDQlN5KGAmRQ/span.rust-debug index 1909b0ee14b..a6454a3ee68 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/GNiHtd4OPiZDQlN5KGAmRQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/GNiHtd4OPiZDQlN5KGAmRQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | \2a {} | ^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/GNiHtd4OPiZDQlN5KGAmRQ/input.css:1:1 + | +1 | \2a {} + | ^^^^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/GNiHtd4OPiZDQlN5KGAmRQ/input.css:1:1 + | +1 | \2a {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/GNiHtd4OPiZDQlN5KGAmRQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/GVqeF3thmlPBqLweHlqIJQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/GVqeF3thmlPBqLweHlqIJQ/output.json index 36b889ad74d..3e26ce14734 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/GVqeF3thmlPBqLweHlqIJQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/GVqeF3thmlPBqLweHlqIJQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -76,22 +84,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 5, "end": 6, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 5, "end": 6, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 5, + "end": 6, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/GVqeF3thmlPBqLweHlqIJQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/GVqeF3thmlPBqLweHlqIJQ/span.rust-debug index 77fec9c03ed..6bcfc19b16a 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/GVqeF3thmlPBqLweHlqIJQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/GVqeF3thmlPBqLweHlqIJQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a/**/b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/GVqeF3thmlPBqLweHlqIJQ/input.css:1:1 + | +1 | a/**/b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/GVqeF3thmlPBqLweHlqIJQ/input.css:1:1 + | +1 | a/**/b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/GVqeF3thmlPBqLweHlqIJQ/input.css:1:1 | @@ -64,6 +76,18 @@ error: TypeSelector 1 | a/**/b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/GVqeF3thmlPBqLweHlqIJQ/input.css:1:6 + | +1 | a/**/b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/GVqeF3thmlPBqLweHlqIJQ/input.css:1:6 + | +1 | a/**/b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/GVqeF3thmlPBqLweHlqIJQ/input.css:1:6 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/GjvJfQVAaNQonYJwt8QRDQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/GjvJfQVAaNQonYJwt8QRDQ/output.json index db6730e5a1c..6cacdafb89a 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/GjvJfQVAaNQonYJwt8QRDQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/GjvJfQVAaNQonYJwt8QRDQ/output.json @@ -46,18 +46,34 @@ "end": 8, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 2, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 2, + "end": 4, + "ctxt": 0 + }, + "value": "*=" }, - "matcher": "*=", "value": { "type": "String", "span": { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/GjvJfQVAaNQonYJwt8QRDQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/GjvJfQVAaNQonYJwt8QRDQ/span.rust-debug index 76044c296c5..82b6899a42a 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/GjvJfQVAaNQonYJwt8QRDQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/GjvJfQVAaNQonYJwt8QRDQ/span.rust-debug @@ -40,18 +40,36 @@ error: SubclassSelector 1 | [b*="c"] {} | ^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/GjvJfQVAaNQonYJwt8QRDQ/input.css:1:1 | 1 | [b*="c"] {} | ^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/GjvJfQVAaNQonYJwt8QRDQ/input.css:1:2 + | +1 | [b*="c"] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/GjvJfQVAaNQonYJwt8QRDQ/input.css:1:2 | 1 | [b*="c"] {} | ^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/GjvJfQVAaNQonYJwt8QRDQ/input.css:1:3 + | +1 | [b*="c"] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/GjvJfQVAaNQonYJwt8QRDQ/input.css:1:5 + | +1 | [b*="c"] {} + | ^^^ + error: Str --> $DIR/tests/fixture/esbuild/misc/GjvJfQVAaNQonYJwt8QRDQ/input.css:1:5 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/GpePX8ZJM8IP14hXFTKKxQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/GpePX8ZJM8IP14hXFTKKxQ/output.json index 3f963df2d52..e0e80870f6b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/GpePX8ZJM8IP14hXFTKKxQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/GpePX8ZJM8IP14hXFTKKxQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/GpePX8ZJM8IP14hXFTKKxQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/GpePX8ZJM8IP14hXFTKKxQ/span.rust-debug index f905e0a57ca..9cb4e9fd917 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/GpePX8ZJM8IP14hXFTKKxQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/GpePX8ZJM8IP14hXFTKKxQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: x\,() } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/GpePX8ZJM8IP14hXFTKKxQ/input.css:1:1 + | +1 | a { value: x\,() } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/GpePX8ZJM8IP14hXFTKKxQ/input.css:1:1 + | +1 | a { value: x\,() } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/GpePX8ZJM8IP14hXFTKKxQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/HBQJEriDrHgN_kXjKrVW9g/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/HBQJEriDrHgN_kXjKrVW9g/output.json index 0e12911345f..6d892e4bfa5 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/HBQJEriDrHgN_kXjKrVW9g/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/HBQJEriDrHgN_kXjKrVW9g/output.json @@ -46,25 +46,41 @@ "end": 11, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 1, - "end": 3, - "ctxt": 0 - }, - "value": "ns", - "raw": "ns" - }, - "name": { - "type": "Identifier", - "span": { - "start": 4, "end": 10, "ctxt": 0 }, - "value": "attr", - "raw": "\\61ttr" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 1, + "end": 4, + "ctxt": 0 + }, + "prefix": { + "type": "Identifier", + "span": { + "start": 1, + "end": 3, + "ctxt": 0 + }, + "value": "ns", + "raw": "ns" + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 4, + "end": 10, + "ctxt": 0 + }, + "value": "attr", + "raw": "\\61ttr" + } }, "matcher": null, "value": null, diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/HBQJEriDrHgN_kXjKrVW9g/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/HBQJEriDrHgN_kXjKrVW9g/span.rust-debug index 4c2026a6d05..f9d8679c68f 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/HBQJEriDrHgN_kXjKrVW9g/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/HBQJEriDrHgN_kXjKrVW9g/span.rust-debug @@ -40,12 +40,24 @@ error: SubclassSelector 1 | [ns|\61ttr] {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/HBQJEriDrHgN_kXjKrVW9g/input.css:1:1 | 1 | [ns|\61ttr] {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/HBQJEriDrHgN_kXjKrVW9g/input.css:1:2 + | +1 | [ns|\61ttr] {} + | ^^^^^^^^^ + +error: NsPrefix + --> $DIR/tests/fixture/esbuild/misc/HBQJEriDrHgN_kXjKrVW9g/input.css:1:2 + | +1 | [ns|\61ttr] {} + | ^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/HBQJEriDrHgN_kXjKrVW9g/input.css:1:2 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/HDNE73X9waUrBkTAzz-20g/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/HDNE73X9waUrBkTAzz-20g/output.json index 4dd817c5fe0..e5bb779aaff 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/HDNE73X9waUrBkTAzz-20g/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/HDNE73X9waUrBkTAzz-20g/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/HDNE73X9waUrBkTAzz-20g/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/HDNE73X9waUrBkTAzz-20g/span.rust-debug index ee8b1ee3aab..54537fef894 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/HDNE73X9waUrBkTAzz-20g/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/HDNE73X9waUrBkTAzz-20g/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: #h\61sh } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/HDNE73X9waUrBkTAzz-20g/input.css:1:1 + | +1 | a { value: #h\61sh } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/HDNE73X9waUrBkTAzz-20g/input.css:1:1 + | +1 | a { value: #h\61sh } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/HDNE73X9waUrBkTAzz-20g/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/HGH4crVp9Whp_G0PY6BaQA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/HGH4crVp9Whp_G0PY6BaQA/output.json index ba38398b57d..689db707e6a 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/HGH4crVp9Whp_G0PY6BaQA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/HGH4crVp9Whp_G0PY6BaQA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -64,16 +72,24 @@ "end": 4, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 2, "end": 3, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 2, + "end": 3, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } }, "matcher": null, "value": null, diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/HGH4crVp9Whp_G0PY6BaQA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/HGH4crVp9Whp_G0PY6BaQA/span.rust-debug index d9a1ec53ef3..e164a462252 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/HGH4crVp9Whp_G0PY6BaQA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/HGH4crVp9Whp_G0PY6BaQA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a[b] {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/HGH4crVp9Whp_G0PY6BaQA/input.css:1:1 + | +1 | a[b] {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/HGH4crVp9Whp_G0PY6BaQA/input.css:1:1 + | +1 | a[b] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/HGH4crVp9Whp_G0PY6BaQA/input.css:1:1 | @@ -52,12 +64,18 @@ error: SubclassSelector 1 | a[b] {} | ^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/HGH4crVp9Whp_G0PY6BaQA/input.css:1:2 | 1 | a[b] {} | ^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/HGH4crVp9Whp_G0PY6BaQA/input.css:1:3 + | +1 | a[b] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/HGH4crVp9Whp_G0PY6BaQA/input.css:1:3 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/HWU09nmB9oZX7WY8zUbrnA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/HWU09nmB9oZX7WY8zUbrnA/output.json index e38eae88128..db2e6da4e17 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/HWU09nmB9oZX7WY8zUbrnA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/HWU09nmB9oZX7WY8zUbrnA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/HWU09nmB9oZX7WY8zUbrnA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/HWU09nmB9oZX7WY8zUbrnA/span.rust-debug index 2c36bfaae23..1a64c69b052 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/HWU09nmB9oZX7WY8zUbrnA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/HWU09nmB9oZX7WY8zUbrnA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: -0.1%; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/HWU09nmB9oZX7WY8zUbrnA/input.css:1:1 + | +1 | a { width: -0.1%; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/HWU09nmB9oZX7WY8zUbrnA/input.css:1:1 + | +1 | a { width: -0.1%; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/HWU09nmB9oZX7WY8zUbrnA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/I33LxmnLDtSRSbNrHmoNRA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/I33LxmnLDtSRSbNrHmoNRA/output.json index a3ec54faf19..815257dbfc2 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/I33LxmnLDtSRSbNrHmoNRA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/I33LxmnLDtSRSbNrHmoNRA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -76,22 +84,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 4, "end": 5, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 4, "end": 5, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 4, + "end": 5, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/I33LxmnLDtSRSbNrHmoNRA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/I33LxmnLDtSRSbNrHmoNRA/span.rust-debug index e2c0db8de4b..e8a55fa03a8 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/I33LxmnLDtSRSbNrHmoNRA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/I33LxmnLDtSRSbNrHmoNRA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a + b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/I33LxmnLDtSRSbNrHmoNRA/input.css:1:1 + | +1 | a + b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/I33LxmnLDtSRSbNrHmoNRA/input.css:1:1 + | +1 | a + b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/I33LxmnLDtSRSbNrHmoNRA/input.css:1:1 | @@ -64,6 +76,18 @@ error: TypeSelector 1 | a + b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/I33LxmnLDtSRSbNrHmoNRA/input.css:1:5 + | +1 | a + b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/I33LxmnLDtSRSbNrHmoNRA/input.css:1:5 + | +1 | a + b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/I33LxmnLDtSRSbNrHmoNRA/input.css:1:5 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/LoeMqdekBkn3XKYHQFHOZA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/LoeMqdekBkn3XKYHQFHOZA/output.json index 2269bc369ee..71cecdc754a 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/LoeMqdekBkn3XKYHQFHOZA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/LoeMqdekBkn3XKYHQFHOZA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/LoeMqdekBkn3XKYHQFHOZA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/LoeMqdekBkn3XKYHQFHOZA/span.rust-debug index cf88c6be03b..ca881482157 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/LoeMqdekBkn3XKYHQFHOZA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/LoeMqdekBkn3XKYHQFHOZA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #AABCCC } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/LoeMqdekBkn3XKYHQFHOZA/input.css:1:1 + | +1 | a { color: #AABCCC } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/LoeMqdekBkn3XKYHQFHOZA/input.css:1:1 + | +1 | a { color: #AABCCC } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/LoeMqdekBkn3XKYHQFHOZA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Loy9sX2qaylR2OySt7N-BQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/Loy9sX2qaylR2OySt7N-BQ/output.json index b3387aabcc7..e7597f7c25c 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Loy9sX2qaylR2OySt7N-BQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Loy9sX2qaylR2OySt7N-BQ/output.json @@ -38,31 +38,29 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, "prefix": { - "type": "Identifier", + "type": "NsPrefix", "span": { "start": 0, - "end": 1, + "end": 2, "ctxt": 0 }, - "value": "a", - "raw": "a" - }, - "name": { - "type": "Identifier", - "span": { - "start": 2, - "end": 3, - "ctxt": 0 - }, - "value": "*", - "raw": "*" + "prefix": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Loy9sX2qaylR2OySt7N-BQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/Loy9sX2qaylR2OySt7N-BQ/span.rust-debug index ad6a988d068..02391005c2b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Loy9sX2qaylR2OySt7N-BQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Loy9sX2qaylR2OySt7N-BQ/span.rust-debug @@ -40,18 +40,24 @@ error: TypeSelector 1 | a|* {} | ^^^ +error: UniversalSelector + --> $DIR/tests/fixture/esbuild/misc/Loy9sX2qaylR2OySt7N-BQ/input.css:1:1 + | +1 | a|* {} + | ^^^ + +error: NsPrefix + --> $DIR/tests/fixture/esbuild/misc/Loy9sX2qaylR2OySt7N-BQ/input.css:1:1 + | +1 | a|* {} + | ^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/Loy9sX2qaylR2OySt7N-BQ/input.css:1:1 | 1 | a|* {} | ^ -error: Ident - --> $DIR/tests/fixture/esbuild/misc/Loy9sX2qaylR2OySt7N-BQ/input.css:1:3 - | -1 | a|* {} - | ^ - error: Block --> $DIR/tests/fixture/esbuild/misc/Loy9sX2qaylR2OySt7N-BQ/input.css:1:5 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/MCJc58-6bYzpgizSxt8jQg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/MCJc58-6bYzpgizSxt8jQg/output.json index b0aa95e11d4..d0a509e5e27 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/MCJc58-6bYzpgizSxt8jQg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/MCJc58-6bYzpgizSxt8jQg/output.json @@ -46,25 +46,41 @@ "end": 12, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 1, - "end": 6, - "ctxt": 0 - }, - "value": ",ns", - "raw": "\\2cns" - }, - "name": { - "type": "Identifier", - "span": { - "start": 7, "end": 11, "ctxt": 0 }, - "value": "attr", - "raw": "attr" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 1, + "end": 7, + "ctxt": 0 + }, + "prefix": { + "type": "Identifier", + "span": { + "start": 1, + "end": 6, + "ctxt": 0 + }, + "value": ",ns", + "raw": "\\2cns" + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 7, + "end": 11, + "ctxt": 0 + }, + "value": "attr", + "raw": "attr" + } }, "matcher": null, "value": null, diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/MCJc58-6bYzpgizSxt8jQg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/MCJc58-6bYzpgizSxt8jQg/span.rust-debug index e002e9bfbfb..244f1bcc0a5 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/MCJc58-6bYzpgizSxt8jQg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/MCJc58-6bYzpgizSxt8jQg/span.rust-debug @@ -40,12 +40,24 @@ error: SubclassSelector 1 | [\2cns|attr] {} | ^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/MCJc58-6bYzpgizSxt8jQg/input.css:1:1 | 1 | [\2cns|attr] {} | ^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/MCJc58-6bYzpgizSxt8jQg/input.css:1:2 + | +1 | [\2cns|attr] {} + | ^^^^^^^^^^ + +error: NsPrefix + --> $DIR/tests/fixture/esbuild/misc/MCJc58-6bYzpgizSxt8jQg/input.css:1:2 + | +1 | [\2cns|attr] {} + | ^^^^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/MCJc58-6bYzpgizSxt8jQg/input.css:1:2 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/MHzCL6d2nAk4bByQ_ja7xg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/MHzCL6d2nAk4bByQ_ja7xg/output.json index 28737eb4f80..015f1f2f6dd 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/MHzCL6d2nAk4bByQ_ja7xg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/MHzCL6d2nAk4bByQ_ja7xg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/MHzCL6d2nAk4bByQ_ja7xg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/MHzCL6d2nAk4bByQ_ja7xg/span.rust-debug index 1eb57b88e99..24e59026606 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/MHzCL6d2nAk4bByQ_ja7xg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/MHzCL6d2nAk4bByQ_ja7xg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a{} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/MHzCL6d2nAk4bByQ_ja7xg/input.css:1:1 + | +1 | a{} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/MHzCL6d2nAk4bByQ_ja7xg/input.css:1:1 + | +1 | a{} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/MHzCL6d2nAk4bByQ_ja7xg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/MK5PGiCFMf7RHDp05gnDCw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/MK5PGiCFMf7RHDp05gnDCw/output.json index 1a6f4ec528f..205500caf9d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/MK5PGiCFMf7RHDp05gnDCw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/MK5PGiCFMf7RHDp05gnDCw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/MK5PGiCFMf7RHDp05gnDCw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/MK5PGiCFMf7RHDp05gnDCw/span.rust-debug index 878a9d56bbb..5dfc29c3cb5 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/MK5PGiCFMf7RHDp05gnDCw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/MK5PGiCFMf7RHDp05gnDCw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #aabbccdd } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/MK5PGiCFMf7RHDp05gnDCw/input.css:1:1 + | +1 | a { color: #aabbccdd } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/MK5PGiCFMf7RHDp05gnDCw/input.css:1:1 + | +1 | a { color: #aabbccdd } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/MK5PGiCFMf7RHDp05gnDCw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/MMBANlJKeKQw886fHOYiHA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/MMBANlJKeKQw886fHOYiHA/output.json index 36bce8dc543..9c2b24704b3 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/MMBANlJKeKQw886fHOYiHA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/MMBANlJKeKQw886fHOYiHA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/MMBANlJKeKQw886fHOYiHA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/MMBANlJKeKQw886fHOYiHA/span.rust-debug index bed56a3b06a..8f10c21ce37 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/MMBANlJKeKQw886fHOYiHA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/MMBANlJKeKQw886fHOYiHA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: 10\32x } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/MMBANlJKeKQw886fHOYiHA/input.css:1:1 + | +1 | a { value: 10\32x } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/MMBANlJKeKQw886fHOYiHA/input.css:1:1 + | +1 | a { value: 10\32x } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/MMBANlJKeKQw886fHOYiHA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/MU8JgGd_-h5ocqkfawNxeQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/MU8JgGd_-h5ocqkfawNxeQ/output.json index 9ca2aa4d0c8..41b9f359c81 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/MU8JgGd_-h5ocqkfawNxeQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/MU8JgGd_-h5ocqkfawNxeQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/MU8JgGd_-h5ocqkfawNxeQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/MU8JgGd_-h5ocqkfawNxeQ/span.rust-debug index 3ec0a3da2d7..428e47ef711 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/MU8JgGd_-h5ocqkfawNxeQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/MU8JgGd_-h5ocqkfawNxeQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #abbbccdd } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/MU8JgGd_-h5ocqkfawNxeQ/input.css:1:1 + | +1 | a { color: #abbbccdd } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/MU8JgGd_-h5ocqkfawNxeQ/input.css:1:1 + | +1 | a { color: #abbbccdd } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/MU8JgGd_-h5ocqkfawNxeQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Mdtiu_Fpfso6gXZMciRJgw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/Mdtiu_Fpfso6gXZMciRJgw/output.json index b99ccebd48b..147e638daa8 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Mdtiu_Fpfso6gXZMciRJgw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Mdtiu_Fpfso6gXZMciRJgw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Mdtiu_Fpfso6gXZMciRJgw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/Mdtiu_Fpfso6gXZMciRJgw/span.rust-debug index 8eef4d0ac68..548f912b341 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Mdtiu_Fpfso6gXZMciRJgw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Mdtiu_Fpfso6gXZMciRJgw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: 10\65m } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/Mdtiu_Fpfso6gXZMciRJgw/input.css:1:1 + | +1 | a { value: 10\65m } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/Mdtiu_Fpfso6gXZMciRJgw/input.css:1:1 + | +1 | a { value: 10\65m } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/Mdtiu_Fpfso6gXZMciRJgw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/MmOsa9XFdPMS9x4ITbWSzg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/MmOsa9XFdPMS9x4ITbWSzg/output.json index 863e10d1789..257e1605698 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/MmOsa9XFdPMS9x4ITbWSzg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/MmOsa9XFdPMS9x4ITbWSzg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/MmOsa9XFdPMS9x4ITbWSzg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/MmOsa9XFdPMS9x4ITbWSzg/span.rust-debug index ae0479c0bc6..4ac8db3b8b2 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/MmOsa9XFdPMS9x4ITbWSzg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/MmOsa9XFdPMS9x4ITbWSzg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: -.00; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/MmOsa9XFdPMS9x4ITbWSzg/input.css:1:1 + | +1 | a { width: -.00; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/MmOsa9XFdPMS9x4ITbWSzg/input.css:1:1 + | +1 | a { width: -.00; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/MmOsa9XFdPMS9x4ITbWSzg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/MxxFvoxSpp02tFmpbNdA8g/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/MxxFvoxSpp02tFmpbNdA8g/output.json index 83c8945bdad..cc436f47d04 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/MxxFvoxSpp02tFmpbNdA8g/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/MxxFvoxSpp02tFmpbNdA8g/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/MxxFvoxSpp02tFmpbNdA8g/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/MxxFvoxSpp02tFmpbNdA8g/span.rust-debug index e4c7ee3fce5..ce25c6b84b9 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/MxxFvoxSpp02tFmpbNdA8g/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/MxxFvoxSpp02tFmpbNdA8g/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: '\0' } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/MxxFvoxSpp02tFmpbNdA8g/input.css:1:1 + | +1 | a { value: '\0' } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/MxxFvoxSpp02tFmpbNdA8g/input.css:1:1 + | +1 | a { value: '\0' } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/MxxFvoxSpp02tFmpbNdA8g/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/NGFFzFWLONNmgWPM_FpiZg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/NGFFzFWLONNmgWPM_FpiZg/output.json index cf38d31add9..4f58ecceea3 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/NGFFzFWLONNmgWPM_FpiZg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/NGFFzFWLONNmgWPM_FpiZg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/NGFFzFWLONNmgWPM_FpiZg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/NGFFzFWLONNmgWPM_FpiZg/span.rust-debug index d275c8d03f7..f620a580b45 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/NGFFzFWLONNmgWPM_FpiZg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/NGFFzFWLONNmgWPM_FpiZg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: +.00%; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/NGFFzFWLONNmgWPM_FpiZg/input.css:1:1 + | +1 | a { width: +.00%; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/NGFFzFWLONNmgWPM_FpiZg/input.css:1:1 + | +1 | a { width: +.00%; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/NGFFzFWLONNmgWPM_FpiZg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/O2EvcnNp_CVyX3xq5-eM-g/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/O2EvcnNp_CVyX3xq5-eM-g/output.json index 8c165238dc2..dd84e6d740d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/O2EvcnNp_CVyX3xq5-eM-g/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/O2EvcnNp_CVyX3xq5-eM-g/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/O2EvcnNp_CVyX3xq5-eM-g/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/O2EvcnNp_CVyX3xq5-eM-g/span.rust-debug index c57d2757307..20518be07b7 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/O2EvcnNp_CVyX3xq5-eM-g/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/O2EvcnNp_CVyX3xq5-eM-g/span.rust-debug @@ -43,6 +43,18 @@ error: TypeSelector 1 | a:after { content: 'a\ | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/O2EvcnNp_CVyX3xq5-eM-g/input.css:1:1 + | +1 | a:after { content: 'a\ + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/O2EvcnNp_CVyX3xq5-eM-g/input.css:1:1 + | +1 | a:after { content: 'a\ + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/O2EvcnNp_CVyX3xq5-eM-g/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Oc6Obl7mbH-MlFllIoAbdg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/Oc6Obl7mbH-MlFllIoAbdg/output.json index 30ab815b8c1..bbcfbf0b7ce 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Oc6Obl7mbH-MlFllIoAbdg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Oc6Obl7mbH-MlFllIoAbdg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Oc6Obl7mbH-MlFllIoAbdg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/Oc6Obl7mbH-MlFllIoAbdg/span.rust-debug index 47c36f2b472..ba58aa72609 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Oc6Obl7mbH-MlFllIoAbdg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Oc6Obl7mbH-MlFllIoAbdg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #AABBCCDE } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/Oc6Obl7mbH-MlFllIoAbdg/input.css:1:1 + | +1 | a { color: #AABBCCDE } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/Oc6Obl7mbH-MlFllIoAbdg/input.css:1:1 + | +1 | a { color: #AABBCCDE } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/Oc6Obl7mbH-MlFllIoAbdg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/OjiW46YAJSt_cq_MHhs2Bw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/OjiW46YAJSt_cq_MHhs2Bw/output.json index 3042dd86346..a9593571ea6 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/OjiW46YAJSt_cq_MHhs2Bw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/OjiW46YAJSt_cq_MHhs2Bw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 4, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 4, "ctxt": 0 }, - "value": "--", - "raw": "\\2d-" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 4, + "ctxt": 0 + }, + "value": "--", + "raw": "\\2d-" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/OjiW46YAJSt_cq_MHhs2Bw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/OjiW46YAJSt_cq_MHhs2Bw/span.rust-debug index 570cdbba7e3..f229d37e835 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/OjiW46YAJSt_cq_MHhs2Bw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/OjiW46YAJSt_cq_MHhs2Bw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | \2d- {} | ^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/OjiW46YAJSt_cq_MHhs2Bw/input.css:1:1 + | +1 | \2d- {} + | ^^^^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/OjiW46YAJSt_cq_MHhs2Bw/input.css:1:1 + | +1 | \2d- {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/OjiW46YAJSt_cq_MHhs2Bw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/OtM9lGhbFLqI-r3dvNTUjQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/OtM9lGhbFLqI-r3dvNTUjQ/output.json index 9aa0f55e2ff..d25fd8a1b9a 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/OtM9lGhbFLqI-r3dvNTUjQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/OtM9lGhbFLqI-r3dvNTUjQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/OtM9lGhbFLqI-r3dvNTUjQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/OtM9lGhbFLqI-r3dvNTUjQ/span.rust-debug index abc4d02041b..358913b3d31 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/OtM9lGhbFLqI-r3dvNTUjQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/OtM9lGhbFLqI-r3dvNTUjQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: -.10; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/OtM9lGhbFLqI-r3dvNTUjQ/input.css:1:1 + | +1 | a { width: -.10; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/OtM9lGhbFLqI-r3dvNTUjQ/input.css:1:1 + | +1 | a { width: -.10; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/OtM9lGhbFLqI-r3dvNTUjQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/PRqD5VDViUThMCxIEmwIcg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/PRqD5VDViUThMCxIEmwIcg/output.json index f3567006d9d..13642acaad9 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/PRqD5VDViUThMCxIEmwIcg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/PRqD5VDViUThMCxIEmwIcg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/PRqD5VDViUThMCxIEmwIcg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/PRqD5VDViUThMCxIEmwIcg/span.rust-debug index 5c158c4ed31..062a781ab19 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/PRqD5VDViUThMCxIEmwIcg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/PRqD5VDViUThMCxIEmwIcg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/PRqD5VDViUThMCxIEmwIcg/input.css:1:1 + | +1 | a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/PRqD5VDViUThMCxIEmwIcg/input.css:1:1 + | +1 | a {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/PRqD5VDViUThMCxIEmwIcg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/PSncmPJMuHC-CjpwiYtkDw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/PSncmPJMuHC-CjpwiYtkDw/output.json index 17a9c88e867..3d5099cd5cb 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/PSncmPJMuHC-CjpwiYtkDw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/PSncmPJMuHC-CjpwiYtkDw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/PSncmPJMuHC-CjpwiYtkDw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/PSncmPJMuHC-CjpwiYtkDw/span.rust-debug index ac25e093f75..1bc6f1adad3 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/PSncmPJMuHC-CjpwiYtkDw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/PSncmPJMuHC-CjpwiYtkDw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { border-top-left-radius: 0 0 } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/PSncmPJMuHC-CjpwiYtkDw/input.css:1:1 + | +1 | a { border-top-left-radius: 0 0 } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/PSncmPJMuHC-CjpwiYtkDw/input.css:1:1 + | +1 | a { border-top-left-radius: 0 0 } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/PSncmPJMuHC-CjpwiYtkDw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Pkkf0GfuA1VzI7L4dGjS-A/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/Pkkf0GfuA1VzI7L4dGjS-A/output.json index f958dd9004f..718c98182fb 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Pkkf0GfuA1VzI7L4dGjS-A/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Pkkf0GfuA1VzI7L4dGjS-A/output.json @@ -45,31 +45,47 @@ } }, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1, "end": 4, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 1, - "end": 2, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - }, - "name": { - "type": "Identifier", - "span": { - "start": 3, "end": 4, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 1, + "end": 3, + "ctxt": 0 + }, + "prefix": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "*", + "raw": "*" + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 3, + "end": 4, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Pkkf0GfuA1VzI7L4dGjS-A/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/Pkkf0GfuA1VzI7L4dGjS-A/span.rust-debug index 443ad4ad077..bbbcab37100 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Pkkf0GfuA1VzI7L4dGjS-A/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Pkkf0GfuA1VzI7L4dGjS-A/span.rust-debug @@ -46,6 +46,24 @@ error: TypeSelector 1 | &*|b {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/Pkkf0GfuA1VzI7L4dGjS-A/input.css:1:2 + | +1 | &*|b {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/Pkkf0GfuA1VzI7L4dGjS-A/input.css:1:2 + | +1 | &*|b {} + | ^^^ + +error: NsPrefix + --> $DIR/tests/fixture/esbuild/misc/Pkkf0GfuA1VzI7L4dGjS-A/input.css:1:2 + | +1 | &*|b {} + | ^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/Pkkf0GfuA1VzI7L4dGjS-A/input.css:1:2 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Q42FDvG6_mtoeI7PoHqgQw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/Q42FDvG6_mtoeI7PoHqgQw/output.json index 88d0d49b6e3..a54fbccbbb9 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Q42FDvG6_mtoeI7PoHqgQw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Q42FDvG6_mtoeI7PoHqgQw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -84,16 +92,24 @@ "end": 5, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 3, "end": 4, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 3, + "end": 4, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } }, "matcher": null, "value": null, diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Q42FDvG6_mtoeI7PoHqgQw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/Q42FDvG6_mtoeI7PoHqgQw/span.rust-debug index 1a9cfaf8c5e..7ea5418ccc6 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Q42FDvG6_mtoeI7PoHqgQw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Q42FDvG6_mtoeI7PoHqgQw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a [b] {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/Q42FDvG6_mtoeI7PoHqgQw/input.css:1:1 + | +1 | a [b] {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/Q42FDvG6_mtoeI7PoHqgQw/input.css:1:1 + | +1 | a [b] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/Q42FDvG6_mtoeI7PoHqgQw/input.css:1:1 | @@ -64,12 +76,18 @@ error: SubclassSelector 1 | a [b] {} | ^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/Q42FDvG6_mtoeI7PoHqgQw/input.css:1:3 | 1 | a [b] {} | ^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/Q42FDvG6_mtoeI7PoHqgQw/input.css:1:4 + | +1 | a [b] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/Q42FDvG6_mtoeI7PoHqgQw/input.css:1:4 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/QLHVnSGDdGN_iDeP3OAXfQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/QLHVnSGDdGN_iDeP3OAXfQ/output.json index 1ee19ec5a08..ac5ca3009b3 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/QLHVnSGDdGN_iDeP3OAXfQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/QLHVnSGDdGN_iDeP3OAXfQ/output.json @@ -46,18 +46,34 @@ "end": 11, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 5, "ctxt": 0 }, - "value": "attr", - "raw": "attr" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 5, + "ctxt": 0 + }, + "value": "attr", + "raw": "attr" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 5, + "end": 6, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/QLHVnSGDdGN_iDeP3OAXfQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/QLHVnSGDdGN_iDeP3OAXfQ/span.rust-debug index 8dc4e36e499..ecd8ff0e7d9 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/QLHVnSGDdGN_iDeP3OAXfQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/QLHVnSGDdGN_iDeP3OAXfQ/span.rust-debug @@ -40,18 +40,36 @@ error: SubclassSelector 1 | [attr="--"] {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/QLHVnSGDdGN_iDeP3OAXfQ/input.css:1:1 | 1 | [attr="--"] {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/QLHVnSGDdGN_iDeP3OAXfQ/input.css:1:2 + | +1 | [attr="--"] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/QLHVnSGDdGN_iDeP3OAXfQ/input.css:1:2 | 1 | [attr="--"] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/QLHVnSGDdGN_iDeP3OAXfQ/input.css:1:6 + | +1 | [attr="--"] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/QLHVnSGDdGN_iDeP3OAXfQ/input.css:1:7 + | +1 | [attr="--"] {} + | ^^^^ + error: Str --> $DIR/tests/fixture/esbuild/misc/QLHVnSGDdGN_iDeP3OAXfQ/input.css:1:7 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Q_wA-fPw3o2m3R7gyWNxbQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/Q_wA-fPw3o2m3R7gyWNxbQ/output.json index b31231a7fd9..33d11edee8d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Q_wA-fPw3o2m3R7gyWNxbQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Q_wA-fPw3o2m3R7gyWNxbQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Q_wA-fPw3o2m3R7gyWNxbQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/Q_wA-fPw3o2m3R7gyWNxbQ/span.rust-debug index 1031bdcbb6d..11244ecfcc2 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Q_wA-fPw3o2m3R7gyWNxbQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Q_wA-fPw3o2m3R7gyWNxbQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a:after { content: '\invalid' } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/Q_wA-fPw3o2m3R7gyWNxbQ/input.css:1:1 + | +1 | a:after { content: '\invalid' } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/Q_wA-fPw3o2m3R7gyWNxbQ/input.css:1:1 + | +1 | a:after { content: '\invalid' } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/Q_wA-fPw3o2m3R7gyWNxbQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/R6OYU1g_sB_euLV8Yzjw6w/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/R6OYU1g_sB_euLV8Yzjw6w/output.json index b13d41bd51e..76d10d9c55f 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/R6OYU1g_sB_euLV8Yzjw6w/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/R6OYU1g_sB_euLV8Yzjw6w/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/R6OYU1g_sB_euLV8Yzjw6w/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/R6OYU1g_sB_euLV8Yzjw6w/span.rust-debug index dbe20f905d1..825b344072d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/R6OYU1g_sB_euLV8Yzjw6w/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/R6OYU1g_sB_euLV8Yzjw6w/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #AABBCCEF } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/R6OYU1g_sB_euLV8Yzjw6w/input.css:1:1 + | +1 | a { color: #AABBCCEF } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/R6OYU1g_sB_euLV8Yzjw6w/input.css:1:1 + | +1 | a { color: #AABBCCEF } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/R6OYU1g_sB_euLV8Yzjw6w/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/RmGccmub1dooAN8WPKTwhQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/RmGccmub1dooAN8WPKTwhQ/output.json index 54c8f683ae6..3d912ccbaf2 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/RmGccmub1dooAN8WPKTwhQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/RmGccmub1dooAN8WPKTwhQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/RmGccmub1dooAN8WPKTwhQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/RmGccmub1dooAN8WPKTwhQ/span.rust-debug index 6d97aa65665..95922144f97 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/RmGccmub1dooAN8WPKTwhQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/RmGccmub1dooAN8WPKTwhQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #123f } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/RmGccmub1dooAN8WPKTwhQ/input.css:1:1 + | +1 | a { color: #123f } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/RmGccmub1dooAN8WPKTwhQ/input.css:1:1 + | +1 | a { color: #123f } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/RmGccmub1dooAN8WPKTwhQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Rq1DOaNCa5Dl2jaozalLXQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/Rq1DOaNCa5Dl2jaozalLXQ/output.json index 4d5a21df82f..3256c2c24d3 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Rq1DOaNCa5Dl2jaozalLXQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Rq1DOaNCa5Dl2jaozalLXQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Rq1DOaNCa5Dl2jaozalLXQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/Rq1DOaNCa5Dl2jaozalLXQ/span.rust-debug index 7ed0aed28b7..2676e4a65c2 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Rq1DOaNCa5Dl2jaozalLXQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Rq1DOaNCa5Dl2jaozalLXQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { box-shadow: inset 0px 0px 0px 0px black } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/Rq1DOaNCa5Dl2jaozalLXQ/input.css:1:1 + | +1 | a { box-shadow: inset 0px 0px 0px 0px black } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/Rq1DOaNCa5Dl2jaozalLXQ/input.css:1:1 + | +1 | a { box-shadow: inset 0px 0px 0px 0px black } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/Rq1DOaNCa5Dl2jaozalLXQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/S2Mhk5rU2YxQPgm9rtF9WA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/S2Mhk5rU2YxQPgm9rtF9WA/output.json index d2faf4d30b7..1780c977e66 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/S2Mhk5rU2YxQPgm9rtF9WA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/S2Mhk5rU2YxQPgm9rtF9WA/output.json @@ -78,22 +78,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 44, "end": 46, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 44, "end": 46, "ctxt": 0 }, - "value": "h1", - "raw": "h1" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 44, + "end": 46, + "ctxt": 0 + }, + "value": "h1", + "raw": "h1" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/S2Mhk5rU2YxQPgm9rtF9WA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/S2Mhk5rU2YxQPgm9rtF9WA/span.rust-debug index 7d3007260b1..90ff13b83cb 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/S2Mhk5rU2YxQPgm9rtF9WA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/S2Mhk5rU2YxQPgm9rtF9WA/span.rust-debug @@ -82,6 +82,18 @@ error: TypeSelector 1 | @document url("https://www.example.com/") { h1 { color: green } } | ^^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/S2Mhk5rU2YxQPgm9rtF9WA/input.css:1:45 + | +1 | @document url("https://www.example.com/") { h1 { color: green } } + | ^^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/S2Mhk5rU2YxQPgm9rtF9WA/input.css:1:45 + | +1 | @document url("https://www.example.com/") { h1 { color: green } } + | ^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/S2Mhk5rU2YxQPgm9rtF9WA/input.css:1:45 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/SFBgyV9jnFbMzWZoo9VbSQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/SFBgyV9jnFbMzWZoo9VbSQ/output.json index 38d71c22b8b..7b75e36e7bc 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/SFBgyV9jnFbMzWZoo9VbSQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/SFBgyV9jnFbMzWZoo9VbSQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/SFBgyV9jnFbMzWZoo9VbSQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/SFBgyV9jnFbMzWZoo9VbSQ/span.rust-debug index 4680339fc71..5aff79e93d1 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/SFBgyV9jnFbMzWZoo9VbSQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/SFBgyV9jnFbMzWZoo9VbSQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #ABCF } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/SFBgyV9jnFbMzWZoo9VbSQ/input.css:1:1 + | +1 | a { color: #ABCF } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/SFBgyV9jnFbMzWZoo9VbSQ/input.css:1:1 + | +1 | a { color: #ABCF } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/SFBgyV9jnFbMzWZoo9VbSQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Ssg_Qhdw7h_c6ZtY52Qe4A/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/Ssg_Qhdw7h_c6ZtY52Qe4A/output.json index b9729438815..d1ad005edc7 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Ssg_Qhdw7h_c6ZtY52Qe4A/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Ssg_Qhdw7h_c6ZtY52Qe4A/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Ssg_Qhdw7h_c6ZtY52Qe4A/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/Ssg_Qhdw7h_c6ZtY52Qe4A/span.rust-debug index 409a7603a37..42c11bcf554 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Ssg_Qhdw7h_c6ZtY52Qe4A/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Ssg_Qhdw7h_c6ZtY52Qe4A/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #112333ff } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/Ssg_Qhdw7h_c6ZtY52Qe4A/input.css:1:1 + | +1 | a { color: #112333ff } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/Ssg_Qhdw7h_c6ZtY52Qe4A/input.css:1:1 + | +1 | a { color: #112333ff } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/Ssg_Qhdw7h_c6ZtY52Qe4A/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Sy2aOxINv1bvZmbK_Pc5Mg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/Sy2aOxINv1bvZmbK_Pc5Mg/output.json index 56dd2607c60..1c49766aba7 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Sy2aOxINv1bvZmbK_Pc5Mg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Sy2aOxINv1bvZmbK_Pc5Mg/output.json @@ -38,31 +38,29 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, "prefix": { - "type": "Identifier", + "type": "NsPrefix", "span": { "start": 0, - "end": 1, + "end": 2, "ctxt": 0 }, - "value": "*", - "raw": "*" - }, - "name": { - "type": "Identifier", - "span": { - "start": 2, - "end": 3, - "ctxt": 0 - }, - "value": "*", - "raw": "*" + "prefix": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "*", + "raw": "*" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Sy2aOxINv1bvZmbK_Pc5Mg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/Sy2aOxINv1bvZmbK_Pc5Mg/span.rust-debug index 5444c677cb5..3de7cf5afa6 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Sy2aOxINv1bvZmbK_Pc5Mg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Sy2aOxINv1bvZmbK_Pc5Mg/span.rust-debug @@ -40,18 +40,24 @@ error: TypeSelector 1 | *|* {} | ^^^ +error: UniversalSelector + --> $DIR/tests/fixture/esbuild/misc/Sy2aOxINv1bvZmbK_Pc5Mg/input.css:1:1 + | +1 | *|* {} + | ^^^ + +error: NsPrefix + --> $DIR/tests/fixture/esbuild/misc/Sy2aOxINv1bvZmbK_Pc5Mg/input.css:1:1 + | +1 | *|* {} + | ^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/Sy2aOxINv1bvZmbK_Pc5Mg/input.css:1:1 | 1 | *|* {} | ^ -error: Ident - --> $DIR/tests/fixture/esbuild/misc/Sy2aOxINv1bvZmbK_Pc5Mg/input.css:1:3 - | -1 | *|* {} - | ^ - error: Block --> $DIR/tests/fixture/esbuild/misc/Sy2aOxINv1bvZmbK_Pc5Mg/input.css:1:5 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/T1SOp4KXmIb1WNsyPFEKqg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/T1SOp4KXmIb1WNsyPFEKqg/output.json index 4b5d40ce974..0ec032fe740 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/T1SOp4KXmIb1WNsyPFEKqg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/T1SOp4KXmIb1WNsyPFEKqg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/T1SOp4KXmIb1WNsyPFEKqg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/T1SOp4KXmIb1WNsyPFEKqg/span.rust-debug index 5901f31003b..3bc27fa3e3b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/T1SOp4KXmIb1WNsyPFEKqg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/T1SOp4KXmIb1WNsyPFEKqg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #aabbccde } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/T1SOp4KXmIb1WNsyPFEKqg/input.css:1:1 + | +1 | a { color: #aabbccde } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/T1SOp4KXmIb1WNsyPFEKqg/input.css:1:1 + | +1 | a { color: #aabbccde } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/T1SOp4KXmIb1WNsyPFEKqg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/TdBn3uBF54mw96CCUwpgew/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/TdBn3uBF54mw96CCUwpgew/output.json index 0972c576b88..84da320f3d8 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/TdBn3uBF54mw96CCUwpgew/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/TdBn3uBF54mw96CCUwpgew/output.json @@ -46,25 +46,41 @@ "end": 5, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 1, - "end": 2, - "ctxt": 0 - }, - "value": "a", - "raw": "a" - }, - "name": { - "type": "Identifier", - "span": { - "start": 3, "end": 4, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 1, + "end": 3, + "ctxt": 0 + }, + "prefix": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 3, + "end": 4, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } }, "matcher": null, "value": null, diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/TdBn3uBF54mw96CCUwpgew/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/TdBn3uBF54mw96CCUwpgew/span.rust-debug index b53ec76f654..1ef92c29a0e 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/TdBn3uBF54mw96CCUwpgew/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/TdBn3uBF54mw96CCUwpgew/span.rust-debug @@ -40,12 +40,24 @@ error: SubclassSelector 1 | [a|b]{} | ^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/TdBn3uBF54mw96CCUwpgew/input.css:1:1 | 1 | [a|b]{} | ^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/TdBn3uBF54mw96CCUwpgew/input.css:1:2 + | +1 | [a|b]{} + | ^^^ + +error: NsPrefix + --> $DIR/tests/fixture/esbuild/misc/TdBn3uBF54mw96CCUwpgew/input.css:1:2 + | +1 | [a|b]{} + | ^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/TdBn3uBF54mw96CCUwpgew/input.css:1:2 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/TyMkoZpPOEhvUBOmUhGOXQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/TyMkoZpPOEhvUBOmUhGOXQ/output.json index 66e6fcfdb7a..bcbb2338dd8 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/TyMkoZpPOEhvUBOmUhGOXQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/TyMkoZpPOEhvUBOmUhGOXQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/TyMkoZpPOEhvUBOmUhGOXQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/TyMkoZpPOEhvUBOmUhGOXQ/span.rust-debug index 2ea8f8830e9..9bc5a056c2d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/TyMkoZpPOEhvUBOmUhGOXQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/TyMkoZpPOEhvUBOmUhGOXQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: \,x } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/TyMkoZpPOEhvUBOmUhGOXQ/input.css:1:1 + | +1 | a { value: \,x } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/TyMkoZpPOEhvUBOmUhGOXQ/input.css:1:1 + | +1 | a { value: \,x } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/TyMkoZpPOEhvUBOmUhGOXQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/U-MOOs2vmQ3m-i8XisYj8w/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/U-MOOs2vmQ3m-i8XisYj8w/output.json index 6fca4551653..f15f9689b42 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/U-MOOs2vmQ3m-i8XisYj8w/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/U-MOOs2vmQ3m-i8XisYj8w/output.json @@ -46,18 +46,34 @@ "end": 10, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 2, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 3, + "end": 5, + "ctxt": 0 + }, + "value": "~=" }, - "matcher": "~=", "value": { "type": "String", "span": { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/U-MOOs2vmQ3m-i8XisYj8w/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/U-MOOs2vmQ3m-i8XisYj8w/span.rust-debug index 75a66df832a..c37cb0d9490 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/U-MOOs2vmQ3m-i8XisYj8w/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/U-MOOs2vmQ3m-i8XisYj8w/span.rust-debug @@ -40,18 +40,36 @@ error: SubclassSelector 1 | [b ~= "c"] {} | ^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/U-MOOs2vmQ3m-i8XisYj8w/input.css:1:1 | 1 | [b ~= "c"] {} | ^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/U-MOOs2vmQ3m-i8XisYj8w/input.css:1:2 + | +1 | [b ~= "c"] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/U-MOOs2vmQ3m-i8XisYj8w/input.css:1:2 | 1 | [b ~= "c"] {} | ^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/U-MOOs2vmQ3m-i8XisYj8w/input.css:1:4 + | +1 | [b ~= "c"] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/U-MOOs2vmQ3m-i8XisYj8w/input.css:1:7 + | +1 | [b ~= "c"] {} + | ^^^ + error: Str --> $DIR/tests/fixture/esbuild/misc/U-MOOs2vmQ3m-i8XisYj8w/input.css:1:7 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/U2nuhvtnEWZ_kMd6i7EDWA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/U2nuhvtnEWZ_kMd6i7EDWA/output.json index f45eda4f72f..ca424f9ee02 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/U2nuhvtnEWZ_kMd6i7EDWA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/U2nuhvtnEWZ_kMd6i7EDWA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/U2nuhvtnEWZ_kMd6i7EDWA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/U2nuhvtnEWZ_kMd6i7EDWA/span.rust-debug index 6da1e1dc39e..fd3576dde2b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/U2nuhvtnEWZ_kMd6i7EDWA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/U2nuhvtnEWZ_kMd6i7EDWA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #AABBCD } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/U2nuhvtnEWZ_kMd6i7EDWA/input.css:1:1 + | +1 | a { color: #AABBCD } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/U2nuhvtnEWZ_kMd6i7EDWA/input.css:1:1 + | +1 | a { color: #AABBCD } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/U2nuhvtnEWZ_kMd6i7EDWA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/UeHn9b5w6R3dVjrtRCGxkA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/UeHn9b5w6R3dVjrtRCGxkA/output.json index 13d11abef25..7b7e3f48835 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/UeHn9b5w6R3dVjrtRCGxkA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/UeHn9b5w6R3dVjrtRCGxkA/output.json @@ -38,31 +38,20 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 0, "end": 2, "ctxt": 0 }, "prefix": { - "type": "Identifier", + "type": "NsPrefix", "span": { "start": 0, - "end": 0, + "end": 1, "ctxt": 0 }, - "value": "", - "raw": "" - }, - "name": { - "type": "Identifier", - "span": { - "start": 1, - "end": 2, - "ctxt": 0 - }, - "value": "*", - "raw": "*" + "prefix": null } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/UeHn9b5w6R3dVjrtRCGxkA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/UeHn9b5w6R3dVjrtRCGxkA/span.rust-debug index 7be0ffa8894..378a2f5d80d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/UeHn9b5w6R3dVjrtRCGxkA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/UeHn9b5w6R3dVjrtRCGxkA/span.rust-debug @@ -40,13 +40,17 @@ error: TypeSelector 1 | |* {} | ^^ -error: Ident - -error: Ident - --> $DIR/tests/fixture/esbuild/misc/UeHn9b5w6R3dVjrtRCGxkA/input.css:1:2 +error: UniversalSelector + --> $DIR/tests/fixture/esbuild/misc/UeHn9b5w6R3dVjrtRCGxkA/input.css:1:1 | 1 | |* {} - | ^ + | ^^ + +error: NsPrefix + --> $DIR/tests/fixture/esbuild/misc/UeHn9b5w6R3dVjrtRCGxkA/input.css:1:1 + | +1 | |* {} + | ^ error: Block --> $DIR/tests/fixture/esbuild/misc/UeHn9b5w6R3dVjrtRCGxkA/input.css:1:4 diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Uuvi9sS4YR_ILpKl0xpfOg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/Uuvi9sS4YR_ILpKl0xpfOg/output.json index 1baf7bf1c4f..a1f8137875d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Uuvi9sS4YR_ILpKl0xpfOg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Uuvi9sS4YR_ILpKl0xpfOg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Uuvi9sS4YR_ILpKl0xpfOg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/Uuvi9sS4YR_ILpKl0xpfOg/span.rust-debug index 6e42185ff2d..18024b4d073 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Uuvi9sS4YR_ILpKl0xpfOg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Uuvi9sS4YR_ILpKl0xpfOg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: url(a\62 c) } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/Uuvi9sS4YR_ILpKl0xpfOg/input.css:1:1 + | +1 | a { value: url(a\62 c) } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/Uuvi9sS4YR_ILpKl0xpfOg/input.css:1:1 + | +1 | a { value: url(a\62 c) } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/Uuvi9sS4YR_ILpKl0xpfOg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/V6ATfoZsbJDwKWSnlREl-w/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/V6ATfoZsbJDwKWSnlREl-w/output.json index c253fcb021d..db6eadc74a9 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/V6ATfoZsbJDwKWSnlREl-w/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/V6ATfoZsbJDwKWSnlREl-w/output.json @@ -46,18 +46,34 @@ "end": 8, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 2, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 2, + "end": 4, + "ctxt": 0 + }, + "value": "~=" }, - "matcher": "~=", "value": { "type": "String", "span": { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/V6ATfoZsbJDwKWSnlREl-w/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/V6ATfoZsbJDwKWSnlREl-w/span.rust-debug index 8d9ccc72474..f8b8c0d8948 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/V6ATfoZsbJDwKWSnlREl-w/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/V6ATfoZsbJDwKWSnlREl-w/span.rust-debug @@ -40,18 +40,36 @@ error: SubclassSelector 1 | [b~="c"] {} | ^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/V6ATfoZsbJDwKWSnlREl-w/input.css:1:1 | 1 | [b~="c"] {} | ^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/V6ATfoZsbJDwKWSnlREl-w/input.css:1:2 + | +1 | [b~="c"] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/V6ATfoZsbJDwKWSnlREl-w/input.css:1:2 | 1 | [b~="c"] {} | ^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/V6ATfoZsbJDwKWSnlREl-w/input.css:1:3 + | +1 | [b~="c"] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/V6ATfoZsbJDwKWSnlREl-w/input.css:1:5 + | +1 | [b~="c"] {} + | ^^^ + error: Str --> $DIR/tests/fixture/esbuild/misc/V6ATfoZsbJDwKWSnlREl-w/input.css:1:5 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/W3R-c5DPSkhG9QWYdcFdFg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/W3R-c5DPSkhG9QWYdcFdFg/output.json index aeee1279f16..d99c8ca7cde 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/W3R-c5DPSkhG9QWYdcFdFg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/W3R-c5DPSkhG9QWYdcFdFg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/W3R-c5DPSkhG9QWYdcFdFg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/W3R-c5DPSkhG9QWYdcFdFg/span.rust-debug index 2be79614349..1f8bfa59000 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/W3R-c5DPSkhG9QWYdcFdFg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/W3R-c5DPSkhG9QWYdcFdFg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #AABBCCDD } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/W3R-c5DPSkhG9QWYdcFdFg/input.css:1:1 + | +1 | a { color: #AABBCCDD } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/W3R-c5DPSkhG9QWYdcFdFg/input.css:1:1 + | +1 | a { color: #AABBCCDD } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/W3R-c5DPSkhG9QWYdcFdFg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/WQWdwW4B4hm60AQgxTU08Q/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/WQWdwW4B4hm60AQgxTU08Q/output.json index 6d82b3ad439..340852d011a 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/WQWdwW4B4hm60AQgxTU08Q/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/WQWdwW4B4hm60AQgxTU08Q/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/WQWdwW4B4hm60AQgxTU08Q/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/WQWdwW4B4hm60AQgxTU08Q/span.rust-debug index e1442d61350..7bcf286ead3 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/WQWdwW4B4hm60AQgxTU08Q/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/WQWdwW4B4hm60AQgxTU08Q/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a::b(c) {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/WQWdwW4B4hm60AQgxTU08Q/input.css:1:1 + | +1 | a::b(c) {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/WQWdwW4B4hm60AQgxTU08Q/input.css:1:1 + | +1 | a::b(c) {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/WQWdwW4B4hm60AQgxTU08Q/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Wb-aVu7CEQfCy1QL2yUrEw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/Wb-aVu7CEQfCy1QL2yUrEw/output.json index cf1143bdc79..a432d9276f0 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Wb-aVu7CEQfCy1QL2yUrEw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Wb-aVu7CEQfCy1QL2yUrEw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Wb-aVu7CEQfCy1QL2yUrEw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/Wb-aVu7CEQfCy1QL2yUrEw/span.rust-debug index 723c47c0b75..786a6425fa5 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Wb-aVu7CEQfCy1QL2yUrEw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Wb-aVu7CEQfCy1QL2yUrEw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { border-radius: 1 2 3 4; border-top-right-radius: 5; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/Wb-aVu7CEQfCy1QL2yUrEw/input.css:1:1 + | +1 | a { border-radius: 1 2 3 4; border-top-right-radius: 5; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/Wb-aVu7CEQfCy1QL2yUrEw/input.css:1:1 + | +1 | a { border-radius: 1 2 3 4; border-top-right-radius: 5; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/Wb-aVu7CEQfCy1QL2yUrEw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/WnrbfdZnESKVnJxygl6yYA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/WnrbfdZnESKVnJxygl6yYA/output.json index 2c5359681e0..f761b6f9f3f 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/WnrbfdZnESKVnJxygl6yYA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/WnrbfdZnESKVnJxygl6yYA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -76,22 +84,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 6, "end": 7, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 6, "end": 7, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 6, + "end": 7, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/WnrbfdZnESKVnJxygl6yYA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/WnrbfdZnESKVnJxygl6yYA/span.rust-debug index 5f34cd8c3a8..a673b18d14b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/WnrbfdZnESKVnJxygl6yYA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/WnrbfdZnESKVnJxygl6yYA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a>/**/b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/WnrbfdZnESKVnJxygl6yYA/input.css:1:1 + | +1 | a>/**/b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/WnrbfdZnESKVnJxygl6yYA/input.css:1:1 + | +1 | a>/**/b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/WnrbfdZnESKVnJxygl6yYA/input.css:1:1 | @@ -64,6 +76,18 @@ error: TypeSelector 1 | a>/**/b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/WnrbfdZnESKVnJxygl6yYA/input.css:1:7 + | +1 | a>/**/b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/WnrbfdZnESKVnJxygl6yYA/input.css:1:7 + | +1 | a>/**/b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/WnrbfdZnESKVnJxygl6yYA/input.css:1:7 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Wplrqmb_IDjNC-o-eqLw4A/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/Wplrqmb_IDjNC-o-eqLw4A/output.json index 44bfebd5dc4..a4b69eaa605 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Wplrqmb_IDjNC-o-eqLw4A/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Wplrqmb_IDjNC-o-eqLw4A/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Wplrqmb_IDjNC-o-eqLw4A/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/Wplrqmb_IDjNC-o-eqLw4A/span.rust-debug index 0db39042f9a..58fcb39f95f 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Wplrqmb_IDjNC-o-eqLw4A/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Wplrqmb_IDjNC-o-eqLw4A/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: \,x() } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/Wplrqmb_IDjNC-o-eqLw4A/input.css:1:1 + | +1 | a { value: \,x() } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/Wplrqmb_IDjNC-o-eqLw4A/input.css:1:1 + | +1 | a { value: \,x() } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/Wplrqmb_IDjNC-o-eqLw4A/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/X-yuwO0x1B-l1Js4JkKJZg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/X-yuwO0x1B-l1Js4JkKJZg/output.json index 2bde14e83a0..c776509480e 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/X-yuwO0x1B-l1Js4JkKJZg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/X-yuwO0x1B-l1Js4JkKJZg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/X-yuwO0x1B-l1Js4JkKJZg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/X-yuwO0x1B-l1Js4JkKJZg/span.rust-debug index c642820842a..ad7bdab18c0 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/X-yuwO0x1B-l1Js4JkKJZg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/X-yuwO0x1B-l1Js4JkKJZg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: +0.0; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/X-yuwO0x1B-l1Js4JkKJZg/input.css:1:1 + | +1 | a { width: +0.0; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/X-yuwO0x1B-l1Js4JkKJZg/input.css:1:1 + | +1 | a { width: +0.0; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/X-yuwO0x1B-l1Js4JkKJZg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/XVtQeQIEHAyQlpmKRigHcg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/XVtQeQIEHAyQlpmKRigHcg/output.json index f12f52963ee..9236481b7c5 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/XVtQeQIEHAyQlpmKRigHcg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/XVtQeQIEHAyQlpmKRigHcg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -76,22 +84,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 4, "end": 5, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 4, "end": 5, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 4, + "end": 5, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/XVtQeQIEHAyQlpmKRigHcg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/XVtQeQIEHAyQlpmKRigHcg/span.rust-debug index 36fda8f153e..3b8f5e30b80 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/XVtQeQIEHAyQlpmKRigHcg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/XVtQeQIEHAyQlpmKRigHcg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a ~ b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/XVtQeQIEHAyQlpmKRigHcg/input.css:1:1 + | +1 | a ~ b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/XVtQeQIEHAyQlpmKRigHcg/input.css:1:1 + | +1 | a ~ b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/XVtQeQIEHAyQlpmKRigHcg/input.css:1:1 | @@ -64,6 +76,18 @@ error: TypeSelector 1 | a ~ b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/XVtQeQIEHAyQlpmKRigHcg/input.css:1:5 + | +1 | a ~ b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/XVtQeQIEHAyQlpmKRigHcg/input.css:1:5 + | +1 | a ~ b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/XVtQeQIEHAyQlpmKRigHcg/input.css:1:5 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/YIW6UUMmxrTYJjJ3JSL3uQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/YIW6UUMmxrTYJjJ3JSL3uQ/output.json index a77c2f0a233..acb0fd8c58e 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/YIW6UUMmxrTYJjJ3JSL3uQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/YIW6UUMmxrTYJjJ3JSL3uQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/YIW6UUMmxrTYJjJ3JSL3uQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/YIW6UUMmxrTYJjJ3JSL3uQ/span.rust-debug index 359d73b5187..26f419c50e1 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/YIW6UUMmxrTYJjJ3JSL3uQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/YIW6UUMmxrTYJjJ3JSL3uQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #112234 } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/YIW6UUMmxrTYJjJ3JSL3uQ/input.css:1:1 + | +1 | a { color: #112234 } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/YIW6UUMmxrTYJjJ3JSL3uQ/input.css:1:1 + | +1 | a { color: #112234 } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/YIW6UUMmxrTYJjJ3JSL3uQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Yc70giIIGDIddrjD858dDw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/Yc70giIIGDIddrjD858dDw/output.json index 99e879423da..256c43a432b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Yc70giIIGDIddrjD858dDw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Yc70giIIGDIddrjD858dDw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Yc70giIIGDIddrjD858dDw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/Yc70giIIGDIddrjD858dDw/span.rust-debug index b9d5b8154cf..566df903665 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Yc70giIIGDIddrjD858dDw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Yc70giIIGDIddrjD858dDw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: '' } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/Yc70giIIGDIddrjD858dDw/input.css:1:1 + | +1 | a { value: '' } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/Yc70giIIGDIddrjD858dDw/input.css:1:1 + | +1 | a { value: '' } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/Yc70giIIGDIddrjD858dDw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Ys7z8C2qi5O_HM9ElZQrUQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/Ys7z8C2qi5O_HM9ElZQrUQ/output.json index 7e4ef7265b4..b7426c4108d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Ys7z8C2qi5O_HM9ElZQrUQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Ys7z8C2qi5O_HM9ElZQrUQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Ys7z8C2qi5O_HM9ElZQrUQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/Ys7z8C2qi5O_HM9ElZQrUQ/span.rust-debug index 6388974b274..1ec9415d65f 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Ys7z8C2qi5O_HM9ElZQrUQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Ys7z8C2qi5O_HM9ElZQrUQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: #\,x } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/Ys7z8C2qi5O_HM9ElZQrUQ/input.css:1:1 + | +1 | a { value: #\,x } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/Ys7z8C2qi5O_HM9ElZQrUQ/input.css:1:1 + | +1 | a { value: #\,x } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/Ys7z8C2qi5O_HM9ElZQrUQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Z4J4sVA4UnGhTMiN5tdMMQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/Z4J4sVA4UnGhTMiN5tdMMQ/output.json index a24fa95474c..9f09c8e9a9b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Z4J4sVA4UnGhTMiN5tdMMQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Z4J4sVA4UnGhTMiN5tdMMQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/Z4J4sVA4UnGhTMiN5tdMMQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/Z4J4sVA4UnGhTMiN5tdMMQ/span.rust-debug index 5c73cee5b6d..e02b41a9d58 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/Z4J4sVA4UnGhTMiN5tdMMQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/Z4J4sVA4UnGhTMiN5tdMMQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { padding: 0 1 0 1 } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/Z4J4sVA4UnGhTMiN5tdMMQ/input.css:1:1 + | +1 | a { padding: 0 1 0 1 } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/Z4J4sVA4UnGhTMiN5tdMMQ/input.css:1:1 + | +1 | a { padding: 0 1 0 1 } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/Z4J4sVA4UnGhTMiN5tdMMQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/_APxY5Pe47Bb71-CwD1nhw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/_APxY5Pe47Bb71-CwD1nhw/output.json index 4e2b5a9e12a..0b54eaf7873 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/_APxY5Pe47Bb71-CwD1nhw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/_APxY5Pe47Bb71-CwD1nhw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/_APxY5Pe47Bb71-CwD1nhw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/_APxY5Pe47Bb71-CwD1nhw/span.rust-debug index b18c1e2bf1a..548f55cd672 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/_APxY5Pe47Bb71-CwD1nhw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/_APxY5Pe47Bb71-CwD1nhw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #AABBCDFF } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/_APxY5Pe47Bb71-CwD1nhw/input.css:1:1 + | +1 | a { color: #AABBCDFF } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/_APxY5Pe47Bb71-CwD1nhw/input.css:1:1 + | +1 | a { color: #AABBCDFF } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/_APxY5Pe47Bb71-CwD1nhw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/_U4zAUbS93Xo7_tJOolGuA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/_U4zAUbS93Xo7_tJOolGuA/output.json index 06122360fdb..840ae1df1fa 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/_U4zAUbS93Xo7_tJOolGuA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/_U4zAUbS93Xo7_tJOolGuA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/_U4zAUbS93Xo7_tJOolGuA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/_U4zAUbS93Xo7_tJOolGuA/span.rust-debug index 47a603953d1..fb8d79381e8 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/_U4zAUbS93Xo7_tJOolGuA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/_U4zAUbS93Xo7_tJOolGuA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #f00 } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/_U4zAUbS93Xo7_tJOolGuA/input.css:1:1 + | +1 | a { color: #f00 } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/_U4zAUbS93Xo7_tJOolGuA/input.css:1:1 + | +1 | a { color: #f00 } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/_U4zAUbS93Xo7_tJOolGuA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/_XB1oeHz4bZ49LCE2cBI6g/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/_XB1oeHz4bZ49LCE2cBI6g/output.json index ab7e11875d3..7ade5807f1b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/_XB1oeHz4bZ49LCE2cBI6g/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/_XB1oeHz4bZ49LCE2cBI6g/output.json @@ -46,25 +46,41 @@ "end": 8, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 1, - "end": 2, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - }, - "name": { - "type": "Identifier", - "span": { - "start": 3, "end": 7, "ctxt": 0 }, - "value": "attr", - "raw": "attr" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 1, + "end": 3, + "ctxt": 0 + }, + "prefix": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "*", + "raw": "*" + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 3, + "end": 7, + "ctxt": 0 + }, + "value": "attr", + "raw": "attr" + } }, "matcher": null, "value": null, diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/_XB1oeHz4bZ49LCE2cBI6g/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/_XB1oeHz4bZ49LCE2cBI6g/span.rust-debug index 7f72aa1f7f5..ccbb14a54e0 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/_XB1oeHz4bZ49LCE2cBI6g/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/_XB1oeHz4bZ49LCE2cBI6g/span.rust-debug @@ -40,12 +40,24 @@ error: SubclassSelector 1 | [*|attr] {} | ^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/_XB1oeHz4bZ49LCE2cBI6g/input.css:1:1 | 1 | [*|attr] {} | ^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/_XB1oeHz4bZ49LCE2cBI6g/input.css:1:2 + | +1 | [*|attr] {} + | ^^^^^^ + +error: NsPrefix + --> $DIR/tests/fixture/esbuild/misc/_XB1oeHz4bZ49LCE2cBI6g/input.css:1:2 + | +1 | [*|attr] {} + | ^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/_XB1oeHz4bZ49LCE2cBI6g/input.css:1:2 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/_d22bZcPKDgNEKSyJ2NRsQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/_d22bZcPKDgNEKSyJ2NRsQ/output.json index dcc676d3127..54ffce42b9a 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/_d22bZcPKDgNEKSyJ2NRsQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/_d22bZcPKDgNEKSyJ2NRsQ/output.json @@ -38,23 +38,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 0, - "end": 1, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [ { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/_d22bZcPKDgNEKSyJ2NRsQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/_d22bZcPKDgNEKSyJ2NRsQ/span.rust-debug index 32384e93fa9..db2dbfee2d0 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/_d22bZcPKDgNEKSyJ2NRsQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/_d22bZcPKDgNEKSyJ2NRsQ/span.rust-debug @@ -40,7 +40,7 @@ error: TypeSelector 1 | *::b(c) {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/esbuild/misc/_d22bZcPKDgNEKSyJ2NRsQ/input.css:1:1 | 1 | *::b(c) {} diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/_qcmYeHAxw35hMnF2IST8A/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/_qcmYeHAxw35hMnF2IST8A/output.json index 2debd485852..a2e127103a0 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/_qcmYeHAxw35hMnF2IST8A/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/_qcmYeHAxw35hMnF2IST8A/output.json @@ -46,18 +46,34 @@ "end": 9, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 2, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 3, + "end": 4, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/_qcmYeHAxw35hMnF2IST8A/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/_qcmYeHAxw35hMnF2IST8A/span.rust-debug index 09640a96155..e3695a69d7c 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/_qcmYeHAxw35hMnF2IST8A/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/_qcmYeHAxw35hMnF2IST8A/span.rust-debug @@ -40,18 +40,36 @@ error: SubclassSelector 1 | [b = "c"] {} | ^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/_qcmYeHAxw35hMnF2IST8A/input.css:1:1 | 1 | [b = "c"] {} | ^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/_qcmYeHAxw35hMnF2IST8A/input.css:1:2 + | +1 | [b = "c"] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/_qcmYeHAxw35hMnF2IST8A/input.css:1:2 | 1 | [b = "c"] {} | ^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/_qcmYeHAxw35hMnF2IST8A/input.css:1:4 + | +1 | [b = "c"] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/_qcmYeHAxw35hMnF2IST8A/input.css:1:6 + | +1 | [b = "c"] {} + | ^^^ + error: Str --> $DIR/tests/fixture/esbuild/misc/_qcmYeHAxw35hMnF2IST8A/input.css:1:6 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/a0Yurt7E7InOYieD7nMCXg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/a0Yurt7E7InOYieD7nMCXg/output.json index 6100cd78f38..003cf2c09b6 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/a0Yurt7E7InOYieD7nMCXg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/a0Yurt7E7InOYieD7nMCXg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/a0Yurt7E7InOYieD7nMCXg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/a0Yurt7E7InOYieD7nMCXg/span.rust-debug index eef37243575..dc5c99d4143 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/a0Yurt7E7InOYieD7nMCXg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/a0Yurt7E7InOYieD7nMCXg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #AABCCCFF } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/a0Yurt7E7InOYieD7nMCXg/input.css:1:1 + | +1 | a { color: #AABCCCFF } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/a0Yurt7E7InOYieD7nMCXg/input.css:1:1 + | +1 | a { color: #AABCCCFF } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/a0Yurt7E7InOYieD7nMCXg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/a7KElWOMF9ilrSsoliHkcg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/a7KElWOMF9ilrSsoliHkcg/output.json index f59f9265d94..3dae9042b61 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/a7KElWOMF9ilrSsoliHkcg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/a7KElWOMF9ilrSsoliHkcg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/a7KElWOMF9ilrSsoliHkcg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/a7KElWOMF9ilrSsoliHkcg/span.rust-debug index 534925df527..d73efc559cb 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/a7KElWOMF9ilrSsoliHkcg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/a7KElWOMF9ilrSsoliHkcg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #AABBCDDD } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/a7KElWOMF9ilrSsoliHkcg/input.css:1:1 + | +1 | a { color: #AABBCDDD } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/a7KElWOMF9ilrSsoliHkcg/input.css:1:1 + | +1 | a { color: #AABBCDDD } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/a7KElWOMF9ilrSsoliHkcg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/aEF_NRb2u-g7UzHxaKpOfA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/aEF_NRb2u-g7UzHxaKpOfA/output.json index 06d9b35e728..ee281e6a90f 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/aEF_NRb2u-g7UzHxaKpOfA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/aEF_NRb2u-g7UzHxaKpOfA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -64,16 +72,24 @@ "end": 8, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 6, "end": 7, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 6, + "end": 7, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } }, "matcher": null, "value": null, diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/aEF_NRb2u-g7UzHxaKpOfA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/aEF_NRb2u-g7UzHxaKpOfA/span.rust-debug index 69108f5bdfe..484c6cc0bc7 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/aEF_NRb2u-g7UzHxaKpOfA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/aEF_NRb2u-g7UzHxaKpOfA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a/**/[b] {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/aEF_NRb2u-g7UzHxaKpOfA/input.css:1:1 + | +1 | a/**/[b] {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/aEF_NRb2u-g7UzHxaKpOfA/input.css:1:1 + | +1 | a/**/[b] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/aEF_NRb2u-g7UzHxaKpOfA/input.css:1:1 | @@ -52,12 +64,18 @@ error: SubclassSelector 1 | a/**/[b] {} | ^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/aEF_NRb2u-g7UzHxaKpOfA/input.css:1:6 | 1 | a/**/[b] {} | ^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/aEF_NRb2u-g7UzHxaKpOfA/input.css:1:7 + | +1 | a/**/[b] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/aEF_NRb2u-g7UzHxaKpOfA/input.css:1:7 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/aVG5R30iWKuuw8iOGrgVmw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/aVG5R30iWKuuw8iOGrgVmw/output.json index 12953defbd4..b3af20c8ee2 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/aVG5R30iWKuuw8iOGrgVmw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/aVG5R30iWKuuw8iOGrgVmw/output.json @@ -38,31 +38,47 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 0, - "end": 1, - "ctxt": 0 - }, - "value": "a", - "raw": "a" - }, - "name": { - "type": "Identifier", - "span": { - "start": 2, "end": 3, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 0, + "end": 2, + "ctxt": 0 + }, + "prefix": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 2, + "end": 3, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/aVG5R30iWKuuw8iOGrgVmw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/aVG5R30iWKuuw8iOGrgVmw/span.rust-debug index 97b882d4eb0..c57e14c5984 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/aVG5R30iWKuuw8iOGrgVmw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/aVG5R30iWKuuw8iOGrgVmw/span.rust-debug @@ -40,6 +40,24 @@ error: TypeSelector 1 | a|b {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/aVG5R30iWKuuw8iOGrgVmw/input.css:1:1 + | +1 | a|b {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/aVG5R30iWKuuw8iOGrgVmw/input.css:1:1 + | +1 | a|b {} + | ^^^ + +error: NsPrefix + --> $DIR/tests/fixture/esbuild/misc/aVG5R30iWKuuw8iOGrgVmw/input.css:1:1 + | +1 | a|b {} + | ^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/aVG5R30iWKuuw8iOGrgVmw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/axTS8OYqxbJ3cRQm9h4ZYA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/axTS8OYqxbJ3cRQm9h4ZYA/output.json index 5dc1d9fbaa5..72dced57320 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/axTS8OYqxbJ3cRQm9h4ZYA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/axTS8OYqxbJ3cRQm9h4ZYA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/axTS8OYqxbJ3cRQm9h4ZYA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/axTS8OYqxbJ3cRQm9h4ZYA/span.rust-debug index 1f86c00ffd8..3dcffd0401e 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/axTS8OYqxbJ3cRQm9h4ZYA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/axTS8OYqxbJ3cRQm9h4ZYA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: '\61 bc' } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/axTS8OYqxbJ3cRQm9h4ZYA/input.css:1:1 + | +1 | a { value: '\61 bc' } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/axTS8OYqxbJ3cRQm9h4ZYA/input.css:1:1 + | +1 | a { value: '\61 bc' } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/axTS8OYqxbJ3cRQm9h4ZYA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/b102IE1MrM3aGTKCRrSU6Q/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/b102IE1MrM3aGTKCRrSU6Q/output.json index d2f3a846670..56bb56de3fd 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/b102IE1MrM3aGTKCRrSU6Q/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/b102IE1MrM3aGTKCRrSU6Q/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/b102IE1MrM3aGTKCRrSU6Q/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/b102IE1MrM3aGTKCRrSU6Q/span.rust-debug index 8e2f757daf0..b4a773243b4 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/b102IE1MrM3aGTKCRrSU6Q/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/b102IE1MrM3aGTKCRrSU6Q/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #ff0000ff } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/b102IE1MrM3aGTKCRrSU6Q/input.css:1:1 + | +1 | a { color: #ff0000ff } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/b102IE1MrM3aGTKCRrSU6Q/input.css:1:1 + | +1 | a { color: #ff0000ff } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/b102IE1MrM3aGTKCRrSU6Q/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/b2m1STf0F5CKity6Nd4vmQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/b2m1STf0F5CKity6Nd4vmQ/output.json index d346cfea38f..e10863a23e0 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/b2m1STf0F5CKity6Nd4vmQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/b2m1STf0F5CKity6Nd4vmQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/b2m1STf0F5CKity6Nd4vmQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/b2m1STf0F5CKity6Nd4vmQ/span.rust-debug index 9e51d63c112..79b82f0fa8b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/b2m1STf0F5CKity6Nd4vmQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/b2m1STf0F5CKity6Nd4vmQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #aabbccff } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/b2m1STf0F5CKity6Nd4vmQ/input.css:1:1 + | +1 | a { color: #aabbccff } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/b2m1STf0F5CKity6Nd4vmQ/input.css:1:1 + | +1 | a { color: #aabbccff } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/b2m1STf0F5CKity6Nd4vmQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/bdiLSVQWZCfQNNwD_OM6qA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/bdiLSVQWZCfQNNwD_OM6qA/output.json index 7e6cbfc938d..f73fb36c84a 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/bdiLSVQWZCfQNNwD_OM6qA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/bdiLSVQWZCfQNNwD_OM6qA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/bdiLSVQWZCfQNNwD_OM6qA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/bdiLSVQWZCfQNNwD_OM6qA/span.rust-debug index da7b548cfaa..cd095cbf2a7 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/bdiLSVQWZCfQNNwD_OM6qA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/bdiLSVQWZCfQNNwD_OM6qA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: #\68ash } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/bdiLSVQWZCfQNNwD_OM6qA/input.css:1:1 + | +1 | a { value: #\68ash } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/bdiLSVQWZCfQNNwD_OM6qA/input.css:1:1 + | +1 | a { value: #\68ash } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/bdiLSVQWZCfQNNwD_OM6qA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/biImEvafuG5pEuEW8LgCCw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/biImEvafuG5pEuEW8LgCCw/output.json index 1fc3d78907e..07644a225f8 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/biImEvafuG5pEuEW8LgCCw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/biImEvafuG5pEuEW8LgCCw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/biImEvafuG5pEuEW8LgCCw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/biImEvafuG5pEuEW8LgCCw/span.rust-debug index 22aba102829..b15a9db9df0 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/biImEvafuG5pEuEW8LgCCw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/biImEvafuG5pEuEW8LgCCw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: f\6e() } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/biImEvafuG5pEuEW8LgCCw/input.css:1:1 + | +1 | a { value: f\6e() } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/biImEvafuG5pEuEW8LgCCw/input.css:1:1 + | +1 | a { value: f\6e() } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/biImEvafuG5pEuEW8LgCCw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/btdQp-3m090Q73vMHSpKgw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/btdQp-3m090Q73vMHSpKgw/output.json index 3bca9d01e68..416667d3593 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/btdQp-3m090Q73vMHSpKgw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/btdQp-3m090Q73vMHSpKgw/output.json @@ -38,31 +38,47 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 7, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 0, - "end": 3, - "ctxt": 0 - }, - "value": "*", - "raw": "\\2a" - }, - "name": { - "type": "Identifier", - "span": { - "start": 4, "end": 7, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 0, + "end": 4, + "ctxt": 0 + }, + "prefix": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "*", + "raw": "\\2a" + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 4, + "end": 7, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/btdQp-3m090Q73vMHSpKgw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/btdQp-3m090Q73vMHSpKgw/span.rust-debug index c58ee71e2a2..8361064cd63 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/btdQp-3m090Q73vMHSpKgw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/btdQp-3m090Q73vMHSpKgw/span.rust-debug @@ -40,6 +40,24 @@ error: TypeSelector 1 | \2a|div {} | ^^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/btdQp-3m090Q73vMHSpKgw/input.css:1:1 + | +1 | \2a|div {} + | ^^^^^^^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/btdQp-3m090Q73vMHSpKgw/input.css:1:1 + | +1 | \2a|div {} + | ^^^^^^^ + +error: NsPrefix + --> $DIR/tests/fixture/esbuild/misc/btdQp-3m090Q73vMHSpKgw/input.css:1:1 + | +1 | \2a|div {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/btdQp-3m090Q73vMHSpKgw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/cFk0V1dktTRk2wWOux0Y9A/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/cFk0V1dktTRk2wWOux0Y9A/output.json index 0091e10d9a7..9fe5b5ecdc1 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/cFk0V1dktTRk2wWOux0Y9A/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/cFk0V1dktTRk2wWOux0Y9A/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/cFk0V1dktTRk2wWOux0Y9A/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/cFk0V1dktTRk2wWOux0Y9A/span.rust-debug index 9b552ed291c..c15ad265734 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/cFk0V1dktTRk2wWOux0Y9A/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/cFk0V1dktTRk2wWOux0Y9A/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a:after { content: '\1010101' } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/cFk0V1dktTRk2wWOux0Y9A/input.css:1:1 + | +1 | a:after { content: '\1010101' } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/cFk0V1dktTRk2wWOux0Y9A/input.css:1:1 + | +1 | a:after { content: '\1010101' } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/cFk0V1dktTRk2wWOux0Y9A/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/cGdUJvMcb_06jPxvv8lGkg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/cGdUJvMcb_06jPxvv8lGkg/output.json index 4e5562dadb6..7527e153f31 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/cGdUJvMcb_06jPxvv8lGkg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/cGdUJvMcb_06jPxvv8lGkg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/cGdUJvMcb_06jPxvv8lGkg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/cGdUJvMcb_06jPxvv8lGkg/span.rust-debug index 4e4bf4c60fe..5de18354283 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/cGdUJvMcb_06jPxvv8lGkg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/cGdUJvMcb_06jPxvv8lGkg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: +.0%; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/cGdUJvMcb_06jPxvv8lGkg/input.css:1:1 + | +1 | a { width: +.0%; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/cGdUJvMcb_06jPxvv8lGkg/input.css:1:1 + | +1 | a { width: +.0%; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/cGdUJvMcb_06jPxvv8lGkg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/ccwWSeXA2f9cTFtUANZA8Q/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/ccwWSeXA2f9cTFtUANZA8Q/output.json index 3c259c1b878..abbe464be01 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/ccwWSeXA2f9cTFtUANZA8Q/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/ccwWSeXA2f9cTFtUANZA8Q/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/ccwWSeXA2f9cTFtUANZA8Q/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/ccwWSeXA2f9cTFtUANZA8Q/span.rust-debug index 117ec5339a4..7f8b9fb1d93 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/ccwWSeXA2f9cTFtUANZA8Q/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/ccwWSeXA2f9cTFtUANZA8Q/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: +0.0%; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/ccwWSeXA2f9cTFtUANZA8Q/input.css:1:1 + | +1 | a { width: +0.0%; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/ccwWSeXA2f9cTFtUANZA8Q/input.css:1:1 + | +1 | a { width: +0.0%; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/ccwWSeXA2f9cTFtUANZA8Q/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/cfNrGQbCQ18L8pQmD7lBZQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/cfNrGQbCQ18L8pQmD7lBZQ/output.json index 09e0233586f..a04f21ff44a 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/cfNrGQbCQ18L8pQmD7lBZQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/cfNrGQbCQ18L8pQmD7lBZQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/cfNrGQbCQ18L8pQmD7lBZQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/cfNrGQbCQ18L8pQmD7lBZQ/span.rust-debug index db522d4f28b..615ab8655a0 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/cfNrGQbCQ18L8pQmD7lBZQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/cfNrGQbCQ18L8pQmD7lBZQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: red; color: green; color: red } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/cfNrGQbCQ18L8pQmD7lBZQ/input.css:1:1 + | +1 | a { color: red; color: green; color: red } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/cfNrGQbCQ18L8pQmD7lBZQ/input.css:1:1 + | +1 | a { color: red; color: green; color: red } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/cfNrGQbCQ18L8pQmD7lBZQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/coHEK8Dkb2Zflw3JwafU5Q/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/coHEK8Dkb2Zflw3JwafU5Q/output.json index 93120ad0641..18c4475fbe9 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/coHEK8Dkb2Zflw3JwafU5Q/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/coHEK8Dkb2Zflw3JwafU5Q/output.json @@ -46,18 +46,34 @@ "end": 8, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 2, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 2, + "end": 4, + "ctxt": 0 + }, + "value": "$=" }, - "matcher": "$=", "value": { "type": "String", "span": { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/coHEK8Dkb2Zflw3JwafU5Q/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/coHEK8Dkb2Zflw3JwafU5Q/span.rust-debug index 87e9ed9f34f..7e6b26fb5fa 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/coHEK8Dkb2Zflw3JwafU5Q/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/coHEK8Dkb2Zflw3JwafU5Q/span.rust-debug @@ -40,18 +40,36 @@ error: SubclassSelector 1 | [b$="c"] {} | ^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/coHEK8Dkb2Zflw3JwafU5Q/input.css:1:1 | 1 | [b$="c"] {} | ^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/coHEK8Dkb2Zflw3JwafU5Q/input.css:1:2 + | +1 | [b$="c"] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/coHEK8Dkb2Zflw3JwafU5Q/input.css:1:2 | 1 | [b$="c"] {} | ^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/coHEK8Dkb2Zflw3JwafU5Q/input.css:1:3 + | +1 | [b$="c"] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/coHEK8Dkb2Zflw3JwafU5Q/input.css:1:5 + | +1 | [b$="c"] {} + | ^^^ + error: Str --> $DIR/tests/fixture/esbuild/misc/coHEK8Dkb2Zflw3JwafU5Q/input.css:1:5 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/cpoL0JfVO7TLrlcAga939A/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/cpoL0JfVO7TLrlcAga939A/output.json index 1f3d5ca8180..a9d08712437 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/cpoL0JfVO7TLrlcAga939A/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/cpoL0JfVO7TLrlcAga939A/output.json @@ -46,18 +46,34 @@ "end": 8, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 2, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 2, + "end": 4, + "ctxt": 0 + }, + "value": "^=" }, - "matcher": "^=", "value": { "type": "String", "span": { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/cpoL0JfVO7TLrlcAga939A/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/cpoL0JfVO7TLrlcAga939A/span.rust-debug index 1b43d4fe249..9028efe8281 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/cpoL0JfVO7TLrlcAga939A/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/cpoL0JfVO7TLrlcAga939A/span.rust-debug @@ -40,18 +40,36 @@ error: SubclassSelector 1 | [b^="c"] {} | ^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/cpoL0JfVO7TLrlcAga939A/input.css:1:1 | 1 | [b^="c"] {} | ^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/cpoL0JfVO7TLrlcAga939A/input.css:1:2 + | +1 | [b^="c"] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/cpoL0JfVO7TLrlcAga939A/input.css:1:2 | 1 | [b^="c"] {} | ^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/cpoL0JfVO7TLrlcAga939A/input.css:1:3 + | +1 | [b^="c"] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/cpoL0JfVO7TLrlcAga939A/input.css:1:5 + | +1 | [b^="c"] {} + | ^^^ + error: Str --> $DIR/tests/fixture/esbuild/misc/cpoL0JfVO7TLrlcAga939A/input.css:1:5 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/cxYYDM0_rXbkvaqi8UPWOg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/cxYYDM0_rXbkvaqi8UPWOg/output.json index 6bfdfb52163..a681f5bc305 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/cxYYDM0_rXbkvaqi8UPWOg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/cxYYDM0_rXbkvaqi8UPWOg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/cxYYDM0_rXbkvaqi8UPWOg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/cxYYDM0_rXbkvaqi8UPWOg/span.rust-debug index 17c51dcaa15..9d05baba804 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/cxYYDM0_rXbkvaqi8UPWOg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/cxYYDM0_rXbkvaqi8UPWOg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #aabbcddd } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/cxYYDM0_rXbkvaqi8UPWOg/input.css:1:1 + | +1 | a { color: #aabbcddd } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/cxYYDM0_rXbkvaqi8UPWOg/input.css:1:1 + | +1 | a { color: #aabbcddd } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/cxYYDM0_rXbkvaqi8UPWOg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/d1BWbOHfSbCE8-_qEz-luA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/d1BWbOHfSbCE8-_qEz-luA/output.json index aad784cf95e..f9432e102f6 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/d1BWbOHfSbCE8-_qEz-luA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/d1BWbOHfSbCE8-_qEz-luA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/d1BWbOHfSbCE8-_qEz-luA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/d1BWbOHfSbCE8-_qEz-luA/span.rust-debug index 924530d4f5c..7d5444095ea 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/d1BWbOHfSbCE8-_qEz-luA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/d1BWbOHfSbCE8-_qEz-luA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a:b(:c) {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/d1BWbOHfSbCE8-_qEz-luA/input.css:1:1 + | +1 | a:b(:c) {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/d1BWbOHfSbCE8-_qEz-luA/input.css:1:1 + | +1 | a:b(:c) {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/d1BWbOHfSbCE8-_qEz-luA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/d6iTYxGk5HHi4hIZcn73Bw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/d6iTYxGk5HHi4hIZcn73Bw/output.json index 76dced8b3ee..3326b22a948 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/d6iTYxGk5HHi4hIZcn73Bw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/d6iTYxGk5HHi4hIZcn73Bw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/d6iTYxGk5HHi4hIZcn73Bw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/d6iTYxGk5HHi4hIZcn73Bw/span.rust-debug index a32adf5a289..36a3f70b149 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/d6iTYxGk5HHi4hIZcn73Bw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/d6iTYxGk5HHi4hIZcn73Bw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a:after { content: 'a\ b' } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/d6iTYxGk5HHi4hIZcn73Bw/input.css:1:1 + | +1 | a:after { content: 'a\ b' } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/d6iTYxGk5HHi4hIZcn73Bw/input.css:1:1 + | +1 | a:after { content: 'a\ b' } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/d6iTYxGk5HHi4hIZcn73Bw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/dCIAD8Ab98J4V9rGaJvZlw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/dCIAD8Ab98J4V9rGaJvZlw/output.json index 37f5e6000cf..5d00678c612 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/dCIAD8Ab98J4V9rGaJvZlw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/dCIAD8Ab98J4V9rGaJvZlw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/dCIAD8Ab98J4V9rGaJvZlw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/dCIAD8Ab98J4V9rGaJvZlw/span.rust-debug index f7207e4f234..fd76f6ed1e1 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/dCIAD8Ab98J4V9rGaJvZlw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/dCIAD8Ab98J4V9rGaJvZlw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: url(\,) } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/dCIAD8Ab98J4V9rGaJvZlw/input.css:1:1 + | +1 | a { value: url(\,) } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/dCIAD8Ab98J4V9rGaJvZlw/input.css:1:1 + | +1 | a { value: url(\,) } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/dCIAD8Ab98J4V9rGaJvZlw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/dVUzkh7NtbXySLzWGW0t9g/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/dVUzkh7NtbXySLzWGW0t9g/output.json index 72990ed62e4..a9a09042790 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/dVUzkh7NtbXySLzWGW0t9g/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/dVUzkh7NtbXySLzWGW0t9g/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -136,22 +144,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 17, "end": 18, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 17, "end": 18, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 17, + "end": 18, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -234,22 +250,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 36, "end": 37, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 36, "end": 37, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 36, + "end": 37, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/dVUzkh7NtbXySLzWGW0t9g/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/dVUzkh7NtbXySLzWGW0t9g/span.rust-debug index 72ab3cd47d5..8515e015e31 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/dVUzkh7NtbXySLzWGW0t9g/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/dVUzkh7NtbXySLzWGW0t9g/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: red } a { color: green } a { color: red } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/dVUzkh7NtbXySLzWGW0t9g/input.css:1:1 + | +1 | a { color: red } a { color: green } a { color: red } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/dVUzkh7NtbXySLzWGW0t9g/input.css:1:1 + | +1 | a { color: red } a { color: green } a { color: red } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/dVUzkh7NtbXySLzWGW0t9g/input.css:1:1 | @@ -118,6 +130,18 @@ error: TypeSelector 1 | a { color: red } a { color: green } a { color: red } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/dVUzkh7NtbXySLzWGW0t9g/input.css:1:18 + | +1 | a { color: red } a { color: green } a { color: red } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/dVUzkh7NtbXySLzWGW0t9g/input.css:1:18 + | +1 | a { color: red } a { color: green } a { color: red } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/dVUzkh7NtbXySLzWGW0t9g/input.css:1:18 | @@ -196,6 +220,18 @@ error: TypeSelector 1 | a { color: red } a { color: green } a { color: red } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/dVUzkh7NtbXySLzWGW0t9g/input.css:1:37 + | +1 | a { color: red } a { color: green } a { color: red } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/dVUzkh7NtbXySLzWGW0t9g/input.css:1:37 + | +1 | a { color: red } a { color: green } a { color: red } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/dVUzkh7NtbXySLzWGW0t9g/input.css:1:37 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/dnJiFdC_77rVfPM-yerzTQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/dnJiFdC_77rVfPM-yerzTQ/output.json index 5000fb3f2b8..de03598c71b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/dnJiFdC_77rVfPM-yerzTQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/dnJiFdC_77rVfPM-yerzTQ/output.json @@ -46,16 +46,24 @@ "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 2, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } }, "matcher": null, "value": null, diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/dnJiFdC_77rVfPM-yerzTQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/dnJiFdC_77rVfPM-yerzTQ/span.rust-debug index ffab529866f..2f27b167c1b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/dnJiFdC_77rVfPM-yerzTQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/dnJiFdC_77rVfPM-yerzTQ/span.rust-debug @@ -40,12 +40,18 @@ error: SubclassSelector 1 | [b] {} | ^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/dnJiFdC_77rVfPM-yerzTQ/input.css:1:1 | 1 | [b] {} | ^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/dnJiFdC_77rVfPM-yerzTQ/input.css:1:2 + | +1 | [b] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/dnJiFdC_77rVfPM-yerzTQ/input.css:1:2 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/eBC_tv-_FNqjWVMq-no99A/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/eBC_tv-_FNqjWVMq-no99A/output.json index f2e20944802..6cf4d7e5f49 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/eBC_tv-_FNqjWVMq-no99A/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/eBC_tv-_FNqjWVMq-no99A/output.json @@ -38,23 +38,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 0, - "end": 1, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [] } diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/eBC_tv-_FNqjWVMq-no99A/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/eBC_tv-_FNqjWVMq-no99A/span.rust-debug index 63a689fccf6..b5c3cad4beb 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/eBC_tv-_FNqjWVMq-no99A/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/eBC_tv-_FNqjWVMq-no99A/span.rust-debug @@ -40,7 +40,7 @@ error: TypeSelector 1 | * {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/esbuild/misc/eBC_tv-_FNqjWVMq-no99A/input.css:1:1 | 1 | * {} diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/eHdhrm6W2iHKQegxH7uEgw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/eHdhrm6W2iHKQegxH7uEgw/output.json index bad6e7c76b0..e431806b6a5 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/eHdhrm6W2iHKQegxH7uEgw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/eHdhrm6W2iHKQegxH7uEgw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/eHdhrm6W2iHKQegxH7uEgw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/eHdhrm6W2iHKQegxH7uEgw/span.rust-debug index 0eacd7b4b9f..98dec14992a 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/eHdhrm6W2iHKQegxH7uEgw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/eHdhrm6W2iHKQegxH7uEgw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: .00%; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/eHdhrm6W2iHKQegxH7uEgw/input.css:1:1 + | +1 | a { width: .00%; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/eHdhrm6W2iHKQegxH7uEgw/input.css:1:1 + | +1 | a { width: .00%; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/eHdhrm6W2iHKQegxH7uEgw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/eVSpM_pYsIvyyewUkjTa2A/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/eVSpM_pYsIvyyewUkjTa2A/output.json index 2b305641d92..171a34edb09 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/eVSpM_pYsIvyyewUkjTa2A/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/eVSpM_pYsIvyyewUkjTa2A/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/eVSpM_pYsIvyyewUkjTa2A/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/eVSpM_pYsIvyyewUkjTa2A/span.rust-debug index f3abe3a3d78..c23c21e090c 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/eVSpM_pYsIvyyewUkjTa2A/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/eVSpM_pYsIvyyewUkjTa2A/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #12223344 } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/eVSpM_pYsIvyyewUkjTa2A/input.css:1:1 + | +1 | a { color: #12223344 } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/eVSpM_pYsIvyyewUkjTa2A/input.css:1:1 + | +1 | a { color: #12223344 } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/eVSpM_pYsIvyyewUkjTa2A/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/eWp7_8m3btY6p4erQ5c2JQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/eWp7_8m3btY6p4erQ5c2JQ/output.json index 3974abbe54d..90c547de291 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/eWp7_8m3btY6p4erQ5c2JQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/eWp7_8m3btY6p4erQ5c2JQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/eWp7_8m3btY6p4erQ5c2JQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/eWp7_8m3btY6p4erQ5c2JQ/span.rust-debug index 4e73e46eb6a..3fc89d61c9a 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/eWp7_8m3btY6p4erQ5c2JQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/eWp7_8m3btY6p4erQ5c2JQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: '\61bc' } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/eWp7_8m3btY6p4erQ5c2JQ/input.css:1:1 + | +1 | a { value: '\61bc' } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/eWp7_8m3btY6p4erQ5c2JQ/input.css:1:1 + | +1 | a { value: '\61bc' } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/eWp7_8m3btY6p4erQ5c2JQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/e_FDMPgmGFzIY3W0EbjxHA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/e_FDMPgmGFzIY3W0EbjxHA/output.json index 5dd73bf2879..469b3223a3c 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/e_FDMPgmGFzIY3W0EbjxHA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/e_FDMPgmGFzIY3W0EbjxHA/output.json @@ -46,25 +46,41 @@ "end": 11, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 1, - "end": 5, - "ctxt": 0 - }, - "value": "ns", - "raw": "\\6es" - }, - "name": { - "type": "Identifier", - "span": { - "start": 6, "end": 10, "ctxt": 0 }, - "value": "attr", - "raw": "attr" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 1, + "end": 6, + "ctxt": 0 + }, + "prefix": { + "type": "Identifier", + "span": { + "start": 1, + "end": 5, + "ctxt": 0 + }, + "value": "ns", + "raw": "\\6es" + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 6, + "end": 10, + "ctxt": 0 + }, + "value": "attr", + "raw": "attr" + } }, "matcher": null, "value": null, diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/e_FDMPgmGFzIY3W0EbjxHA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/e_FDMPgmGFzIY3W0EbjxHA/span.rust-debug index 9da1d834f79..f2e547c5307 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/e_FDMPgmGFzIY3W0EbjxHA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/e_FDMPgmGFzIY3W0EbjxHA/span.rust-debug @@ -40,12 +40,24 @@ error: SubclassSelector 1 | [\6es|attr] {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/e_FDMPgmGFzIY3W0EbjxHA/input.css:1:1 | 1 | [\6es|attr] {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/e_FDMPgmGFzIY3W0EbjxHA/input.css:1:2 + | +1 | [\6es|attr] {} + | ^^^^^^^^^ + +error: NsPrefix + --> $DIR/tests/fixture/esbuild/misc/e_FDMPgmGFzIY3W0EbjxHA/input.css:1:2 + | +1 | [\6es|attr] {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/e_FDMPgmGFzIY3W0EbjxHA/input.css:1:2 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/egyt9Hk9xnn2Xfbi3Ckfrg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/egyt9Hk9xnn2Xfbi3Ckfrg/output.json index 5057e3e6662..9ff2f6e285c 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/egyt9Hk9xnn2Xfbi3Ckfrg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/egyt9Hk9xnn2Xfbi3Ckfrg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/egyt9Hk9xnn2Xfbi3Ckfrg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/egyt9Hk9xnn2Xfbi3Ckfrg/span.rust-debug index af5ed641755..5c79a27fa4f 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/egyt9Hk9xnn2Xfbi3Ckfrg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/egyt9Hk9xnn2Xfbi3Ckfrg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: +.0; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/egyt9Hk9xnn2Xfbi3Ckfrg/input.css:1:1 + | +1 | a { width: +.0; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/egyt9Hk9xnn2Xfbi3Ckfrg/input.css:1:1 + | +1 | a { width: +.0; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/egyt9Hk9xnn2Xfbi3Ckfrg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/eivsIn6ub-xYiqErLqd8oA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/eivsIn6ub-xYiqErLqd8oA/output.json index 6d6738355f7..9eafdc3b385 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/eivsIn6ub-xYiqErLqd8oA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/eivsIn6ub-xYiqErLqd8oA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/eivsIn6ub-xYiqErLqd8oA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/eivsIn6ub-xYiqErLqd8oA/span.rust-debug index 0f85773eae2..b84dc7b5912 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/eivsIn6ub-xYiqErLqd8oA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/eivsIn6ub-xYiqErLqd8oA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: #\2cx } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/eivsIn6ub-xYiqErLqd8oA/input.css:1:1 + | +1 | a { value: #\2cx } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/eivsIn6ub-xYiqErLqd8oA/input.css:1:1 + | +1 | a { value: #\2cx } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/eivsIn6ub-xYiqErLqd8oA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/fTZzFds73kLZoyY9Y2gZdQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/fTZzFds73kLZoyY9Y2gZdQ/output.json index eb731d1f19c..16f7692e7a6 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/fTZzFds73kLZoyY9Y2gZdQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/fTZzFds73kLZoyY9Y2gZdQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/fTZzFds73kLZoyY9Y2gZdQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/fTZzFds73kLZoyY9Y2gZdQ/span.rust-debug index 054a4698c84..72a935dc022 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/fTZzFds73kLZoyY9Y2gZdQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/fTZzFds73kLZoyY9Y2gZdQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #11223345 } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/fTZzFds73kLZoyY9Y2gZdQ/input.css:1:1 + | +1 | a { color: #11223345 } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/fTZzFds73kLZoyY9Y2gZdQ/input.css:1:1 + | +1 | a { color: #11223345 } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/fTZzFds73kLZoyY9Y2gZdQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/fYJdtIZOdQKTLI8JJC2b_g/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/fYJdtIZOdQKTLI8JJC2b_g/output.json index c166dabe9e7..ec9a4a6dcc5 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/fYJdtIZOdQKTLI8JJC2b_g/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/fYJdtIZOdQKTLI8JJC2b_g/output.json @@ -46,27 +46,51 @@ "end": 10, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 1, - "end": 2, - "ctxt": 0 - }, - "value": "a", - "raw": "a" - }, - "name": { - "type": "Identifier", - "span": { - "start": 3, "end": 4, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 1, + "end": 3, + "ctxt": 0 + }, + "prefix": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 3, + "end": 4, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 4, + "end": 6, + "ctxt": 0 + }, + "value": "|=" }, - "matcher": "|=", "value": { "type": "String", "span": { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/fYJdtIZOdQKTLI8JJC2b_g/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/fYJdtIZOdQKTLI8JJC2b_g/span.rust-debug index 35f8488a1d8..018f69ee895 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/fYJdtIZOdQKTLI8JJC2b_g/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/fYJdtIZOdQKTLI8JJC2b_g/span.rust-debug @@ -40,12 +40,24 @@ error: SubclassSelector 1 | [a|b|="c"]{} | ^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/fYJdtIZOdQKTLI8JJC2b_g/input.css:1:1 | 1 | [a|b|="c"]{} | ^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/fYJdtIZOdQKTLI8JJC2b_g/input.css:1:2 + | +1 | [a|b|="c"]{} + | ^^^ + +error: NsPrefix + --> $DIR/tests/fixture/esbuild/misc/fYJdtIZOdQKTLI8JJC2b_g/input.css:1:2 + | +1 | [a|b|="c"]{} + | ^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/fYJdtIZOdQKTLI8JJC2b_g/input.css:1:2 | @@ -58,6 +70,18 @@ error: Ident 1 | [a|b|="c"]{} | ^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/fYJdtIZOdQKTLI8JJC2b_g/input.css:1:5 + | +1 | [a|b|="c"]{} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/fYJdtIZOdQKTLI8JJC2b_g/input.css:1:7 + | +1 | [a|b|="c"]{} + | ^^^ + error: Str --> $DIR/tests/fixture/esbuild/misc/fYJdtIZOdQKTLI8JJC2b_g/input.css:1:7 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/fe2WQQLV9qt16pYQLzZrpw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/fe2WQQLV9qt16pYQLzZrpw/output.json index c540cfce7a6..86ded1239b8 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/fe2WQQLV9qt16pYQLzZrpw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/fe2WQQLV9qt16pYQLzZrpw/output.json @@ -46,18 +46,34 @@ "end": 9, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 2, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 2, + "end": 3, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/fe2WQQLV9qt16pYQLzZrpw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/fe2WQQLV9qt16pYQLzZrpw/span.rust-debug index 8a6ade9cd5f..475e4a27ba2 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/fe2WQQLV9qt16pYQLzZrpw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/fe2WQQLV9qt16pYQLzZrpw/span.rust-debug @@ -40,18 +40,36 @@ error: SubclassSelector 1 | [b="c d"] {} | ^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/fe2WQQLV9qt16pYQLzZrpw/input.css:1:1 | 1 | [b="c d"] {} | ^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/fe2WQQLV9qt16pYQLzZrpw/input.css:1:2 + | +1 | [b="c d"] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/fe2WQQLV9qt16pYQLzZrpw/input.css:1:2 | 1 | [b="c d"] {} | ^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/fe2WQQLV9qt16pYQLzZrpw/input.css:1:3 + | +1 | [b="c d"] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/fe2WQQLV9qt16pYQLzZrpw/input.css:1:4 + | +1 | [b="c d"] {} + | ^^^^^ + error: Str --> $DIR/tests/fixture/esbuild/misc/fe2WQQLV9qt16pYQLzZrpw/input.css:1:4 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/fmt94qCRfRXbpej5kzLZUw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/fmt94qCRfRXbpej5kzLZUw/output.json index b38e0bb74ba..1667abe91d8 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/fmt94qCRfRXbpej5kzLZUw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/fmt94qCRfRXbpej5kzLZUw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/fmt94qCRfRXbpej5kzLZUw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/fmt94qCRfRXbpej5kzLZUw/span.rust-debug index d0fccaac43a..9e96de48da3 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/fmt94qCRfRXbpej5kzLZUw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/fmt94qCRfRXbpej5kzLZUw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: url(\2c) } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/fmt94qCRfRXbpej5kzLZUw/input.css:1:1 + | +1 | a { value: url(\2c) } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/fmt94qCRfRXbpej5kzLZUw/input.css:1:1 + | +1 | a { value: url(\2c) } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/fmt94qCRfRXbpej5kzLZUw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/fp9AcaoyGYHGTzXDXcy_ZQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/fp9AcaoyGYHGTzXDXcy_ZQ/output.json index 8ac5241ee97..eebdff53c4d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/fp9AcaoyGYHGTzXDXcy_ZQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/fp9AcaoyGYHGTzXDXcy_ZQ/output.json @@ -46,18 +46,34 @@ "end": 10, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 2, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 3, + "end": 5, + "ctxt": 0 + }, + "value": "*=" }, - "matcher": "*=", "value": { "type": "String", "span": { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/fp9AcaoyGYHGTzXDXcy_ZQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/fp9AcaoyGYHGTzXDXcy_ZQ/span.rust-debug index a0cf5e4a363..a1eff1436c8 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/fp9AcaoyGYHGTzXDXcy_ZQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/fp9AcaoyGYHGTzXDXcy_ZQ/span.rust-debug @@ -40,18 +40,36 @@ error: SubclassSelector 1 | [b *= "c"] {} | ^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/fp9AcaoyGYHGTzXDXcy_ZQ/input.css:1:1 | 1 | [b *= "c"] {} | ^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/fp9AcaoyGYHGTzXDXcy_ZQ/input.css:1:2 + | +1 | [b *= "c"] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/fp9AcaoyGYHGTzXDXcy_ZQ/input.css:1:2 | 1 | [b *= "c"] {} | ^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/fp9AcaoyGYHGTzXDXcy_ZQ/input.css:1:4 + | +1 | [b *= "c"] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/fp9AcaoyGYHGTzXDXcy_ZQ/input.css:1:7 + | +1 | [b *= "c"] {} + | ^^^ + error: Str --> $DIR/tests/fixture/esbuild/misc/fp9AcaoyGYHGTzXDXcy_ZQ/input.css:1:7 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/ftc5-zf_sliOrFRRBGGS-g/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/ftc5-zf_sliOrFRRBGGS-g/output.json index 4d0162eb072..1144dd46860 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/ftc5-zf_sliOrFRRBGGS-g/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/ftc5-zf_sliOrFRRBGGS-g/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/ftc5-zf_sliOrFRRBGGS-g/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/ftc5-zf_sliOrFRRBGGS-g/span.rust-debug index 836785b2b72..4de7ad26eeb 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/ftc5-zf_sliOrFRRBGGS-g/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/ftc5-zf_sliOrFRRBGGS-g/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #122233ff } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/ftc5-zf_sliOrFRRBGGS-g/input.css:1:1 + | +1 | a { color: #122233ff } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/ftc5-zf_sliOrFRRBGGS-g/input.css:1:1 + | +1 | a { color: #122233ff } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/ftc5-zf_sliOrFRRBGGS-g/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/fxosM7xcuYbDyErN-ODVbw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/fxosM7xcuYbDyErN-ODVbw/output.json index 0d8896bd59a..5c24021fa78 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/fxosM7xcuYbDyErN-ODVbw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/fxosM7xcuYbDyErN-ODVbw/output.json @@ -46,18 +46,34 @@ "end": 8, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 2, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 2, + "end": 4, + "ctxt": 0 + }, + "value": "|=" }, - "matcher": "|=", "value": { "type": "String", "span": { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/fxosM7xcuYbDyErN-ODVbw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/fxosM7xcuYbDyErN-ODVbw/span.rust-debug index 93078027b8c..d5e43cc9298 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/fxosM7xcuYbDyErN-ODVbw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/fxosM7xcuYbDyErN-ODVbw/span.rust-debug @@ -40,18 +40,36 @@ error: SubclassSelector 1 | [b|="c"] {} | ^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/fxosM7xcuYbDyErN-ODVbw/input.css:1:1 | 1 | [b|="c"] {} | ^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/fxosM7xcuYbDyErN-ODVbw/input.css:1:2 + | +1 | [b|="c"] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/fxosM7xcuYbDyErN-ODVbw/input.css:1:2 | 1 | [b|="c"] {} | ^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/fxosM7xcuYbDyErN-ODVbw/input.css:1:3 + | +1 | [b|="c"] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/fxosM7xcuYbDyErN-ODVbw/input.css:1:5 + | +1 | [b|="c"] {} + | ^^^ + error: Str --> $DIR/tests/fixture/esbuild/misc/fxosM7xcuYbDyErN-ODVbw/input.css:1:5 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/gPpnAqOuxEdLAEJjFaUEkg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/gPpnAqOuxEdLAEJjFaUEkg/output.json index b800928b79b..7ec884e9771 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/gPpnAqOuxEdLAEJjFaUEkg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/gPpnAqOuxEdLAEJjFaUEkg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/gPpnAqOuxEdLAEJjFaUEkg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/gPpnAqOuxEdLAEJjFaUEkg/span.rust-debug index e1d1ca84b87..8c9f42e6981 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/gPpnAqOuxEdLAEJjFaUEkg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/gPpnAqOuxEdLAEJjFaUEkg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: url(\61 bc) } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/gPpnAqOuxEdLAEJjFaUEkg/input.css:1:1 + | +1 | a { value: url(\61 bc) } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/gPpnAqOuxEdLAEJjFaUEkg/input.css:1:1 + | +1 | a { value: url(\61 bc) } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/gPpnAqOuxEdLAEJjFaUEkg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/gVzUgfEllenh46I3Psx-uQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/gVzUgfEllenh46I3Psx-uQ/output.json index bd4574d264a..424cbbfc4ad 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/gVzUgfEllenh46I3Psx-uQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/gVzUgfEllenh46I3Psx-uQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/gVzUgfEllenh46I3Psx-uQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/gVzUgfEllenh46I3Psx-uQ/span.rust-debug index 270cc3987c9..9027da6221d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/gVzUgfEllenh46I3Psx-uQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/gVzUgfEllenh46I3Psx-uQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { margin: 0 1 0px 1px } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/gVzUgfEllenh46I3Psx-uQ/input.css:1:1 + | +1 | a { margin: 0 1 0px 1px } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/gVzUgfEllenh46I3Psx-uQ/input.css:1:1 + | +1 | a { margin: 0 1 0px 1px } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/gVzUgfEllenh46I3Psx-uQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/gxBoWO36fKxIuYwPzrWyKQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/gxBoWO36fKxIuYwPzrWyKQ/output.json index c3853993904..fbb3cf889ef 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/gxBoWO36fKxIuYwPzrWyKQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/gxBoWO36fKxIuYwPzrWyKQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/gxBoWO36fKxIuYwPzrWyKQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/gxBoWO36fKxIuYwPzrWyKQ/span.rust-debug index bcd577a9dff..86e85ec6029 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/gxBoWO36fKxIuYwPzrWyKQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/gxBoWO36fKxIuYwPzrWyKQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: #x\2c } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/gxBoWO36fKxIuYwPzrWyKQ/input.css:1:1 + | +1 | a { value: #x\2c } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/gxBoWO36fKxIuYwPzrWyKQ/input.css:1:1 + | +1 | a { value: #x\2c } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/gxBoWO36fKxIuYwPzrWyKQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/hYoP2sEvEyLualMll8L_RQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/hYoP2sEvEyLualMll8L_RQ/output.json index 135f8ad6ae7..976bad854a6 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/hYoP2sEvEyLualMll8L_RQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/hYoP2sEvEyLualMll8L_RQ/output.json @@ -45,23 +45,13 @@ } }, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 1, "end": 2, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 1, - "end": 2, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [] } diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/hYoP2sEvEyLualMll8L_RQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/hYoP2sEvEyLualMll8L_RQ/span.rust-debug index bc79ff6db7b..ca4a19d95c2 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/hYoP2sEvEyLualMll8L_RQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/hYoP2sEvEyLualMll8L_RQ/span.rust-debug @@ -46,7 +46,7 @@ error: TypeSelector 1 | &* {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/esbuild/misc/hYoP2sEvEyLualMll8L_RQ/input.css:1:2 | 1 | &* {} diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/hfprsTDi2yEOOmPdjb8Cew/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/hfprsTDi2yEOOmPdjb8Cew/output.json index f5544b567c0..660732be9f0 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/hfprsTDi2yEOOmPdjb8Cew/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/hfprsTDi2yEOOmPdjb8Cew/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [ diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/hfprsTDi2yEOOmPdjb8Cew/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/hfprsTDi2yEOOmPdjb8Cew/span.rust-debug index 63ea504b4fe..2a7a722d512 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/hfprsTDi2yEOOmPdjb8Cew/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/hfprsTDi2yEOOmPdjb8Cew/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | div#\30 {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/hfprsTDi2yEOOmPdjb8Cew/input.css:1:1 + | +1 | div#\30 {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/hfprsTDi2yEOOmPdjb8Cew/input.css:1:1 + | +1 | div#\30 {} + | ^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/hfprsTDi2yEOOmPdjb8Cew/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/i7oy_7cYzOxuhIPcZo1yow/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/i7oy_7cYzOxuhIPcZo1yow/output.json index c15fb2984f2..832e2cffcf1 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/i7oy_7cYzOxuhIPcZo1yow/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/i7oy_7cYzOxuhIPcZo1yow/output.json @@ -46,18 +46,34 @@ "end": 10, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 5, "ctxt": 0 }, - "value": "attr", - "raw": "attr" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 5, + "ctxt": 0 + }, + "value": "attr", + "raw": "attr" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 5, + "end": 6, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "Identifier", "span": { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/i7oy_7cYzOxuhIPcZo1yow/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/i7oy_7cYzOxuhIPcZo1yow/span.rust-debug index b124e9f9c7c..bf745964508 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/i7oy_7cYzOxuhIPcZo1yow/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/i7oy_7cYzOxuhIPcZo1yow/span.rust-debug @@ -40,18 +40,36 @@ error: SubclassSelector 1 | [attr=\2c] {} | ^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/i7oy_7cYzOxuhIPcZo1yow/input.css:1:1 | 1 | [attr=\2c] {} | ^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/i7oy_7cYzOxuhIPcZo1yow/input.css:1:2 + | +1 | [attr=\2c] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/i7oy_7cYzOxuhIPcZo1yow/input.css:1:2 | 1 | [attr=\2c] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/i7oy_7cYzOxuhIPcZo1yow/input.css:1:6 + | +1 | [attr=\2c] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/i7oy_7cYzOxuhIPcZo1yow/input.css:1:7 + | +1 | [attr=\2c] {} + | ^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/i7oy_7cYzOxuhIPcZo1yow/input.css:1:7 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/inMW5rttJFPDfH0aKVFg_Q/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/inMW5rttJFPDfH0aKVFg_Q/output.json index 2db02f2350e..3f043da66f7 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/inMW5rttJFPDfH0aKVFg_Q/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/inMW5rttJFPDfH0aKVFg_Q/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/inMW5rttJFPDfH0aKVFg_Q/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/inMW5rttJFPDfH0aKVFg_Q/span.rust-debug index 1e9ca9d8291..3e01b41d192 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/inMW5rttJFPDfH0aKVFg_Q/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/inMW5rttJFPDfH0aKVFg_Q/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #11233344 } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/inMW5rttJFPDfH0aKVFg_Q/input.css:1:1 + | +1 | a { color: #11233344 } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/inMW5rttJFPDfH0aKVFg_Q/input.css:1:1 + | +1 | a { color: #11233344 } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/inMW5rttJFPDfH0aKVFg_Q/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/isfWm5W8qb6_aJSz_bdwDw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/isfWm5W8qb6_aJSz_bdwDw/output.json index 3c9b0b00e81..7983d6f1b80 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/isfWm5W8qb6_aJSz_bdwDw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/isfWm5W8qb6_aJSz_bdwDw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/isfWm5W8qb6_aJSz_bdwDw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/isfWm5W8qb6_aJSz_bdwDw/span.rust-debug index ef61b829c0b..9e056f2c8cd 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/isfWm5W8qb6_aJSz_bdwDw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/isfWm5W8qb6_aJSz_bdwDw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #112233 } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/isfWm5W8qb6_aJSz_bdwDw/input.css:1:1 + | +1 | a { color: #112233 } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/isfWm5W8qb6_aJSz_bdwDw/input.css:1:1 + | +1 | a { color: #112233 } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/isfWm5W8qb6_aJSz_bdwDw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/j9dr5-Ih68VDH1exMwsmZA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/j9dr5-Ih68VDH1exMwsmZA/output.json index 2d4612d5de2..0525f7cdb90 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/j9dr5-Ih68VDH1exMwsmZA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/j9dr5-Ih68VDH1exMwsmZA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/j9dr5-Ih68VDH1exMwsmZA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/j9dr5-Ih68VDH1exMwsmZA/span.rust-debug index a58c75d1f10..8acd97a320e 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/j9dr5-Ih68VDH1exMwsmZA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/j9dr5-Ih68VDH1exMwsmZA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #aabcccff } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/j9dr5-Ih68VDH1exMwsmZA/input.css:1:1 + | +1 | a { color: #aabcccff } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/j9dr5-Ih68VDH1exMwsmZA/input.css:1:1 + | +1 | a { color: #aabcccff } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/j9dr5-Ih68VDH1exMwsmZA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/jD_IvFQVk8LtCrictrWpxw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/jD_IvFQVk8LtCrictrWpxw/output.json index 22f8c9c6cae..b48ab5e4ffe 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/jD_IvFQVk8LtCrictrWpxw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/jD_IvFQVk8LtCrictrWpxw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/jD_IvFQVk8LtCrictrWpxw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/jD_IvFQVk8LtCrictrWpxw/span.rust-debug index bca8318700e..dc9c9502ec9 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/jD_IvFQVk8LtCrictrWpxw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/jD_IvFQVk8LtCrictrWpxw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: 0.1; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/jD_IvFQVk8LtCrictrWpxw/input.css:1:1 + | +1 | a { width: 0.1; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/jD_IvFQVk8LtCrictrWpxw/input.css:1:1 + | +1 | a { width: 0.1; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/jD_IvFQVk8LtCrictrWpxw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/jdLujY0rTP02e0KuCnvbvg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/jdLujY0rTP02e0KuCnvbvg/output.json index 213e6038b34..cac00414f89 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/jdLujY0rTP02e0KuCnvbvg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/jdLujY0rTP02e0KuCnvbvg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/jdLujY0rTP02e0KuCnvbvg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/jdLujY0rTP02e0KuCnvbvg/span.rust-debug index a8f53c3a0f0..acad189e28a 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/jdLujY0rTP02e0KuCnvbvg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/jdLujY0rTP02e0KuCnvbvg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a/**/:b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/jdLujY0rTP02e0KuCnvbvg/input.css:1:1 + | +1 | a/**/:b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/jdLujY0rTP02e0KuCnvbvg/input.css:1:1 + | +1 | a/**/:b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/jdLujY0rTP02e0KuCnvbvg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/jzpj5gTOBgKB1ITBDfJiNA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/jzpj5gTOBgKB1ITBDfJiNA/output.json index 66cf3b0c95a..843509811df 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/jzpj5gTOBgKB1ITBDfJiNA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/jzpj5gTOBgKB1ITBDfJiNA/output.json @@ -38,31 +38,47 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 0, - "end": 1, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - }, - "name": { - "type": "Identifier", - "span": { - "start": 2, "end": 3, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 0, + "end": 2, + "ctxt": 0 + }, + "prefix": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "*", + "raw": "*" + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 2, + "end": 3, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/jzpj5gTOBgKB1ITBDfJiNA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/jzpj5gTOBgKB1ITBDfJiNA/span.rust-debug index 5b9860c6bda..3f1525bbdb1 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/jzpj5gTOBgKB1ITBDfJiNA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/jzpj5gTOBgKB1ITBDfJiNA/span.rust-debug @@ -40,6 +40,24 @@ error: TypeSelector 1 | *|b {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/jzpj5gTOBgKB1ITBDfJiNA/input.css:1:1 + | +1 | *|b {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/jzpj5gTOBgKB1ITBDfJiNA/input.css:1:1 + | +1 | *|b {} + | ^^^ + +error: NsPrefix + --> $DIR/tests/fixture/esbuild/misc/jzpj5gTOBgKB1ITBDfJiNA/input.css:1:1 + | +1 | *|b {} + | ^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/jzpj5gTOBgKB1ITBDfJiNA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/kVdd5WJZqKSou4cGvcL40g/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/kVdd5WJZqKSou4cGvcL40g/output.json index 54451e8df16..fe7129f8979 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/kVdd5WJZqKSou4cGvcL40g/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/kVdd5WJZqKSou4cGvcL40g/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/kVdd5WJZqKSou4cGvcL40g/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/kVdd5WJZqKSou4cGvcL40g/span.rust-debug index bd7c48db648..d054d420c11 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/kVdd5WJZqKSou4cGvcL40g/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/kVdd5WJZqKSou4cGvcL40g/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: \69dent } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/kVdd5WJZqKSou4cGvcL40g/input.css:1:1 + | +1 | a { value: \69dent } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/kVdd5WJZqKSou4cGvcL40g/input.css:1:1 + | +1 | a { value: \69dent } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/kVdd5WJZqKSou4cGvcL40g/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/kubgOdBUY3iT30KfPRcbsA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/kubgOdBUY3iT30KfPRcbsA/output.json index 89f04c05a95..bd475ed4ed7 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/kubgOdBUY3iT30KfPRcbsA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/kubgOdBUY3iT30KfPRcbsA/output.json @@ -46,27 +46,51 @@ "end": 12, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 1, - "end": 2, - "ctxt": 0 - }, - "value": "a", - "raw": "a" - }, - "name": { - "type": "Identifier", - "span": { - "start": 3, "end": 4, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 1, + "end": 3, + "ctxt": 0 + }, + "prefix": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 3, + "end": 4, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 5, + "end": 7, + "ctxt": 0 + }, + "value": "|=" }, - "matcher": "|=", "value": { "type": "String", "span": { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/kubgOdBUY3iT30KfPRcbsA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/kubgOdBUY3iT30KfPRcbsA/span.rust-debug index eecba3943b5..0d219f4f61b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/kubgOdBUY3iT30KfPRcbsA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/kubgOdBUY3iT30KfPRcbsA/span.rust-debug @@ -40,12 +40,24 @@ error: SubclassSelector 1 | [a|b |= "c"]{} | ^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/kubgOdBUY3iT30KfPRcbsA/input.css:1:1 | 1 | [a|b |= "c"]{} | ^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/kubgOdBUY3iT30KfPRcbsA/input.css:1:2 + | +1 | [a|b |= "c"]{} + | ^^^ + +error: NsPrefix + --> $DIR/tests/fixture/esbuild/misc/kubgOdBUY3iT30KfPRcbsA/input.css:1:2 + | +1 | [a|b |= "c"]{} + | ^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/kubgOdBUY3iT30KfPRcbsA/input.css:1:2 | @@ -58,6 +70,18 @@ error: Ident 1 | [a|b |= "c"]{} | ^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/kubgOdBUY3iT30KfPRcbsA/input.css:1:6 + | +1 | [a|b |= "c"]{} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/kubgOdBUY3iT30KfPRcbsA/input.css:1:9 + | +1 | [a|b |= "c"]{} + | ^^^ + error: Str --> $DIR/tests/fixture/esbuild/misc/kubgOdBUY3iT30KfPRcbsA/input.css:1:9 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/lFIVvsKPgxD4lJlULqKluw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/lFIVvsKPgxD4lJlULqKluw/output.json index 3c5b57b07cd..bcd498aeaee 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/lFIVvsKPgxD4lJlULqKluw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/lFIVvsKPgxD4lJlULqKluw/output.json @@ -46,16 +46,24 @@ "end": 8, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 7, "ctxt": 0 }, - "value": "attr", - "raw": "\\61ttr" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 7, + "ctxt": 0 + }, + "value": "attr", + "raw": "\\61ttr" + } }, "matcher": null, "value": null, diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/lFIVvsKPgxD4lJlULqKluw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/lFIVvsKPgxD4lJlULqKluw/span.rust-debug index 76efd615b30..9000910846f 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/lFIVvsKPgxD4lJlULqKluw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/lFIVvsKPgxD4lJlULqKluw/span.rust-debug @@ -40,12 +40,18 @@ error: SubclassSelector 1 | [\61ttr] {} | ^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/lFIVvsKPgxD4lJlULqKluw/input.css:1:1 | 1 | [\61ttr] {} | ^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/lFIVvsKPgxD4lJlULqKluw/input.css:1:2 + | +1 | [\61ttr] {} + | ^^^^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/lFIVvsKPgxD4lJlULqKluw/input.css:1:2 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/mJEhy0k_dxoszsTVHb3x_Q/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/mJEhy0k_dxoszsTVHb3x_Q/output.json index ac786ee95e5..522240b61e6 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/mJEhy0k_dxoszsTVHb3x_Q/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/mJEhy0k_dxoszsTVHb3x_Q/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/mJEhy0k_dxoszsTVHb3x_Q/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/mJEhy0k_dxoszsTVHb3x_Q/span.rust-debug index 3cbe24b28f6..4e955d1ce77 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/mJEhy0k_dxoszsTVHb3x_Q/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/mJEhy0k_dxoszsTVHb3x_Q/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #112233ef } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/mJEhy0k_dxoszsTVHb3x_Q/input.css:1:1 + | +1 | a { color: #112233ef } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/mJEhy0k_dxoszsTVHb3x_Q/input.css:1:1 + | +1 | a { color: #112233ef } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/mJEhy0k_dxoszsTVHb3x_Q/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/mnQPy45Xrp2Ze7IdrwV0Ow/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/mnQPy45Xrp2Ze7IdrwV0Ow/output.json index 4ffd298ca08..6ae93b548db 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/mnQPy45Xrp2Ze7IdrwV0Ow/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/mnQPy45Xrp2Ze7IdrwV0Ow/output.json @@ -38,23 +38,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 0, - "end": 1, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [ { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/mnQPy45Xrp2Ze7IdrwV0Ow/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/mnQPy45Xrp2Ze7IdrwV0Ow/span.rust-debug index 77c7d2d6036..94126aa130e 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/mnQPy45Xrp2Ze7IdrwV0Ow/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/mnQPy45Xrp2Ze7IdrwV0Ow/span.rust-debug @@ -40,7 +40,7 @@ error: TypeSelector 1 | *::b {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/esbuild/misc/mnQPy45Xrp2Ze7IdrwV0Ow/input.css:1:1 | 1 | *::b {} diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/mx296i8q4HfA0IzZ055Xpw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/mx296i8q4HfA0IzZ055Xpw/output.json index 7ea04da73b6..14000eb2779 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/mx296i8q4HfA0IzZ055Xpw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/mx296i8q4HfA0IzZ055Xpw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/mx296i8q4HfA0IzZ055Xpw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/mx296i8q4HfA0IzZ055Xpw/span.rust-debug index b562cf9f4e9..203be3403b3 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/mx296i8q4HfA0IzZ055Xpw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/mx296i8q4HfA0IzZ055Xpw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: url(\61bc) } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/mx296i8q4HfA0IzZ055Xpw/input.css:1:1 + | +1 | a { value: url(\61bc) } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/mx296i8q4HfA0IzZ055Xpw/input.css:1:1 + | +1 | a { value: url(\61bc) } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/mx296i8q4HfA0IzZ055Xpw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/nTOoTMumkTvMLx_Y_al5RQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/nTOoTMumkTvMLx_Y_al5RQ/output.json index 8f4b0ebb2a8..10f5eaa8cac 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/nTOoTMumkTvMLx_Y_al5RQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/nTOoTMumkTvMLx_Y_al5RQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/nTOoTMumkTvMLx_Y_al5RQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/nTOoTMumkTvMLx_Y_al5RQ/span.rust-debug index 50db80ed403..8065ff5b4f1 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/nTOoTMumkTvMLx_Y_al5RQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/nTOoTMumkTvMLx_Y_al5RQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: '\,' } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/nTOoTMumkTvMLx_Y_al5RQ/input.css:1:1 + | +1 | a { value: '\,' } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/nTOoTMumkTvMLx_Y_al5RQ/input.css:1:1 + | +1 | a { value: '\,' } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/nTOoTMumkTvMLx_Y_al5RQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/niufyVEBI4s-ZqSXdfhptA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/niufyVEBI4s-ZqSXdfhptA/output.json index ed676e339a1..0f6222c8bdb 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/niufyVEBI4s-ZqSXdfhptA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/niufyVEBI4s-ZqSXdfhptA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/niufyVEBI4s-ZqSXdfhptA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/niufyVEBI4s-ZqSXdfhptA/span.rust-debug index d1942d4a7a2..e5c149fbe84 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/niufyVEBI4s-ZqSXdfhptA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/niufyVEBI4s-ZqSXdfhptA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #abcd } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/niufyVEBI4s-ZqSXdfhptA/input.css:1:1 + | +1 | a { color: #abcd } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/niufyVEBI4s-ZqSXdfhptA/input.css:1:1 + | +1 | a { color: #abcd } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/niufyVEBI4s-ZqSXdfhptA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/nlYSjWzJfpf38YhsJNbwmA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/nlYSjWzJfpf38YhsJNbwmA/output.json index 8b677df7f98..5d296e2f5f3 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/nlYSjWzJfpf38YhsJNbwmA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/nlYSjWzJfpf38YhsJNbwmA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/nlYSjWzJfpf38YhsJNbwmA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/nlYSjWzJfpf38YhsJNbwmA/span.rust-debug index 2c61251cafc..6beeae4117b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/nlYSjWzJfpf38YhsJNbwmA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/nlYSjWzJfpf38YhsJNbwmA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #f00f } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/nlYSjWzJfpf38YhsJNbwmA/input.css:1:1 + | +1 | a { color: #f00f } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/nlYSjWzJfpf38YhsJNbwmA/input.css:1:1 + | +1 | a { color: #f00f } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/nlYSjWzJfpf38YhsJNbwmA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/oNUbYW5wdxqAQR8cAY1YBA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/oNUbYW5wdxqAQR8cAY1YBA/output.json index 5e09f761969..a699a0a3df2 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/oNUbYW5wdxqAQR8cAY1YBA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/oNUbYW5wdxqAQR8cAY1YBA/output.json @@ -46,18 +46,34 @@ "end": 10, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 2, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 3, + "end": 5, + "ctxt": 0 + }, + "value": "^=" }, - "matcher": "^=", "value": { "type": "String", "span": { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/oNUbYW5wdxqAQR8cAY1YBA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/oNUbYW5wdxqAQR8cAY1YBA/span.rust-debug index ced6a80ae53..b7c8ce93330 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/oNUbYW5wdxqAQR8cAY1YBA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/oNUbYW5wdxqAQR8cAY1YBA/span.rust-debug @@ -40,18 +40,36 @@ error: SubclassSelector 1 | [b ^= "c"] {} | ^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/oNUbYW5wdxqAQR8cAY1YBA/input.css:1:1 | 1 | [b ^= "c"] {} | ^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/oNUbYW5wdxqAQR8cAY1YBA/input.css:1:2 + | +1 | [b ^= "c"] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/oNUbYW5wdxqAQR8cAY1YBA/input.css:1:2 | 1 | [b ^= "c"] {} | ^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/oNUbYW5wdxqAQR8cAY1YBA/input.css:1:4 + | +1 | [b ^= "c"] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/oNUbYW5wdxqAQR8cAY1YBA/input.css:1:7 + | +1 | [b ^= "c"] {} + | ^^^ + error: Str --> $DIR/tests/fixture/esbuild/misc/oNUbYW5wdxqAQR8cAY1YBA/input.css:1:7 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/oj5Yn0RxnGFEbVphKqrL2Q/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/oj5Yn0RxnGFEbVphKqrL2Q/output.json index 7535ee592ad..888fb833962 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/oj5Yn0RxnGFEbVphKqrL2Q/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/oj5Yn0RxnGFEbVphKqrL2Q/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/oj5Yn0RxnGFEbVphKqrL2Q/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/oj5Yn0RxnGFEbVphKqrL2Q/span.rust-debug index 7dccae4470e..37b0144682d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/oj5Yn0RxnGFEbVphKqrL2Q/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/oj5Yn0RxnGFEbVphKqrL2Q/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #aabcccdd } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/oj5Yn0RxnGFEbVphKqrL2Q/input.css:1:1 + | +1 | a { color: #aabcccdd } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/oj5Yn0RxnGFEbVphKqrL2Q/input.css:1:1 + | +1 | a { color: #aabcccdd } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/oj5Yn0RxnGFEbVphKqrL2Q/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/ottVCVON2IlQB3WCD-lu_A/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/ottVCVON2IlQB3WCD-lu_A/output.json index 0fe4c1adbb3..99bb2299ad1 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/ottVCVON2IlQB3WCD-lu_A/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/ottVCVON2IlQB3WCD-lu_A/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/ottVCVON2IlQB3WCD-lu_A/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/ottVCVON2IlQB3WCD-lu_A/span.rust-debug index fd4557bee3f67b7de5212714a7d6270f4938ea19..9b0bcc7baf0b9cf89482e2cb59f28614fde7c859 100644 GIT binary patch delta 35 rcmZ3>w@hHeLT2`m#B{&J+| $DIR/tests/fixture/esbuild/misc/p4k8Aj2Nw7Pd4QNaHfLCyg/input.css:1:1 | 1 | [attr="-"] {} | ^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/p4k8Aj2Nw7Pd4QNaHfLCyg/input.css:1:2 + | +1 | [attr="-"] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/p4k8Aj2Nw7Pd4QNaHfLCyg/input.css:1:2 | 1 | [attr="-"] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/p4k8Aj2Nw7Pd4QNaHfLCyg/input.css:1:6 + | +1 | [attr="-"] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/p4k8Aj2Nw7Pd4QNaHfLCyg/input.css:1:7 + | +1 | [attr="-"] {} + | ^^^ + error: Str --> $DIR/tests/fixture/esbuild/misc/p4k8Aj2Nw7Pd4QNaHfLCyg/input.css:1:7 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/pJGP-gxqsiFs_ruNrpY3bw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/pJGP-gxqsiFs_ruNrpY3bw/output.json index c4e3a85c292..f8f1125dad3 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/pJGP-gxqsiFs_ruNrpY3bw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/pJGP-gxqsiFs_ruNrpY3bw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/pJGP-gxqsiFs_ruNrpY3bw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/pJGP-gxqsiFs_ruNrpY3bw/span.rust-debug index 7e5a30d0faa..2706e4965c2 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/pJGP-gxqsiFs_ruNrpY3bw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/pJGP-gxqsiFs_ruNrpY3bw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a:b:c {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/pJGP-gxqsiFs_ruNrpY3bw/input.css:1:1 + | +1 | a:b:c {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/pJGP-gxqsiFs_ruNrpY3bw/input.css:1:1 + | +1 | a:b:c {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/pJGP-gxqsiFs_ruNrpY3bw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/pO8ANIJaeZDUsUBCBMKErg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/pO8ANIJaeZDUsUBCBMKErg/output.json index 9075a4c01a2..312cbc27db8 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/pO8ANIJaeZDUsUBCBMKErg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/pO8ANIJaeZDUsUBCBMKErg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/pO8ANIJaeZDUsUBCBMKErg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/pO8ANIJaeZDUsUBCBMKErg/span.rust-debug index e127299d908..e6fea3311e1 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/pO8ANIJaeZDUsUBCBMKErg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/pO8ANIJaeZDUsUBCBMKErg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: -0.0%; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/pO8ANIJaeZDUsUBCBMKErg/input.css:1:1 + | +1 | a { width: -0.0%; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/pO8ANIJaeZDUsUBCBMKErg/input.css:1:1 + | +1 | a { width: -0.0%; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/pO8ANIJaeZDUsUBCBMKErg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/pOZgFOB3GdVvQ0hiAsWfpQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/pOZgFOB3GdVvQ0hiAsWfpQ/output.json index 02e69f2032c..7c96142200c 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/pOZgFOB3GdVvQ0hiAsWfpQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/pOZgFOB3GdVvQ0hiAsWfpQ/output.json @@ -46,18 +46,34 @@ "end": 11, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 2, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 3, + "end": 4, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { @@ -68,7 +84,24 @@ "value": "c", "raw": "\"c\"" }, - "modifier": "I" + "modifier": { + "type": "AttributeSelectorModifier", + "span": { + "start": 9, + "end": 10, + "ctxt": 0 + }, + "value": { + "type": "Identifier", + "span": { + "start": 9, + "end": 10, + "ctxt": 0 + }, + "value": "I", + "raw": "I" + } + } } ] } diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/pOZgFOB3GdVvQ0hiAsWfpQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/pOZgFOB3GdVvQ0hiAsWfpQ/span.rust-debug index 89f6fd12154..cb8ba95ead3 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/pOZgFOB3GdVvQ0hiAsWfpQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/pOZgFOB3GdVvQ0hiAsWfpQ/span.rust-debug @@ -40,24 +40,54 @@ error: SubclassSelector 1 | [b = "c" I] {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/pOZgFOB3GdVvQ0hiAsWfpQ/input.css:1:1 | 1 | [b = "c" I] {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/pOZgFOB3GdVvQ0hiAsWfpQ/input.css:1:2 + | +1 | [b = "c" I] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/pOZgFOB3GdVvQ0hiAsWfpQ/input.css:1:2 | 1 | [b = "c" I] {} | ^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/pOZgFOB3GdVvQ0hiAsWfpQ/input.css:1:4 + | +1 | [b = "c" I] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/pOZgFOB3GdVvQ0hiAsWfpQ/input.css:1:6 + | +1 | [b = "c" I] {} + | ^^^ + error: Str --> $DIR/tests/fixture/esbuild/misc/pOZgFOB3GdVvQ0hiAsWfpQ/input.css:1:6 | 1 | [b = "c" I] {} | ^^^ +error: AttributeSelectorModifier + --> $DIR/tests/fixture/esbuild/misc/pOZgFOB3GdVvQ0hiAsWfpQ/input.css:1:10 + | +1 | [b = "c" I] {} + | ^ + +error: Ident + --> $DIR/tests/fixture/esbuild/misc/pOZgFOB3GdVvQ0hiAsWfpQ/input.css:1:10 + | +1 | [b = "c" I] {} + | ^ + error: Block --> $DIR/tests/fixture/esbuild/misc/pOZgFOB3GdVvQ0hiAsWfpQ/input.css:1:13 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/pQWwEpWgxuUS6-uSAJR0nQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/pQWwEpWgxuUS6-uSAJR0nQ/output.json index 6a46c4328c2..66eb406ec57 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/pQWwEpWgxuUS6-uSAJR0nQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/pQWwEpWgxuUS6-uSAJR0nQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/pQWwEpWgxuUS6-uSAJR0nQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/pQWwEpWgxuUS6-uSAJR0nQ/span.rust-debug index 4370844c638..e743887aff0 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/pQWwEpWgxuUS6-uSAJR0nQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/pQWwEpWgxuUS6-uSAJR0nQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: +.00; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/pQWwEpWgxuUS6-uSAJR0nQ/input.css:1:1 + | +1 | a { width: +.00; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/pQWwEpWgxuUS6-uSAJR0nQ/input.css:1:1 + | +1 | a { width: +.00; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/pQWwEpWgxuUS6-uSAJR0nQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/pRKMU9FUvZ77y9hGWxYQnw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/pRKMU9FUvZ77y9hGWxYQnw/output.json index 1d3da1ca1b1..483919a68c9 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/pRKMU9FUvZ77y9hGWxYQnw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/pRKMU9FUvZ77y9hGWxYQnw/output.json @@ -46,18 +46,34 @@ "end": 9, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 5, "ctxt": 0 }, - "value": "attr", - "raw": "attr" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 5, + "ctxt": 0 + }, + "value": "attr", + "raw": "attr" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 5, + "end": 6, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "Identifier", "span": { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/pRKMU9FUvZ77y9hGWxYQnw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/pRKMU9FUvZ77y9hGWxYQnw/span.rust-debug index 948176918e4..e7785115af2 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/pRKMU9FUvZ77y9hGWxYQnw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/pRKMU9FUvZ77y9hGWxYQnw/span.rust-debug @@ -40,18 +40,36 @@ error: SubclassSelector 1 | [attr=\,] {} | ^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/pRKMU9FUvZ77y9hGWxYQnw/input.css:1:1 | 1 | [attr=\,] {} | ^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/pRKMU9FUvZ77y9hGWxYQnw/input.css:1:2 + | +1 | [attr=\,] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/pRKMU9FUvZ77y9hGWxYQnw/input.css:1:2 | 1 | [attr=\,] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/pRKMU9FUvZ77y9hGWxYQnw/input.css:1:6 + | +1 | [attr=\,] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/pRKMU9FUvZ77y9hGWxYQnw/input.css:1:7 + | +1 | [attr=\,] {} + | ^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/pRKMU9FUvZ77y9hGWxYQnw/input.css:1:7 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/pTW2Z7kJ0nR_yQzsOsjAwQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/pTW2Z7kJ0nR_yQzsOsjAwQ/output.json index 4b951f8c776..2e6f2f314c3 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/pTW2Z7kJ0nR_yQzsOsjAwQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/pTW2Z7kJ0nR_yQzsOsjAwQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/pTW2Z7kJ0nR_yQzsOsjAwQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/pTW2Z7kJ0nR_yQzsOsjAwQ/span.rust-debug index 29f9cceeaab..af285d88752 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/pTW2Z7kJ0nR_yQzsOsjAwQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/pTW2Z7kJ0nR_yQzsOsjAwQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #aabbcdff } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/pTW2Z7kJ0nR_yQzsOsjAwQ/input.css:1:1 + | +1 | a { color: #aabbcdff } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/pTW2Z7kJ0nR_yQzsOsjAwQ/input.css:1:1 + | +1 | a { color: #aabbcdff } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/pTW2Z7kJ0nR_yQzsOsjAwQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/pUymwoCxUAxDqtaTC7CaOQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/pUymwoCxUAxDqtaTC7CaOQ/output.json index edc44b9c549..5e0dae4ec36 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/pUymwoCxUAxDqtaTC7CaOQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/pUymwoCxUAxDqtaTC7CaOQ/output.json @@ -38,31 +38,47 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 5, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 0, - "end": 1, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - }, - "name": { - "type": "Identifier", - "span": { - "start": 2, "end": 5, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 0, + "end": 2, + "ctxt": 0 + }, + "prefix": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "*", + "raw": "*" + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 2, + "end": 5, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/pUymwoCxUAxDqtaTC7CaOQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/pUymwoCxUAxDqtaTC7CaOQ/span.rust-debug index bb6009ec57c..99e7a0887d4 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/pUymwoCxUAxDqtaTC7CaOQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/pUymwoCxUAxDqtaTC7CaOQ/span.rust-debug @@ -40,6 +40,24 @@ error: TypeSelector 1 | *|div {} | ^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/pUymwoCxUAxDqtaTC7CaOQ/input.css:1:1 + | +1 | *|div {} + | ^^^^^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/pUymwoCxUAxDqtaTC7CaOQ/input.css:1:1 + | +1 | *|div {} + | ^^^^^ + +error: NsPrefix + --> $DIR/tests/fixture/esbuild/misc/pUymwoCxUAxDqtaTC7CaOQ/input.css:1:1 + | +1 | *|div {} + | ^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/pUymwoCxUAxDqtaTC7CaOQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/prqRW0qUpem2SVAI9WN-5w/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/prqRW0qUpem2SVAI9WN-5w/output.json index 4c6bc0c58c3..0a96ecaaa27 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/prqRW0qUpem2SVAI9WN-5w/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/prqRW0qUpem2SVAI9WN-5w/output.json @@ -38,31 +38,38 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 2, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 0, - "end": 0, - "ctxt": 0 - }, - "value": "", - "raw": "" - }, - "name": { - "type": "Identifier", - "span": { - "start": 1, "end": 2, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "prefix": null + }, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/prqRW0qUpem2SVAI9WN-5w/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/prqRW0qUpem2SVAI9WN-5w/span.rust-debug index 0d97ccb1306..ec58e693565 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/prqRW0qUpem2SVAI9WN-5w/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/prqRW0qUpem2SVAI9WN-5w/span.rust-debug @@ -40,7 +40,23 @@ error: TypeSelector 1 | |b {} | ^^ -error: Ident +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/prqRW0qUpem2SVAI9WN-5w/input.css:1:1 + | +1 | |b {} + | ^^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/prqRW0qUpem2SVAI9WN-5w/input.css:1:1 + | +1 | |b {} + | ^^ + +error: NsPrefix + --> $DIR/tests/fixture/esbuild/misc/prqRW0qUpem2SVAI9WN-5w/input.css:1:1 + | +1 | |b {} + | ^ error: Ident --> $DIR/tests/fixture/esbuild/misc/prqRW0qUpem2SVAI9WN-5w/input.css:1:2 diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/ptR_ezJzwIRsP3geOEZI5A/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/ptR_ezJzwIRsP3geOEZI5A/output.json index c8b5ac5a0db..0549afc0d86 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/ptR_ezJzwIRsP3geOEZI5A/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/ptR_ezJzwIRsP3geOEZI5A/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/ptR_ezJzwIRsP3geOEZI5A/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/ptR_ezJzwIRsP3geOEZI5A/span.rust-debug index b315628695b..8ae206bceee 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/ptR_ezJzwIRsP3geOEZI5A/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/ptR_ezJzwIRsP3geOEZI5A/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: -.0%; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/ptR_ezJzwIRsP3geOEZI5A/input.css:1:1 + | +1 | a { width: -.0%; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/ptR_ezJzwIRsP3geOEZI5A/input.css:1:1 + | +1 | a { width: -.0%; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/ptR_ezJzwIRsP3geOEZI5A/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/qgkE_nOj4HtPukMzEjCY5w/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/qgkE_nOj4HtPukMzEjCY5w/output.json index f471a89a84d..916f5c3a2a3 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/qgkE_nOj4HtPukMzEjCY5w/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/qgkE_nOj4HtPukMzEjCY5w/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/qgkE_nOj4HtPukMzEjCY5w/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/qgkE_nOj4HtPukMzEjCY5w/span.rust-debug index 1d098a0a913..fb7fe983523 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/qgkE_nOj4HtPukMzEjCY5w/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/qgkE_nOj4HtPukMzEjCY5w/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: '\2c' } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/qgkE_nOj4HtPukMzEjCY5w/input.css:1:1 + | +1 | a { value: '\2c' } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/qgkE_nOj4HtPukMzEjCY5w/input.css:1:1 + | +1 | a { value: '\2c' } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/qgkE_nOj4HtPukMzEjCY5w/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/qmXSF9N8euK5gfPoFGmV_Q/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/qmXSF9N8euK5gfPoFGmV_Q/output.json index ef5e1cbb2b0..d4c0bd478dd 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/qmXSF9N8euK5gfPoFGmV_Q/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/qmXSF9N8euK5gfPoFGmV_Q/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/qmXSF9N8euK5gfPoFGmV_Q/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/qmXSF9N8euK5gfPoFGmV_Q/span.rust-debug index d00aa8e3fbf..80d91e10858 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/qmXSF9N8euK5gfPoFGmV_Q/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/qmXSF9N8euK5gfPoFGmV_Q/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #AABBCC } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/qmXSF9N8euK5gfPoFGmV_Q/input.css:1:1 + | +1 | a { color: #AABBCC } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/qmXSF9N8euK5gfPoFGmV_Q/input.css:1:1 + | +1 | a { color: #AABBCC } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/qmXSF9N8euK5gfPoFGmV_Q/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/qsC9vwnhYfmqVreVrA1SEg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/qsC9vwnhYfmqVreVrA1SEg/output.json index 3ee88eb6ad3..66c278969ce 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/qsC9vwnhYfmqVreVrA1SEg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/qsC9vwnhYfmqVreVrA1SEg/output.json @@ -46,18 +46,34 @@ "end": 10, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 2, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 3, + "end": 5, + "ctxt": 0 + }, + "value": "|=" }, - "matcher": "|=", "value": { "type": "String", "span": { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/qsC9vwnhYfmqVreVrA1SEg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/qsC9vwnhYfmqVreVrA1SEg/span.rust-debug index fdfb8408340..a02b86b93c7 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/qsC9vwnhYfmqVreVrA1SEg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/qsC9vwnhYfmqVreVrA1SEg/span.rust-debug @@ -40,18 +40,36 @@ error: SubclassSelector 1 | [b |= "c"] {} | ^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/qsC9vwnhYfmqVreVrA1SEg/input.css:1:1 | 1 | [b |= "c"] {} | ^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/qsC9vwnhYfmqVreVrA1SEg/input.css:1:2 + | +1 | [b |= "c"] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/qsC9vwnhYfmqVreVrA1SEg/input.css:1:2 | 1 | [b |= "c"] {} | ^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/qsC9vwnhYfmqVreVrA1SEg/input.css:1:4 + | +1 | [b |= "c"] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/qsC9vwnhYfmqVreVrA1SEg/input.css:1:7 + | +1 | [b |= "c"] {} + | ^^^ + error: Str --> $DIR/tests/fixture/esbuild/misc/qsC9vwnhYfmqVreVrA1SEg/input.css:1:7 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/rAzJtA56igpCO-gN3gRrYw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/rAzJtA56igpCO-gN3gRrYw/output.json index 117ca94161e..63a2322b522 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/rAzJtA56igpCO-gN3gRrYw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/rAzJtA56igpCO-gN3gRrYw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/rAzJtA56igpCO-gN3gRrYw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/rAzJtA56igpCO-gN3gRrYw/span.rust-debug index 1ae472cf932..e37c955faae 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/rAzJtA56igpCO-gN3gRrYw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/rAzJtA56igpCO-gN3gRrYw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: 'a\62c' } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/rAzJtA56igpCO-gN3gRrYw/input.css:1:1 + | +1 | a { value: 'a\62c' } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/rAzJtA56igpCO-gN3gRrYw/input.css:1:1 + | +1 | a { value: 'a\62c' } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/rAzJtA56igpCO-gN3gRrYw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/rPWYt0NoxD_TvsI8Xrhvyg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/rPWYt0NoxD_TvsI8Xrhvyg/output.json index 447cf740500..134e04cc3bf 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/rPWYt0NoxD_TvsI8Xrhvyg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/rPWYt0NoxD_TvsI8Xrhvyg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/rPWYt0NoxD_TvsI8Xrhvyg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/rPWYt0NoxD_TvsI8Xrhvyg/span.rust-debug index eaef9acd751..bf45da35e6e 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/rPWYt0NoxD_TvsI8Xrhvyg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/rPWYt0NoxD_TvsI8Xrhvyg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: .10%; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/rPWYt0NoxD_TvsI8Xrhvyg/input.css:1:1 + | +1 | a { width: .10%; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/rPWYt0NoxD_TvsI8Xrhvyg/input.css:1:1 + | +1 | a { width: .10%; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/rPWYt0NoxD_TvsI8Xrhvyg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/rZIFO-RMBeLmmQK8U6nNmQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/rZIFO-RMBeLmmQK8U6nNmQ/output.json index f187456ec71..579da72a6d4 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/rZIFO-RMBeLmmQK8U6nNmQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/rZIFO-RMBeLmmQK8U6nNmQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/rZIFO-RMBeLmmQK8U6nNmQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/rZIFO-RMBeLmmQK8U6nNmQ/span.rust-debug index a0ac9fc53fa..b52b2982dc0 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/rZIFO-RMBeLmmQK8U6nNmQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/rZIFO-RMBeLmmQK8U6nNmQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #11223444 } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/rZIFO-RMBeLmmQK8U6nNmQ/input.css:1:1 + | +1 | a { color: #11223444 } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/rZIFO-RMBeLmmQK8U6nNmQ/input.css:1:1 + | +1 | a { color: #11223444 } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/rZIFO-RMBeLmmQK8U6nNmQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/sAlB53zm7iv9WuhRVKadHQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/sAlB53zm7iv9WuhRVKadHQ/output.json index 0ca67d03953..808768815f9 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/sAlB53zm7iv9WuhRVKadHQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/sAlB53zm7iv9WuhRVKadHQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/sAlB53zm7iv9WuhRVKadHQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/sAlB53zm7iv9WuhRVKadHQ/span.rust-debug index 3f6e78f86fc..0e4b7fe18c5 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/sAlB53zm7iv9WuhRVKadHQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/sAlB53zm7iv9WuhRVKadHQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a::b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/sAlB53zm7iv9WuhRVKadHQ/input.css:1:1 + | +1 | a::b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/sAlB53zm7iv9WuhRVKadHQ/input.css:1:1 + | +1 | a::b {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/sAlB53zm7iv9WuhRVKadHQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/sEqPCrxONsC0GxTLw0X7IA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/sEqPCrxONsC0GxTLw0X7IA/output.json index 28b7c61652f..4453da80736 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/sEqPCrxONsC0GxTLw0X7IA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/sEqPCrxONsC0GxTLw0X7IA/output.json @@ -46,25 +46,41 @@ "end": 13, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 1, - "end": 3, - "ctxt": 0 - }, - "value": "ns", - "raw": "ns" - }, - "name": { - "type": "Identifier", - "span": { - "start": 4, "end": 12, "ctxt": 0 }, - "value": ",attr", - "raw": "\\2c attr" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 1, + "end": 4, + "ctxt": 0 + }, + "prefix": { + "type": "Identifier", + "span": { + "start": 1, + "end": 3, + "ctxt": 0 + }, + "value": "ns", + "raw": "ns" + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 4, + "end": 12, + "ctxt": 0 + }, + "value": ",attr", + "raw": "\\2c attr" + } }, "matcher": null, "value": null, diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/sEqPCrxONsC0GxTLw0X7IA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/sEqPCrxONsC0GxTLw0X7IA/span.rust-debug index 5f9273280ba..09e12a27a7f 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/sEqPCrxONsC0GxTLw0X7IA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/sEqPCrxONsC0GxTLw0X7IA/span.rust-debug @@ -40,12 +40,24 @@ error: SubclassSelector 1 | [ns|\2c attr] {} | ^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/sEqPCrxONsC0GxTLw0X7IA/input.css:1:1 | 1 | [ns|\2c attr] {} | ^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/sEqPCrxONsC0GxTLw0X7IA/input.css:1:2 + | +1 | [ns|\2c attr] {} + | ^^^^^^^^^^^ + +error: NsPrefix + --> $DIR/tests/fixture/esbuild/misc/sEqPCrxONsC0GxTLw0X7IA/input.css:1:2 + | +1 | [ns|\2c attr] {} + | ^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/sEqPCrxONsC0GxTLw0X7IA/input.css:1:2 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/sI7kJsMAHm4ehV5Ec9i9hg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/sI7kJsMAHm4ehV5Ec9i9hg/output.json index 5d2ae047197..0c213621a21 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/sI7kJsMAHm4ehV5Ec9i9hg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/sI7kJsMAHm4ehV5Ec9i9hg/output.json @@ -46,18 +46,34 @@ "end": 10, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 7, "ctxt": 0 }, - "value": "attr~", - "raw": "attr\\~" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 7, + "ctxt": 0 + }, + "value": "attr~", + "raw": "attr\\~" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 7, + "end": 8, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "Identifier", "span": { diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/sI7kJsMAHm4ehV5Ec9i9hg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/sI7kJsMAHm4ehV5Ec9i9hg/span.rust-debug index a069058641b..90e9de19237 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/sI7kJsMAHm4ehV5Ec9i9hg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/sI7kJsMAHm4ehV5Ec9i9hg/span.rust-debug @@ -40,18 +40,36 @@ error: SubclassSelector 1 | [attr\~=x] {} | ^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/sI7kJsMAHm4ehV5Ec9i9hg/input.css:1:1 | 1 | [attr\~=x] {} | ^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/sI7kJsMAHm4ehV5Ec9i9hg/input.css:1:2 + | +1 | [attr\~=x] {} + | ^^^^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/sI7kJsMAHm4ehV5Ec9i9hg/input.css:1:2 | 1 | [attr\~=x] {} | ^^^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/esbuild/misc/sI7kJsMAHm4ehV5Ec9i9hg/input.css:1:8 + | +1 | [attr\~=x] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/esbuild/misc/sI7kJsMAHm4ehV5Ec9i9hg/input.css:1:9 + | +1 | [attr\~=x] {} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/sI7kJsMAHm4ehV5Ec9i9hg/input.css:1:9 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/sNuIucY7tsVtjkcMTIXaGw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/sNuIucY7tsVtjkcMTIXaGw/output.json index f2b8757040e..d9139e9c668 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/sNuIucY7tsVtjkcMTIXaGw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/sNuIucY7tsVtjkcMTIXaGw/output.json @@ -46,16 +46,24 @@ "end": 10, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 9, "ctxt": 0 }, - "value": ",attr", - "raw": "\\2c attr" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 9, + "ctxt": 0 + }, + "value": ",attr", + "raw": "\\2c attr" + } }, "matcher": null, "value": null, diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/sNuIucY7tsVtjkcMTIXaGw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/sNuIucY7tsVtjkcMTIXaGw/span.rust-debug index d6458b57645..054e118284f 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/sNuIucY7tsVtjkcMTIXaGw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/sNuIucY7tsVtjkcMTIXaGw/span.rust-debug @@ -40,12 +40,18 @@ error: SubclassSelector 1 | [\2c attr] {} | ^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/sNuIucY7tsVtjkcMTIXaGw/input.css:1:1 | 1 | [\2c attr] {} | ^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/sNuIucY7tsVtjkcMTIXaGw/input.css:1:2 + | +1 | [\2c attr] {} + | ^^^^^^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/sNuIucY7tsVtjkcMTIXaGw/input.css:1:2 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/sPEO1vW1kIUNhCVdR2d7fg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/sPEO1vW1kIUNhCVdR2d7fg/output.json index 5b85edaac5e..519df1e2786 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/sPEO1vW1kIUNhCVdR2d7fg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/sPEO1vW1kIUNhCVdR2d7fg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/sPEO1vW1kIUNhCVdR2d7fg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/sPEO1vW1kIUNhCVdR2d7fg/span.rust-debug index d90a6c54050..ad4d1e072bb 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/sPEO1vW1kIUNhCVdR2d7fg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/sPEO1vW1kIUNhCVdR2d7fg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: 10x\, } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/sPEO1vW1kIUNhCVdR2d7fg/input.css:1:1 + | +1 | a { value: 10x\, } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/sPEO1vW1kIUNhCVdR2d7fg/input.css:1:1 + | +1 | a { value: 10x\, } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/sPEO1vW1kIUNhCVdR2d7fg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/tJNGkqEMVKFfOWjyOm5TSg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/tJNGkqEMVKFfOWjyOm5TSg/output.json index ea966393078..9ff80760ae6 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/tJNGkqEMVKFfOWjyOm5TSg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/tJNGkqEMVKFfOWjyOm5TSg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/tJNGkqEMVKFfOWjyOm5TSg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/tJNGkqEMVKFfOWjyOm5TSg/span.rust-debug index efde9af8c8b..4d3161f0f86 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/tJNGkqEMVKFfOWjyOm5TSg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/tJNGkqEMVKFfOWjyOm5TSg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: -0.1; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/tJNGkqEMVKFfOWjyOm5TSg/input.css:1:1 + | +1 | a { width: -0.1; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/tJNGkqEMVKFfOWjyOm5TSg/input.css:1:1 + | +1 | a { width: -0.1; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/tJNGkqEMVKFfOWjyOm5TSg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/tr7rB0yt-SnlIRotrT7uFA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/tr7rB0yt-SnlIRotrT7uFA/output.json index 3dc33597fbf..4fb29053959 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/tr7rB0yt-SnlIRotrT7uFA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/tr7rB0yt-SnlIRotrT7uFA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 7, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 7, "ctxt": 0 }, - "value": "-123", - "raw": "\\2d 123" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 7, + "ctxt": 0 + }, + "value": "-123", + "raw": "\\2d 123" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/tr7rB0yt-SnlIRotrT7uFA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/tr7rB0yt-SnlIRotrT7uFA/span.rust-debug index afec0b86cef..4298fa78a66 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/tr7rB0yt-SnlIRotrT7uFA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/tr7rB0yt-SnlIRotrT7uFA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | \2d 123 {} | ^^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/tr7rB0yt-SnlIRotrT7uFA/input.css:1:1 + | +1 | \2d 123 {} + | ^^^^^^^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/tr7rB0yt-SnlIRotrT7uFA/input.css:1:1 + | +1 | \2d 123 {} + | ^^^^^^^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/tr7rB0yt-SnlIRotrT7uFA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/uxHrqNkMo_2PTuF8sIRQxA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/uxHrqNkMo_2PTuF8sIRQxA/output.json index c67eb7835f2..0c4ea5b822b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/uxHrqNkMo_2PTuF8sIRQxA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/uxHrqNkMo_2PTuF8sIRQxA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/uxHrqNkMo_2PTuF8sIRQxA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/uxHrqNkMo_2PTuF8sIRQxA/span.rust-debug index 3a22f59ff95..64ad9c55e06 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/uxHrqNkMo_2PTuF8sIRQxA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/uxHrqNkMo_2PTuF8sIRQxA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: 10\,x } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/uxHrqNkMo_2PTuF8sIRQxA/input.css:1:1 + | +1 | a { value: 10\,x } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/uxHrqNkMo_2PTuF8sIRQxA/input.css:1:1 + | +1 | a { value: 10\,x } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/uxHrqNkMo_2PTuF8sIRQxA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/vCiwe_ipn8ReAa4wyU52Ng/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/vCiwe_ipn8ReAa4wyU52Ng/output.json index 835319b9f41..354c5a750f9 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/vCiwe_ipn8ReAa4wyU52Ng/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/vCiwe_ipn8ReAa4wyU52Ng/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/vCiwe_ipn8ReAa4wyU52Ng/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/vCiwe_ipn8ReAa4wyU52Ng/span.rust-debug index f72dd0117a0..23401f76543 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/vCiwe_ipn8ReAa4wyU52Ng/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/vCiwe_ipn8ReAa4wyU52Ng/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: tUrQuOiSe } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/vCiwe_ipn8ReAa4wyU52Ng/input.css:1:1 + | +1 | a { color: tUrQuOiSe } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/vCiwe_ipn8ReAa4wyU52Ng/input.css:1:1 + | +1 | a { color: tUrQuOiSe } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/vCiwe_ipn8ReAa4wyU52Ng/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/vFNgwFW2EHA0WTOoSWhSTg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/vFNgwFW2EHA0WTOoSWhSTg/output.json index b0db0bb11f4..de4feb68ed8 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/vFNgwFW2EHA0WTOoSWhSTg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/vFNgwFW2EHA0WTOoSWhSTg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/vFNgwFW2EHA0WTOoSWhSTg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/vFNgwFW2EHA0WTOoSWhSTg/span.rust-debug index 6aa3bf2923c..96b1aad9ba5 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/vFNgwFW2EHA0WTOoSWhSTg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/vFNgwFW2EHA0WTOoSWhSTg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: +.10%; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/vFNgwFW2EHA0WTOoSWhSTg/input.css:1:1 + | +1 | a { width: +.10%; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/vFNgwFW2EHA0WTOoSWhSTg/input.css:1:1 + | +1 | a { width: +.10%; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/vFNgwFW2EHA0WTOoSWhSTg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/vIco-E1oKlSzuggLOcviNg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/vIco-E1oKlSzuggLOcviNg/output.json index ce5e23c0fb9..c1a6476fed5 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/vIco-E1oKlSzuggLOcviNg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/vIco-E1oKlSzuggLOcviNg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/vIco-E1oKlSzuggLOcviNg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/vIco-E1oKlSzuggLOcviNg/span.rust-debug index fad67893576..b047bc83bdc 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/vIco-E1oKlSzuggLOcviNg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/vIco-E1oKlSzuggLOcviNg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: 0.0%; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/vIco-E1oKlSzuggLOcviNg/input.css:1:1 + | +1 | a { width: 0.0%; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/vIco-E1oKlSzuggLOcviNg/input.css:1:1 + | +1 | a { width: 0.0%; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/vIco-E1oKlSzuggLOcviNg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/vJrDZy-xgYNUTNK3uei3cg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/vJrDZy-xgYNUTNK3uei3cg/output.json index f8602dc15de..be1ed935b4b 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/vJrDZy-xgYNUTNK3uei3cg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/vJrDZy-xgYNUTNK3uei3cg/output.json @@ -46,16 +46,24 @@ "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 2, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 2, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } }, "matcher": null, "value": null, diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/vJrDZy-xgYNUTNK3uei3cg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/vJrDZy-xgYNUTNK3uei3cg/span.rust-debug index be7476ff3d3..c86e059c43d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/vJrDZy-xgYNUTNK3uei3cg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/vJrDZy-xgYNUTNK3uei3cg/span.rust-debug @@ -40,12 +40,18 @@ error: SubclassSelector 1 | [b]{} | ^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/esbuild/misc/vJrDZy-xgYNUTNK3uei3cg/input.css:1:1 | 1 | [b]{} | ^^^ +error: WqName + --> $DIR/tests/fixture/esbuild/misc/vJrDZy-xgYNUTNK3uei3cg/input.css:1:2 + | +1 | [b]{} + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/vJrDZy-xgYNUTNK3uei3cg/input.css:1:2 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/vN7xRB9YekSqanW68eIoNA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/vN7xRB9YekSqanW68eIoNA/output.json index 41b8adf7c10..2731e1329ca 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/vN7xRB9YekSqanW68eIoNA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/vN7xRB9YekSqanW68eIoNA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/vN7xRB9YekSqanW68eIoNA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/vN7xRB9YekSqanW68eIoNA/span.rust-debug index 82018626cd1..e9112f45999 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/vN7xRB9YekSqanW68eIoNA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/vN7xRB9YekSqanW68eIoNA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #112233ff } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/vN7xRB9YekSqanW68eIoNA/input.css:1:1 + | +1 | a { color: #112233ff } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/vN7xRB9YekSqanW68eIoNA/input.css:1:1 + | +1 | a { color: #112233ff } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/vN7xRB9YekSqanW68eIoNA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/wEB80kxMinK4EZaPb3My1A/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/wEB80kxMinK4EZaPb3My1A/output.json index 6ee4649a7fb..14a1d431aba 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/wEB80kxMinK4EZaPb3My1A/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/wEB80kxMinK4EZaPb3My1A/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/wEB80kxMinK4EZaPb3My1A/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/wEB80kxMinK4EZaPb3My1A/span.rust-debug index 0e00105c761..4aea94c7f4f 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/wEB80kxMinK4EZaPb3My1A/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/wEB80kxMinK4EZaPb3My1A/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: .00; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/wEB80kxMinK4EZaPb3My1A/input.css:1:1 + | +1 | a { width: .00; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/wEB80kxMinK4EZaPb3My1A/input.css:1:1 + | +1 | a { width: .00; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/wEB80kxMinK4EZaPb3My1A/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/wwLEw52LUKMFH3Wp5CaBAQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/wwLEw52LUKMFH3Wp5CaBAQ/output.json index 97110f5d015..1761fe7755d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/wwLEw52LUKMFH3Wp5CaBAQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/wwLEw52LUKMFH3Wp5CaBAQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/wwLEw52LUKMFH3Wp5CaBAQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/wwLEw52LUKMFH3Wp5CaBAQ/span.rust-debug index a4fb87ec52c..ea92c4fc7d0 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/wwLEw52LUKMFH3Wp5CaBAQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/wwLEw52LUKMFH3Wp5CaBAQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: -0.0; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/wwLEw52LUKMFH3Wp5CaBAQ/input.css:1:1 + | +1 | a { width: -0.0; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/wwLEw52LUKMFH3Wp5CaBAQ/input.css:1:1 + | +1 | a { width: -0.0; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/wwLEw52LUKMFH3Wp5CaBAQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/xc1mD3YfHByTKL-N-FL49A/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/xc1mD3YfHByTKL-N-FL49A/output.json index 7e68181ac1b..b039b76d433 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/xc1mD3YfHByTKL-N-FL49A/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/xc1mD3YfHByTKL-N-FL49A/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/xc1mD3YfHByTKL-N-FL49A/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/xc1mD3YfHByTKL-N-FL49A/span.rust-debug index 224fedeab4b..cbdbfb7390a 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/xc1mD3YfHByTKL-N-FL49A/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/xc1mD3YfHByTKL-N-FL49A/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #ABBBCCFF } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/xc1mD3YfHByTKL-N-FL49A/input.css:1:1 + | +1 | a { color: #ABBBCCFF } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/xc1mD3YfHByTKL-N-FL49A/input.css:1:1 + | +1 | a { color: #ABBBCCFF } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/xc1mD3YfHByTKL-N-FL49A/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/xdJ7w6fdV3po3r2aWrgPdA/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/xdJ7w6fdV3po3r2aWrgPdA/output.json index 9eb84c3761d..c359aec118c 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/xdJ7w6fdV3po3r2aWrgPdA/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/xdJ7w6fdV3po3r2aWrgPdA/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/xdJ7w6fdV3po3r2aWrgPdA/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/xdJ7w6fdV3po3r2aWrgPdA/span.rust-debug index 4d7c3af4eb2..66b12963edf 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/xdJ7w6fdV3po3r2aWrgPdA/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/xdJ7w6fdV3po3r2aWrgPdA/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #abbbcc } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/xdJ7w6fdV3po3r2aWrgPdA/input.css:1:1 + | +1 | a { color: #abbbcc } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/xdJ7w6fdV3po3r2aWrgPdA/input.css:1:1 + | +1 | a { color: #abbbcc } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/xdJ7w6fdV3po3r2aWrgPdA/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/yOHW3TOE35U7DAf9Hn7-Ew/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/yOHW3TOE35U7DAf9Hn7-Ew/output.json index 5d00852f0c3..313878dd343 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/yOHW3TOE35U7DAf9Hn7-Ew/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/yOHW3TOE35U7DAf9Hn7-Ew/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/yOHW3TOE35U7DAf9Hn7-Ew/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/yOHW3TOE35U7DAf9Hn7-Ew/span.rust-debug index e335bcbde9f..4d79f8f01ad 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/yOHW3TOE35U7DAf9Hn7-Ew/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/yOHW3TOE35U7DAf9Hn7-Ew/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: \2cx() } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/yOHW3TOE35U7DAf9Hn7-Ew/input.css:1:1 + | +1 | a { value: \2cx() } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/yOHW3TOE35U7DAf9Hn7-Ew/input.css:1:1 + | +1 | a { value: \2cx() } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/yOHW3TOE35U7DAf9Hn7-Ew/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/yVqdwpiB7OK23Te5mXKdFw/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/yVqdwpiB7OK23Te5mXKdFw/output.json index ecf17af0613..492bf887cd6 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/yVqdwpiB7OK23Te5mXKdFw/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/yVqdwpiB7OK23Te5mXKdFw/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/yVqdwpiB7OK23Te5mXKdFw/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/yVqdwpiB7OK23Te5mXKdFw/span.rust-debug index 93cd4554d43..a3153fec0a4 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/yVqdwpiB7OK23Te5mXKdFw/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/yVqdwpiB7OK23Te5mXKdFw/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { width: .0; } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/yVqdwpiB7OK23Te5mXKdFw/input.css:1:1 + | +1 | a { width: .0; } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/yVqdwpiB7OK23Te5mXKdFw/input.css:1:1 + | +1 | a { width: .0; } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/yVqdwpiB7OK23Te5mXKdFw/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/yboE7Tr5zjKHy9-m10AZTg/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/yboE7Tr5zjKHy9-m10AZTg/output.json index 7dfa6ddb13b..9626b772e54 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/yboE7Tr5zjKHy9-m10AZTg/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/yboE7Tr5zjKHy9-m10AZTg/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/yboE7Tr5zjKHy9-m10AZTg/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/yboE7Tr5zjKHy9-m10AZTg/span.rust-debug index fd62c8594b8..424cdc826ed 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/yboE7Tr5zjKHy9-m10AZTg/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/yboE7Tr5zjKHy9-m10AZTg/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #11223344 } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/yboE7Tr5zjKHy9-m10AZTg/input.css:1:1 + | +1 | a { color: #11223344 } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/yboE7Tr5zjKHy9-m10AZTg/input.css:1:1 + | +1 | a { color: #11223344 } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/yboE7Tr5zjKHy9-m10AZTg/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/zUuWz4A8Y6yZO8JMLAe2fQ/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/zUuWz4A8Y6yZO8JMLAe2fQ/output.json index ea975acfaad..a6f771c1140 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/zUuWz4A8Y6yZO8JMLAe2fQ/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/zUuWz4A8Y6yZO8JMLAe2fQ/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/zUuWz4A8Y6yZO8JMLAe2fQ/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/zUuWz4A8Y6yZO8JMLAe2fQ/span.rust-debug index ebd49fd46c6..85d6d13a884 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/zUuWz4A8Y6yZO8JMLAe2fQ/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/zUuWz4A8Y6yZO8JMLAe2fQ/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { color: #ff0000 } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/zUuWz4A8Y6yZO8JMLAe2fQ/input.css:1:1 + | +1 | a { color: #ff0000 } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/zUuWz4A8Y6yZO8JMLAe2fQ/input.css:1:1 + | +1 | a { color: #ff0000 } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/zUuWz4A8Y6yZO8JMLAe2fQ/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/zz_B6vK87VUHpkOMFR_R1g/output.json b/crates/swc_css_parser/tests/fixture/esbuild/misc/zz_B6vK87VUHpkOMFR_R1g/output.json index feee118ef16..a8a3d0942c9 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/zz_B6vK87VUHpkOMFR_R1g/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/zz_B6vK87VUHpkOMFR_R1g/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/misc/zz_B6vK87VUHpkOMFR_R1g/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/misc/zz_B6vK87VUHpkOMFR_R1g/span.rust-debug index 87fe4dc38db..50eb037a2db 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/misc/zz_B6vK87VUHpkOMFR_R1g/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/misc/zz_B6vK87VUHpkOMFR_R1g/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { value: 10e\32x } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/misc/zz_B6vK87VUHpkOMFR_R1g/input.css:1:1 + | +1 | a { value: 10e\32x } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/misc/zz_B6vK87VUHpkOMFR_R1g/input.css:1:1 + | +1 | a { value: 10e\32x } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/misc/zz_B6vK87VUHpkOMFR_R1g/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/esbuild/value/mixed-separator-01/output.json b/crates/swc_css_parser/tests/fixture/esbuild/value/mixed-separator-01/output.json index 04361992c70..38ba278fe69 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/value/mixed-separator-01/output.json +++ b/crates/swc_css_parser/tests/fixture/esbuild/value/mixed-separator-01/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/esbuild/value/mixed-separator-01/span.rust-debug b/crates/swc_css_parser/tests/fixture/esbuild/value/mixed-separator-01/span.rust-debug index d6dc8f0d359..a276513c68d 100644 --- a/crates/swc_css_parser/tests/fixture/esbuild/value/mixed-separator-01/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/esbuild/value/mixed-separator-01/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | a { box-shadow: rebeccapurple , yellow , black } | ^ +error: TagNameSelector + --> $DIR/tests/fixture/esbuild/value/mixed-separator-01/input.css:1:1 + | +1 | a { box-shadow: rebeccapurple , yellow , black } + | ^ + +error: WqName + --> $DIR/tests/fixture/esbuild/value/mixed-separator-01/input.css:1:1 + | +1 | a { box-shadow: rebeccapurple , yellow , black } + | ^ + error: Ident --> $DIR/tests/fixture/esbuild/value/mixed-separator-01/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/function/calc/output.json b/crates/swc_css_parser/tests/fixture/function/calc/output.json index 6af7d49beae..a72ee556110 100644 --- a/crates/swc_css_parser/tests/fixture/function/calc/output.json +++ b/crates/swc_css_parser/tests/fixture/function/calc/output.json @@ -195,22 +195,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 44, "end": 47, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 44, "end": 47, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 44, + "end": 47, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -3051,22 +3059,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1206, "end": 1209, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1206, "end": 1209, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1206, + "end": 1209, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -3117,22 +3133,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1309, "end": 1312, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1309, "end": 1312, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1309, + "end": 1312, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -3262,22 +3286,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1340, "end": 1343, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1340, "end": 1343, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1340, + "end": 1343, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/function/calc/span.rust-debug b/crates/swc_css_parser/tests/fixture/function/calc/span.rust-debug index 8e589c818c8..dcf6157b0b3 100644 --- a/crates/swc_css_parser/tests/fixture/function/calc/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/function/calc/span.rust-debug @@ -203,6 +203,18 @@ error: TypeSelector 5 | div { | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/function/calc/input.css:5:1 + | +5 | div { + | ^^^ + +error: WqName + --> $DIR/tests/fixture/function/calc/input.css:5:1 + | +5 | div { + | ^^^ + error: Ident --> $DIR/tests/fixture/function/calc/input.css:5:1 | @@ -2942,6 +2954,18 @@ error: TypeSelector 45 | div { | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/function/calc/input.css:45:1 + | +45 | div { + | ^^^ + +error: WqName + --> $DIR/tests/fixture/function/calc/input.css:45:1 + | +45 | div { + | ^^^ + error: Ident --> $DIR/tests/fixture/function/calc/input.css:45:1 | @@ -2994,6 +3018,18 @@ error: TypeSelector 49 | div { width: calc(100% / 4); } | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/function/calc/input.css:49:1 + | +49 | div { width: calc(100% / 4); } + | ^^^ + +error: WqName + --> $DIR/tests/fixture/function/calc/input.css:49:1 + | +49 | div { width: calc(100% / 4); } + | ^^^ + error: Ident --> $DIR/tests/fixture/function/calc/input.css:49:1 | @@ -3120,6 +3156,18 @@ error: TypeSelector 50 | div { margin-top: calc(-120% - 4px); } | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/function/calc/input.css:50:1 + | +50 | div { margin-top: calc(-120% - 4px); } + | ^^^ + +error: WqName + --> $DIR/tests/fixture/function/calc/input.css:50:1 + | +50 | div { margin-top: calc(-120% - 4px); } + | ^^^ + error: Ident --> $DIR/tests/fixture/function/calc/input.css:50:1 | diff --git a/crates/swc_css_parser/tests/fixture/function/url/output.json b/crates/swc_css_parser/tests/fixture/function/url/output.json index 9604ab4350b..26e0300fb65 100644 --- a/crates/swc_css_parser/tests/fixture/function/url/output.json +++ b/crates/swc_css_parser/tests/fixture/function/url/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/function/url/span.rust-debug b/crates/swc_css_parser/tests/fixture/function/url/span.rust-debug index 4ba91fb7238..64f56abab3d 100644 --- a/crates/swc_css_parser/tests/fixture/function/url/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/function/url/span.rust-debug @@ -58,6 +58,18 @@ error: TypeSelector 1 | a { | ^ +error: TagNameSelector + --> $DIR/tests/fixture/function/url/input.css:1:1 + | +1 | a { + | ^ + +error: WqName + --> $DIR/tests/fixture/function/url/input.css:1:1 + | +1 | a { + | ^ + error: Ident --> $DIR/tests/fixture/function/url/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/hacks/output.json b/crates/swc_css_parser/tests/fixture/hacks/output.json index b4ee031d53e..95da3ae0ccb 100644 --- a/crates/swc_css_parser/tests/fixture/hacks/output.json +++ b/crates/swc_css_parser/tests/fixture/hacks/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 4, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 4, "ctxt": 0 }, - "value": "html", - "raw": "html" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 4, + "ctxt": 0 + }, + "value": "html", + "raw": "html" + } } }, "subclassSelectors": [] @@ -76,22 +84,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 12, "end": 16, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 12, "end": 16, "ctxt": 0 }, - "value": "body", - "raw": "body" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 12, + "end": 16, + "ctxt": 0 + }, + "value": "body", + "raw": "body" + } } }, "subclassSelectors": [] @@ -181,22 +197,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 30, "end": 34, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 30, "end": 34, "ctxt": 0 }, - "value": "head", - "raw": "head" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 30, + "end": 34, + "ctxt": 0 + }, + "value": "head", + "raw": "head" + } } }, "subclassSelectors": [] @@ -219,22 +243,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 42, "end": 46, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 42, "end": 46, "ctxt": 0 }, - "value": "body", - "raw": "body" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 42, + "end": 46, + "ctxt": 0 + }, + "value": "body", + "raw": "body" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/hacks/span.rust-debug b/crates/swc_css_parser/tests/fixture/hacks/span.rust-debug index ed889766ff1..79201d6b805 100644 --- a/crates/swc_css_parser/tests/fixture/hacks/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/hacks/span.rust-debug @@ -46,6 +46,18 @@ error: TypeSelector 1 | html > /**/ body .selector {} | ^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/hacks/input.css:1:1 + | +1 | html > /**/ body .selector {} + | ^^^^ + +error: WqName + --> $DIR/tests/fixture/hacks/input.css:1:1 + | +1 | html > /**/ body .selector {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/hacks/input.css:1:1 | @@ -70,6 +82,18 @@ error: TypeSelector 1 | html > /**/ body .selector {} | ^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/hacks/input.css:1:13 + | +1 | html > /**/ body .selector {} + | ^^^^ + +error: WqName + --> $DIR/tests/fixture/hacks/input.css:1:13 + | +1 | html > /**/ body .selector {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/hacks/input.css:1:13 | @@ -148,6 +172,18 @@ error: TypeSelector 2 | head ~ /**/ body .selector {} | ^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/hacks/input.css:2:1 + | +2 | head ~ /**/ body .selector {} + | ^^^^ + +error: WqName + --> $DIR/tests/fixture/hacks/input.css:2:1 + | +2 | head ~ /**/ body .selector {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/hacks/input.css:2:1 | @@ -172,6 +208,18 @@ error: TypeSelector 2 | head ~ /**/ body .selector {} | ^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/hacks/input.css:2:13 + | +2 | head ~ /**/ body .selector {} + | ^^^^ + +error: WqName + --> $DIR/tests/fixture/hacks/input.css:2:13 + | +2 | head ~ /**/ body .selector {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/hacks/input.css:2:13 | diff --git a/crates/swc_css_parser/tests/fixture/hex-colors/output.json b/crates/swc_css_parser/tests/fixture/hex-colors/output.json index c5b9b20ef04..4250af231a3 100644 --- a/crates/swc_css_parser/tests/fixture/hex-colors/output.json +++ b/crates/swc_css_parser/tests/fixture/hex-colors/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/hex-colors/span.rust-debug b/crates/swc_css_parser/tests/fixture/hex-colors/span.rust-debug index 63203c56ca4..a45d6ac9c83 100644 --- a/crates/swc_css_parser/tests/fixture/hex-colors/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/hex-colors/span.rust-debug @@ -58,6 +58,18 @@ error: TypeSelector 1 | a { | ^ +error: TagNameSelector + --> $DIR/tests/fixture/hex-colors/input.css:1:1 + | +1 | a { + | ^ + +error: WqName + --> $DIR/tests/fixture/hex-colors/input.css:1:1 + | +1 | a { + | ^ + error: Ident --> $DIR/tests/fixture/hex-colors/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/number/output.json b/crates/swc_css_parser/tests/fixture/number/output.json index 5518411b48c..36e9fac4b9a 100644 --- a/crates/swc_css_parser/tests/fixture/number/output.json +++ b/crates/swc_css_parser/tests/fixture/number/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/number/span.rust-debug b/crates/swc_css_parser/tests/fixture/number/span.rust-debug index 72561ff9b82..74d8c5a8d6b 100644 --- a/crates/swc_css_parser/tests/fixture/number/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/number/span.rust-debug @@ -58,6 +58,18 @@ error: TypeSelector 1 | div { | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/number/input.css:1:1 + | +1 | div { + | ^^^ + +error: WqName + --> $DIR/tests/fixture/number/input.css:1:1 + | +1 | div { + | ^^^ + error: Ident --> $DIR/tests/fixture/number/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/property/escaped/output.json b/crates/swc_css_parser/tests/fixture/property/escaped/output.json index d10abfcaa55..739c6769bd9 100644 --- a/crates/swc_css_parser/tests/fixture/property/escaped/output.json +++ b/crates/swc_css_parser/tests/fixture/property/escaped/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 5, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 5, "ctxt": 0 }, - "value": "table", - "raw": "table" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 5, + "ctxt": 0 + }, + "value": "table", + "raw": "table" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/property/escaped/span.rust-debug b/crates/swc_css_parser/tests/fixture/property/escaped/span.rust-debug index 0914ae3c6ed..00ee9927d38 100644 --- a/crates/swc_css_parser/tests/fixture/property/escaped/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/property/escaped/span.rust-debug @@ -46,6 +46,18 @@ error: TypeSelector 1 | table { | ^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/property/escaped/input.css:1:1 + | +1 | table { + | ^^^^^ + +error: WqName + --> $DIR/tests/fixture/property/escaped/input.css:1:1 + | +1 | table { + | ^^^^^ + error: Ident --> $DIR/tests/fixture/property/escaped/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/rome/comment/output.json b/crates/swc_css_parser/tests/fixture/rome/comment/output.json index 93a9e1d34de..5d3e690f2fb 100644 --- a/crates/swc_css_parser/tests/fixture/rome/comment/output.json +++ b/crates/swc_css_parser/tests/fixture/rome/comment/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 20, "end": 21, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 20, "end": 21, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 20, + "end": 21, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -136,22 +144,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 56, "end": 57, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 56, "end": 57, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 56, + "end": 57, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -234,22 +250,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 92, "end": 93, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 92, "end": 93, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 92, + "end": 93, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/rome/comment/span.rust-debug b/crates/swc_css_parser/tests/fixture/rome/comment/span.rust-debug index 4e3d6a398f5..e1eb82a96b0 100644 --- a/crates/swc_css_parser/tests/fixture/rome/comment/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/rome/comment/span.rust-debug @@ -51,6 +51,18 @@ error: TypeSelector 5 | a { | ^ +error: TagNameSelector + --> $DIR/tests/fixture/rome/comment/input.css:5:1 + | +5 | a { + | ^ + +error: WqName + --> $DIR/tests/fixture/rome/comment/input.css:5:1 + | +5 | a { + | ^ + error: Ident --> $DIR/tests/fixture/rome/comment/input.css:5:1 | @@ -136,6 +148,18 @@ error: TypeSelector 9 | a { | ^ +error: TagNameSelector + --> $DIR/tests/fixture/rome/comment/input.css:9:1 + | +9 | a { + | ^ + +error: WqName + --> $DIR/tests/fixture/rome/comment/input.css:9:1 + | +9 | a { + | ^ + error: Ident --> $DIR/tests/fixture/rome/comment/input.css:9:1 | @@ -221,6 +245,18 @@ error: TypeSelector 13 | a /* comment */ { | ^ +error: TagNameSelector + --> $DIR/tests/fixture/rome/comment/input.css:13:1 + | +13 | a /* comment */ { + | ^ + +error: WqName + --> $DIR/tests/fixture/rome/comment/input.css:13:1 + | +13 | a /* comment */ { + | ^ + error: Ident --> $DIR/tests/fixture/rome/comment/input.css:13:1 | diff --git a/crates/swc_css_parser/tests/fixture/rome/media/condition/output.json b/crates/swc_css_parser/tests/fixture/rome/media/condition/output.json index 381406e799d..e4b918cdc07 100644 --- a/crates/swc_css_parser/tests/fixture/rome/media/condition/output.json +++ b/crates/swc_css_parser/tests/fixture/rome/media/condition/output.json @@ -1264,22 +1264,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 463, "end": 464, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 463, "end": 464, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 463, + "end": 464, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -1601,22 +1609,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 563, "end": 564, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 563, "end": 564, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 563, + "end": 564, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/rome/media/condition/span.rust-debug b/crates/swc_css_parser/tests/fixture/rome/media/condition/span.rust-debug index 63c0725167b..91822aeab71 100644 --- a/crates/swc_css_parser/tests/fixture/rome/media/condition/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/rome/media/condition/span.rust-debug @@ -1528,6 +1528,18 @@ error: TypeSelector 8 | a { | ^ +error: TagNameSelector + --> $DIR/tests/fixture/rome/media/condition/input.css:8:2 + | +8 | a { + | ^ + +error: WqName + --> $DIR/tests/fixture/rome/media/condition/input.css:8:2 + | +8 | a { + | ^ + error: Ident --> $DIR/tests/fixture/rome/media/condition/input.css:8:2 | @@ -1912,6 +1924,18 @@ error: TypeSelector 16 | a { | ^ +error: TagNameSelector + --> $DIR/tests/fixture/rome/media/condition/input.css:16:2 + | +16 | a { + | ^ + +error: WqName + --> $DIR/tests/fixture/rome/media/condition/input.css:16:2 + | +16 | a { + | ^ + error: Ident --> $DIR/tests/fixture/rome/media/condition/input.css:16:2 | diff --git a/crates/swc_css_parser/tests/fixture/rome/selectors/output.json b/crates/swc_css_parser/tests/fixture/rome/selectors/output.json index 015fe9dc635..7290ef462ba 100644 --- a/crates/swc_css_parser/tests/fixture/rome/selectors/output.json +++ b/crates/swc_css_parser/tests/fixture/rome/selectors/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -77,22 +85,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 5, "end": 8, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 5, "end": 8, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 5, + "end": 8, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -155,22 +171,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 16, "end": 19, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 16, "end": 19, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 16, + "end": 19, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -233,22 +257,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 27, "end": 30, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 27, "end": 30, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 27, + "end": 30, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -444,23 +476,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 80, "end": 81, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 80, - "end": 81, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [] } @@ -510,22 +532,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 88, "end": 89, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 88, "end": 89, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 88, + "end": 89, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -536,16 +566,24 @@ "end": 96, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 90, "end": 95, "ctxt": 0 }, - "value": "title", - "raw": "title" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 90, + "end": 95, + "ctxt": 0 + }, + "value": "title", + "raw": "title" + } }, "matcher": null, "value": null, @@ -631,22 +669,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 119, "end": 120, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 119, "end": 120, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 119, + "end": 120, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -657,18 +703,34 @@ "end": 137, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 121, "end": 126, "ctxt": 0 }, - "value": "title", - "raw": "title" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 121, + "end": 126, + "ctxt": 0 + }, + "value": "title", + "raw": "title" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 127, + "end": 128, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { @@ -761,22 +823,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 160, "end": 161, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 160, "end": 161, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 160, + "end": 161, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -787,18 +857,34 @@ "end": 179, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 162, "end": 167, "ctxt": 0 }, - "value": "title", - "raw": "title" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 162, + "end": 167, + "ctxt": 0 + }, + "value": "title", + "raw": "title" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 167, + "end": 169, + "ctxt": 0 + }, + "value": "~=" }, - "matcher": "~=", "value": { "type": "String", "span": { @@ -809,7 +895,24 @@ "value": "title", "raw": "\"title\"" }, - "modifier": "i" + "modifier": { + "type": "AttributeSelectorModifier", + "span": { + "start": 177, + "end": 178, + "ctxt": 0 + }, + "value": { + "type": "Identifier", + "span": { + "start": 177, + "end": 178, + "ctxt": 0 + }, + "value": "i", + "raw": "i" + } + } } ] } @@ -891,22 +994,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 202, "end": 203, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 202, "end": 203, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 202, + "end": 203, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -917,18 +1028,34 @@ "end": 220, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 204, "end": 209, "ctxt": 0 }, - "value": "title", - "raw": "title" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 204, + "end": 209, + "ctxt": 0 + }, + "value": "title", + "raw": "title" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 210, + "end": 211, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { @@ -948,18 +1075,34 @@ "end": 239, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 221, "end": 225, "ctxt": 0 }, - "value": "href", - "raw": "href" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 221, + "end": 225, + "ctxt": 0 + }, + "value": "href", + "raw": "href" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 225, + "end": 227, + "ctxt": 0 + }, + "value": "*=" }, - "matcher": "*=", "value": { "type": "String", "span": { @@ -970,7 +1113,24 @@ "value": "image/*", "raw": "\"image/*\"" }, - "modifier": "S" + "modifier": { + "type": "AttributeSelectorModifier", + "span": { + "start": 237, + "end": 238, + "ctxt": 0 + }, + "value": { + "type": "Identifier", + "span": { + "start": 237, + "end": 238, + "ctxt": 0 + }, + "value": "S", + "raw": "S" + } + } } ] } @@ -1052,22 +1212,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 261, "end": 262, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 261, "end": 262, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 261, + "end": 262, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [ diff --git a/crates/swc_css_parser/tests/fixture/rome/selectors/span.rust-debug b/crates/swc_css_parser/tests/fixture/rome/selectors/span.rust-debug index 47d27ef7361..51b1e96c936 100644 --- a/crates/swc_css_parser/tests/fixture/rome/selectors/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/rome/selectors/span.rust-debug @@ -50,6 +50,18 @@ error: TypeSelector 1 | div, div + #id, div ~ #id, div > #id { | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/rome/selectors/input.css:1:1 + | +1 | div, div + #id, div ~ #id, div > #id { + | ^^^ + +error: WqName + --> $DIR/tests/fixture/rome/selectors/input.css:1:1 + | +1 | div, div + #id, div ~ #id, div > #id { + | ^^^ + error: Ident --> $DIR/tests/fixture/rome/selectors/input.css:1:1 | @@ -74,6 +86,18 @@ error: TypeSelector 1 | div, div + #id, div ~ #id, div > #id { | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/rome/selectors/input.css:1:6 + | +1 | div, div + #id, div ~ #id, div > #id { + | ^^^ + +error: WqName + --> $DIR/tests/fixture/rome/selectors/input.css:1:6 + | +1 | div, div + #id, div ~ #id, div > #id { + | ^^^ + error: Ident --> $DIR/tests/fixture/rome/selectors/input.css:1:6 | @@ -128,6 +152,18 @@ error: TypeSelector 1 | div, div + #id, div ~ #id, div > #id { | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/rome/selectors/input.css:1:17 + | +1 | div, div + #id, div ~ #id, div > #id { + | ^^^ + +error: WqName + --> $DIR/tests/fixture/rome/selectors/input.css:1:17 + | +1 | div, div + #id, div ~ #id, div > #id { + | ^^^ + error: Ident --> $DIR/tests/fixture/rome/selectors/input.css:1:17 | @@ -182,6 +218,18 @@ error: TypeSelector 1 | div, div + #id, div ~ #id, div > #id { | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/rome/selectors/input.css:1:28 + | +1 | div, div + #id, div ~ #id, div > #id { + | ^^^ + +error: WqName + --> $DIR/tests/fixture/rome/selectors/input.css:1:28 + | +1 | div, div + #id, div ~ #id, div > #id { + | ^^^ + error: Ident --> $DIR/tests/fixture/rome/selectors/input.css:1:28 | @@ -358,7 +406,7 @@ error: TypeSelector 9 | .class + * { | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/rome/selectors/input.css:9:10 | 9 | .class + * { @@ -413,6 +461,18 @@ error: TypeSelector 13 | a[title] { | ^ +error: TagNameSelector + --> $DIR/tests/fixture/rome/selectors/input.css:13:1 + | +13 | a[title] { + | ^ + +error: WqName + --> $DIR/tests/fixture/rome/selectors/input.css:13:1 + | +13 | a[title] { + | ^ + error: Ident --> $DIR/tests/fixture/rome/selectors/input.css:13:1 | @@ -425,12 +485,18 @@ error: SubclassSelector 13 | a[title] { | ^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/rome/selectors/input.css:13:2 | 13 | a[title] { | ^^^^^^^ +error: WqName + --> $DIR/tests/fixture/rome/selectors/input.css:13:3 + | +13 | a[title] { + | ^^^^^ + error: Ident --> $DIR/tests/fixture/rome/selectors/input.css:13:3 | @@ -516,6 +582,18 @@ error: TypeSelector 17 | a[title = "title"] { | ^ +error: TagNameSelector + --> $DIR/tests/fixture/rome/selectors/input.css:17:1 + | +17 | a[title = "title"] { + | ^ + +error: WqName + --> $DIR/tests/fixture/rome/selectors/input.css:17:1 + | +17 | a[title = "title"] { + | ^ + error: Ident --> $DIR/tests/fixture/rome/selectors/input.css:17:1 | @@ -528,18 +606,36 @@ error: SubclassSelector 17 | a[title = "title"] { | ^^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/rome/selectors/input.css:17:2 | 17 | a[title = "title"] { | ^^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/rome/selectors/input.css:17:3 + | +17 | a[title = "title"] { + | ^^^^^ + error: Ident --> $DIR/tests/fixture/rome/selectors/input.css:17:3 | 17 | a[title = "title"] { | ^^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/rome/selectors/input.css:17:9 + | +17 | a[title = "title"] { + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/rome/selectors/input.css:17:11 + | +17 | a[title = "title"] { + | ^^^^^^^ + error: Str --> $DIR/tests/fixture/rome/selectors/input.css:17:11 | @@ -625,6 +721,18 @@ error: TypeSelector 21 | a[title~="title" i] { | ^ +error: TagNameSelector + --> $DIR/tests/fixture/rome/selectors/input.css:21:1 + | +21 | a[title~="title" i] { + | ^ + +error: WqName + --> $DIR/tests/fixture/rome/selectors/input.css:21:1 + | +21 | a[title~="title" i] { + | ^ + error: Ident --> $DIR/tests/fixture/rome/selectors/input.css:21:1 | @@ -637,24 +745,54 @@ error: SubclassSelector 21 | a[title~="title" i] { | ^^^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/rome/selectors/input.css:21:2 | 21 | a[title~="title" i] { | ^^^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/rome/selectors/input.css:21:3 + | +21 | a[title~="title" i] { + | ^^^^^ + error: Ident --> $DIR/tests/fixture/rome/selectors/input.css:21:3 | 21 | a[title~="title" i] { | ^^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/rome/selectors/input.css:21:8 + | +21 | a[title~="title" i] { + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/rome/selectors/input.css:21:10 + | +21 | a[title~="title" i] { + | ^^^^^^^ + error: Str --> $DIR/tests/fixture/rome/selectors/input.css:21:10 | 21 | a[title~="title" i] { | ^^^^^^^ +error: AttributeSelectorModifier + --> $DIR/tests/fixture/rome/selectors/input.css:21:18 + | +21 | a[title~="title" i] { + | ^ + +error: Ident + --> $DIR/tests/fixture/rome/selectors/input.css:21:18 + | +21 | a[title~="title" i] { + | ^ + error: Block --> $DIR/tests/fixture/rome/selectors/input.css:21:21 | @@ -734,6 +872,18 @@ error: TypeSelector 25 | a[title = "title"][href*="image/*" S] { | ^ +error: TagNameSelector + --> $DIR/tests/fixture/rome/selectors/input.css:25:1 + | +25 | a[title = "title"][href*="image/*" S] { + | ^ + +error: WqName + --> $DIR/tests/fixture/rome/selectors/input.css:25:1 + | +25 | a[title = "title"][href*="image/*" S] { + | ^ + error: Ident --> $DIR/tests/fixture/rome/selectors/input.css:25:1 | @@ -746,18 +896,36 @@ error: SubclassSelector 25 | a[title = "title"][href*="image/*" S] { | ^^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/rome/selectors/input.css:25:2 | 25 | a[title = "title"][href*="image/*" S] { | ^^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/rome/selectors/input.css:25:3 + | +25 | a[title = "title"][href*="image/*" S] { + | ^^^^^ + error: Ident --> $DIR/tests/fixture/rome/selectors/input.css:25:3 | 25 | a[title = "title"][href*="image/*" S] { | ^^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/rome/selectors/input.css:25:9 + | +25 | a[title = "title"][href*="image/*" S] { + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/rome/selectors/input.css:25:11 + | +25 | a[title = "title"][href*="image/*" S] { + | ^^^^^^^ + error: Str --> $DIR/tests/fixture/rome/selectors/input.css:25:11 | @@ -770,24 +938,54 @@ error: SubclassSelector 25 | a[title = "title"][href*="image/*" S] { | ^^^^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/rome/selectors/input.css:25:19 | 25 | a[title = "title"][href*="image/*" S] { | ^^^^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/rome/selectors/input.css:25:20 + | +25 | a[title = "title"][href*="image/*" S] { + | ^^^^ + error: Ident --> $DIR/tests/fixture/rome/selectors/input.css:25:20 | 25 | a[title = "title"][href*="image/*" S] { | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/rome/selectors/input.css:25:24 + | +25 | a[title = "title"][href*="image/*" S] { + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/rome/selectors/input.css:25:26 + | +25 | a[title = "title"][href*="image/*" S] { + | ^^^^^^^^^ + error: Str --> $DIR/tests/fixture/rome/selectors/input.css:25:26 | 25 | a[title = "title"][href*="image/*" S] { | ^^^^^^^^^ +error: AttributeSelectorModifier + --> $DIR/tests/fixture/rome/selectors/input.css:25:36 + | +25 | a[title = "title"][href*="image/*" S] { + | ^ + +error: Ident + --> $DIR/tests/fixture/rome/selectors/input.css:25:36 + | +25 | a[title = "title"][href*="image/*" S] { + | ^ + error: Block --> $DIR/tests/fixture/rome/selectors/input.css:25:39 | @@ -865,6 +1063,18 @@ error: TypeSelector 29 | p:nth-last-of-type(2) { | ^ +error: TagNameSelector + --> $DIR/tests/fixture/rome/selectors/input.css:29:1 + | +29 | p:nth-last-of-type(2) { + | ^ + +error: WqName + --> $DIR/tests/fixture/rome/selectors/input.css:29:1 + | +29 | p:nth-last-of-type(2) { + | ^ + error: Ident --> $DIR/tests/fixture/rome/selectors/input.css:29:1 | diff --git a/crates/swc_css_parser/tests/fixture/rome/smoke/output.json b/crates/swc_css_parser/tests/fixture/rome/smoke/output.json index a295120e35d..9f0b17df395 100644 --- a/crates/swc_css_parser/tests/fixture/rome/smoke/output.json +++ b/crates/swc_css_parser/tests/fixture/rome/smoke/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 22, "end": 26, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 22, "end": 26, "ctxt": 0 }, - "value": "body", - "raw": "body" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 22, + "end": 26, + "ctxt": 0 + }, + "value": "body", + "raw": "body" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/rome/smoke/span.rust-debug b/crates/swc_css_parser/tests/fixture/rome/smoke/span.rust-debug index 2e3292ad44e..8203e44101f 100644 --- a/crates/swc_css_parser/tests/fixture/rome/smoke/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/rome/smoke/span.rust-debug @@ -53,6 +53,18 @@ error: TypeSelector 2 | body { | ^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/rome/smoke/input.css:2:1 + | +2 | body { + | ^^^^ + +error: WqName + --> $DIR/tests/fixture/rome/smoke/input.css:2:1 + | +2 | body { + | ^^^^ + error: Ident --> $DIR/tests/fixture/rome/smoke/input.css:2:1 | diff --git a/crates/swc_css_parser/tests/fixture/rome/values/output.json b/crates/swc_css_parser/tests/fixture/rome/values/output.json index 8fad01cdf55..996f8096ceb 100644 --- a/crates/swc_css_parser/tests/fixture/rome/values/output.json +++ b/crates/swc_css_parser/tests/fixture/rome/values/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [ @@ -364,22 +372,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 117, "end": 120, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 117, "end": 120, "ctxt": 0 }, - "value": "foo", - "raw": "foo" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 117, + "end": 120, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } } }, "subclassSelectors": [] @@ -462,22 +478,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 141, "end": 144, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 141, "end": 144, "ctxt": 0 }, - "value": "bar", - "raw": "bar" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 141, + "end": 144, + "ctxt": 0 + }, + "value": "bar", + "raw": "bar" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/rome/values/span.rust-debug b/crates/swc_css_parser/tests/fixture/rome/values/span.rust-debug index 413c57fb0c5..68c65970d02 100644 --- a/crates/swc_css_parser/tests/fixture/rome/values/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/rome/values/span.rust-debug @@ -50,6 +50,18 @@ error: TypeSelector 1 | p::before { | ^ +error: TagNameSelector + --> $DIR/tests/fixture/rome/values/input.css:1:1 + | +1 | p::before { + | ^ + +error: WqName + --> $DIR/tests/fixture/rome/values/input.css:1:1 + | +1 | p::before { + | ^ + error: Ident --> $DIR/tests/fixture/rome/values/input.css:1:1 | @@ -355,6 +367,18 @@ error: TypeSelector 12 | foo { | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/rome/values/input.css:12:1 + | +12 | foo { + | ^^^ + +error: WqName + --> $DIR/tests/fixture/rome/values/input.css:12:1 + | +12 | foo { + | ^^^ + error: Ident --> $DIR/tests/fixture/rome/values/input.css:12:1 | @@ -442,6 +466,18 @@ error: TypeSelector 16 | bar { | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/rome/values/input.css:16:1 + | +16 | bar { + | ^^^ + +error: WqName + --> $DIR/tests/fixture/rome/values/input.css:16:1 + | +16 | bar { + | ^^^ + error: Ident --> $DIR/tests/fixture/rome/values/input.css:16:1 | diff --git a/crates/swc_css_parser/tests/fixture/selector/attribute/output.json b/crates/swc_css_parser/tests/fixture/selector/attribute/output.json index 5700813174e..931f3598c70 100644 --- a/crates/swc_css_parser/tests/fixture/selector/attribute/output.json +++ b/crates/swc_css_parser/tests/fixture/selector/attribute/output.json @@ -46,16 +46,24 @@ "end": 7, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1, "end": 6, "ctxt": 0 }, - "value": "title", - "raw": "title" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1, + "end": 6, + "ctxt": 0 + }, + "value": "title", + "raw": "title" + } }, "matcher": null, "value": null, @@ -117,18 +125,34 @@ "end": 22, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 12, "end": 17, "ctxt": 0 }, - "value": "title", - "raw": "title" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 12, + "end": 17, + "ctxt": 0 + }, + "value": "title", + "raw": "title" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 17, + "end": 18, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "Identifier", "span": { @@ -197,18 +221,34 @@ "end": 39, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 27, "end": 32, "ctxt": 0 }, - "value": "title", - "raw": "title" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 27, + "end": 32, + "ctxt": 0 + }, + "value": "title", + "raw": "title" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 32, + "end": 33, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { @@ -277,18 +317,34 @@ "end": 60, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 45, "end": 50, "ctxt": 0 }, - "value": "title", - "raw": "title" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 45, + "end": 50, + "ctxt": 0 + }, + "value": "title", + "raw": "title" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 51, + "end": 52, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { @@ -357,18 +413,34 @@ "end": 89, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 68, "end": 73, "ctxt": 0 }, - "value": "title", - "raw": "title" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 68, + "end": 73, + "ctxt": 0 + }, + "value": "title", + "raw": "title" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 76, + "end": 77, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { @@ -437,18 +509,34 @@ "end": 108, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 94, "end": 98, "ctxt": 0 }, - "value": "lang", - "raw": "lang" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 94, + "end": 98, + "ctxt": 0 + }, + "value": "lang", + "raw": "lang" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 98, + "end": 100, + "ctxt": 0 + }, + "value": "~=" }, - "matcher": "~=", "value": { "type": "String", "span": { @@ -517,18 +605,34 @@ "end": 124, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 113, "end": 117, "ctxt": 0 }, - "value": "lang", - "raw": "lang" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 113, + "end": 117, + "ctxt": 0 + }, + "value": "lang", + "raw": "lang" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 117, + "end": 119, + "ctxt": 0 + }, + "value": "|=" }, - "matcher": "|=", "value": { "type": "String", "span": { @@ -597,18 +701,34 @@ "end": 139, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 129, "end": 133, "ctxt": 0 }, - "value": "href", - "raw": "href" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 129, + "end": 133, + "ctxt": 0 + }, + "value": "href", + "raw": "href" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 133, + "end": 135, + "ctxt": 0 + }, + "value": "^=" }, - "matcher": "^=", "value": { "type": "String", "span": { @@ -677,18 +797,34 @@ "end": 157, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 144, "end": 148, "ctxt": 0 }, - "value": "href", - "raw": "href" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 144, + "end": 148, + "ctxt": 0 + }, + "value": "href", + "raw": "href" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 148, + "end": 150, + "ctxt": 0 + }, + "value": "$=" }, - "matcher": "$=", "value": { "type": "String", "span": { @@ -757,18 +893,34 @@ "end": 178, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 162, "end": 166, "ctxt": 0 }, - "value": "href", - "raw": "href" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 162, + "end": 166, + "ctxt": 0 + }, + "value": "href", + "raw": "href" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 166, + "end": 168, + "ctxt": 0 + }, + "value": "*=" }, - "matcher": "*=", "value": { "type": "String", "span": { @@ -837,18 +989,34 @@ "end": 205, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 183, "end": 187, "ctxt": 0 }, - "value": "href", - "raw": "href" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 183, + "end": 187, + "ctxt": 0 + }, + "value": "href", + "raw": "href" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 187, + "end": 189, + "ctxt": 0 + }, + "value": "*=" }, - "matcher": "*=", "value": { "type": "String", "span": { @@ -859,7 +1027,24 @@ "value": "insensitive", "raw": "\"insensitive\"" }, - "modifier": "i" + "modifier": { + "type": "AttributeSelectorModifier", + "span": { + "start": 203, + "end": 204, + "ctxt": 0 + }, + "value": { + "type": "Identifier", + "span": { + "start": 203, + "end": 204, + "ctxt": 0 + }, + "value": "i", + "raw": "i" + } + } } ] } @@ -917,18 +1102,34 @@ "end": 232, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 210, "end": 214, "ctxt": 0 }, - "value": "href", - "raw": "href" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 210, + "end": 214, + "ctxt": 0 + }, + "value": "href", + "raw": "href" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 214, + "end": 216, + "ctxt": 0 + }, + "value": "*=" }, - "matcher": "*=", "value": { "type": "String", "span": { @@ -939,7 +1140,24 @@ "value": "insensitive", "raw": "\"insensitive\"" }, - "modifier": "I" + "modifier": { + "type": "AttributeSelectorModifier", + "span": { + "start": 230, + "end": 231, + "ctxt": 0 + }, + "value": { + "type": "Identifier", + "span": { + "start": 230, + "end": 231, + "ctxt": 0 + }, + "value": "I", + "raw": "I" + } + } } ] } @@ -997,18 +1215,34 @@ "end": 252, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 237, "end": 241, "ctxt": 0 }, - "value": "href", - "raw": "href" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 237, + "end": 241, + "ctxt": 0 + }, + "value": "href", + "raw": "href" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 241, + "end": 243, + "ctxt": 0 + }, + "value": "*=" }, - "matcher": "*=", "value": { "type": "String", "span": { @@ -1019,7 +1253,24 @@ "value": "cAsE", "raw": "\"cAsE\"" }, - "modifier": "s" + "modifier": { + "type": "AttributeSelectorModifier", + "span": { + "start": 250, + "end": 251, + "ctxt": 0 + }, + "value": { + "type": "Identifier", + "span": { + "start": 250, + "end": 251, + "ctxt": 0 + }, + "value": "s", + "raw": "s" + } + } } ] } @@ -1077,18 +1328,34 @@ "end": 272, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 257, "end": 261, "ctxt": 0 }, - "value": "href", - "raw": "href" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 257, + "end": 261, + "ctxt": 0 + }, + "value": "href", + "raw": "href" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 261, + "end": 263, + "ctxt": 0 + }, + "value": "*=" }, - "matcher": "*=", "value": { "type": "String", "span": { @@ -1099,7 +1366,24 @@ "value": "cAsE", "raw": "\"cAsE\"" }, - "modifier": "S" + "modifier": { + "type": "AttributeSelectorModifier", + "span": { + "start": 270, + "end": 271, + "ctxt": 0 + }, + "value": { + "type": "Identifier", + "span": { + "start": 270, + "end": 271, + "ctxt": 0 + }, + "value": "S", + "raw": "S" + } + } } ] } @@ -1157,27 +1441,51 @@ "end": 289, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 277, - "end": 280, - "ctxt": 0 - }, - "value": "foo", - "raw": "foo" - }, - "name": { - "type": "Identifier", - "span": { - "start": 281, "end": 284, "ctxt": 0 }, - "value": "att", - "raw": "att" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 277, + "end": 281, + "ctxt": 0 + }, + "prefix": { + "type": "Identifier", + "span": { + "start": 277, + "end": 280, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 281, + "end": 284, + "ctxt": 0 + }, + "value": "att", + "raw": "att" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 284, + "end": 285, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "Identifier", "span": { @@ -1246,25 +1554,41 @@ "end": 300, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 294, - "end": 295, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - }, - "name": { - "type": "Identifier", - "span": { - "start": 296, "end": 299, "ctxt": 0 }, - "value": "att", - "raw": "att" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 294, + "end": 296, + "ctxt": 0 + }, + "prefix": { + "type": "Identifier", + "span": { + "start": 294, + "end": 295, + "ctxt": 0 + }, + "value": "*", + "raw": "*" + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 296, + "end": 299, + "ctxt": 0 + }, + "value": "att", + "raw": "att" + } }, "matcher": null, "value": null, @@ -1326,25 +1650,41 @@ "end": 317, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 308, - "end": 309, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - }, - "name": { - "type": "Identifier", - "span": { - "start": 310, "end": 313, "ctxt": 0 }, - "value": "att", - "raw": "att" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 308, + "end": 310, + "ctxt": 0 + }, + "prefix": { + "type": "Identifier", + "span": { + "start": 308, + "end": 309, + "ctxt": 0 + }, + "value": "*", + "raw": "*" + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 310, + "end": 313, + "ctxt": 0 + }, + "value": "att", + "raw": "att" + } }, "matcher": null, "value": null, @@ -1406,25 +1746,32 @@ "end": 327, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 322, - "end": 322, - "ctxt": 0 - }, - "value": "", - "raw": "" - }, - "name": { - "type": "Identifier", - "span": { - "start": 323, "end": 326, "ctxt": 0 }, - "value": "att", - "raw": "att" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 322, + "end": 323, + "ctxt": 0 + }, + "prefix": null + }, + "value": { + "type": "Identifier", + "span": { + "start": 323, + "end": 326, + "ctxt": 0 + }, + "value": "att", + "raw": "att" + } }, "matcher": null, "value": null, @@ -1486,25 +1833,32 @@ "end": 339, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 333, - "end": 333, - "ctxt": 0 - }, - "value": "", - "raw": "" - }, - "name": { - "type": "Identifier", - "span": { - "start": 334, "end": 337, "ctxt": 0 }, - "value": "att", - "raw": "att" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 333, + "end": 334, + "ctxt": 0 + }, + "prefix": null + }, + "value": { + "type": "Identifier", + "span": { + "start": 334, + "end": 337, + "ctxt": 0 + }, + "value": "att", + "raw": "att" + } }, "matcher": null, "value": null, @@ -1566,25 +1920,32 @@ "end": 355, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 347, - "end": 347, - "ctxt": 0 - }, - "value": "", - "raw": "" - }, - "name": { - "type": "Identifier", - "span": { - "start": 348, "end": 351, "ctxt": 0 }, - "value": "att", - "raw": "att" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 347, + "end": 348, + "ctxt": 0 + }, + "prefix": null + }, + "value": { + "type": "Identifier", + "span": { + "start": 348, + "end": 351, + "ctxt": 0 + }, + "value": "att", + "raw": "att" + } }, "matcher": null, "value": null, @@ -1646,16 +2007,24 @@ "end": 364, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 360, "end": 363, "ctxt": 0 }, - "value": "att", - "raw": "att" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 360, + "end": 363, + "ctxt": 0 + }, + "value": "att", + "raw": "att" + } }, "matcher": null, "value": null, @@ -1717,16 +2086,24 @@ "end": 375, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 370, "end": 373, "ctxt": 0 }, - "value": "att", - "raw": "att" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 370, + "end": 373, + "ctxt": 0 + }, + "value": "att", + "raw": "att" + } }, "matcher": null, "value": null, @@ -1788,16 +2165,24 @@ "end": 390, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 383, "end": 386, "ctxt": 0 }, - "value": "att", - "raw": "att" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 383, + "end": 386, + "ctxt": 0 + }, + "value": "att", + "raw": "att" + } }, "matcher": null, "value": null, @@ -1851,22 +2236,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 394, "end": 395, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 394, "end": 395, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 394, + "end": 395, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -1877,18 +2270,34 @@ "end": 413, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 397, "end": 402, "ctxt": 0 }, - "value": "class", - "raw": "class" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 397, + "end": 402, + "ctxt": 0 + }, + "value": "class", + "raw": "class" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 403, + "end": 404, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { @@ -1949,22 +2358,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 417, "end": 418, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 417, "end": 418, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 417, + "end": 418, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -1975,18 +2392,34 @@ "end": 444, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 422, "end": 427, "ctxt": 0 }, - "value": "class", - "raw": "class" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 422, + "end": 427, + "ctxt": 0 + }, + "value": "class", + "raw": "class" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 430, + "end": 431, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { @@ -2055,18 +2488,34 @@ "end": 473, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 449, "end": 453, "ctxt": 0 }, - "value": "href", - "raw": "href" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 449, + "end": 453, + "ctxt": 0 + }, + "value": "href", + "raw": "href" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 453, + "end": 455, + "ctxt": 0 + }, + "value": "*=" }, - "matcher": "*=", "value": { "type": "String", "span": { @@ -2077,7 +2526,24 @@ "value": "insensitive", "raw": "\"insensitive\"" }, - "modifier": "i" + "modifier": { + "type": "AttributeSelectorModifier", + "span": { + "start": 471, + "end": 472, + "ctxt": 0 + }, + "value": { + "type": "Identifier", + "span": { + "start": 471, + "end": 472, + "ctxt": 0 + }, + "value": "i", + "raw": "i" + } + } } ] } @@ -2135,18 +2601,34 @@ "end": 508, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 481, "end": 485, "ctxt": 0 }, - "value": "href", - "raw": "href" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 481, + "end": 485, + "ctxt": 0 + }, + "value": "href", + "raw": "href" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 485, + "end": 487, + "ctxt": 0 + }, + "value": "*=" }, - "matcher": "*=", "value": { "type": "String", "span": { @@ -2157,7 +2639,24 @@ "value": "insensitive", "raw": "\"insensitive\"" }, - "modifier": "i" + "modifier": { + "type": "AttributeSelectorModifier", + "span": { + "start": 503, + "end": 504, + "ctxt": 0 + }, + "value": { + "type": "Identifier", + "span": { + "start": 503, + "end": 504, + "ctxt": 0 + }, + "value": "i", + "raw": "i" + } + } } ] } @@ -2215,18 +2714,34 @@ "end": 549, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 516, "end": 520, "ctxt": 0 }, - "value": "href", - "raw": "href" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 516, + "end": 520, + "ctxt": 0 + }, + "value": "href", + "raw": "href" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 523, + "end": 525, + "ctxt": 0 + }, + "value": "*=" }, - "matcher": "*=", "value": { "type": "String", "span": { @@ -2237,7 +2752,24 @@ "value": "insensitive", "raw": "\"insensitive\"" }, - "modifier": "i" + "modifier": { + "type": "AttributeSelectorModifier", + "span": { + "start": 544, + "end": 545, + "ctxt": 0 + }, + "value": { + "type": "Identifier", + "span": { + "start": 544, + "end": 545, + "ctxt": 0 + }, + "value": "i", + "raw": "i" + } + } } ] } @@ -2295,16 +2827,24 @@ "end": 565, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 557, "end": 561, "ctxt": 0 }, - "value": "href", - "raw": "href" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 557, + "end": 561, + "ctxt": 0 + }, + "value": "href", + "raw": "href" + } }, "matcher": null, "value": null, @@ -2366,18 +2906,34 @@ "end": 585, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 570, "end": 575, "ctxt": 0 }, - "value": "frame", - "raw": "frame" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 570, + "end": 575, + "ctxt": 0 + }, + "value": "frame", + "raw": "frame" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 575, + "end": 576, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "Identifier", "span": { @@ -2388,7 +2944,24 @@ "value": "hsides", "raw": "hsides" }, - "modifier": "i" + "modifier": { + "type": "AttributeSelectorModifier", + "span": { + "start": 583, + "end": 584, + "ctxt": 0 + }, + "value": { + "type": "Identifier", + "span": { + "start": 583, + "end": 584, + "ctxt": 0 + }, + "value": "i", + "raw": "i" + } + } } ] } @@ -2482,16 +3055,24 @@ "end": 606, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 599, "end": 605, "ctxt": 0 }, - "value": "target", - "raw": "target" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 599, + "end": 605, + "ctxt": 0 + }, + "value": "target", + "raw": "target" + } }, "matcher": null, "value": null, @@ -2571,16 +3152,24 @@ "end": 621, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 614, "end": 620, "ctxt": 0 }, - "value": "target", - "raw": "target" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 614, + "end": 620, + "ctxt": 0 + }, + "value": "target", + "raw": "target" + } }, "matcher": null, "value": null, @@ -2642,16 +3231,24 @@ "end": 633, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 626, "end": 632, "ctxt": 0 }, - "value": "target", - "raw": "target" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 626, + "end": 632, + "ctxt": 0 + }, + "value": "target", + "raw": "target" + } }, "matcher": null, "value": null, @@ -2731,18 +3328,34 @@ "end": 656, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 644, "end": 649, "ctxt": 0 }, - "value": "title", - "raw": "title" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 644, + "end": 649, + "ctxt": 0 + }, + "value": "title", + "raw": "title" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 649, + "end": 650, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { @@ -2811,18 +3424,34 @@ "end": 680, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 661, "end": 671, "ctxt": 0 }, - "value": "data-style", - "raw": "data-style" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 661, + "end": 671, + "ctxt": 0 + }, + "value": "data-style", + "raw": "data-style" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 671, + "end": 672, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { @@ -2842,16 +3471,24 @@ "end": 694, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 681, "end": 693, "ctxt": 0 }, - "value": "data-loading", - "raw": "data-loading" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 681, + "end": 693, + "ctxt": 0 + }, + "value": "data-loading", + "raw": "data-loading" + } }, "matcher": null, "value": null, @@ -2905,22 +3542,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 698, "end": 699, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 698, "end": 699, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 698, + "end": 699, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -2931,18 +3576,34 @@ "end": 714, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 700, "end": 704, "ctxt": 0 }, - "value": "href", - "raw": "href" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 700, + "end": 704, + "ctxt": 0 + }, + "value": "href", + "raw": "href" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 704, + "end": 705, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { @@ -3003,22 +3664,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 718, "end": 719, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 718, "end": 719, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 718, + "end": 719, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -3029,18 +3698,34 @@ "end": 734, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 720, "end": 724, "ctxt": 0 }, - "value": "href", - "raw": "href" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 720, + "end": 724, + "ctxt": 0 + }, + "value": "href", + "raw": "href" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 724, + "end": 725, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { @@ -3109,16 +3794,24 @@ "end": 749, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 739, "end": 748, "ctxt": 0 }, - "value": "ng:cloak", - "raw": "ng\\:cloak" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 739, + "end": 748, + "ctxt": 0 + }, + "value": "ng:cloak", + "raw": "ng\\:cloak" + } }, "matcher": null, "value": null, @@ -3180,16 +3873,24 @@ "end": 766, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 754, "end": 765, "ctxt": 0 }, - "value": "ng:cloak", - "raw": "ng\\3a cloak" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 754, + "end": 765, + "ctxt": 0 + }, + "value": "ng:cloak", + "raw": "ng\\3a cloak" + } }, "matcher": null, "value": null, @@ -3251,16 +3952,24 @@ "end": 786, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 771, "end": 785, "ctxt": 0 }, - "value": "ng:cloak", - "raw": "ng\\00003acloak" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 771, + "end": 785, + "ctxt": 0 + }, + "value": "ng:cloak", + "raw": "ng\\00003acloak" + } }, "matcher": null, "value": null, diff --git a/crates/swc_css_parser/tests/fixture/selector/attribute/span.rust-debug b/crates/swc_css_parser/tests/fixture/selector/attribute/span.rust-debug index a8c65d35c3e..3f062c72aaf 100644 --- a/crates/swc_css_parser/tests/fixture/selector/attribute/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/selector/attribute/span.rust-debug @@ -46,12 +46,18 @@ error: SubclassSelector 1 | [title] {} | ^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:1:1 | 1 | [title] {} | ^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:1:2 + | +1 | [title] {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:1:2 | @@ -100,18 +106,36 @@ error: SubclassSelector 2 | [title=foo] {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:2:1 | 2 | [title=foo] {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:2:2 + | +2 | [title=foo] {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:2:2 | 2 | [title=foo] {} | ^^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:2:7 + | +2 | [title=foo] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:2:8 + | +2 | [title=foo] {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:2:8 | @@ -160,18 +184,36 @@ error: SubclassSelector 3 | [title="foo"] {} | ^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:3:1 | 3 | [title="foo"] {} | ^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:3:2 + | +3 | [title="foo"] {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:3:2 | 3 | [title="foo"] {} | ^^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:3:7 + | +3 | [title="foo"] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:3:8 + | +3 | [title="foo"] {} + | ^^^^^ + error: Str --> $DIR/tests/fixture/selector/attribute/input.css:3:8 | @@ -220,18 +262,36 @@ error: SubclassSelector 4 | [ title = "foo" ] {} | ^^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:4:1 | 4 | [ title = "foo" ] {} | ^^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:4:3 + | +4 | [ title = "foo" ] {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:4:3 | 4 | [ title = "foo" ] {} | ^^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:4:9 + | +4 | [ title = "foo" ] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:4:11 + | +4 | [ title = "foo" ] {} + | ^^^^^ + error: Str --> $DIR/tests/fixture/selector/attribute/input.css:4:11 | @@ -280,18 +340,36 @@ error: SubclassSelector 5 | [ title = "foo" ] {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:5:1 | 5 | [ title = "foo" ] {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:5:5 + | +5 | [ title = "foo" ] {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:5:5 | 5 | [ title = "foo" ] {} | ^^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:5:13 + | +5 | [ title = "foo" ] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:5:17 + | +5 | [ title = "foo" ] {} + | ^^^^^ + error: Str --> $DIR/tests/fixture/selector/attribute/input.css:5:17 | @@ -340,18 +418,36 @@ error: SubclassSelector 6 | [lang~="en-us"] {} | ^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:6:1 | 6 | [lang~="en-us"] {} | ^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:6:2 + | +6 | [lang~="en-us"] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:6:2 | 6 | [lang~="en-us"] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:6:6 + | +6 | [lang~="en-us"] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:6:8 + | +6 | [lang~="en-us"] {} + | ^^^^^^^ + error: Str --> $DIR/tests/fixture/selector/attribute/input.css:6:8 | @@ -400,18 +496,36 @@ error: SubclassSelector 7 | [lang|="zh"] {} | ^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:7:1 | 7 | [lang|="zh"] {} | ^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:7:2 + | +7 | [lang|="zh"] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:7:2 | 7 | [lang|="zh"] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:7:6 + | +7 | [lang|="zh"] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:7:8 + | +7 | [lang|="zh"] {} + | ^^^^ + error: Str --> $DIR/tests/fixture/selector/attribute/input.css:7:8 | @@ -460,18 +574,36 @@ error: SubclassSelector 8 | [href^="#"] {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:8:1 | 8 | [href^="#"] {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:8:2 + | +8 | [href^="#"] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:8:2 | 8 | [href^="#"] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:8:6 + | +8 | [href^="#"] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:8:8 + | +8 | [href^="#"] {} + | ^^^ + error: Str --> $DIR/tests/fixture/selector/attribute/input.css:8:8 | @@ -520,18 +652,36 @@ error: SubclassSelector 9 | [href$=".org"] {} | ^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:9:1 | 9 | [href$=".org"] {} | ^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:9:2 + | +9 | [href$=".org"] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:9:2 | 9 | [href$=".org"] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:9:6 + | +9 | [href$=".org"] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:9:8 + | +9 | [href$=".org"] {} + | ^^^^^^ + error: Str --> $DIR/tests/fixture/selector/attribute/input.css:9:8 | @@ -580,18 +730,36 @@ error: SubclassSelector 10 | [href*="example"] {} | ^^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:10:1 | 10 | [href*="example"] {} | ^^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:10:2 + | +10 | [href*="example"] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:10:2 | 10 | [href*="example"] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:10:6 + | +10 | [href*="example"] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:10:8 + | +10 | [href*="example"] {} + | ^^^^^^^^^ + error: Str --> $DIR/tests/fixture/selector/attribute/input.css:10:8 | @@ -640,24 +808,54 @@ error: SubclassSelector 11 | [href*="insensitive" i] {} | ^^^^^^^^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:11:1 | 11 | [href*="insensitive" i] {} | ^^^^^^^^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:11:2 + | +11 | [href*="insensitive" i] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:11:2 | 11 | [href*="insensitive" i] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:11:6 + | +11 | [href*="insensitive" i] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:11:8 + | +11 | [href*="insensitive" i] {} + | ^^^^^^^^^^^^^ + error: Str --> $DIR/tests/fixture/selector/attribute/input.css:11:8 | 11 | [href*="insensitive" i] {} | ^^^^^^^^^^^^^ +error: AttributeSelectorModifier + --> $DIR/tests/fixture/selector/attribute/input.css:11:22 + | +11 | [href*="insensitive" i] {} + | ^ + +error: Ident + --> $DIR/tests/fixture/selector/attribute/input.css:11:22 + | +11 | [href*="insensitive" i] {} + | ^ + error: Block --> $DIR/tests/fixture/selector/attribute/input.css:11:25 | @@ -700,24 +898,54 @@ error: SubclassSelector 12 | [href*="insensitive" I] {} | ^^^^^^^^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:12:1 | 12 | [href*="insensitive" I] {} | ^^^^^^^^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:12:2 + | +12 | [href*="insensitive" I] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:12:2 | 12 | [href*="insensitive" I] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:12:6 + | +12 | [href*="insensitive" I] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:12:8 + | +12 | [href*="insensitive" I] {} + | ^^^^^^^^^^^^^ + error: Str --> $DIR/tests/fixture/selector/attribute/input.css:12:8 | 12 | [href*="insensitive" I] {} | ^^^^^^^^^^^^^ +error: AttributeSelectorModifier + --> $DIR/tests/fixture/selector/attribute/input.css:12:22 + | +12 | [href*="insensitive" I] {} + | ^ + +error: Ident + --> $DIR/tests/fixture/selector/attribute/input.css:12:22 + | +12 | [href*="insensitive" I] {} + | ^ + error: Block --> $DIR/tests/fixture/selector/attribute/input.css:12:25 | @@ -760,24 +988,54 @@ error: SubclassSelector 13 | [href*="cAsE" s] {} | ^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:13:1 | 13 | [href*="cAsE" s] {} | ^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:13:2 + | +13 | [href*="cAsE" s] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:13:2 | 13 | [href*="cAsE" s] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:13:6 + | +13 | [href*="cAsE" s] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:13:8 + | +13 | [href*="cAsE" s] {} + | ^^^^^^ + error: Str --> $DIR/tests/fixture/selector/attribute/input.css:13:8 | 13 | [href*="cAsE" s] {} | ^^^^^^ +error: AttributeSelectorModifier + --> $DIR/tests/fixture/selector/attribute/input.css:13:15 + | +13 | [href*="cAsE" s] {} + | ^ + +error: Ident + --> $DIR/tests/fixture/selector/attribute/input.css:13:15 + | +13 | [href*="cAsE" s] {} + | ^ + error: Block --> $DIR/tests/fixture/selector/attribute/input.css:13:18 | @@ -820,24 +1078,54 @@ error: SubclassSelector 14 | [href*="cAsE" S] {} | ^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:14:1 | 14 | [href*="cAsE" S] {} | ^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:14:2 + | +14 | [href*="cAsE" S] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:14:2 | 14 | [href*="cAsE" S] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:14:6 + | +14 | [href*="cAsE" S] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:14:8 + | +14 | [href*="cAsE" S] {} + | ^^^^^^ + error: Str --> $DIR/tests/fixture/selector/attribute/input.css:14:8 | 14 | [href*="cAsE" S] {} | ^^^^^^ +error: AttributeSelectorModifier + --> $DIR/tests/fixture/selector/attribute/input.css:14:15 + | +14 | [href*="cAsE" S] {} + | ^ + +error: Ident + --> $DIR/tests/fixture/selector/attribute/input.css:14:15 + | +14 | [href*="cAsE" S] {} + | ^ + error: Block --> $DIR/tests/fixture/selector/attribute/input.css:14:18 | @@ -880,12 +1168,24 @@ error: SubclassSelector 15 | [foo|att=val] {} | ^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:15:1 | 15 | [foo|att=val] {} | ^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:15:2 + | +15 | [foo|att=val] {} + | ^^^^^^^ + +error: NsPrefix + --> $DIR/tests/fixture/selector/attribute/input.css:15:2 + | +15 | [foo|att=val] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:15:2 | @@ -898,6 +1198,18 @@ error: Ident 15 | [foo|att=val] {} | ^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:15:9 + | +15 | [foo|att=val] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:15:10 + | +15 | [foo|att=val] {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:15:10 | @@ -946,12 +1258,24 @@ error: SubclassSelector 16 | [*|att] {} | ^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:16:1 | 16 | [*|att] {} | ^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:16:2 + | +16 | [*|att] {} + | ^^^^^ + +error: NsPrefix + --> $DIR/tests/fixture/selector/attribute/input.css:16:2 + | +16 | [*|att] {} + | ^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:16:2 | @@ -1006,12 +1330,24 @@ error: SubclassSelector 17 | [ *|att ] {} | ^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:17:1 | 17 | [ *|att ] {} | ^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:17:5 + | +17 | [ *|att ] {} + | ^^^^^ + +error: NsPrefix + --> $DIR/tests/fixture/selector/attribute/input.css:17:5 + | +17 | [ *|att ] {} + | ^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:17:5 | @@ -1066,13 +1402,19 @@ error: SubclassSelector 18 | [|att] {} | ^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:18:1 | 18 | [|att] {} | ^^^^^^ -error: Ident +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:18:2 + | +18 | [|att] {} + | ^^^^ + +error: NsPrefix --> $DIR/tests/fixture/selector/attribute/input.css:18:2 | 18 | [|att] {} @@ -1126,13 +1468,19 @@ error: SubclassSelector 19 | [ |att ] {} | ^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:19:1 | 19 | [ |att ] {} | ^^^^^^^^ -error: Ident +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:19:3 + | +19 | [ |att ] {} + | ^^^^ + +error: NsPrefix --> $DIR/tests/fixture/selector/attribute/input.css:19:3 | 19 | [ |att ] {} @@ -1186,13 +1534,19 @@ error: SubclassSelector 20 | [ |att ] {} | ^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:20:1 | 20 | [ |att ] {} | ^^^^^^^^^^^^ -error: Ident +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:20:5 + | +20 | [ |att ] {} + | ^^^^ + +error: NsPrefix --> $DIR/tests/fixture/selector/attribute/input.css:20:5 | 20 | [ |att ] {} @@ -1246,12 +1600,18 @@ error: SubclassSelector 21 | [att] {} | ^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:21:1 | 21 | [att] {} | ^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:21:2 + | +21 | [att] {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:21:2 | @@ -1300,12 +1660,18 @@ error: SubclassSelector 22 | [ att ] {} | ^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:22:1 | 22 | [ att ] {} | ^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:22:3 + | +22 | [ att ] {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:22:3 | @@ -1354,12 +1720,18 @@ error: SubclassSelector 23 | [ att ] {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:23:1 | 23 | [ att ] {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:23:5 + | +23 | [ att ] {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:23:5 | @@ -1408,6 +1780,18 @@ error: TypeSelector 24 | a[ class = "test" ] {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/attribute/input.css:24:1 + | +24 | a[ class = "test" ] {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:24:1 + | +24 | a[ class = "test" ] {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:24:1 | @@ -1420,18 +1804,36 @@ error: SubclassSelector 24 | a[ class = "test" ] {} | ^^^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:24:2 | 24 | a[ class = "test" ] {} | ^^^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:24:4 + | +24 | a[ class = "test" ] {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:24:4 | 24 | a[ class = "test" ] {} | ^^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:24:10 + | +24 | a[ class = "test" ] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:24:12 + | +24 | a[ class = "test" ] {} + | ^^^^^^ + error: Str --> $DIR/tests/fixture/selector/attribute/input.css:24:12 | @@ -1480,6 +1882,18 @@ error: TypeSelector 25 | a[ class = "test" ] {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/attribute/input.css:25:1 + | +25 | a[ class = "test" ] {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:25:1 + | +25 | a[ class = "test" ] {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:25:1 | @@ -1492,18 +1906,36 @@ error: SubclassSelector 25 | a[ class = "test" ] {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:25:2 | 25 | a[ class = "test" ] {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:25:6 + | +25 | a[ class = "test" ] {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:25:6 | 25 | a[ class = "test" ] {} | ^^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:25:14 + | +25 | a[ class = "test" ] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:25:18 + | +25 | a[ class = "test" ] {} + | ^^^^^^ + error: Str --> $DIR/tests/fixture/selector/attribute/input.css:25:18 | @@ -1552,24 +1984,54 @@ error: SubclassSelector 26 | [href*="insensitive" i] {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:26:1 | 26 | [href*="insensitive" i] {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:26:2 + | +26 | [href*="insensitive" i] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:26:2 | 26 | [href*="insensitive" i] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:26:6 + | +26 | [href*="insensitive" i] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:26:8 + | +26 | [href*="insensitive" i] {} + | ^^^^^^^^^^^^^ + error: Str --> $DIR/tests/fixture/selector/attribute/input.css:26:8 | 26 | [href*="insensitive" i] {} | ^^^^^^^^^^^^^ +error: AttributeSelectorModifier + --> $DIR/tests/fixture/selector/attribute/input.css:26:24 + | +26 | [href*="insensitive" i] {} + | ^ + +error: Ident + --> $DIR/tests/fixture/selector/attribute/input.css:26:24 + | +26 | [href*="insensitive" i] {} + | ^ + error: Block --> $DIR/tests/fixture/selector/attribute/input.css:26:27 | @@ -1612,24 +2074,54 @@ error: SubclassSelector 27 | [ href*="insensitive" i ] {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:27:1 | 27 | [ href*="insensitive" i ] {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:27:5 + | +27 | [ href*="insensitive" i ] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:27:5 | 27 | [ href*="insensitive" i ] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:27:9 + | +27 | [ href*="insensitive" i ] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:27:11 + | +27 | [ href*="insensitive" i ] {} + | ^^^^^^^^^^^^^ + error: Str --> $DIR/tests/fixture/selector/attribute/input.css:27:11 | 27 | [ href*="insensitive" i ] {} | ^^^^^^^^^^^^^ +error: AttributeSelectorModifier + --> $DIR/tests/fixture/selector/attribute/input.css:27:27 + | +27 | [ href*="insensitive" i ] {} + | ^ + +error: Ident + --> $DIR/tests/fixture/selector/attribute/input.css:27:27 + | +27 | [ href*="insensitive" i ] {} + | ^ + error: Block --> $DIR/tests/fixture/selector/attribute/input.css:27:33 | @@ -1672,24 +2164,54 @@ error: SubclassSelector 28 | [ href *= "insensitive" i ] {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:28:1 | 28 | [ href *= "insensitive" i ] {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:28:5 + | +28 | [ href *= "insensitive" i ] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:28:5 | 28 | [ href *= "insensitive" i ] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:28:12 + | +28 | [ href *= "insensitive" i ] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:28:17 + | +28 | [ href *= "insensitive" i ] {} + | ^^^^^^^^^^^^^ + error: Str --> $DIR/tests/fixture/selector/attribute/input.css:28:17 | 28 | [ href *= "insensitive" i ] {} | ^^^^^^^^^^^^^ +error: AttributeSelectorModifier + --> $DIR/tests/fixture/selector/attribute/input.css:28:33 + | +28 | [ href *= "insensitive" i ] {} + | ^ + +error: Ident + --> $DIR/tests/fixture/selector/attribute/input.css:28:33 + | +28 | [ href *= "insensitive" i ] {} + | ^ + error: Block --> $DIR/tests/fixture/selector/attribute/input.css:28:39 | @@ -1732,12 +2254,18 @@ error: SubclassSelector 29 | [ href ] {} | ^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:29:1 | 29 | [ href ] {} | ^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:29:5 + | +29 | [ href ] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:29:5 | @@ -1786,24 +2314,54 @@ error: SubclassSelector 30 | [frame=hsides i] {} | ^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:30:1 | 30 | [frame=hsides i] {} | ^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:30:2 + | +30 | [frame=hsides i] {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:30:2 | 30 | [frame=hsides i] {} | ^^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:30:7 + | +30 | [frame=hsides i] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:30:8 + | +30 | [frame=hsides i] {} + | ^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:30:8 | 30 | [frame=hsides i] {} | ^^^^^^ +error: AttributeSelectorModifier + --> $DIR/tests/fixture/selector/attribute/input.css:30:15 + | +30 | [frame=hsides i] {} + | ^ + +error: Ident + --> $DIR/tests/fixture/selector/attribute/input.css:30:15 + | +30 | [frame=hsides i] {} + | ^ + error: Block --> $DIR/tests/fixture/selector/attribute/input.css:30:18 | @@ -1882,12 +2440,18 @@ error: SubclassSelector 31 | #id.class[target] {} | ^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:31:10 | 31 | #id.class[target] {} | ^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:31:11 + | +31 | #id.class[target] {} + | ^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:31:11 | @@ -1954,12 +2518,18 @@ error: SubclassSelector 32 | #id[target] {} | ^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:32:4 | 32 | #id[target] {} | ^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:32:5 + | +32 | #id[target] {} + | ^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:32:5 | @@ -2008,12 +2578,18 @@ error: SubclassSelector 33 | [target].class {} | ^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:33:1 | 33 | [target].class {} | ^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:33:2 + | +33 | [target].class {} + | ^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:33:2 | @@ -2080,18 +2656,36 @@ error: SubclassSelector 34 | [title='foo'] {} | ^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:34:1 | 34 | [title='foo'] {} | ^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:34:2 + | +34 | [title='foo'] {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:34:2 | 34 | [title='foo'] {} | ^^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:34:7 + | +34 | [title='foo'] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:34:8 + | +34 | [title='foo'] {} + | ^^^^^ + error: Str --> $DIR/tests/fixture/selector/attribute/input.css:34:8 | @@ -2140,18 +2734,36 @@ error: SubclassSelector 35 | [data-style='value'][data-loading] {} | ^^^^^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:35:1 | 35 | [data-style='value'][data-loading] {} | ^^^^^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:35:2 + | +35 | [data-style='value'][data-loading] {} + | ^^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:35:2 | 35 | [data-style='value'][data-loading] {} | ^^^^^^^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:35:12 + | +35 | [data-style='value'][data-loading] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:35:13 + | +35 | [data-style='value'][data-loading] {} + | ^^^^^^^ + error: Str --> $DIR/tests/fixture/selector/attribute/input.css:35:13 | @@ -2164,12 +2776,18 @@ error: SubclassSelector 35 | [data-style='value'][data-loading] {} | ^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:35:21 | 35 | [data-style='value'][data-loading] {} | ^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:35:22 + | +35 | [data-style='value'][data-loading] {} + | ^^^^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:35:22 | @@ -2218,6 +2836,18 @@ error: TypeSelector 36 | a[href="te's't"] {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/attribute/input.css:36:1 + | +36 | a[href="te's't"] {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:36:1 + | +36 | a[href="te's't"] {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:36:1 | @@ -2230,18 +2860,36 @@ error: SubclassSelector 36 | a[href="te's't"] {} | ^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:36:2 | 36 | a[href="te's't"] {} | ^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:36:3 + | +36 | a[href="te's't"] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:36:3 | 36 | a[href="te's't"] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:36:7 + | +36 | a[href="te's't"] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:36:8 + | +36 | a[href="te's't"] {} + | ^^^^^^^^ + error: Str --> $DIR/tests/fixture/selector/attribute/input.css:36:8 | @@ -2290,6 +2938,18 @@ error: TypeSelector 37 | a[href='te"s"t'] {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/attribute/input.css:37:1 + | +37 | a[href='te"s"t'] {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:37:1 + | +37 | a[href='te"s"t'] {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:37:1 | @@ -2302,18 +2962,36 @@ error: SubclassSelector 37 | a[href='te"s"t'] {} | ^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:37:2 | 37 | a[href='te"s"t'] {} | ^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:37:3 + | +37 | a[href='te"s"t'] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:37:3 | 37 | a[href='te"s"t'] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/attribute/input.css:37:7 + | +37 | a[href='te"s"t'] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/attribute/input.css:37:8 + | +37 | a[href='te"s"t'] {} + | ^^^^^^^^ + error: Str --> $DIR/tests/fixture/selector/attribute/input.css:37:8 | @@ -2362,12 +3040,18 @@ error: SubclassSelector 38 | [ng\:cloak] {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:38:1 | 38 | [ng\:cloak] {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:38:2 + | +38 | [ng\:cloak] {} + | ^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:38:2 | @@ -2416,12 +3100,18 @@ error: SubclassSelector 39 | [ng\3a cloak] {} | ^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:39:1 | 39 | [ng\3a cloak] {} | ^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:39:2 + | +39 | [ng\3a cloak] {} + | ^^^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:39:2 | @@ -2470,12 +3160,18 @@ error: SubclassSelector 40 | [ng\00003acloak] {} | ^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/attribute/input.css:40:1 | 40 | [ng\00003acloak] {} | ^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/attribute/input.css:40:2 + | +40 | [ng\00003acloak] {} + | ^^^^^^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/attribute/input.css:40:2 | diff --git a/crates/swc_css_parser/tests/fixture/selector/class/output.json b/crates/swc_css_parser/tests/fixture/selector/class/output.json index a178f9d316d..56d04a48bf3 100644 --- a/crates/swc_css_parser/tests/fixture/selector/class/output.json +++ b/crates/swc_css_parser/tests/fixture/selector/class/output.json @@ -2517,22 +2517,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 679, "end": 682, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 679, "end": 682, "ctxt": 0 }, - "value": "foo", - "raw": "foo" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 679, + "end": 682, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } } }, "subclassSelectors": [ @@ -2770,16 +2778,24 @@ "end": 730, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 723, "end": 729, "ctxt": 0 }, - "value": "target", - "raw": "target" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 723, + "end": 729, + "ctxt": 0 + }, + "value": "target", + "raw": "target" + } }, "matcher": null, "value": null, @@ -2877,16 +2893,24 @@ "end": 751, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 744, "end": 750, "ctxt": 0 }, - "value": "target", - "raw": "target" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 744, + "end": 750, + "ctxt": 0 + }, + "value": "target", + "raw": "target" + } }, "matcher": null, "value": null, @@ -2940,22 +2964,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 755, "end": 757, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 755, "end": 757, "ctxt": 0 }, - "value": "ul", - "raw": "ul" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 755, + "end": 757, + "ctxt": 0 + }, + "value": "ul", + "raw": "ul" + } } }, "subclassSelectors": [ @@ -3025,22 +3057,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 766, "end": 768, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 766, "end": 768, "ctxt": 0 }, - "value": "ul", - "raw": "ul" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 766, + "end": 768, + "ctxt": 0 + }, + "value": "ul", + "raw": "ul" + } } }, "subclassSelectors": [ diff --git a/crates/swc_css_parser/tests/fixture/selector/class/span.rust-debug b/crates/swc_css_parser/tests/fixture/selector/class/span.rust-debug index 166e846b7fd..74d2d5c7401 100644 --- a/crates/swc_css_parser/tests/fixture/selector/class/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/selector/class/span.rust-debug @@ -2044,6 +2044,18 @@ error: TypeSelector 38 | foo.class > .foo.class {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/class/input.css:38:1 + | +38 | foo.class > .foo.class {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/class/input.css:38:1 + | +38 | foo.class > .foo.class {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/class/input.css:38:1 | @@ -2248,12 +2260,18 @@ error: SubclassSelector 40 | .class[target] {} | ^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/class/input.css:40:7 | 40 | .class[target] {} | ^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/class/input.css:40:8 + | +40 | .class[target] {} + | ^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/class/input.css:40:8 | @@ -2338,12 +2356,18 @@ error: SubclassSelector 41 | .class#id[target] {} | ^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/class/input.css:41:10 | 41 | .class#id[target] {} | ^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/class/input.css:41:11 + | +41 | .class#id[target] {} + | ^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/class/input.css:41:11 | @@ -2392,6 +2416,18 @@ error: TypeSelector 42 | ul.list {} | ^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/class/input.css:42:1 + | +42 | ul.list {} + | ^^ + +error: WqName + --> $DIR/tests/fixture/selector/class/input.css:42:1 + | +42 | ul.list {} + | ^^ + error: Ident --> $DIR/tests/fixture/selector/class/input.css:42:1 | @@ -2458,6 +2494,18 @@ error: TypeSelector 43 | ul.list::before {} | ^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/class/input.css:43:1 + | +43 | ul.list::before {} + | ^^ + +error: WqName + --> $DIR/tests/fixture/selector/class/input.css:43:1 + | +43 | ul.list::before {} + | ^^ + error: Ident --> $DIR/tests/fixture/selector/class/input.css:43:1 | diff --git a/crates/swc_css_parser/tests/fixture/selector/comments/output.json b/crates/swc_css_parser/tests/fixture/selector/comments/output.json index 63806a41464..ade19f6ee0d 100644 --- a/crates/swc_css_parser/tests/fixture/selector/comments/output.json +++ b/crates/swc_css_parser/tests/fixture/selector/comments/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 9, "end": 10, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 9, "end": 10, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 9, + "end": 10, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -76,22 +84,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 11, "end": 12, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 11, "end": 12, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 11, + "end": 12, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] @@ -142,22 +158,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 26, "end": 27, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 26, "end": 27, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 26, + "end": 27, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -180,22 +204,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 28, "end": 29, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 28, "end": 29, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 28, + "end": 29, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] @@ -246,22 +278,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 43, "end": 44, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 43, "end": 44, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 43, + "end": 44, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -284,22 +324,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 45, "end": 46, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 45, "end": 46, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 45, + "end": 46, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] @@ -350,22 +398,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 61, "end": 62, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 61, "end": 62, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 61, + "end": 62, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -388,22 +444,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 63, "end": 64, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 63, "end": 64, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 63, + "end": 64, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] @@ -454,22 +518,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 68, "end": 69, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 68, "end": 69, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 68, + "end": 69, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -492,22 +564,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 78, "end": 79, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 78, "end": 79, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 78, + "end": 79, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] @@ -558,22 +638,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 83, "end": 84, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 83, "end": 84, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 83, + "end": 84, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -596,22 +684,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 94, "end": 95, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 94, "end": 95, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 94, + "end": 95, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] @@ -662,22 +758,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 99, "end": 100, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 99, "end": 100, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 99, + "end": 100, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -700,22 +804,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 111, "end": 112, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 111, "end": 112, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 111, + "end": 112, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] @@ -766,22 +878,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 116, "end": 117, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 116, "end": 117, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 116, + "end": 117, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -804,22 +924,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 129, "end": 130, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 129, "end": 130, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 129, + "end": 130, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] @@ -870,22 +998,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 134, "end": 135, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 134, "end": 135, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 134, + "end": 135, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -908,22 +1044,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 136, "end": 137, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 136, "end": 137, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 136, + "end": 137, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] @@ -974,22 +1118,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 150, "end": 151, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 150, "end": 151, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 150, + "end": 151, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -1012,22 +1164,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 152, "end": 153, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 152, "end": 153, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 152, + "end": 153, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] @@ -1078,22 +1238,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 167, "end": 168, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 167, "end": 168, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 167, + "end": 168, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -1116,22 +1284,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 169, "end": 170, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 169, "end": 170, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 169, + "end": 170, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] @@ -1182,22 +1358,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 184, "end": 185, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 184, "end": 185, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 184, + "end": 185, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -1220,22 +1404,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 186, "end": 187, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 186, "end": 187, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 186, + "end": 187, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] @@ -1286,22 +1478,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 202, "end": 203, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 202, "end": 203, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 202, + "end": 203, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -1324,22 +1524,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 204, "end": 205, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 204, "end": 205, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 204, + "end": 205, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] @@ -1390,22 +1598,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 217, "end": 218, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 217, "end": 218, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 217, + "end": 218, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -1428,22 +1644,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 219, "end": 220, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 219, "end": 220, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 219, + "end": 220, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] @@ -1494,22 +1718,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 233, "end": 234, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 233, "end": 234, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 233, + "end": 234, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -1533,22 +1765,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 255, "end": 256, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 255, "end": 256, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 255, + "end": 256, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] @@ -1599,22 +1839,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 259, "end": 260, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 259, "end": 260, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 259, + "end": 260, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -1638,22 +1886,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 285, "end": 286, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 285, "end": 286, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 285, + "end": 286, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/selector/comments/span.rust-debug b/crates/swc_css_parser/tests/fixture/selector/comments/span.rust-debug index d221aa59fd7..3c952f1e6ae 100644 --- a/crates/swc_css_parser/tests/fixture/selector/comments/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/selector/comments/span.rust-debug @@ -47,6 +47,18 @@ error: TypeSelector 1 | /* { } */a b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:1:10 + | +1 | /* { } */a b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:1:10 + | +1 | /* { } */a b {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:1:10 | @@ -71,6 +83,18 @@ error: TypeSelector 1 | /* { } */a b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:1:12 + | +1 | /* { } */a b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:1:12 + | +1 | /* { } */a b {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:1:12 | @@ -119,6 +143,18 @@ error: TypeSelector 2 | /* test */a b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:2:11 + | +2 | /* test */a b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:2:11 + | +2 | /* test */a b {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:2:11 | @@ -143,6 +179,18 @@ error: TypeSelector 2 | /* test */a b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:2:13 + | +2 | /* test */a b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:2:13 + | +2 | /* test */a b {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:2:13 | @@ -191,6 +239,18 @@ error: TypeSelector 3 | /* { } */ a b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:3:11 + | +3 | /* { } */ a b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:3:11 + | +3 | /* { } */ a b {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:3:11 | @@ -215,6 +275,18 @@ error: TypeSelector 3 | /* { } */ a b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:3:13 + | +3 | /* { } */ a b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:3:13 + | +3 | /* { } */ a b {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:3:13 | @@ -263,6 +335,18 @@ error: TypeSelector 4 | /* test */ a b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:4:12 + | +4 | /* test */ a b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:4:12 + | +4 | /* test */ a b {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:4:12 | @@ -287,6 +371,18 @@ error: TypeSelector 4 | /* test */ a b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:4:14 + | +4 | /* test */ a b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:4:14 + | +4 | /* test */ a b {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:4:14 | @@ -335,6 +431,18 @@ error: TypeSelector 5 | a/* { } */b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:5:1 + | +5 | a/* { } */b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:5:1 + | +5 | a/* { } */b {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:5:1 | @@ -359,6 +467,18 @@ error: TypeSelector 5 | a/* { } */b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:5:11 + | +5 | a/* { } */b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:5:11 + | +5 | a/* { } */b {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:5:11 | @@ -407,6 +527,18 @@ error: TypeSelector 6 | a/* test */b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:6:1 + | +6 | a/* test */b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:6:1 + | +6 | a/* test */b {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:6:1 | @@ -431,6 +563,18 @@ error: TypeSelector 6 | a/* test */b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:6:12 + | +6 | a/* test */b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:6:12 + | +6 | a/* test */b {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:6:12 | @@ -479,6 +623,18 @@ error: TypeSelector 7 | a /* { } */ b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:7:1 + | +7 | a /* { } */ b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:7:1 + | +7 | a /* { } */ b {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:7:1 | @@ -503,6 +659,18 @@ error: TypeSelector 7 | a /* { } */ b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:7:13 + | +7 | a /* { } */ b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:7:13 + | +7 | a /* { } */ b {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:7:13 | @@ -551,6 +719,18 @@ error: TypeSelector 8 | a /* test */ b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:8:1 + | +8 | a /* test */ b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:8:1 + | +8 | a /* test */ b {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:8:1 | @@ -575,6 +755,18 @@ error: TypeSelector 8 | a /* test */ b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:8:14 + | +8 | a /* test */ b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:8:14 + | +8 | a /* test */ b {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:8:14 | @@ -623,6 +815,18 @@ error: TypeSelector 9 | a b/* { } */ {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:9:1 + | +9 | a b/* { } */ {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:9:1 + | +9 | a b/* { } */ {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:9:1 | @@ -647,6 +851,18 @@ error: TypeSelector 9 | a b/* { } */ {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:9:3 + | +9 | a b/* { } */ {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:9:3 + | +9 | a b/* { } */ {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:9:3 | @@ -695,6 +911,18 @@ error: TypeSelector 10 | a b/* test */ {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:10:1 + | +10 | a b/* test */ {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:10:1 + | +10 | a b/* test */ {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:10:1 | @@ -719,6 +947,18 @@ error: TypeSelector 10 | a b/* test */ {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:10:3 + | +10 | a b/* test */ {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:10:3 + | +10 | a b/* test */ {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:10:3 | @@ -767,6 +1007,18 @@ error: TypeSelector 11 | a b /* { } */ {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:11:1 + | +11 | a b /* { } */ {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:11:1 + | +11 | a b /* { } */ {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:11:1 | @@ -791,6 +1043,18 @@ error: TypeSelector 11 | a b /* { } */ {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:11:3 + | +11 | a b /* { } */ {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:11:3 + | +11 | a b /* { } */ {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:11:3 | @@ -839,6 +1103,18 @@ error: TypeSelector 12 | a b /* test */ {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:12:1 + | +12 | a b /* test */ {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:12:1 + | +12 | a b /* test */ {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:12:1 | @@ -863,6 +1139,18 @@ error: TypeSelector 12 | a b /* test */ {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:12:3 + | +12 | a b /* test */ {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:12:3 + | +12 | a b /* test */ {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:12:3 | @@ -911,6 +1199,18 @@ error: TypeSelector 13 | a b/* { } */{} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:13:1 + | +13 | a b/* { } */{} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:13:1 + | +13 | a b/* { } */{} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:13:1 | @@ -935,6 +1235,18 @@ error: TypeSelector 13 | a b/* { } */{} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:13:3 + | +13 | a b/* { } */{} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:13:3 + | +13 | a b/* { } */{} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:13:3 | @@ -983,6 +1295,18 @@ error: TypeSelector 14 | a b/* test */{} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:14:1 + | +14 | a b/* test */{} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:14:1 + | +14 | a b/* test */{} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:14:1 | @@ -1007,6 +1331,18 @@ error: TypeSelector 14 | a b/* test */{} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:14:3 + | +14 | a b/* test */{} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:14:3 + | +14 | a b/* test */{} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:14:3 | @@ -1055,6 +1391,18 @@ error: TypeSelector 15 | a/* test */,/* test */b{} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:15:1 + | +15 | a/* test */,/* test */b{} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:15:1 + | +15 | a/* test */,/* test */b{} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:15:1 | @@ -1079,6 +1427,18 @@ error: TypeSelector 15 | a/* test */,/* test */b{} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:15:23 + | +15 | a/* test */,/* test */b{} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:15:23 + | +15 | a/* test */,/* test */b{} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:15:23 | @@ -1127,6 +1487,18 @@ error: TypeSelector 16 | a /* test */ , /* test */ b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:16:1 + | +16 | a /* test */ , /* test */ b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:16:1 + | +16 | a /* test */ , /* test */ b {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:16:1 | @@ -1151,6 +1523,18 @@ error: TypeSelector 16 | a /* test */ , /* test */ b {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/comments/input.css:16:27 + | +16 | a /* test */ , /* test */ b {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/comments/input.css:16:27 + | +16 | a /* test */ , /* test */ b {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/comments/input.css:16:27 | diff --git a/crates/swc_css_parser/tests/fixture/selector/complex/input.css b/crates/swc_css_parser/tests/fixture/selector/complex/input.css index fa3bf358d90..4ac674e2cf5 100644 --- a/crates/swc_css_parser/tests/fixture/selector/complex/input.css +++ b/crates/swc_css_parser/tests/fixture/selector/complex/input.css @@ -96,3 +96,9 @@ div div div div div div div div div div div {} * * {} *[href] *:not(*.green) {} *::-webkit-media-controls-play-button {} +col.selected || td {} +col.selected +|| +td +{} +col.selected||td {} diff --git a/crates/swc_css_parser/tests/fixture/selector/complex/output.json b/crates/swc_css_parser/tests/fixture/selector/complex/output.json index 162fbbc6b08..ce5983edac5 100644 --- a/crates/swc_css_parser/tests/fixture/selector/complex/output.json +++ b/crates/swc_css_parser/tests/fixture/selector/complex/output.json @@ -2,7 +2,7 @@ "type": "Stylesheet", "span": { "start": 0, - "end": 1563, + "end": 1628, "ctxt": 0 }, "rules": [ @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 7, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 7, "ctxt": 0 }, - "value": "article", - "raw": "article" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 7, + "ctxt": 0 + }, + "value": "article", + "raw": "article" + } } }, "subclassSelectors": [] @@ -76,22 +84,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 8, "end": 9, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 8, "end": 9, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 8, + "end": 9, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -142,22 +158,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 13, "end": 20, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 13, "end": 20, "ctxt": 0 }, - "value": "article", - "raw": "article" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 13, + "end": 20, + "ctxt": 0 + }, + "value": "article", + "raw": "article" + } } }, "subclassSelectors": [] @@ -180,22 +204,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 21, "end": 22, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 21, "end": 22, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 21, + "end": 22, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -246,22 +278,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 26, "end": 33, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 26, "end": 33, "ctxt": 0 }, - "value": "article", - "raw": "article" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 26, + "end": 33, + "ctxt": 0 + }, + "value": "article", + "raw": "article" + } } }, "subclassSelectors": [] @@ -284,22 +324,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 36, "end": 37, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 36, "end": 37, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 36, + "end": 37, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -350,22 +398,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 43, "end": 50, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 43, "end": 50, "ctxt": 0 }, - "value": "article", - "raw": "article" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 43, + "end": 50, + "ctxt": 0 + }, + "value": "article", + "raw": "article" + } } }, "subclassSelectors": [] @@ -388,22 +444,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 53, "end": 54, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 53, "end": 54, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 53, + "end": 54, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -454,22 +518,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 58, "end": 65, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 58, "end": 65, "ctxt": 0 }, - "value": "article", - "raw": "article" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 58, + "end": 65, + "ctxt": 0 + }, + "value": "article", + "raw": "article" + } } }, "subclassSelectors": [] @@ -492,22 +564,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 69, "end": 70, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 69, "end": 70, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 69, + "end": 70, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -558,22 +638,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 74, "end": 81, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 74, "end": 81, "ctxt": 0 }, - "value": "article", - "raw": "article" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 74, + "end": 81, + "ctxt": 0 + }, + "value": "article", + "raw": "article" + } } }, "subclassSelectors": [] @@ -596,22 +684,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 90, "end": 91, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 90, "end": 91, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 90, + "end": 91, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -662,22 +758,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 98, "end": 99, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 98, "end": 99, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 98, + "end": 99, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -700,22 +804,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 102, "end": 105, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 102, "end": 105, "ctxt": 0 }, - "value": "img", - "raw": "img" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 102, + "end": 105, + "ctxt": 0 + }, + "value": "img", + "raw": "img" + } } }, "subclassSelectors": [] @@ -766,22 +878,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 109, "end": 110, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 109, "end": 110, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 109, + "end": 110, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -804,22 +924,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 115, "end": 118, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 115, "end": 118, "ctxt": 0 }, - "value": "img", - "raw": "img" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 115, + "end": 118, + "ctxt": 0 + }, + "value": "img", + "raw": "img" + } } }, "subclassSelectors": [] @@ -870,22 +998,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 122, "end": 123, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 122, "end": 123, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 122, + "end": 123, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -908,22 +1044,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 130, "end": 133, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 130, "end": 133, "ctxt": 0 }, - "value": "img", - "raw": "img" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 130, + "end": 133, + "ctxt": 0 + }, + "value": "img", + "raw": "img" + } } }, "subclassSelectors": [] @@ -974,22 +1118,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 137, "end": 138, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 137, "end": 138, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 137, + "end": 138, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -1012,22 +1164,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 141, "end": 144, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 141, "end": 144, "ctxt": 0 }, - "value": "img", - "raw": "img" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 141, + "end": 144, + "ctxt": 0 + }, + "value": "img", + "raw": "img" + } } }, "subclassSelectors": [] @@ -1078,22 +1238,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 148, "end": 149, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 148, "end": 149, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 148, + "end": 149, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -1116,22 +1284,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 154, "end": 157, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 154, "end": 157, "ctxt": 0 }, - "value": "img", - "raw": "img" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 154, + "end": 157, + "ctxt": 0 + }, + "value": "img", + "raw": "img" + } } }, "subclassSelectors": [] @@ -1182,22 +1358,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 161, "end": 162, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 161, "end": 162, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 161, + "end": 162, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -1220,22 +1404,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 171, "end": 174, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 171, "end": 174, "ctxt": 0 }, - "value": "img", - "raw": "img" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 171, + "end": 174, + "ctxt": 0 + }, + "value": "img", + "raw": "img" + } } }, "subclassSelectors": [] @@ -1286,22 +1478,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 178, "end": 185, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 178, "end": 185, "ctxt": 0 }, - "value": "article", - "raw": "article" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 178, + "end": 185, + "ctxt": 0 + }, + "value": "article", + "raw": "article" + } } }, "subclassSelectors": [] @@ -1324,22 +1524,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 188, "end": 189, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 188, "end": 189, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 188, + "end": 189, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -1362,22 +1570,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 192, "end": 193, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 192, "end": 193, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 192, + "end": 193, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -1428,22 +1644,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 197, "end": 204, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 197, "end": 204, "ctxt": 0 }, - "value": "article", - "raw": "article" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 197, + "end": 204, + "ctxt": 0 + }, + "value": "article", + "raw": "article" + } } }, "subclassSelectors": [] @@ -1466,22 +1690,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 207, "end": 208, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 207, "end": 208, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 207, + "end": 208, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -1504,22 +1736,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 211, "end": 212, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 211, "end": 212, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 211, + "end": 212, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -1570,22 +1810,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 216, "end": 219, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 216, "end": 219, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 216, + "end": 219, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -1608,22 +1856,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 220, "end": 221, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 220, "end": 221, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 220, + "end": 221, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -1713,22 +1969,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 232, "end": 233, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 232, "end": 233, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 232, + "end": 233, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -1779,22 +2043,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 237, "end": 240, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 237, "end": 240, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 237, + "end": 240, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -2029,22 +2301,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 272, "end": 273, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 272, "end": 273, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 272, + "end": 273, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -2095,22 +2375,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 277, "end": 280, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 277, "end": 280, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 277, + "end": 280, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -2314,16 +2602,24 @@ "end": 310, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 300, "end": 309, "ctxt": 0 }, - "value": "attribute", - "raw": "attribute" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 300, + "end": 309, + "ctxt": 0 + }, + "value": "attribute", + "raw": "attribute" + } }, "matcher": null, "value": null, @@ -2349,22 +2645,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 311, "end": 312, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 311, "end": 312, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 311, + "end": 312, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -2415,22 +2719,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 316, "end": 319, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 316, "end": 319, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 316, + "end": 319, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -2461,16 +2773,24 @@ "end": 331, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 321, "end": 330, "ctxt": 0 }, - "value": "attribute", - "raw": "attribute" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 321, + "end": 330, + "ctxt": 0 + }, + "value": "attribute", + "raw": "attribute" + } }, "matcher": null, "value": null, @@ -2532,16 +2852,24 @@ "end": 346, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 336, "end": 345, "ctxt": 0 }, - "value": "attribute", - "raw": "attribute" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 336, + "end": 345, + "ctxt": 0 + }, + "value": "attribute", + "raw": "attribute" + } }, "matcher": null, "value": null, @@ -2575,16 +2903,24 @@ "end": 352, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 348, "end": 351, "ctxt": 0 }, - "value": "src", - "raw": "src" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 348, + "end": 351, + "ctxt": 0 + }, + "value": "src", + "raw": "src" + } }, "matcher": null, "value": null, @@ -2638,22 +2974,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 356, "end": 359, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 356, "end": 359, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 356, + "end": 359, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -2676,22 +3020,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 362, "end": 363, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 362, "end": 363, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 362, + "end": 363, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -2781,22 +3133,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 376, "end": 377, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 376, "end": 377, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 376, + "end": 377, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -2847,22 +3207,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 381, "end": 384, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 381, "end": 384, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 381, + "end": 384, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -3097,22 +3465,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 422, "end": 423, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 422, "end": 423, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 422, + "end": 423, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -3163,22 +3539,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 427, "end": 430, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 427, "end": 430, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 427, + "end": 430, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -3382,16 +3766,24 @@ "end": 464, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 454, "end": 463, "ctxt": 0 }, - "value": "attribute", - "raw": "attribute" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 454, + "end": 463, + "ctxt": 0 + }, + "value": "attribute", + "raw": "attribute" + } }, "matcher": null, "value": null, @@ -3417,22 +3809,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 467, "end": 468, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 467, "end": 468, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 467, + "end": 468, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -3483,22 +3883,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 472, "end": 475, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 472, "end": 475, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 472, + "end": 475, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -3529,16 +3937,24 @@ "end": 489, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 479, "end": 488, "ctxt": 0 }, - "value": "attribute", - "raw": "attribute" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 479, + "end": 488, + "ctxt": 0 + }, + "value": "attribute", + "raw": "attribute" + } }, "matcher": null, "value": null, @@ -3600,16 +4016,24 @@ "end": 504, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 494, "end": 503, "ctxt": 0 }, - "value": "attribute", - "raw": "attribute" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 494, + "end": 503, + "ctxt": 0 + }, + "value": "attribute", + "raw": "attribute" + } }, "matcher": null, "value": null, @@ -3643,16 +4067,24 @@ "end": 512, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 508, "end": 511, "ctxt": 0 }, - "value": "src", - "raw": "src" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 508, + "end": 511, + "ctxt": 0 + }, + "value": "src", + "raw": "src" + } }, "matcher": null, "value": null, @@ -3706,22 +4138,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 516, "end": 519, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 516, "end": 519, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 516, + "end": 519, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -3744,22 +4184,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 522, "end": 523, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 522, "end": 523, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 522, + "end": 523, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -3849,22 +4297,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 536, "end": 537, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 536, "end": 537, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 536, + "end": 537, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -3915,22 +4371,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 541, "end": 544, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 541, "end": 544, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 541, + "end": 544, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -4165,22 +4629,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 582, "end": 583, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 582, "end": 583, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 582, + "end": 583, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -4231,22 +4703,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 587, "end": 590, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 587, "end": 590, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 587, + "end": 590, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -4450,16 +4930,24 @@ "end": 624, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 614, "end": 623, "ctxt": 0 }, - "value": "attribute", - "raw": "attribute" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 614, + "end": 623, + "ctxt": 0 + }, + "value": "attribute", + "raw": "attribute" + } }, "matcher": null, "value": null, @@ -4485,22 +4973,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 627, "end": 628, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 627, "end": 628, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 627, + "end": 628, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -4551,22 +5047,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 632, "end": 635, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 632, "end": 635, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 632, + "end": 635, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -4597,16 +5101,24 @@ "end": 649, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 639, "end": 648, "ctxt": 0 }, - "value": "attribute", - "raw": "attribute" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 639, + "end": 648, + "ctxt": 0 + }, + "value": "attribute", + "raw": "attribute" + } }, "matcher": null, "value": null, @@ -4668,16 +5180,24 @@ "end": 664, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 654, "end": 663, "ctxt": 0 }, - "value": "attribute", - "raw": "attribute" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 654, + "end": 663, + "ctxt": 0 + }, + "value": "attribute", + "raw": "attribute" + } }, "matcher": null, "value": null, @@ -4711,16 +5231,24 @@ "end": 672, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 668, "end": 671, "ctxt": 0 }, - "value": "src", - "raw": "src" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 668, + "end": 671, + "ctxt": 0 + }, + "value": "src", + "raw": "src" + } }, "matcher": null, "value": null, @@ -4774,22 +5302,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 676, "end": 679, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 676, "end": 679, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 676, + "end": 679, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -4812,22 +5348,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 682, "end": 683, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 682, "end": 683, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 682, + "end": 683, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -4917,22 +5461,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 696, "end": 697, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 696, "end": 697, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 696, + "end": 697, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -4983,22 +5535,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 701, "end": 704, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 701, "end": 704, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 701, + "end": 704, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -5233,22 +5793,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 742, "end": 743, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 742, "end": 743, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 742, + "end": 743, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -5299,22 +5867,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 747, "end": 750, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 747, "end": 750, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 747, + "end": 750, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -5518,16 +6094,24 @@ "end": 784, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 774, "end": 783, "ctxt": 0 }, - "value": "attribute", - "raw": "attribute" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 774, + "end": 783, + "ctxt": 0 + }, + "value": "attribute", + "raw": "attribute" + } }, "matcher": null, "value": null, @@ -5553,22 +6137,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 787, "end": 788, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 787, "end": 788, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 787, + "end": 788, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -5619,22 +6211,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 792, "end": 795, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 792, "end": 795, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 792, + "end": 795, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -5665,16 +6265,24 @@ "end": 809, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 799, "end": 808, "ctxt": 0 }, - "value": "attribute", - "raw": "attribute" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 799, + "end": 808, + "ctxt": 0 + }, + "value": "attribute", + "raw": "attribute" + } }, "matcher": null, "value": null, @@ -5736,16 +6344,24 @@ "end": 824, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 814, "end": 823, "ctxt": 0 }, - "value": "attribute", - "raw": "attribute" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 814, + "end": 823, + "ctxt": 0 + }, + "value": "attribute", + "raw": "attribute" + } }, "matcher": null, "value": null, @@ -5779,16 +6395,24 @@ "end": 832, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 828, "end": 831, "ctxt": 0 }, - "value": "src", - "raw": "src" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 828, + "end": 831, + "ctxt": 0 + }, + "value": "src", + "raw": "src" + } }, "matcher": null, "value": null, @@ -5842,22 +6466,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 836, "end": 837, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 836, "end": 837, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 836, + "end": 837, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -5908,16 +6540,24 @@ "end": 855, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 845, "end": 854, "ctxt": 0 }, - "value": "attribute", - "raw": "attribute" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 845, + "end": 854, + "ctxt": 0 + }, + "value": "attribute", + "raw": "attribute" + } }, "matcher": null, "value": null, @@ -5971,22 +6611,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 859, "end": 860, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 859, "end": 860, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 859, + "end": 860, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -6096,22 +6744,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 874, "end": 875, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 874, "end": 875, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 874, + "end": 875, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -6221,22 +6877,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 892, "end": 893, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 892, "end": 893, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 892, + "end": 893, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -6279,22 +6943,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 900, "end": 903, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 900, "end": 903, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 900, + "end": 903, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [ @@ -6364,22 +7036,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 913, "end": 914, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 913, "end": 914, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 913, + "end": 914, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -6402,22 +7082,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 917, "end": 918, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 917, "end": 918, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 917, + "end": 918, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -6428,18 +7116,34 @@ "end": 932, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 919, "end": 923, "ctxt": 0 }, - "value": "href", - "raw": "href" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 919, + "end": 923, + "ctxt": 0 + }, + "value": "href", + "raw": "href" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 923, + "end": 924, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { @@ -6500,22 +7204,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 936, "end": 938, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 936, "end": 938, "ctxt": 0 }, - "value": "ul", - "raw": "ul" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 936, + "end": 938, + "ctxt": 0 + }, + "value": "ul", + "raw": "ul" + } } }, "subclassSelectors": [ @@ -6557,22 +7269,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 946, "end": 947, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 946, "end": 947, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 946, + "end": 947, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -6662,22 +7382,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 958, "end": 959, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 958, "end": 959, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 958, + "end": 959, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -6700,22 +7428,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 962, "end": 965, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 962, "end": 965, "ctxt": 0 }, - "value": "bar", - "raw": "bar" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 962, + "end": 965, + "ctxt": 0 + }, + "value": "bar", + "raw": "bar" + } } }, "subclassSelectors": [] @@ -6766,22 +7502,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 969, "end": 970, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 969, "end": 970, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 969, + "end": 970, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -6804,22 +7548,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 972, "end": 973, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 972, "end": 973, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 972, + "end": 973, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -6870,22 +7622,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 977, "end": 978, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 977, "end": 978, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 977, + "end": 978, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -6908,22 +7668,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 980, "end": 981, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 980, "end": 981, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 980, + "end": 981, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -6974,22 +7742,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 985, "end": 986, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 985, "end": 986, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 985, + "end": 986, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -7012,22 +7788,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 988, "end": 989, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 988, "end": 989, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 988, + "end": 989, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -7078,22 +7862,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 993, "end": 994, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 993, "end": 994, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 993, + "end": 994, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -7116,22 +7908,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 996, "end": 997, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 996, "end": 997, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 996, + "end": 997, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -7182,22 +7982,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1001, "end": 1002, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1001, "end": 1002, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1001, + "end": 1002, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -7220,22 +8028,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1004, "end": 1005, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1004, "end": 1005, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1004, + "end": 1005, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -7286,22 +8102,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1009, "end": 1010, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1009, "end": 1010, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1009, + "end": 1010, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -7324,22 +8148,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1012, "end": 1013, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1012, "end": 1013, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1012, + "end": 1013, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -7390,22 +8222,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1017, "end": 1018, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1017, "end": 1018, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1017, + "end": 1018, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -7428,22 +8268,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1019, "end": 1020, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1019, "end": 1020, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1019, + "end": 1020, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -7494,22 +8342,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1024, "end": 1025, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1024, "end": 1025, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1024, + "end": 1025, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -7532,22 +8388,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1026, "end": 1027, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1026, "end": 1027, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1026, + "end": 1027, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -7598,22 +8462,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1031, "end": 1032, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1031, "end": 1032, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1031, + "end": 1032, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -7636,22 +8508,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1033, "end": 1034, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1033, "end": 1034, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1033, + "end": 1034, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -7702,22 +8582,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1038, "end": 1039, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1038, "end": 1039, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1038, + "end": 1039, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -7748,18 +8636,34 @@ "end": 1055, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1041, "end": 1045, "ctxt": 0 }, - "value": "type", - "raw": "type" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1041, + "end": 1045, + "ctxt": 0 + }, + "value": "type", + "raw": "type" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 1045, + "end": 1046, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { @@ -7820,22 +8724,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1059, "end": 1060, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1059, "end": 1060, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1059, + "end": 1060, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -7866,18 +8778,34 @@ "end": 1077, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1063, "end": 1067, "ctxt": 0 }, - "value": "type", - "raw": "type" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1063, + "end": 1067, + "ctxt": 0 + }, + "value": "type", + "raw": "type" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 1067, + "end": 1068, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { @@ -7938,22 +8866,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1081, "end": 1082, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1081, "end": 1082, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1081, + "end": 1082, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -7976,22 +8912,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1085, "end": 1086, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1085, "end": 1086, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1085, + "end": 1086, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -8042,31 +8986,47 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1090, "end": 1104, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 1090, - "end": 1099, - "ctxt": 0 - }, - "value": "namespace", - "raw": "namespace" - }, - "name": { - "type": "Identifier", - "span": { - "start": 1100, "end": 1104, "ctxt": 0 }, - "value": "type", - "raw": "type" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 1090, + "end": 1100, + "ctxt": 0 + }, + "prefix": { + "type": "Identifier", + "span": { + "start": 1090, + "end": 1099, + "ctxt": 0 + }, + "value": "namespace", + "raw": "namespace" + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 1100, + "end": 1104, + "ctxt": 0 + }, + "value": "type", + "raw": "type" + } } }, "subclassSelectors": [ @@ -8320,22 +9280,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1138, "end": 1139, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1138, "end": 1139, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1138, + "end": 1139, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -8358,22 +9326,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1140, "end": 1141, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1140, "end": 1141, "ctxt": 0 }, - "value": "c", - "raw": "c" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1140, + "end": 1141, + "ctxt": 0 + }, + "value": "c", + "raw": "c" + } } }, "subclassSelectors": [] @@ -8397,22 +9373,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1143, "end": 1144, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1143, "end": 1144, "ctxt": 0 }, - "value": "d", - "raw": "d" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1143, + "end": 1144, + "ctxt": 0 + }, + "value": "d", + "raw": "d" + } } }, "subclassSelectors": [] @@ -8435,22 +9419,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1147, "end": 1148, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1147, "end": 1148, "ctxt": 0 }, - "value": "e", - "raw": "e" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1147, + "end": 1148, + "ctxt": 0 + }, + "value": "e", + "raw": "e" + } } }, "subclassSelectors": [] @@ -8473,22 +9465,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1149, "end": 1150, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1149, "end": 1150, "ctxt": 0 }, - "value": "h", - "raw": "h" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1149, + "end": 1150, + "ctxt": 0 + }, + "value": "h", + "raw": "h" + } } }, "subclassSelectors": [] @@ -8539,22 +9539,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1154, "end": 1155, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1154, "end": 1155, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1154, + "end": 1155, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -8577,22 +9585,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1158, "end": 1159, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1158, "end": 1159, "ctxt": 0 }, - "value": "h", - "raw": "h" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1158, + "end": 1159, + "ctxt": 0 + }, + "value": "h", + "raw": "h" + } } }, "subclassSelectors": [] @@ -8615,22 +9631,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1162, "end": 1163, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1162, "end": 1163, "ctxt": 0 }, - "value": "d", - "raw": "d" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1162, + "end": 1163, + "ctxt": 0 + }, + "value": "d", + "raw": "d" + } } }, "subclassSelectors": [] @@ -8681,22 +9705,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1167, "end": 1170, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1167, "end": 1170, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1167, + "end": 1170, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -8719,22 +9751,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1171, "end": 1174, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1171, "end": 1174, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1171, + "end": 1174, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -8757,22 +9797,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1175, "end": 1178, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1175, "end": 1178, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1175, + "end": 1178, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -8795,22 +9843,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1179, "end": 1182, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1179, "end": 1182, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1179, + "end": 1182, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -8833,22 +9889,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1183, "end": 1186, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1183, "end": 1186, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1183, + "end": 1186, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -8871,22 +9935,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1187, "end": 1190, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1187, "end": 1190, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1187, + "end": 1190, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -8909,22 +9981,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1191, "end": 1194, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1191, "end": 1194, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1191, + "end": 1194, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -8947,22 +10027,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1195, "end": 1198, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1195, "end": 1198, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1195, + "end": 1198, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -8985,22 +10073,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1199, "end": 1202, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1199, "end": 1202, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1199, + "end": 1202, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -9023,22 +10119,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1203, "end": 1206, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1203, "end": 1206, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1203, + "end": 1206, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -9061,22 +10165,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1207, "end": 1210, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1207, "end": 1210, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1207, + "end": 1210, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -9135,16 +10247,24 @@ "end": 1220, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1215, "end": 1219, "ctxt": 0 }, - "value": "href", - "raw": "href" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1215, + "end": 1219, + "ctxt": 0 + }, + "value": "href", + "raw": "href" + } }, "matcher": null, "value": null, @@ -9157,16 +10277,24 @@ "end": 1227, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1221, "end": 1226, "ctxt": 0 }, - "value": "class", - "raw": "class" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1221, + "end": 1226, + "ctxt": 0 + }, + "value": "class", + "raw": "class" + } }, "matcher": null, "value": null, @@ -9179,16 +10307,24 @@ "end": 1233, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1228, "end": 1232, "ctxt": 0 }, - "value": "name", - "raw": "name" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1228, + "end": 1232, + "ctxt": 0 + }, + "value": "name", + "raw": "name" + } }, "matcher": null, "value": null, @@ -9214,22 +10350,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1234, "end": 1236, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1234, "end": 1236, "ctxt": 0 }, - "value": "h1", - "raw": "h1" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1234, + "end": 1236, + "ctxt": 0 + }, + "value": "h1", + "raw": "h1" + } } }, "subclassSelectors": [] @@ -9252,22 +10396,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 1239, "end": 1241, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1239, "end": 1241, "ctxt": 0 }, - "value": "h2", - "raw": "h2" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1239, + "end": 1241, + "ctxt": 0 + }, + "value": "h2", + "raw": "h2" + } } }, "subclassSelectors": [] @@ -9326,18 +10478,34 @@ "end": 1263, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1246, "end": 1250, "ctxt": 0 }, - "value": "href", - "raw": "href" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1246, + "end": 1250, + "ctxt": 0 + }, + "value": "href", + "raw": "href" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 1250, + "end": 1252, + "ctxt": 0 + }, + "value": "*=" }, - "matcher": "*=", "value": { "type": "String", "span": { @@ -9357,18 +10525,34 @@ "end": 1279, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1264, "end": 1267, "ctxt": 0 }, - "value": "rel", - "raw": "rel" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1264, + "end": 1267, + "ctxt": 0 + }, + "value": "rel", + "raw": "rel" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 1267, + "end": 1268, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { @@ -9388,16 +10572,24 @@ "end": 1283, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1280, "end": 1282, "ctxt": 0 }, - "value": "id", - "raw": "id" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1280, + "end": 1282, + "ctxt": 0 + }, + "value": "id", + "raw": "id" + } }, "matcher": null, "value": null, @@ -9410,18 +10602,34 @@ "end": 1298, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1284, "end": 1289, "ctxt": 0 }, - "value": "class", - "raw": "class" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1284, + "end": 1289, + "ctxt": 0 + }, + "value": "class", + "raw": "class" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 1289, + "end": 1291, + "ctxt": 0 + }, + "value": "~=" }, - "matcher": "~=", "value": { "type": "String", "span": { @@ -9462,16 +10670,24 @@ "end": 1307, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1302, "end": 1306, "ctxt": 0 }, - "value": "name", - "raw": "name" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1302, + "end": 1306, + "ctxt": 0 + }, + "value": "name", + "raw": "name" + } }, "matcher": null, "value": null, @@ -9533,18 +10749,34 @@ "end": 1347, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1312, "end": 1327, "ctxt": 0 }, - "value": "data-weird-attr", - "raw": "data-weird-attr" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1312, + "end": 1327, + "ctxt": 0 + }, + "value": "data-weird-attr", + "raw": "data-weird-attr" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 1327, + "end": 1329, + "ctxt": 0 + }, + "value": "*=" }, - "matcher": "*=", "value": { "type": "String", "span": { @@ -9586,18 +10818,34 @@ "end": 1385, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1350, "end": 1365, "ctxt": 0 }, - "value": "data-weird-attr", - "raw": "data-weird-attr" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1350, + "end": 1365, + "ctxt": 0 + }, + "value": "data-weird-attr", + "raw": "data-weird-attr" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 1365, + "end": 1367, + "ctxt": 0 + }, + "value": "^=" }, - "matcher": "^=", "value": { "type": "String", "span": { @@ -9639,18 +10887,34 @@ "end": 1423, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1388, "end": 1403, "ctxt": 0 }, - "value": "data-weird-attr", - "raw": "data-weird-attr" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1388, + "end": 1403, + "ctxt": 0 + }, + "value": "data-weird-attr", + "raw": "data-weird-attr" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 1403, + "end": 1405, + "ctxt": 0 + }, + "value": "$=" }, - "matcher": "$=", "value": { "type": "String", "span": { @@ -9692,18 +10956,34 @@ "end": 1461, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1426, "end": 1441, "ctxt": 0 }, - "value": "data-weird-attr", - "raw": "data-weird-attr" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1426, + "end": 1441, + "ctxt": 0 + }, + "value": "data-weird-attr", + "raw": "data-weird-attr" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 1441, + "end": 1443, + "ctxt": 0 + }, + "value": "|=" }, - "matcher": "|=", "value": { "type": "String", "span": { @@ -9764,23 +11044,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 1465, "end": 1466, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 1465, - "end": 1466, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [] }, @@ -9802,23 +11072,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 1469, "end": 1470, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 1469, - "end": 1470, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [] } @@ -9868,23 +11128,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 1474, "end": 1475, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 1474, - "end": 1475, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [] }, @@ -9906,23 +11156,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 1476, "end": 1477, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 1476, - "end": 1477, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [] } @@ -9972,23 +11212,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 1481, "end": 1482, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 1481, - "end": 1482, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [] }, @@ -10010,23 +11240,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 1491, "end": 1492, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 1491, - "end": 1492, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [] } @@ -10076,23 +11296,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 1496, "end": 1497, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 1496, - "end": 1497, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [ { @@ -10102,16 +11312,24 @@ "end": 1503, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 1498, "end": 1502, "ctxt": 0 }, - "value": "href", - "raw": "href" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1498, + "end": 1502, + "ctxt": 0 + }, + "value": "href", + "raw": "href" + } }, "matcher": null, "value": null, @@ -10137,23 +11355,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 1504, "end": 1505, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 1504, - "end": 1505, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [ { @@ -10269,23 +11477,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 1522, "end": 1523, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 1522, - "end": 1523, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [ { @@ -10322,6 +11520,423 @@ }, "value": [] } + }, + { + "type": "QualifiedRule", + "span": { + "start": 1563, + "end": 1584, + "ctxt": 0 + }, + "prelude": { + "type": "SelectorList", + "span": { + "start": 1563, + "end": 1581, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 1563, + "end": 1581, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1563, + "end": 1575, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", + "span": { + "start": 1563, + "end": 1566, + "ctxt": 0 + }, + "name": { + "type": "WqName", + "span": { + "start": 1563, + "end": 1566, + "ctxt": 0 + }, + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1563, + "end": 1566, + "ctxt": 0 + }, + "value": "col", + "raw": "col" + } + } + }, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1566, + "end": 1575, + "ctxt": 0 + }, + "text": { + "type": "Identifier", + "span": { + "start": 1567, + "end": 1575, + "ctxt": 0 + }, + "value": "selected", + "raw": "selected" + } + } + ] + }, + { + "type": "Combinator", + "span": { + "start": 1576, + "end": 1578, + "ctxt": 0 + }, + "value": "||" + }, + { + "type": "CompoundSelector", + "span": { + "start": 1579, + "end": 1581, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", + "span": { + "start": 1579, + "end": 1581, + "ctxt": 0 + }, + "name": { + "type": "WqName", + "span": { + "start": 1579, + "end": 1581, + "ctxt": 0 + }, + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1579, + "end": 1581, + "ctxt": 0 + }, + "value": "td", + "raw": "td" + } + } + }, + "subclassSelectors": [] + } + ] + } + ] + }, + "block": { + "type": "Block", + "span": { + "start": 1582, + "end": 1584, + "ctxt": 0 + }, + "value": [] + } + }, + { + "type": "QualifiedRule", + "span": { + "start": 1585, + "end": 1607, + "ctxt": 0 + }, + "prelude": { + "type": "SelectorList", + "span": { + "start": 1585, + "end": 1604, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 1585, + "end": 1604, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1585, + "end": 1597, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", + "span": { + "start": 1585, + "end": 1588, + "ctxt": 0 + }, + "name": { + "type": "WqName", + "span": { + "start": 1585, + "end": 1588, + "ctxt": 0 + }, + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1585, + "end": 1588, + "ctxt": 0 + }, + "value": "col", + "raw": "col" + } + } + }, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1588, + "end": 1597, + "ctxt": 0 + }, + "text": { + "type": "Identifier", + "span": { + "start": 1589, + "end": 1597, + "ctxt": 0 + }, + "value": "selected", + "raw": "selected" + } + } + ] + }, + { + "type": "Combinator", + "span": { + "start": 1598, + "end": 1600, + "ctxt": 0 + }, + "value": "||" + }, + { + "type": "CompoundSelector", + "span": { + "start": 1602, + "end": 1604, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", + "span": { + "start": 1602, + "end": 1604, + "ctxt": 0 + }, + "name": { + "type": "WqName", + "span": { + "start": 1602, + "end": 1604, + "ctxt": 0 + }, + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1602, + "end": 1604, + "ctxt": 0 + }, + "value": "td", + "raw": "td" + } + } + }, + "subclassSelectors": [] + } + ] + } + ] + }, + "block": { + "type": "Block", + "span": { + "start": 1605, + "end": 1607, + "ctxt": 0 + }, + "value": [] + } + }, + { + "type": "QualifiedRule", + "span": { + "start": 1608, + "end": 1627, + "ctxt": 0 + }, + "prelude": { + "type": "SelectorList", + "span": { + "start": 1608, + "end": 1624, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 1608, + "end": 1624, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1608, + "end": 1620, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", + "span": { + "start": 1608, + "end": 1611, + "ctxt": 0 + }, + "name": { + "type": "WqName", + "span": { + "start": 1608, + "end": 1611, + "ctxt": 0 + }, + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1608, + "end": 1611, + "ctxt": 0 + }, + "value": "col", + "raw": "col" + } + } + }, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1611, + "end": 1620, + "ctxt": 0 + }, + "text": { + "type": "Identifier", + "span": { + "start": 1612, + "end": 1620, + "ctxt": 0 + }, + "value": "selected", + "raw": "selected" + } + } + ] + }, + { + "type": "Combinator", + "span": { + "start": 1620, + "end": 1622, + "ctxt": 0 + }, + "value": "||" + }, + { + "type": "CompoundSelector", + "span": { + "start": 1622, + "end": 1624, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": { + "type": "TagNameSelector", + "span": { + "start": 1622, + "end": 1624, + "ctxt": 0 + }, + "name": { + "type": "WqName", + "span": { + "start": 1622, + "end": 1624, + "ctxt": 0 + }, + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 1622, + "end": 1624, + "ctxt": 0 + }, + "value": "td", + "raw": "td" + } + } + }, + "subclassSelectors": [] + } + ] + } + ] + }, + "block": { + "type": "Block", + "span": { + "start": 1625, + "end": 1627, + "ctxt": 0 + }, + "value": [] + } } ] } diff --git a/crates/swc_css_parser/tests/fixture/selector/complex/span.rust-debug b/crates/swc_css_parser/tests/fixture/selector/complex/span.rust-debug index 9f5a07a6227..1c0bb613fa5 100644 --- a/crates/swc_css_parser/tests/fixture/selector/complex/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/selector/complex/span.rust-debug @@ -1,14 +1,14 @@ error: Stylesheet - --> $DIR/tests/fixture/selector/complex/input.css:1:1 - | -1 | / article p {} -2 | | article -3 | | p {} -4 | | article p {} -... | -97 | | *[href] *:not(*.green) {} -98 | | *::-webkit-media-controls-play-button {} - | |_________________________________________^ + --> $DIR/tests/fixture/selector/complex/input.css:1:1 + | +1 | / article p {} +2 | | article +3 | | p {} +4 | | article p {} +... | +103 | | {} +104 | | col.selected||td {} + | |____________________^ error: Rule --> $DIR/tests/fixture/selector/complex/input.css:1:1 @@ -46,6 +46,18 @@ error: TypeSelector 1 | article p {} | ^^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:1:1 + | +1 | article p {} + | ^^^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:1:1 + | +1 | article p {} + | ^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:1:1 | @@ -70,6 +82,18 @@ error: TypeSelector 1 | article p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:1:9 + | +1 | article p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:1:9 + | +1 | article p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:1:9 | @@ -122,6 +146,18 @@ error: TypeSelector 2 | article | ^^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:2:1 + | +2 | article + | ^^^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:2:1 + | +2 | article + | ^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:2:1 | @@ -148,6 +184,18 @@ error: TypeSelector 3 | p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:3:1 + | +3 | p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:3:1 + | +3 | p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:3:1 | @@ -196,6 +244,18 @@ error: TypeSelector 4 | article p {} | ^^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:4:1 + | +4 | article p {} + | ^^^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:4:1 + | +4 | article p {} + | ^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:4:1 | @@ -220,6 +280,18 @@ error: TypeSelector 4 | article p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:4:11 + | +4 | article p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:4:11 + | +4 | article p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:4:11 | @@ -268,6 +340,18 @@ error: TypeSelector 5 | article > p {} | ^^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:5:1 + | +5 | article > p {} + | ^^^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:5:1 + | +5 | article > p {} + | ^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:5:1 | @@ -292,6 +376,18 @@ error: TypeSelector 5 | article > p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:5:11 + | +5 | article > p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:5:11 + | +5 | article > p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:5:11 | @@ -348,6 +444,18 @@ error: TypeSelector 6 | article | ^^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:6:1 + | +6 | article + | ^^^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:6:1 + | +6 | article + | ^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:6:1 | @@ -372,6 +480,18 @@ error: TypeSelector 8 | p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:8:1 + | +8 | p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:8:1 + | +8 | p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:8:1 | @@ -420,6 +540,18 @@ error: TypeSelector 9 | article > p {} | ^^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:9:1 + | +9 | article > p {} + | ^^^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:9:1 + | +9 | article > p {} + | ^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:9:1 | @@ -444,6 +576,18 @@ error: TypeSelector 9 | article > p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:9:17 + | +9 | article > p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:9:17 + | +9 | article > p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:9:17 | @@ -492,6 +636,18 @@ error: TypeSelector 10 | p + img {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:10:1 + | +10 | p + img {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:10:1 + | +10 | p + img {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:10:1 | @@ -516,6 +672,18 @@ error: TypeSelector 10 | p + img {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:10:5 + | +10 | p + img {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:10:5 + | +10 | p + img {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:10:5 | @@ -572,6 +740,18 @@ error: TypeSelector 11 | p | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:11:1 + | +11 | p + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:11:1 + | +11 | p + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:11:1 | @@ -596,6 +776,18 @@ error: TypeSelector 13 | img {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:13:1 + | +13 | img {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:13:1 + | +13 | img {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:13:1 | @@ -644,6 +836,18 @@ error: TypeSelector 14 | p + img {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:14:1 + | +14 | p + img {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:14:1 + | +14 | p + img {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:14:1 | @@ -668,6 +872,18 @@ error: TypeSelector 14 | p + img {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:14:9 + | +14 | p + img {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:14:9 + | +14 | p + img {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:14:9 | @@ -716,6 +932,18 @@ error: TypeSelector 15 | p ~ img {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:15:1 + | +15 | p ~ img {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:15:1 + | +15 | p ~ img {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:15:1 | @@ -740,6 +968,18 @@ error: TypeSelector 15 | p ~ img {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:15:5 + | +15 | p ~ img {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:15:5 + | +15 | p ~ img {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:15:5 | @@ -796,6 +1036,18 @@ error: TypeSelector 16 | p | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:16:1 + | +16 | p + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:16:1 + | +16 | p + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:16:1 | @@ -820,6 +1072,18 @@ error: TypeSelector 18 | img {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:18:1 + | +18 | img {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:18:1 + | +18 | img {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:18:1 | @@ -868,6 +1132,18 @@ error: TypeSelector 19 | p ~ img {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:19:1 + | +19 | p ~ img {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:19:1 + | +19 | p ~ img {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:19:1 | @@ -892,6 +1168,18 @@ error: TypeSelector 19 | p ~ img {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:19:11 + | +19 | p ~ img {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:19:11 + | +19 | p ~ img {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:19:11 | @@ -940,6 +1228,18 @@ error: TypeSelector 20 | article > p > a {} | ^^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:20:1 + | +20 | article > p > a {} + | ^^^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:20:1 + | +20 | article > p > a {} + | ^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:20:1 | @@ -964,6 +1264,18 @@ error: TypeSelector 20 | article > p > a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:20:11 + | +20 | article > p > a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:20:11 + | +20 | article > p > a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:20:11 | @@ -988,6 +1300,18 @@ error: TypeSelector 20 | article > p > a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:20:15 + | +20 | article > p > a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:20:15 + | +20 | article > p > a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:20:15 | @@ -1052,6 +1376,18 @@ error: TypeSelector 21 | article | ^^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:21:1 + | +21 | article + | ^^^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:21:1 + | +21 | article + | ^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:21:1 | @@ -1076,6 +1412,18 @@ error: TypeSelector 23 | p | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:23:1 + | +23 | p + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:23:1 + | +23 | p + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:23:1 | @@ -1100,6 +1448,18 @@ error: TypeSelector 25 | a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:25:1 + | +25 | a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:25:1 + | +25 | a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:25:1 | @@ -1148,6 +1508,18 @@ error: TypeSelector 26 | div p {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:26:1 + | +26 | div p {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:26:1 + | +26 | div p {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:26:1 | @@ -1172,6 +1544,18 @@ error: TypeSelector 26 | div p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:26:5 + | +26 | div p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:26:5 + | +26 | div p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:26:5 | @@ -1250,6 +1634,18 @@ error: TypeSelector 27 | .class p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:27:8 + | +27 | .class p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:27:8 + | +27 | .class p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:27:8 | @@ -1298,6 +1694,18 @@ error: TypeSelector 28 | div .class {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:28:1 + | +28 | div .class {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:28:1 + | +28 | div .class {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:28:1 | @@ -1490,6 +1898,18 @@ error: TypeSelector 30 | #id p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:30:5 + | +30 | #id p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:30:5 + | +30 | #id p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:30:5 | @@ -1538,6 +1958,18 @@ error: TypeSelector 31 | div #id {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:31:1 + | +31 | div #id {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:31:1 + | +31 | div #id {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:31:1 | @@ -1700,12 +2132,18 @@ error: SubclassSelector 33 | [attribute] p {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:33:1 | 33 | [attribute] p {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:33:2 + | +33 | [attribute] p {} + | ^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:33:2 | @@ -1730,6 +2168,18 @@ error: TypeSelector 33 | [attribute] p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:33:13 + | +33 | [attribute] p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:33:13 + | +33 | [attribute] p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:33:13 | @@ -1778,6 +2228,18 @@ error: TypeSelector 34 | div [attribute] {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:34:1 + | +34 | div [attribute] {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:34:1 + | +34 | div [attribute] {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:34:1 | @@ -1802,12 +2264,18 @@ error: SubclassSelector 34 | div [attribute] {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:34:5 | 34 | div [attribute] {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:34:6 + | +34 | div [attribute] {} + | ^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:34:6 | @@ -1856,12 +2324,18 @@ error: SubclassSelector 35 | [attribute] [src] {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:35:1 | 35 | [attribute] [src] {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:35:2 + | +35 | [attribute] [src] {} + | ^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:35:2 | @@ -1886,12 +2360,18 @@ error: SubclassSelector 35 | [attribute] [src] {} | ^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:35:13 | 35 | [attribute] [src] {} | ^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:35:14 + | +35 | [attribute] [src] {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:35:14 | @@ -1940,6 +2420,18 @@ error: TypeSelector 36 | div > p {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:36:1 + | +36 | div > p {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:36:1 + | +36 | div > p {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:36:1 | @@ -1964,6 +2456,18 @@ error: TypeSelector 36 | div > p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:36:7 + | +36 | div > p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:36:7 + | +36 | div > p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:36:7 | @@ -2042,6 +2546,18 @@ error: TypeSelector 37 | .class > p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:37:10 + | +37 | .class > p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:37:10 + | +37 | .class > p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:37:10 | @@ -2090,6 +2606,18 @@ error: TypeSelector 38 | div > .class {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:38:1 + | +38 | div > .class {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:38:1 + | +38 | div > .class {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:38:1 | @@ -2282,6 +2810,18 @@ error: TypeSelector 40 | #id > p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:40:7 + | +40 | #id > p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:40:7 + | +40 | #id > p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:40:7 | @@ -2330,6 +2870,18 @@ error: TypeSelector 41 | div > #id {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:41:1 + | +41 | div > #id {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:41:1 + | +41 | div > #id {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:41:1 | @@ -2492,12 +3044,18 @@ error: SubclassSelector 43 | [attribute] > p {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:43:1 | 43 | [attribute] > p {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:43:2 + | +43 | [attribute] > p {} + | ^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:43:2 | @@ -2522,6 +3080,18 @@ error: TypeSelector 43 | [attribute] > p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:43:15 + | +43 | [attribute] > p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:43:15 + | +43 | [attribute] > p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:43:15 | @@ -2570,6 +3140,18 @@ error: TypeSelector 44 | div > [attribute] {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:44:1 + | +44 | div > [attribute] {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:44:1 + | +44 | div > [attribute] {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:44:1 | @@ -2594,12 +3176,18 @@ error: SubclassSelector 44 | div > [attribute] {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:44:7 | 44 | div > [attribute] {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:44:8 + | +44 | div > [attribute] {} + | ^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:44:8 | @@ -2648,12 +3236,18 @@ error: SubclassSelector 45 | [attribute] > [src] {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:45:1 | 45 | [attribute] > [src] {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:45:2 + | +45 | [attribute] > [src] {} + | ^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:45:2 | @@ -2678,12 +3272,18 @@ error: SubclassSelector 45 | [attribute] > [src] {} | ^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:45:15 | 45 | [attribute] > [src] {} | ^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:45:16 + | +45 | [attribute] > [src] {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:45:16 | @@ -2732,6 +3332,18 @@ error: TypeSelector 46 | div + p {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:46:1 + | +46 | div + p {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:46:1 + | +46 | div + p {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:46:1 | @@ -2756,6 +3368,18 @@ error: TypeSelector 46 | div + p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:46:7 + | +46 | div + p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:46:7 + | +46 | div + p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:46:7 | @@ -2834,6 +3458,18 @@ error: TypeSelector 47 | .class + p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:47:10 + | +47 | .class + p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:47:10 + | +47 | .class + p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:47:10 | @@ -2882,6 +3518,18 @@ error: TypeSelector 48 | div + .class {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:48:1 + | +48 | div + .class {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:48:1 + | +48 | div + .class {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:48:1 | @@ -3074,6 +3722,18 @@ error: TypeSelector 50 | #id + p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:50:7 + | +50 | #id + p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:50:7 + | +50 | #id + p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:50:7 | @@ -3122,6 +3782,18 @@ error: TypeSelector 51 | div + #id {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:51:1 + | +51 | div + #id {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:51:1 + | +51 | div + #id {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:51:1 | @@ -3284,12 +3956,18 @@ error: SubclassSelector 53 | [attribute] + p {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:53:1 | 53 | [attribute] + p {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:53:2 + | +53 | [attribute] + p {} + | ^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:53:2 | @@ -3314,6 +3992,18 @@ error: TypeSelector 53 | [attribute] + p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:53:15 + | +53 | [attribute] + p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:53:15 + | +53 | [attribute] + p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:53:15 | @@ -3362,6 +4052,18 @@ error: TypeSelector 54 | div + [attribute] {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:54:1 + | +54 | div + [attribute] {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:54:1 + | +54 | div + [attribute] {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:54:1 | @@ -3386,12 +4088,18 @@ error: SubclassSelector 54 | div + [attribute] {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:54:7 | 54 | div + [attribute] {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:54:8 + | +54 | div + [attribute] {} + | ^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:54:8 | @@ -3440,12 +4148,18 @@ error: SubclassSelector 55 | [attribute] + [src] {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:55:1 | 55 | [attribute] + [src] {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:55:2 + | +55 | [attribute] + [src] {} + | ^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:55:2 | @@ -3470,12 +4184,18 @@ error: SubclassSelector 55 | [attribute] + [src] {} | ^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:55:15 | 55 | [attribute] + [src] {} | ^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:55:16 + | +55 | [attribute] + [src] {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:55:16 | @@ -3524,6 +4244,18 @@ error: TypeSelector 56 | div ~ p {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:56:1 + | +56 | div ~ p {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:56:1 + | +56 | div ~ p {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:56:1 | @@ -3548,6 +4280,18 @@ error: TypeSelector 56 | div ~ p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:56:7 + | +56 | div ~ p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:56:7 + | +56 | div ~ p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:56:7 | @@ -3626,6 +4370,18 @@ error: TypeSelector 57 | .class ~ p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:57:10 + | +57 | .class ~ p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:57:10 + | +57 | .class ~ p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:57:10 | @@ -3674,6 +4430,18 @@ error: TypeSelector 58 | div ~ .class {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:58:1 + | +58 | div ~ .class {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:58:1 + | +58 | div ~ .class {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:58:1 | @@ -3866,6 +4634,18 @@ error: TypeSelector 60 | #id ~ p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:60:7 + | +60 | #id ~ p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:60:7 + | +60 | #id ~ p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:60:7 | @@ -3914,6 +4694,18 @@ error: TypeSelector 61 | div ~ #id {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:61:1 + | +61 | div ~ #id {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:61:1 + | +61 | div ~ #id {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:61:1 | @@ -4076,12 +4868,18 @@ error: SubclassSelector 63 | [attribute] ~ p {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:63:1 | 63 | [attribute] ~ p {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:63:2 + | +63 | [attribute] ~ p {} + | ^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:63:2 | @@ -4106,6 +4904,18 @@ error: TypeSelector 63 | [attribute] ~ p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:63:15 + | +63 | [attribute] ~ p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:63:15 + | +63 | [attribute] ~ p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:63:15 | @@ -4154,6 +4964,18 @@ error: TypeSelector 64 | div ~ [attribute] {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:64:1 + | +64 | div ~ [attribute] {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:64:1 + | +64 | div ~ [attribute] {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:64:1 | @@ -4178,12 +5000,18 @@ error: SubclassSelector 64 | div ~ [attribute] {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:64:7 | 64 | div ~ [attribute] {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:64:8 + | +64 | div ~ [attribute] {} + | ^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:64:8 | @@ -4232,12 +5060,18 @@ error: SubclassSelector 65 | [attribute] ~ [src] {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:65:1 | 65 | [attribute] ~ [src] {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:65:2 + | +65 | [attribute] ~ [src] {} + | ^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:65:2 | @@ -4262,12 +5096,18 @@ error: SubclassSelector 65 | [attribute] ~ [src] {} | ^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:65:15 | 65 | [attribute] ~ [src] {} | ^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:65:16 + | +65 | [attribute] ~ [src] {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:65:16 | @@ -4316,6 +5156,18 @@ error: TypeSelector 66 | a:hover [attribute] {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:66:1 + | +66 | a:hover [attribute] {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:66:1 + | +66 | a:hover [attribute] {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:66:1 | @@ -4358,12 +5210,18 @@ error: SubclassSelector 66 | a:hover [attribute] {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:66:9 | 66 | a:hover [attribute] {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:66:10 + | +66 | a:hover [attribute] {} + | ^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:66:10 | @@ -4412,6 +5270,18 @@ error: TypeSelector 67 | a:hover #id {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:67:1 + | +67 | a:hover #id {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:67:1 + | +67 | a:hover #id {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:67:1 | @@ -4508,6 +5378,18 @@ error: TypeSelector 68 | a:hover .class {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:68:1 + | +68 | a:hover .class {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:68:1 + | +68 | a:hover .class {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:68:1 | @@ -4604,6 +5486,18 @@ error: TypeSelector 69 | a:hover div#thing {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:69:1 + | +69 | a:hover div#thing {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:69:1 + | +69 | a:hover div#thing {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:69:1 | @@ -4646,6 +5540,18 @@ error: TypeSelector 69 | a:hover div#thing {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:69:9 + | +69 | a:hover div#thing {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:69:9 + | +69 | a:hover div#thing {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:69:9 | @@ -4712,6 +5618,18 @@ error: TypeSelector 70 | a + a[href='place'] {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:70:1 + | +70 | a + a[href='place'] {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:70:1 + | +70 | a + a[href='place'] {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:70:1 | @@ -4736,6 +5654,18 @@ error: TypeSelector 70 | a + a[href='place'] {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:70:5 + | +70 | a + a[href='place'] {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:70:5 + | +70 | a + a[href='place'] {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:70:5 | @@ -4748,18 +5678,36 @@ error: SubclassSelector 70 | a + a[href='place'] {} | ^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:70:6 | 70 | a + a[href='place'] {} | ^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:70:7 + | +70 | a + a[href='place'] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:70:7 | 70 | a + a[href='place'] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/complex/input.css:70:11 + | +70 | a + a[href='place'] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/complex/input.css:70:12 + | +70 | a + a[href='place'] {} + | ^^^^^^^ + error: Str --> $DIR/tests/fixture/selector/complex/input.css:70:12 | @@ -4808,6 +5756,18 @@ error: TypeSelector 71 | ul.list + a {} | ^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:71:1 + | +71 | ul.list + a {} + | ^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:71:1 + | +71 | ul.list + a {} + | ^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:71:1 | @@ -4850,6 +5810,18 @@ error: TypeSelector 71 | ul.list + a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:71:11 + | +71 | ul.list + a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:71:11 + | +71 | ul.list + a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:71:11 | @@ -4928,6 +5900,18 @@ error: TypeSelector 72 | .foo ~ a + bar {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:72:8 + | +72 | .foo ~ a + bar {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:72:8 + | +72 | .foo ~ a + bar {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:72:8 | @@ -4952,6 +5936,18 @@ error: TypeSelector 72 | .foo ~ a + bar {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:72:12 + | +72 | .foo ~ a + bar {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:72:12 + | +72 | .foo ~ a + bar {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:72:12 | @@ -5000,6 +5996,18 @@ error: TypeSelector 73 | a+ a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:73:1 + | +73 | a+ a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:73:1 + | +73 | a+ a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:73:1 | @@ -5024,6 +6032,18 @@ error: TypeSelector 73 | a+ a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:73:4 + | +73 | a+ a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:73:4 + | +73 | a+ a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:73:4 | @@ -5072,6 +6092,18 @@ error: TypeSelector 74 | a> a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:74:1 + | +74 | a> a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:74:1 + | +74 | a> a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:74:1 | @@ -5096,6 +6128,18 @@ error: TypeSelector 74 | a> a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:74:4 + | +74 | a> a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:74:4 + | +74 | a> a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:74:4 | @@ -5144,6 +6188,18 @@ error: TypeSelector 75 | a~ a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:75:1 + | +75 | a~ a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:75:1 + | +75 | a~ a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:75:1 | @@ -5168,6 +6224,18 @@ error: TypeSelector 75 | a~ a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:75:4 + | +75 | a~ a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:75:4 + | +75 | a~ a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:75:4 | @@ -5216,6 +6284,18 @@ error: TypeSelector 76 | a +a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:76:1 + | +76 | a +a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:76:1 + | +76 | a +a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:76:1 | @@ -5240,6 +6320,18 @@ error: TypeSelector 76 | a +a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:76:4 + | +76 | a +a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:76:4 + | +76 | a +a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:76:4 | @@ -5288,6 +6380,18 @@ error: TypeSelector 77 | a >a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:77:1 + | +77 | a >a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:77:1 + | +77 | a >a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:77:1 | @@ -5312,6 +6416,18 @@ error: TypeSelector 77 | a >a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:77:4 + | +77 | a >a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:77:4 + | +77 | a >a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:77:4 | @@ -5360,6 +6476,18 @@ error: TypeSelector 78 | a ~a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:78:1 + | +78 | a ~a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:78:1 + | +78 | a ~a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:78:1 | @@ -5384,6 +6512,18 @@ error: TypeSelector 78 | a ~a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:78:4 + | +78 | a ~a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:78:4 + | +78 | a ~a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:78:4 | @@ -5432,6 +6572,18 @@ error: TypeSelector 79 | a+a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:79:1 + | +79 | a+a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:79:1 + | +79 | a+a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:79:1 | @@ -5456,6 +6608,18 @@ error: TypeSelector 79 | a+a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:79:3 + | +79 | a+a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:79:3 + | +79 | a+a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:79:3 | @@ -5504,6 +6668,18 @@ error: TypeSelector 80 | a>a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:80:1 + | +80 | a>a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:80:1 + | +80 | a>a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:80:1 | @@ -5528,6 +6704,18 @@ error: TypeSelector 80 | a>a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:80:3 + | +80 | a>a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:80:3 + | +80 | a>a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:80:3 | @@ -5576,6 +6764,18 @@ error: TypeSelector 81 | a~a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:81:1 + | +81 | a~a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:81:1 + | +81 | a~a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:81:1 | @@ -5600,6 +6800,18 @@ error: TypeSelector 81 | a~a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:81:3 + | +81 | a~a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:81:3 + | +81 | a~a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:81:3 | @@ -5648,6 +6860,18 @@ error: TypeSelector 82 | a [type='button'] {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:82:1 + | +82 | a [type='button'] {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:82:1 + | +82 | a [type='button'] {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:82:1 | @@ -5672,18 +6896,36 @@ error: SubclassSelector 82 | a [type='button'] {} | ^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:82:3 | 82 | a [type='button'] {} | ^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:82:4 + | +82 | a [type='button'] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:82:4 | 82 | a [type='button'] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/complex/input.css:82:8 + | +82 | a [type='button'] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/complex/input.css:82:9 + | +82 | a [type='button'] {} + | ^^^^^^^^ + error: Str --> $DIR/tests/fixture/selector/complex/input.css:82:9 | @@ -5736,6 +6978,18 @@ error: TypeSelector 83 | a | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:83:1 + | +83 | a + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:83:1 + | +83 | a + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:83:1 | @@ -5762,18 +7016,36 @@ error: SubclassSelector 84 | [type='button'] {} | ^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:84:1 | 84 | [type='button'] {} | ^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:84:2 + | +84 | [type='button'] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:84:2 | 84 | [type='button'] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/complex/input.css:84:6 + | +84 | [type='button'] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/complex/input.css:84:7 + | +84 | [type='button'] {} + | ^^^^^^^^ + error: Str --> $DIR/tests/fixture/selector/complex/input.css:84:7 | @@ -5822,6 +7094,18 @@ error: TypeSelector 85 | a a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:85:1 + | +85 | a a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:85:1 + | +85 | a a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:85:1 | @@ -5846,6 +7130,18 @@ error: TypeSelector 85 | a a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:85:5 + | +85 | a a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:85:5 + | +85 | a a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:85:5 | @@ -5894,6 +7190,24 @@ error: TypeSelector 86 | namespace|type#id > .foo {} | ^^^^^^^^^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:86:1 + | +86 | namespace|type#id > .foo {} + | ^^^^^^^^^^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:86:1 + | +86 | namespace|type#id > .foo {} + | ^^^^^^^^^^^^^^ + +error: NsPrefix + --> $DIR/tests/fixture/selector/complex/input.css:86:1 + | +86 | namespace|type#id > .foo {} + | ^^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:86:1 | @@ -6110,6 +7424,18 @@ error: TypeSelector 88 | a c, d + e h {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:88:1 + | +88 | a c, d + e h {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:88:1 + | +88 | a c, d + e h {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:88:1 | @@ -6134,6 +7460,18 @@ error: TypeSelector 88 | a c, d + e h {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:88:3 + | +88 | a c, d + e h {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:88:3 + | +88 | a c, d + e h {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:88:3 | @@ -6158,6 +7496,18 @@ error: TypeSelector 88 | a c, d + e h {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:88:6 + | +88 | a c, d + e h {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:88:6 + | +88 | a c, d + e h {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:88:6 | @@ -6182,6 +7532,18 @@ error: TypeSelector 88 | a c, d + e h {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:88:10 + | +88 | a c, d + e h {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:88:10 + | +88 | a c, d + e h {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:88:10 | @@ -6206,6 +7568,18 @@ error: TypeSelector 88 | a c, d + e h {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:88:12 + | +88 | a c, d + e h {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:88:12 + | +88 | a c, d + e h {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:88:12 | @@ -6254,6 +7628,18 @@ error: TypeSelector 89 | a ~ h + d {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:89:1 + | +89 | a ~ h + d {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:89:1 + | +89 | a ~ h + d {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:89:1 | @@ -6278,6 +7664,18 @@ error: TypeSelector 89 | a ~ h + d {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:89:5 + | +89 | a ~ h + d {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:89:5 + | +89 | a ~ h + d {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:89:5 | @@ -6302,6 +7700,18 @@ error: TypeSelector 89 | a ~ h + d {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:89:9 + | +89 | a ~ h + d {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:89:9 + | +89 | a ~ h + d {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:89:9 | @@ -6350,6 +7760,18 @@ error: TypeSelector 90 | div div div div div div div div div div div {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:90:1 + | +90 | div div div div div div div div div div div {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:90:1 + | +90 | div div div div div div div div div div div {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:90:1 | @@ -6374,6 +7796,18 @@ error: TypeSelector 90 | div div div div div div div div div div div {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:90:5 + | +90 | div div div div div div div div div div div {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:90:5 + | +90 | div div div div div div div div div div div {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:90:5 | @@ -6398,6 +7832,18 @@ error: TypeSelector 90 | div div div div div div div div div div div {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:90:9 + | +90 | div div div div div div div div div div div {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:90:9 + | +90 | div div div div div div div div div div div {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:90:9 | @@ -6422,6 +7868,18 @@ error: TypeSelector 90 | div div div div div div div div div div div {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:90:13 + | +90 | div div div div div div div div div div div {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:90:13 + | +90 | div div div div div div div div div div div {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:90:13 | @@ -6446,6 +7904,18 @@ error: TypeSelector 90 | div div div div div div div div div div div {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:90:17 + | +90 | div div div div div div div div div div div {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:90:17 + | +90 | div div div div div div div div div div div {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:90:17 | @@ -6470,6 +7940,18 @@ error: TypeSelector 90 | div div div div div div div div div div div {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:90:21 + | +90 | div div div div div div div div div div div {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:90:21 + | +90 | div div div div div div div div div div div {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:90:21 | @@ -6494,6 +7976,18 @@ error: TypeSelector 90 | div div div div div div div div div div div {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:90:25 + | +90 | div div div div div div div div div div div {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:90:25 + | +90 | div div div div div div div div div div div {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:90:25 | @@ -6518,6 +8012,18 @@ error: TypeSelector 90 | div div div div div div div div div div div {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:90:29 + | +90 | div div div div div div div div div div div {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:90:29 + | +90 | div div div div div div div div div div div {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:90:29 | @@ -6542,6 +8048,18 @@ error: TypeSelector 90 | div div div div div div div div div div div {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:90:33 + | +90 | div div div div div div div div div div div {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:90:33 + | +90 | div div div div div div div div div div div {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:90:33 | @@ -6566,6 +8084,18 @@ error: TypeSelector 90 | div div div div div div div div div div div {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:90:37 + | +90 | div div div div div div div div div div div {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:90:37 + | +90 | div div div div div div div div div div div {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:90:37 | @@ -6590,6 +8120,18 @@ error: TypeSelector 90 | div div div div div div div div div div div {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:90:41 + | +90 | div div div div div div div div div div div {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:90:41 + | +90 | div div div div div div div div div div div {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:90:41 | @@ -6638,12 +8180,18 @@ error: SubclassSelector 91 | [href][class][name] h1 > h2 {} | ^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:91:1 | 91 | [href][class][name] h1 > h2 {} | ^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:91:2 + | +91 | [href][class][name] h1 > h2 {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:91:2 | @@ -6656,12 +8204,18 @@ error: SubclassSelector 91 | [href][class][name] h1 > h2 {} | ^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:91:7 | 91 | [href][class][name] h1 > h2 {} | ^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:91:8 + | +91 | [href][class][name] h1 > h2 {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:91:8 | @@ -6674,12 +8228,18 @@ error: SubclassSelector 91 | [href][class][name] h1 > h2 {} | ^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:91:14 | 91 | [href][class][name] h1 > h2 {} | ^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:91:15 + | +91 | [href][class][name] h1 > h2 {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:91:15 | @@ -6704,6 +8264,18 @@ error: TypeSelector 91 | [href][class][name] h1 > h2 {} | ^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:91:21 + | +91 | [href][class][name] h1 > h2 {} + | ^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:91:21 + | +91 | [href][class][name] h1 > h2 {} + | ^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:91:21 | @@ -6728,6 +8300,18 @@ error: TypeSelector 91 | [href][class][name] h1 > h2 {} | ^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:91:26 + | +91 | [href][class][name] h1 > h2 {} + | ^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:91:26 + | +91 | [href][class][name] h1 > h2 {} + | ^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:91:26 | @@ -6776,18 +8360,36 @@ error: SubclassSelector 92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} | ^^^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:92:1 | 92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} | ^^^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:92:2 + | +92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:92:2 | 92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/complex/input.css:92:6 + | +92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/complex/input.css:92:8 + | +92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} + | ^^^^^^^^^^ + error: Str --> $DIR/tests/fixture/selector/complex/input.css:92:8 | @@ -6800,18 +8402,36 @@ error: SubclassSelector 92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} | ^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:92:19 | 92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} | ^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:92:20 + | +92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:92:20 | 92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} | ^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/complex/input.css:92:23 + | +92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/complex/input.css:92:24 + | +92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} + | ^^^^^^^^^^ + error: Str --> $DIR/tests/fixture/selector/complex/input.css:92:24 | @@ -6824,12 +8444,18 @@ error: SubclassSelector 92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} | ^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:92:35 | 92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} | ^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:92:36 + | +92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} + | ^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:92:36 | @@ -6842,18 +8468,36 @@ error: SubclassSelector 92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} | ^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:92:39 | 92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} | ^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:92:40 + | +92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:92:40 | 92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} | ^^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/complex/input.css:92:45 + | +92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/complex/input.css:92:47 + | +92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} + | ^^^^^^ + error: Str --> $DIR/tests/fixture/selector/complex/input.css:92:47 | @@ -6878,12 +8522,18 @@ error: SubclassSelector 92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} | ^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:92:57 | 92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} | ^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:92:58 + | +92 | [href*="test.com"][rel='external'][id][class~="test"] > [name] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:92:58 | @@ -6932,18 +8582,36 @@ error: SubclassSelector 93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:93:1 | 93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:93:2 + | +93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} + | ^^^^^^^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:93:2 | 93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} | ^^^^^^^^^^^^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/complex/input.css:93:17 + | +93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/complex/input.css:93:19 + | +93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} + | ^^^^^^^^^^^^^^^^^ + error: Str --> $DIR/tests/fixture/selector/complex/input.css:93:19 | @@ -6968,18 +8636,36 @@ error: SubclassSelector 93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:93:39 | 93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:93:40 + | +93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} + | ^^^^^^^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:93:40 | 93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} | ^^^^^^^^^^^^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/complex/input.css:93:55 + | +93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/complex/input.css:93:57 + | +93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} + | ^^^^^^^^^^^^^^^^^ + error: Str --> $DIR/tests/fixture/selector/complex/input.css:93:57 | @@ -7004,18 +8690,36 @@ error: SubclassSelector 93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:93:77 | 93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:93:78 + | +93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} + | ^^^^^^^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:93:78 | 93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} | ^^^^^^^^^^^^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/complex/input.css:93:93 + | +93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/complex/input.css:93:95 + | +93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} + | ^^^^^^^^^^^^^^^^^ + error: Str --> $DIR/tests/fixture/selector/complex/input.css:93:95 | @@ -7040,18 +8744,36 @@ error: SubclassSelector 93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:93:115 | 93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:93:116 + | +93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} + | ^^^^^^^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:93:116 | 93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} | ^^^^^^^^^^^^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/complex/input.css:93:131 + | +93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/complex/input.css:93:133 + | +93 | [data-weird-attr*="Something=weird"], [data-weird-attr^="Something=weird"], [data-weird-attr$="Something=weird"], [data-weird-attr|="Something=weird"] {} + | ^^^^^^^^^^^^^^^^^ + error: Str --> $DIR/tests/fixture/selector/complex/input.css:93:133 | @@ -7100,7 +8822,7 @@ error: TypeSelector 94 | * + * {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/complex/input.css:94:1 | 94 | * + * {} @@ -7124,7 +8846,7 @@ error: TypeSelector 94 | * + * {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/complex/input.css:94:5 | 94 | * + * {} @@ -7172,7 +8894,7 @@ error: TypeSelector 95 | * * {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/complex/input.css:95:1 | 95 | * * {} @@ -7196,7 +8918,7 @@ error: TypeSelector 95 | * * {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/complex/input.css:95:3 | 95 | * * {} @@ -7244,7 +8966,7 @@ error: TypeSelector 96 | * * {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/complex/input.css:96:1 | 96 | * * {} @@ -7268,7 +8990,7 @@ error: TypeSelector 96 | * * {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/complex/input.css:96:11 | 96 | * * {} @@ -7316,7 +9038,7 @@ error: TypeSelector 97 | *[href] *:not(*.green) {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/complex/input.css:97:1 | 97 | *[href] *:not(*.green) {} @@ -7328,12 +9050,18 @@ error: SubclassSelector 97 | *[href] *:not(*.green) {} | ^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/complex/input.css:97:2 | 97 | *[href] *:not(*.green) {} | ^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:97:3 + | +97 | *[href] *:not(*.green) {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/complex/input.css:97:3 | @@ -7358,7 +9086,7 @@ error: TypeSelector 97 | *[href] *:not(*.green) {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/complex/input.css:97:9 | 97 | *[href] *:not(*.green) {} @@ -7448,7 +9176,7 @@ error: TypeSelector 98 | *::-webkit-media-controls-play-button {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/complex/input.css:98:1 | 98 | *::-webkit-media-controls-play-button {} @@ -7478,3 +9206,355 @@ error: Block 98 | *::-webkit-media-controls-play-button {} | ^^ +error: Rule + --> $DIR/tests/fixture/selector/complex/input.css:99:1 + | +99 | col.selected || td {} + | ^^^^^^^^^^^^^^^^^^^^^ + +error: QualifiedRule + --> $DIR/tests/fixture/selector/complex/input.css:99:1 + | +99 | col.selected || td {} + | ^^^^^^^^^^^^^^^^^^^^^ + +error: SelectorList + --> $DIR/tests/fixture/selector/complex/input.css:99:1 + | +99 | col.selected || td {} + | ^^^^^^^^^^^^^^^^^^ + +error: ComplexSelector + --> $DIR/tests/fixture/selector/complex/input.css:99:1 + | +99 | col.selected || td {} + | ^^^^^^^^^^^^^^^^^^ + +error: CompoundSelector + --> $DIR/tests/fixture/selector/complex/input.css:99:1 + | +99 | col.selected || td {} + | ^^^^^^^^^^^^ + +error: TypeSelector + --> $DIR/tests/fixture/selector/complex/input.css:99:1 + | +99 | col.selected || td {} + | ^^^ + +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:99:1 + | +99 | col.selected || td {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:99:1 + | +99 | col.selected || td {} + | ^^^ + +error: Ident + --> $DIR/tests/fixture/selector/complex/input.css:99:1 + | +99 | col.selected || td {} + | ^^^ + +error: SubclassSelector + --> $DIR/tests/fixture/selector/complex/input.css:99:4 + | +99 | col.selected || td {} + | ^^^^^^^^^ + +error: ClassSelector + --> $DIR/tests/fixture/selector/complex/input.css:99:4 + | +99 | col.selected || td {} + | ^^^^^^^^^ + +error: Ident + --> $DIR/tests/fixture/selector/complex/input.css:99:5 + | +99 | col.selected || td {} + | ^^^^^^^^ + +error: Combinator + --> $DIR/tests/fixture/selector/complex/input.css:99:14 + | +99 | col.selected || td {} + | ^^ + +error: CompoundSelector + --> $DIR/tests/fixture/selector/complex/input.css:99:17 + | +99 | col.selected || td {} + | ^^ + +error: TypeSelector + --> $DIR/tests/fixture/selector/complex/input.css:99:17 + | +99 | col.selected || td {} + | ^^ + +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:99:17 + | +99 | col.selected || td {} + | ^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:99:17 + | +99 | col.selected || td {} + | ^^ + +error: Ident + --> $DIR/tests/fixture/selector/complex/input.css:99:17 + | +99 | col.selected || td {} + | ^^ + +error: Block + --> $DIR/tests/fixture/selector/complex/input.css:99:20 + | +99 | col.selected || td {} + | ^^ + +error: Rule + --> $DIR/tests/fixture/selector/complex/input.css:100:1 + | +100 | / col.selected +101 | | || +102 | | td +103 | | {} + | |__^ + +error: QualifiedRule + --> $DIR/tests/fixture/selector/complex/input.css:100:1 + | +100 | / col.selected +101 | | || +102 | | td +103 | | {} + | |__^ + +error: SelectorList + --> $DIR/tests/fixture/selector/complex/input.css:100:1 + | +100 | / col.selected +101 | | || +102 | | td + | |__^ + +error: ComplexSelector + --> $DIR/tests/fixture/selector/complex/input.css:100:1 + | +100 | / col.selected +101 | | || +102 | | td + | |__^ + +error: CompoundSelector + --> $DIR/tests/fixture/selector/complex/input.css:100:1 + | +100 | col.selected + | ^^^^^^^^^^^^ + +error: TypeSelector + --> $DIR/tests/fixture/selector/complex/input.css:100:1 + | +100 | col.selected + | ^^^ + +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:100:1 + | +100 | col.selected + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:100:1 + | +100 | col.selected + | ^^^ + +error: Ident + --> $DIR/tests/fixture/selector/complex/input.css:100:1 + | +100 | col.selected + | ^^^ + +error: SubclassSelector + --> $DIR/tests/fixture/selector/complex/input.css:100:4 + | +100 | col.selected + | ^^^^^^^^^ + +error: ClassSelector + --> $DIR/tests/fixture/selector/complex/input.css:100:4 + | +100 | col.selected + | ^^^^^^^^^ + +error: Ident + --> $DIR/tests/fixture/selector/complex/input.css:100:5 + | +100 | col.selected + | ^^^^^^^^ + +error: Combinator + --> $DIR/tests/fixture/selector/complex/input.css:101:1 + | +101 | || + | ^^ + +error: CompoundSelector + --> $DIR/tests/fixture/selector/complex/input.css:102:1 + | +102 | td + | ^^ + +error: TypeSelector + --> $DIR/tests/fixture/selector/complex/input.css:102:1 + | +102 | td + | ^^ + +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:102:1 + | +102 | td + | ^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:102:1 + | +102 | td + | ^^ + +error: Ident + --> $DIR/tests/fixture/selector/complex/input.css:102:1 + | +102 | td + | ^^ + +error: Block + --> $DIR/tests/fixture/selector/complex/input.css:103:1 + | +103 | {} + | ^^ + +error: Rule + --> $DIR/tests/fixture/selector/complex/input.css:104:1 + | +104 | col.selected||td {} + | ^^^^^^^^^^^^^^^^^^^ + +error: QualifiedRule + --> $DIR/tests/fixture/selector/complex/input.css:104:1 + | +104 | col.selected||td {} + | ^^^^^^^^^^^^^^^^^^^ + +error: SelectorList + --> $DIR/tests/fixture/selector/complex/input.css:104:1 + | +104 | col.selected||td {} + | ^^^^^^^^^^^^^^^^ + +error: ComplexSelector + --> $DIR/tests/fixture/selector/complex/input.css:104:1 + | +104 | col.selected||td {} + | ^^^^^^^^^^^^^^^^ + +error: CompoundSelector + --> $DIR/tests/fixture/selector/complex/input.css:104:1 + | +104 | col.selected||td {} + | ^^^^^^^^^^^^ + +error: TypeSelector + --> $DIR/tests/fixture/selector/complex/input.css:104:1 + | +104 | col.selected||td {} + | ^^^ + +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:104:1 + | +104 | col.selected||td {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:104:1 + | +104 | col.selected||td {} + | ^^^ + +error: Ident + --> $DIR/tests/fixture/selector/complex/input.css:104:1 + | +104 | col.selected||td {} + | ^^^ + +error: SubclassSelector + --> $DIR/tests/fixture/selector/complex/input.css:104:4 + | +104 | col.selected||td {} + | ^^^^^^^^^ + +error: ClassSelector + --> $DIR/tests/fixture/selector/complex/input.css:104:4 + | +104 | col.selected||td {} + | ^^^^^^^^^ + +error: Ident + --> $DIR/tests/fixture/selector/complex/input.css:104:5 + | +104 | col.selected||td {} + | ^^^^^^^^ + +error: Combinator + --> $DIR/tests/fixture/selector/complex/input.css:104:13 + | +104 | col.selected||td {} + | ^^ + +error: CompoundSelector + --> $DIR/tests/fixture/selector/complex/input.css:104:15 + | +104 | col.selected||td {} + | ^^ + +error: TypeSelector + --> $DIR/tests/fixture/selector/complex/input.css:104:15 + | +104 | col.selected||td {} + | ^^ + +error: TagNameSelector + --> $DIR/tests/fixture/selector/complex/input.css:104:15 + | +104 | col.selected||td {} + | ^^ + +error: WqName + --> $DIR/tests/fixture/selector/complex/input.css:104:15 + | +104 | col.selected||td {} + | ^^ + +error: Ident + --> $DIR/tests/fixture/selector/complex/input.css:104:15 + | +104 | col.selected||td {} + | ^^ + +error: Block + --> $DIR/tests/fixture/selector/complex/input.css:104:18 + | +104 | col.selected||td {} + | ^^ + diff --git a/crates/swc_css_parser/tests/fixture/selector/compound/output.json b/crates/swc_css_parser/tests/fixture/selector/compound/output.json index 294600c59e3..95659b00fcb 100644 --- a/crates/swc_css_parser/tests/fixture/selector/compound/output.json +++ b/crates/swc_css_parser/tests/fixture/selector/compound/output.json @@ -301,16 +301,24 @@ "end": 45, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 38, "end": 44, "ctxt": 0 }, - "value": "target", - "raw": "target" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 38, + "end": 44, + "ctxt": 0 + }, + "value": "target", + "raw": "target" + } }, "matcher": null, "value": null, @@ -408,16 +416,24 @@ "end": 66, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 59, "end": 65, "ctxt": 0 }, - "value": "target", - "raw": "target" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 59, + "end": 65, + "ctxt": 0 + }, + "value": "target", + "raw": "target" + } }, "matcher": null, "value": null, @@ -600,16 +616,24 @@ "end": 100, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 93, "end": 99, "ctxt": 0 }, - "value": "target", - "raw": "target" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 93, + "end": 99, + "ctxt": 0 + }, + "value": "target", + "raw": "target" + } }, "matcher": null, "value": null, @@ -663,22 +687,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 104, "end": 107, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 104, "end": 107, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 104, + "end": 107, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [ @@ -767,22 +799,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 123, "end": 126, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 123, "end": 126, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 123, + "end": 126, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [ @@ -871,22 +911,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 144, "end": 145, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 144, "end": 145, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 144, + "end": 145, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -897,18 +945,34 @@ "end": 159, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 146, "end": 150, "ctxt": 0 }, - "value": "href", - "raw": "href" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 146, + "end": 150, + "ctxt": 0 + }, + "value": "href", + "raw": "href" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 150, + "end": 151, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { @@ -988,22 +1052,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 169, "end": 170, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 169, "end": 170, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 169, + "end": 170, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -1014,18 +1086,34 @@ "end": 184, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 171, "end": 175, "ctxt": 0 }, - "value": "href", - "raw": "href" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 171, + "end": 175, + "ctxt": 0 + }, + "value": "href", + "raw": "href" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 175, + "end": 176, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { @@ -1208,22 +1296,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 214, "end": 220, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 214, "end": 220, "ctxt": 0 }, - "value": "button", - "raw": "button" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 214, + "end": 220, + "ctxt": 0 + }, + "value": "button", + "raw": "button" + } } }, "subclassSelectors": [ @@ -1293,23 +1389,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 236, "end": 237, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 236, - "end": 237, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [ { diff --git a/crates/swc_css_parser/tests/fixture/selector/compound/span.rust-debug b/crates/swc_css_parser/tests/fixture/selector/compound/span.rust-debug index 9ecbf8cc434..c520f138417 100644 --- a/crates/swc_css_parser/tests/fixture/selector/compound/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/selector/compound/span.rust-debug @@ -262,12 +262,18 @@ error: SubclassSelector 4 | .class[target] {} | ^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/compound/input.css:4:7 | 4 | .class[target] {} | ^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/compound/input.css:4:8 + | +4 | .class[target] {} + | ^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/compound/input.css:4:8 | @@ -352,12 +358,18 @@ error: SubclassSelector 5 | .class#id[target] {} | ^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/compound/input.css:5:10 | 5 | .class#id[target] {} | ^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/compound/input.css:5:11 + | +5 | .class#id[target] {} + | ^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/compound/input.css:5:11 | @@ -514,12 +526,18 @@ error: SubclassSelector 7 | #id.class[target] {} | ^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/compound/input.css:7:10 | 7 | #id.class[target] {} | ^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/compound/input.css:7:11 + | +7 | #id.class[target] {} + | ^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/compound/input.css:7:11 | @@ -568,6 +586,18 @@ error: TypeSelector 8 | div#thing:hover {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/compound/input.css:8:1 + | +8 | div#thing:hover {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/compound/input.css:8:1 + | +8 | div#thing:hover {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/compound/input.css:8:1 | @@ -652,6 +682,18 @@ error: TypeSelector 9 | div#thing::before {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/compound/input.css:9:1 + | +9 | div#thing::before {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/compound/input.css:9:1 + | +9 | div#thing::before {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/compound/input.css:9:1 | @@ -736,6 +778,18 @@ error: TypeSelector 10 | a[href='place']:hover {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/compound/input.css:10:1 + | +10 | a[href='place']:hover {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/compound/input.css:10:1 + | +10 | a[href='place']:hover {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/compound/input.css:10:1 | @@ -748,18 +802,36 @@ error: SubclassSelector 10 | a[href='place']:hover {} | ^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/compound/input.css:10:2 | 10 | a[href='place']:hover {} | ^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/compound/input.css:10:3 + | +10 | a[href='place']:hover {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/compound/input.css:10:3 | 10 | a[href='place']:hover {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/compound/input.css:10:7 + | +10 | a[href='place']:hover {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/compound/input.css:10:8 + | +10 | a[href='place']:hover {} + | ^^^^^^^ + error: Str --> $DIR/tests/fixture/selector/compound/input.css:10:8 | @@ -826,6 +898,18 @@ error: TypeSelector 11 | a[href='place']::before {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/compound/input.css:11:1 + | +11 | a[href='place']::before {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/compound/input.css:11:1 + | +11 | a[href='place']::before {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/compound/input.css:11:1 | @@ -838,18 +922,36 @@ error: SubclassSelector 11 | a[href='place']::before {} | ^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/compound/input.css:11:2 | 11 | a[href='place']::before {} | ^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/compound/input.css:11:3 + | +11 | a[href='place']::before {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/compound/input.css:11:3 | 11 | a[href='place']::before {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/compound/input.css:11:7 + | +11 | a[href='place']::before {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/compound/input.css:11:8 + | +11 | a[href='place']::before {} + | ^^^^^^^ + error: Str --> $DIR/tests/fixture/selector/compound/input.css:11:8 | @@ -1006,6 +1108,18 @@ error: TypeSelector 13 | button.btn-primary {} | ^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/compound/input.css:13:1 + | +13 | button.btn-primary {} + | ^^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/compound/input.css:13:1 + | +13 | button.btn-primary {} + | ^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/compound/input.css:13:1 | @@ -1072,7 +1186,7 @@ error: TypeSelector 14 | *#z98y {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/compound/input.css:14:1 | 14 | *#z98y {} diff --git a/crates/swc_css_parser/tests/fixture/selector/id/output.json b/crates/swc_css_parser/tests/fixture/selector/id/output.json index 1a5fce96a26..07bbac328fc 100644 --- a/crates/swc_css_parser/tests/fixture/selector/id/output.json +++ b/crates/swc_css_parser/tests/fixture/selector/id/output.json @@ -2579,16 +2579,24 @@ "end": 687, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 680, "end": 686, "ctxt": 0 }, - "value": "target", - "raw": "target" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 680, + "end": 686, + "ctxt": 0 + }, + "value": "target", + "raw": "target" + } }, "matcher": null, "value": null, @@ -2642,22 +2650,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 691, "end": 694, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 691, "end": 694, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 691, + "end": 694, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [ @@ -2746,22 +2762,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 710, "end": 713, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 710, "end": 713, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 710, + "end": 713, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [ @@ -2870,22 +2894,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 739, "end": 742, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 739, "end": 742, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 739, + "end": 742, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [ @@ -3000,18 +3032,34 @@ "end": 774, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 765, "end": 769, "ctxt": 0 }, - "value": "lang", - "raw": "lang" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 765, + "end": 769, + "ctxt": 0 + }, + "value": "lang", + "raw": "lang" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 769, + "end": 771, + "ctxt": 0 + }, + "value": "^=" }, - "matcher": "^=", "value": { "type": "Identifier", "span": { diff --git a/crates/swc_css_parser/tests/fixture/selector/id/span.rust-debug b/crates/swc_css_parser/tests/fixture/selector/id/span.rust-debug index 855c5963e44..330c40aca71 100644 --- a/crates/swc_css_parser/tests/fixture/selector/id/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/selector/id/span.rust-debug @@ -2098,12 +2098,18 @@ error: SubclassSelector 38 | #id.class[target] {} | ^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/id/input.css:38:10 | 38 | #id.class[target] {} | ^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/id/input.css:38:11 + | +38 | #id.class[target] {} + | ^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/id/input.css:38:11 | @@ -2152,6 +2158,18 @@ error: TypeSelector 39 | div#thing:hover {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/id/input.css:39:1 + | +39 | div#thing:hover {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/id/input.css:39:1 + | +39 | div#thing:hover {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/id/input.css:39:1 | @@ -2236,6 +2254,18 @@ error: TypeSelector 40 | div#thing:nth-child(2n+1) {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/id/input.css:40:1 + | +40 | div#thing:nth-child(2n+1) {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/id/input.css:40:1 + | +40 | div#thing:nth-child(2n+1) {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/id/input.css:40:1 | @@ -2332,6 +2362,18 @@ error: TypeSelector 41 | div#thing::before {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/id/input.css:41:1 + | +41 | div#thing::before {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/id/input.css:41:1 + | +41 | div#thing::before {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/id/input.css:41:1 | @@ -2434,18 +2476,36 @@ error: SubclassSelector 42 | #foo[lang^=en] {} | ^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/id/input.css:42:5 | 42 | #foo[lang^=en] {} | ^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/id/input.css:42:6 + | +42 | #foo[lang^=en] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/id/input.css:42:6 | 42 | #foo[lang^=en] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/id/input.css:42:10 + | +42 | #foo[lang^=en] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/id/input.css:42:12 + | +42 | #foo[lang^=en] {} + | ^^ + error: Ident --> $DIR/tests/fixture/selector/id/input.css:42:12 | diff --git a/crates/swc_css_parser/tests/fixture/selector/list/output.json b/crates/swc_css_parser/tests/fixture/selector/list/output.json index 18126bf2ee8..6d8ec88b64e 100644 --- a/crates/swc_css_parser/tests/fixture/selector/list/output.json +++ b/crates/swc_css_parser/tests/fixture/selector/list/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -77,22 +85,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 5, "end": 6, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 5, "end": 6, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 5, + "end": 6, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -143,22 +159,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 10, "end": 13, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 10, "end": 13, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 10, + "end": 13, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -182,22 +206,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 16, "end": 17, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 16, "end": 17, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 16, + "end": 17, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -248,22 +280,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 21, "end": 24, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 21, "end": 24, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 21, + "end": 24, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -287,22 +327,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 31, "end": 32, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 31, "end": 32, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 31, + "end": 32, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -353,22 +401,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 38, "end": 39, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 38, "end": 39, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 38, + "end": 39, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -392,22 +448,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 41, "end": 42, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 41, "end": 42, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 41, + "end": 42, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -418,18 +482,34 @@ "end": 56, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 43, "end": 47, "ctxt": 0 }, - "value": "href", - "raw": "href" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 43, + "end": 47, + "ctxt": 0 + }, + "value": "href", + "raw": "href" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 47, + "end": 48, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { @@ -490,22 +570,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 60, "end": 61, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 60, "end": 61, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 60, + "end": 61, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -575,18 +663,34 @@ "end": 80, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 70, "end": 73, "ctxt": 0 }, - "value": "foo", - "raw": "foo" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 70, + "end": 73, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 73, + "end": 74, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { @@ -687,22 +791,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 90, "end": 93, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 90, "end": 93, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 90, + "end": 93, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -726,22 +838,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 95, "end": 96, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 95, "end": 96, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 95, + "end": 96, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -765,22 +885,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 98, "end": 99, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 98, "end": 99, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 98, + "end": 99, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -831,22 +959,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 103, "end": 106, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 103, "end": 106, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 103, + "end": 106, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -870,22 +1006,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 107, "end": 108, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 107, "end": 108, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 107, + "end": 108, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -909,22 +1053,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 109, "end": 110, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 109, "end": 110, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 109, + "end": 110, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -975,22 +1127,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 113, "end": 116, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 113, "end": 116, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 113, + "end": 116, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -1014,22 +1174,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 123, "end": 124, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 123, "end": 124, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 123, + "end": 124, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -1053,22 +1221,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 131, "end": 132, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 131, "end": 132, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 131, + "end": 132, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -1119,22 +1295,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 138, "end": 141, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 138, "end": 141, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 138, + "end": 141, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -1158,22 +1342,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 145, "end": 146, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 145, "end": 146, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 145, + "end": 146, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] @@ -1197,22 +1389,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 150, "end": 151, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 150, "end": 151, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 150, + "end": 151, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -1343,23 +1543,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 168, "end": 169, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 168, - "end": 169, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [ { @@ -1428,22 +1618,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 177, "end": 182, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 177, "end": 182, "ctxt": 0 }, - "value": "input", - "raw": "input" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 177, + "end": 182, + "ctxt": 0 + }, + "value": "input", + "raw": "input" + } } }, "subclassSelectors": [ @@ -1487,22 +1685,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 202, "end": 207, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 202, "end": 207, "ctxt": 0 }, - "value": "input", - "raw": "input" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 202, + "end": 207, + "ctxt": 0 + }, + "value": "input", + "raw": "input" + } } }, "subclassSelectors": [ @@ -1573,22 +1779,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 224, "end": 225, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 224, "end": 225, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 224, + "end": 225, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -1612,22 +1826,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 226, "end": 227, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 226, "end": 227, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 226, + "end": 227, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] @@ -1651,22 +1873,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 228, "end": 229, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 228, "end": 229, "ctxt": 0 }, - "value": "c", - "raw": "c" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 228, + "end": 229, + "ctxt": 0 + }, + "value": "c", + "raw": "c" + } } }, "subclassSelectors": [] @@ -1690,22 +1920,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 230, "end": 231, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 230, "end": 231, "ctxt": 0 }, - "value": "d", - "raw": "d" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 230, + "end": 231, + "ctxt": 0 + }, + "value": "d", + "raw": "d" + } } }, "subclassSelectors": [] @@ -1729,22 +1967,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 232, "end": 233, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 232, "end": 233, "ctxt": 0 }, - "value": "e", - "raw": "e" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 232, + "end": 233, + "ctxt": 0 + }, + "value": "e", + "raw": "e" + } } }, "subclassSelectors": [] @@ -1768,22 +2014,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 234, "end": 235, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 234, "end": 235, "ctxt": 0 }, - "value": "f", - "raw": "f" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 234, + "end": 235, + "ctxt": 0 + }, + "value": "f", + "raw": "f" + } } }, "subclassSelectors": [] @@ -1807,22 +2061,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 236, "end": 237, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 236, "end": 237, "ctxt": 0 }, - "value": "g", - "raw": "g" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 236, + "end": 237, + "ctxt": 0 + }, + "value": "g", + "raw": "g" + } } }, "subclassSelectors": [] @@ -1873,22 +2135,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 241, "end": 242, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 241, "end": 242, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 241, + "end": 242, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -1912,22 +2182,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 244, "end": 245, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 244, "end": 245, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 244, + "end": 245, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] @@ -1951,22 +2229,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 247, "end": 248, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 247, "end": 248, "ctxt": 0 }, - "value": "c", - "raw": "c" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 247, + "end": 248, + "ctxt": 0 + }, + "value": "c", + "raw": "c" + } } }, "subclassSelectors": [] @@ -1990,22 +2276,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 250, "end": 251, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 250, "end": 251, "ctxt": 0 }, - "value": "d", - "raw": "d" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 250, + "end": 251, + "ctxt": 0 + }, + "value": "d", + "raw": "d" + } } }, "subclassSelectors": [] @@ -2029,22 +2323,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 253, "end": 254, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 253, "end": 254, "ctxt": 0 }, - "value": "e", - "raw": "e" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 253, + "end": 254, + "ctxt": 0 + }, + "value": "e", + "raw": "e" + } } }, "subclassSelectors": [] @@ -2068,22 +2370,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 256, "end": 257, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 256, "end": 257, "ctxt": 0 }, - "value": "f", - "raw": "f" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 256, + "end": 257, + "ctxt": 0 + }, + "value": "f", + "raw": "f" + } } }, "subclassSelectors": [] @@ -2107,22 +2417,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 259, "end": 260, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 259, "end": 260, "ctxt": 0 }, - "value": "g", - "raw": "g" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 259, + "end": 260, + "ctxt": 0 + }, + "value": "g", + "raw": "g" + } } }, "subclassSelectors": [] @@ -2173,23 +2491,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 264, "end": 265, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 264, - "end": 265, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [] } @@ -2212,23 +2520,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 267, "end": 268, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 267, - "end": 268, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [] } @@ -2385,22 +2683,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 285, "end": 287, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 285, "end": 287, "ctxt": 0 }, - "value": "h1", - "raw": "h1" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 285, + "end": 287, + "ctxt": 0 + }, + "value": "h1", + "raw": "h1" + } } }, "subclassSelectors": [] @@ -2424,22 +2730,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 289, "end": 291, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 289, "end": 291, "ctxt": 0 }, - "value": "h2", - "raw": "h2" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 289, + "end": 291, + "ctxt": 0 + }, + "value": "h2", + "raw": "h2" + } } }, "subclassSelectors": [] @@ -2605,16 +2919,24 @@ "end": 317, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 312, "end": 316, "ctxt": 0 }, - "value": "attr", - "raw": "attr" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 312, + "end": 316, + "ctxt": 0 + }, + "value": "attr", + "raw": "attr" + } }, "matcher": null, "value": null, @@ -2649,16 +2971,24 @@ "end": 328, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 320, "end": 327, "ctxt": 0 }, - "value": "attrtoo", - "raw": "attrtoo" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 320, + "end": 327, + "ctxt": 0 + }, + "value": "attrtoo", + "raw": "attrtoo" + } }, "matcher": null, "value": null, diff --git a/crates/swc_css_parser/tests/fixture/selector/list/span.rust-debug b/crates/swc_css_parser/tests/fixture/selector/list/span.rust-debug index 5da4627eb23..6a10ee0df62 100644 --- a/crates/swc_css_parser/tests/fixture/selector/list/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/selector/list/span.rust-debug @@ -46,6 +46,18 @@ error: TypeSelector 1 | div, p {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:1:1 + | +1 | div, p {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:1:1 + | +1 | div, p {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:1:1 | @@ -70,6 +82,18 @@ error: TypeSelector 1 | div, p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:1:6 + | +1 | div, p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:1:6 + | +1 | div, p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:1:6 | @@ -118,6 +142,18 @@ error: TypeSelector 2 | div , p {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:2:1 + | +2 | div , p {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:2:1 + | +2 | div , p {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:2:1 | @@ -142,6 +178,18 @@ error: TypeSelector 2 | div , p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:2:7 + | +2 | div , p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:2:7 + | +2 | div , p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:2:7 | @@ -190,6 +238,18 @@ error: TypeSelector 3 | div , p {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:3:1 + | +3 | div , p {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:3:1 + | +3 | div , p {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:3:1 | @@ -214,6 +274,18 @@ error: TypeSelector 3 | div , p {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:3:11 + | +3 | div , p {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:3:11 + | +3 | div , p {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:3:11 | @@ -262,6 +334,18 @@ error: TypeSelector 4 | a, a[href='place'] {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:4:1 + | +4 | a, a[href='place'] {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:4:1 + | +4 | a, a[href='place'] {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:4:1 | @@ -286,6 +370,18 @@ error: TypeSelector 4 | a, a[href='place'] {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:4:4 + | +4 | a, a[href='place'] {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:4:4 + | +4 | a, a[href='place'] {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:4:4 | @@ -298,18 +394,36 @@ error: SubclassSelector 4 | a, a[href='place'] {} | ^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/list/input.css:4:5 | 4 | a, a[href='place'] {} | ^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:4:6 + | +4 | a, a[href='place'] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:4:6 | 4 | a, a[href='place'] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/list/input.css:4:10 + | +4 | a, a[href='place'] {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/list/input.css:4:11 + | +4 | a, a[href='place'] {} + | ^^^^^^^ + error: Str --> $DIR/tests/fixture/selector/list/input.css:4:11 | @@ -358,6 +472,18 @@ error: TypeSelector 5 | a #foo > [foo='bar'], .FOO {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:5:1 + | +5 | a #foo > [foo='bar'], .FOO {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:5:1 + | +5 | a #foo > [foo='bar'], .FOO {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:5:1 | @@ -412,18 +538,36 @@ error: SubclassSelector 5 | a #foo > [foo='bar'], .FOO {} | ^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/list/input.css:5:10 | 5 | a #foo > [foo='bar'], .FOO {} | ^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:5:11 + | +5 | a #foo > [foo='bar'], .FOO {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:5:11 | 5 | a #foo > [foo='bar'], .FOO {} | ^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/list/input.css:5:14 + | +5 | a #foo > [foo='bar'], .FOO {} + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/list/input.css:5:15 + | +5 | a #foo > [foo='bar'], .FOO {} + | ^^^^^ + error: Str --> $DIR/tests/fixture/selector/list/input.css:5:15 | @@ -502,6 +646,18 @@ error: TypeSelector 6 | div, p, a {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:6:1 + | +6 | div, p, a {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:6:1 + | +6 | div, p, a {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:6:1 | @@ -526,6 +682,18 @@ error: TypeSelector 6 | div, p, a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:6:6 + | +6 | div, p, a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:6:6 + | +6 | div, p, a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:6:6 | @@ -550,6 +718,18 @@ error: TypeSelector 6 | div, p, a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:6:9 + | +6 | div, p, a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:6:9 + | +6 | div, p, a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:6:9 | @@ -598,6 +778,18 @@ error: TypeSelector 7 | div,p,a{} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:7:1 + | +7 | div,p,a{} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:7:1 + | +7 | div,p,a{} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:7:1 | @@ -622,6 +814,18 @@ error: TypeSelector 7 | div,p,a{} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:7:5 + | +7 | div,p,a{} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:7:5 + | +7 | div,p,a{} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:7:5 | @@ -646,6 +850,18 @@ error: TypeSelector 7 | div,p,a{} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:7:7 + | +7 | div,p,a{} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:7:7 + | +7 | div,p,a{} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:7:7 | @@ -694,6 +910,18 @@ error: TypeSelector 8 | div , p , a {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:8:1 + | +8 | div , p , a {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:8:1 + | +8 | div , p , a {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:8:1 | @@ -718,6 +946,18 @@ error: TypeSelector 8 | div , p , a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:8:11 + | +8 | div , p , a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:8:11 + | +8 | div , p , a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:8:11 | @@ -742,6 +982,18 @@ error: TypeSelector 8 | div , p , a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:8:19 + | +8 | div , p , a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:8:19 + | +8 | div , p , a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:8:19 | @@ -804,6 +1056,18 @@ error: TypeSelector 9 | div | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:9:1 + | +9 | div + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:9:1 + | +9 | div + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:9:1 | @@ -828,6 +1092,18 @@ error: TypeSelector 11 | p | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:11:1 + | +11 | p + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:11:1 + | +11 | p + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:11:1 | @@ -852,6 +1128,18 @@ error: TypeSelector 13 | a | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:13:1 + | +13 | a + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:13:1 + | +13 | a + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:13:1 | @@ -960,7 +1248,7 @@ error: TypeSelector 15 | .foo, .bar, *.baz {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/list/input.css:15:13 | 15 | .foo, .bar, *.baz {} @@ -1026,6 +1314,18 @@ error: TypeSelector 16 | input::-moz-placeholder, input::placeholder {} | ^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:16:1 + | +16 | input::-moz-placeholder, input::placeholder {} + | ^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:16:1 + | +16 | input::-moz-placeholder, input::placeholder {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:16:1 | @@ -1068,6 +1368,18 @@ error: TypeSelector 16 | input::-moz-placeholder, input::placeholder {} | ^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:16:26 + | +16 | input::-moz-placeholder, input::placeholder {} + | ^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:16:26 + | +16 | input::-moz-placeholder, input::placeholder {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:16:26 | @@ -1134,6 +1446,18 @@ error: TypeSelector 17 | a,b,c,d,e,f,g {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:17:1 + | +17 | a,b,c,d,e,f,g {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:17:1 + | +17 | a,b,c,d,e,f,g {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:17:1 | @@ -1158,6 +1482,18 @@ error: TypeSelector 17 | a,b,c,d,e,f,g {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:17:3 + | +17 | a,b,c,d,e,f,g {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:17:3 + | +17 | a,b,c,d,e,f,g {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:17:3 | @@ -1182,6 +1518,18 @@ error: TypeSelector 17 | a,b,c,d,e,f,g {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:17:5 + | +17 | a,b,c,d,e,f,g {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:17:5 + | +17 | a,b,c,d,e,f,g {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:17:5 | @@ -1206,6 +1554,18 @@ error: TypeSelector 17 | a,b,c,d,e,f,g {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:17:7 + | +17 | a,b,c,d,e,f,g {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:17:7 + | +17 | a,b,c,d,e,f,g {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:17:7 | @@ -1230,6 +1590,18 @@ error: TypeSelector 17 | a,b,c,d,e,f,g {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:17:9 + | +17 | a,b,c,d,e,f,g {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:17:9 + | +17 | a,b,c,d,e,f,g {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:17:9 | @@ -1254,6 +1626,18 @@ error: TypeSelector 17 | a,b,c,d,e,f,g {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:17:11 + | +17 | a,b,c,d,e,f,g {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:17:11 + | +17 | a,b,c,d,e,f,g {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:17:11 | @@ -1278,6 +1662,18 @@ error: TypeSelector 17 | a,b,c,d,e,f,g {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:17:13 + | +17 | a,b,c,d,e,f,g {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:17:13 + | +17 | a,b,c,d,e,f,g {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:17:13 | @@ -1326,6 +1722,18 @@ error: TypeSelector 18 | a, b, c, d, e, f, g {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:18:1 + | +18 | a, b, c, d, e, f, g {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:18:1 + | +18 | a, b, c, d, e, f, g {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:18:1 | @@ -1350,6 +1758,18 @@ error: TypeSelector 18 | a, b, c, d, e, f, g {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:18:4 + | +18 | a, b, c, d, e, f, g {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:18:4 + | +18 | a, b, c, d, e, f, g {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:18:4 | @@ -1374,6 +1794,18 @@ error: TypeSelector 18 | a, b, c, d, e, f, g {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:18:7 + | +18 | a, b, c, d, e, f, g {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:18:7 + | +18 | a, b, c, d, e, f, g {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:18:7 | @@ -1398,6 +1830,18 @@ error: TypeSelector 18 | a, b, c, d, e, f, g {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:18:10 + | +18 | a, b, c, d, e, f, g {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:18:10 + | +18 | a, b, c, d, e, f, g {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:18:10 | @@ -1422,6 +1866,18 @@ error: TypeSelector 18 | a, b, c, d, e, f, g {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:18:13 + | +18 | a, b, c, d, e, f, g {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:18:13 + | +18 | a, b, c, d, e, f, g {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:18:13 | @@ -1446,6 +1902,18 @@ error: TypeSelector 18 | a, b, c, d, e, f, g {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:18:16 + | +18 | a, b, c, d, e, f, g {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:18:16 + | +18 | a, b, c, d, e, f, g {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:18:16 | @@ -1470,6 +1938,18 @@ error: TypeSelector 18 | a, b, c, d, e, f, g {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:18:19 + | +18 | a, b, c, d, e, f, g {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:18:19 + | +18 | a, b, c, d, e, f, g {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:18:19 | @@ -1518,7 +1998,7 @@ error: TypeSelector 19 | *, * {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/list/input.css:19:1 | 19 | *, * {} @@ -1542,7 +2022,7 @@ error: TypeSelector 19 | *, * {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/list/input.css:19:4 | 19 | *, * {} @@ -1674,6 +2154,18 @@ error: TypeSelector 21 | h1, h2 {} | ^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:21:1 + | +21 | h1, h2 {} + | ^^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:21:1 + | +21 | h1, h2 {} + | ^^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:21:1 | @@ -1698,6 +2190,18 @@ error: TypeSelector 21 | h1, h2 {} | ^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/list/input.css:21:5 + | +21 | h1, h2 {} + | ^^ + +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:21:5 + | +21 | h1, h2 {} + | ^^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:21:5 | @@ -1830,12 +2334,18 @@ error: SubclassSelector 23 | [attr], [attrtoo] {} | ^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/list/input.css:23:1 | 23 | [attr], [attrtoo] {} | ^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:23:2 + | +23 | [attr], [attrtoo] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:23:2 | @@ -1860,12 +2370,18 @@ error: SubclassSelector 23 | [attr], [attrtoo] {} | ^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/list/input.css:23:9 | 23 | [attr], [attrtoo] {} | ^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/list/input.css:23:10 + | +23 | [attr], [attrtoo] {} + | ^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/list/input.css:23:10 | diff --git a/crates/swc_css_parser/tests/fixture/selector/pseudo-class/basic/output.json b/crates/swc_css_parser/tests/fixture/selector/pseudo-class/basic/output.json index ef2d960afdf..45b8abc7ad6 100644 --- a/crates/swc_css_parser/tests/fixture/selector/pseudo-class/basic/output.json +++ b/crates/swc_css_parser/tests/fixture/selector/pseudo-class/basic/output.json @@ -174,22 +174,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 22, "end": 28, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 22, "end": 28, "ctxt": 0 }, - "value": "button", - "raw": "button" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 22, + "end": 28, + "ctxt": 0 + }, + "value": "button", + "raw": "button" + } } }, "subclassSelectors": [ @@ -260,22 +268,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 38, "end": 49, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 38, "end": 49, "ctxt": 0 }, - "value": "div:before", - "raw": "div\\:before" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 38, + "end": 49, + "ctxt": 0 + }, + "value": "div:before", + "raw": "div\\:before" + } } }, "subclassSelectors": [] @@ -326,22 +342,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 53, "end": 58, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 53, "end": 58, "ctxt": 0 }, - "value": "div:", - "raw": "div\\:" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 53, + "end": 58, + "ctxt": 0 + }, + "value": "div:", + "raw": "div\\:" + } } }, "subclassSelectors": [ @@ -412,22 +436,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 69, "end": 74, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 69, "end": 74, "ctxt": 0 }, - "value": "iNpUt", - "raw": "iNpUt" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 69, + "end": 74, + "ctxt": 0 + }, + "value": "iNpUt", + "raw": "iNpUt" + } } }, "subclassSelectors": [] @@ -639,22 +671,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 117, "end": 119, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 117, "end": 119, "ctxt": 0 }, - "value": "h1", - "raw": "h1" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 117, + "end": 119, + "ctxt": 0 + }, + "value": "h1", + "raw": "h1" + } } }, "subclassSelectors": [] @@ -705,22 +745,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 123, "end": 128, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 123, "end": 128, "ctxt": 0 }, - "value": "input", - "raw": "input" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 123, + "end": 128, + "ctxt": 0 + }, + "value": "input", + "raw": "input" + } } }, "subclassSelectors": [ @@ -854,22 +902,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 153, "end": 156, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 153, "end": 156, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 153, + "end": 156, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [ @@ -1451,23 +1507,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 366, "end": 367, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 366, - "end": 367, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [ { @@ -1626,22 +1672,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 391, "end": 392, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 391, "end": 392, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 391, + "end": 392, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -1712,22 +1766,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 413, "end": 414, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 413, "end": 414, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 413, + "end": 414, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -1817,22 +1879,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 432, "end": 435, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 432, "end": 435, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 432, + "end": 435, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -1943,22 +2013,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 453, "end": 454, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 453, "end": 454, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 453, + "end": 454, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -2069,22 +2147,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 485, "end": 486, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 485, "end": 486, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 485, + "end": 486, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/selector/pseudo-class/basic/span.rust-debug b/crates/swc_css_parser/tests/fixture/selector/pseudo-class/basic/span.rust-debug index 638845d2a20..ecaadd86d60 100644 --- a/crates/swc_css_parser/tests/fixture/selector/pseudo-class/basic/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/selector/pseudo-class/basic/span.rust-debug @@ -154,6 +154,18 @@ error: TypeSelector 3 | button:hover {} | ^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:3:1 + | +3 | button:hover {} + | ^^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:3:1 + | +3 | button:hover {} + | ^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:3:1 | @@ -220,6 +232,18 @@ error: TypeSelector 4 | div\:before {} | ^^^^^^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:4:1 + | +4 | div\:before {} + | ^^^^^^^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:4:1 + | +4 | div\:before {} + | ^^^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:4:1 | @@ -268,6 +292,18 @@ error: TypeSelector 5 | div\::before {} | ^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:5:1 + | +5 | div\::before {} + | ^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:5:1 + | +5 | div\::before {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:5:1 | @@ -334,6 +370,18 @@ error: TypeSelector 6 | iNpUt {} | ^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:6:1 + | +6 | iNpUt {} + | ^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:6:1 + | +6 | iNpUt {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:6:1 | @@ -478,6 +526,18 @@ error: TypeSelector 7 | :matches(section, article, aside, nav) h1 {} | ^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:7:40 + | +7 | :matches(section, article, aside, nav) h1 {} + | ^^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:7:40 + | +7 | :matches(section, article, aside, nav) h1 {} + | ^^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:7:40 | @@ -526,6 +586,18 @@ error: TypeSelector 8 | input:not([type='submit']) {} | ^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:8:1 + | +8 | input:not([type='submit']) {} + | ^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:8:1 + | +8 | input:not([type='submit']) {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:8:1 | @@ -628,6 +700,18 @@ error: TypeSelector 9 | div.sidebar:has(*:nth-child(5)):not(:has(*:nth-child(6))) {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:9:1 + | +9 | div.sidebar:has(*:nth-child(5)):not(:has(*:nth-child(6))) {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:9:1 + | +9 | div.sidebar:has(*:nth-child(5)):not(:has(*:nth-child(6))) {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:9:1 | @@ -1090,7 +1174,7 @@ error: TypeSelector 13 | *:is(*) {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:13:1 | 13 | *:is(*) {} @@ -1222,6 +1306,18 @@ error: TypeSelector 15 | a:-moz-placeholder {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:15:1 + | +15 | a:-moz-placeholder {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:15:1 + | +15 | a:-moz-placeholder {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:15:1 | @@ -1288,6 +1384,18 @@ error: TypeSelector 16 | a:hover::before {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:16:1 + | +16 | a:hover::before {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:16:1 + | +16 | a:hover::before {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:16:1 | @@ -1372,6 +1480,18 @@ error: TypeSelector 17 | div :nth-child(2) {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:17:1 + | +17 | div :nth-child(2) {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:17:1 + | +17 | div :nth-child(2) {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:17:1 | @@ -1462,6 +1582,18 @@ error: TypeSelector 18 | a:hOvEr {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:18:1 + | +18 | a:hOvEr {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:18:1 + | +18 | a:hOvEr {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:18:1 | @@ -1558,6 +1690,18 @@ error: TypeSelector 19 | :-webkit-full-screen a {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:19:22 + | +19 | :-webkit-full-screen a {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:19:22 + | +19 | :-webkit-full-screen a {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-class/basic/input.css:19:22 | diff --git a/crates/swc_css_parser/tests/fixture/selector/pseudo-element/basic/output.json b/crates/swc_css_parser/tests/fixture/selector/pseudo-element/basic/output.json index df2e45f8515..8a358dcbf8c 100644 --- a/crates/swc_css_parser/tests/fixture/selector/pseudo-element/basic/output.json +++ b/crates/swc_css_parser/tests/fixture/selector/pseudo-element/basic/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -124,22 +132,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 13, "end": 19, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 13, "end": 19, "ctxt": 0 }, - "value": "dialog", - "raw": "dialog" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 13, + "end": 19, + "ctxt": 0 + }, + "value": "dialog", + "raw": "dialog" + } } }, "subclassSelectors": [ @@ -210,22 +226,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 34, "end": 35, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 34, "end": 35, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 34, + "end": 35, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -296,22 +320,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 48, "end": 53, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 48, "end": 53, "ctxt": 0 }, - "value": "video", - "raw": "video" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 48, + "end": 53, + "ctxt": 0 + }, + "value": "video", + "raw": "video" + } } }, "subclassSelectors": [ @@ -382,22 +414,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 62, "end": 67, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 62, "end": 67, "ctxt": 0 }, - "value": "video", - "raw": "video" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 62, + "end": 67, + "ctxt": 0 + }, + "value": "video", + "raw": "video" + } } }, "subclassSelectors": [ @@ -490,22 +530,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 80, "end": 85, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 80, "end": 85, "ctxt": 0 }, - "value": "video", - "raw": "video" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 80, + "end": 85, + "ctxt": 0 + }, + "value": "video", + "raw": "video" + } } }, "subclassSelectors": [ @@ -576,22 +624,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 101, "end": 106, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 101, "end": 106, "ctxt": 0 }, - "value": "video", - "raw": "video" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 101, + "end": 106, + "ctxt": 0 + }, + "value": "video", + "raw": "video" + } } }, "subclassSelectors": [ @@ -821,22 +877,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 165, "end": 186, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 165, "end": 186, "ctxt": 0 }, - "value": "tabbed-custom-element", - "raw": "tabbed-custom-element" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 165, + "end": 186, + "ctxt": 0 + }, + "value": "tabbed-custom-element", + "raw": "tabbed-custom-element" + } } }, "subclassSelectors": [ @@ -1485,22 +1549,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 356, "end": 357, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 356, "end": 357, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 356, + "end": 357, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -1571,22 +1643,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 370, "end": 371, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 370, "end": 371, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 370, + "end": 371, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -1676,22 +1756,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 389, "end": 390, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 389, "end": 390, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 389, + "end": 390, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -1781,22 +1869,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 418, "end": 419, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 418, "end": 419, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 418, + "end": 419, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] @@ -1820,22 +1916,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 421, "end": 422, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 421, "end": 422, "ctxt": 0 }, - "value": "b", - "raw": "b" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 421, + "end": 422, + "ctxt": 0 + }, + "value": "b", + "raw": "b" + } } }, "subclassSelectors": [] @@ -1944,23 +2048,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 441, "end": 442, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 441, - "end": 442, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [ { diff --git a/crates/swc_css_parser/tests/fixture/selector/pseudo-element/basic/span.rust-debug b/crates/swc_css_parser/tests/fixture/selector/pseudo-element/basic/span.rust-debug index c871b62df04..62cb0afe0d5 100644 --- a/crates/swc_css_parser/tests/fixture/selector/pseudo-element/basic/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/selector/pseudo-element/basic/span.rust-debug @@ -46,6 +46,18 @@ error: TypeSelector 1 | a::after {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:1:1 + | +1 | a::after {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:1:1 + | +1 | a::after {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:1:1 | @@ -112,6 +124,18 @@ error: TypeSelector 3 | dialog::backdrop {} | ^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:3:1 + | +3 | dialog::backdrop {} + | ^^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:3:1 + | +3 | dialog::backdrop {} + | ^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:3:1 | @@ -178,6 +202,18 @@ error: TypeSelector 5 | a::before {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:5:1 + | +5 | a::before {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:5:1 + | +5 | a::before {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:5:1 | @@ -244,6 +280,18 @@ error: TypeSelector 7 | video::cue {} | ^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:7:1 + | +7 | video::cue {} + | ^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:7:1 + | +7 | video::cue {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:7:1 | @@ -310,6 +358,18 @@ error: TypeSelector 8 | video::cue(b) {} | ^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:8:1 + | +8 | video::cue(b) {} + | ^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:8:1 + | +8 | video::cue(b) {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:8:1 | @@ -388,6 +448,18 @@ error: TypeSelector 10 | video::cue-region {} | ^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:10:1 + | +10 | video::cue-region {} + | ^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:10:1 + | +10 | video::cue-region {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:10:1 | @@ -454,6 +526,18 @@ error: TypeSelector 11 | video::cue-region(#scroll) {} | ^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:11:1 + | +11 | video::cue-region(#scroll) {} + | ^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:11:1 + | +11 | video::cue-region(#scroll) {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:11:1 | @@ -640,6 +724,18 @@ error: TypeSelector 17 | tabbed-custom-element::part(tab) {} | ^^^^^^^^^^^^^^^^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:17:1 + | +17 | tabbed-custom-element::part(tab) {} + | ^^^^^^^^^^^^^^^^^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:17:1 + | +17 | tabbed-custom-element::part(tab) {} + | ^^^^^^^^^^^^^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:17:1 | @@ -1156,6 +1252,18 @@ error: TypeSelector 32 | a::bEfOrE {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:32:1 + | +32 | a::bEfOrE {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:32:1 + | +32 | a::bEfOrE {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:32:1 | @@ -1222,6 +1330,18 @@ error: TypeSelector 34 | a:hover::before {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:34:1 + | +34 | a:hover::before {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:34:1 + | +34 | a:hover::before {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:34:1 | @@ -1306,6 +1426,18 @@ error: TypeSelector 35 | a:hover::-moz-placeholder {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:35:1 + | +35 | a:hover::-moz-placeholder {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:35:1 + | +35 | a:hover::-moz-placeholder {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:35:1 | @@ -1390,6 +1522,18 @@ error: TypeSelector 36 | a, b > .foo::before {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:36:1 + | +36 | a, b > .foo::before {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:36:1 + | +36 | a, b > .foo::before {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:36:1 | @@ -1414,6 +1558,18 @@ error: TypeSelector 36 | a, b > .foo::before {} | ^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:36:4 + | +36 | a, b > .foo::before {} + | ^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:36:4 + | +36 | a, b > .foo::before {} + | ^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:36:4 | @@ -1510,7 +1666,7 @@ error: TypeSelector 37 | *:hover.class {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/pseudo-element/basic/input.css:37:1 | 37 | *:hover.class {} diff --git a/crates/swc_css_parser/tests/fixture/selector/pseudo-element/escaped/output.json b/crates/swc_css_parser/tests/fixture/selector/pseudo-element/escaped/output.json index 2cba9ef0d6a..5872506b516 100644 --- a/crates/swc_css_parser/tests/fixture/selector/pseudo-element/escaped/output.json +++ b/crates/swc_css_parser/tests/fixture/selector/pseudo-element/escaped/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [ diff --git a/crates/swc_css_parser/tests/fixture/selector/pseudo-element/escaped/span.rust-debug b/crates/swc_css_parser/tests/fixture/selector/pseudo-element/escaped/span.rust-debug index b145c87abb0..f59c9f9c4f6 100644 --- a/crates/swc_css_parser/tests/fixture/selector/pseudo-element/escaped/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/selector/pseudo-element/escaped/span.rust-debug @@ -40,6 +40,18 @@ error: TypeSelector 1 | div::bef\ore {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/pseudo-element/escaped/input.css:1:1 + | +1 | div::bef\ore {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/pseudo-element/escaped/input.css:1:1 + | +1 | div::bef\ore {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/pseudo-element/escaped/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/selector/type/output.json b/crates/swc_css_parser/tests/fixture/selector/type/output.json index 9306a28add5..80726a630fb 100644 --- a/crates/swc_css_parser/tests/fixture/selector/type/output.json +++ b/crates/swc_css_parser/tests/fixture/selector/type/output.json @@ -38,31 +38,29 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, "prefix": { - "type": "Identifier", + "type": "NsPrefix", "span": { "start": 0, - "end": 1, + "end": 2, "ctxt": 0 }, - "value": "*", - "raw": "*" - }, - "name": { - "type": "Identifier", - "span": { - "start": 2, - "end": 3, - "ctxt": 0 - }, - "value": "*", - "raw": "*" + "prefix": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "*", + "raw": "*" + } } }, "subclassSelectors": [] @@ -113,31 +111,47 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 7, "end": 13, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 7, - "end": 10, - "ctxt": 0 - }, - "value": "foo", - "raw": "foo" - }, - "name": { - "type": "Identifier", - "span": { - "start": 11, "end": 13, "ctxt": 0 }, - "value": "h1", - "raw": "h1" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 7, + "end": 11, + "ctxt": 0 + }, + "prefix": { + "type": "Identifier", + "span": { + "start": 7, + "end": 10, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 11, + "end": 13, + "ctxt": 0 + }, + "value": "h1", + "raw": "h1" + } } }, "subclassSelectors": [] @@ -188,31 +202,29 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 17, "end": 22, "ctxt": 0 }, "prefix": { - "type": "Identifier", + "type": "NsPrefix", "span": { "start": 17, - "end": 20, + "end": 21, "ctxt": 0 }, - "value": "foo", - "raw": "foo" - }, - "name": { - "type": "Identifier", - "span": { - "start": 21, - "end": 22, - "ctxt": 0 - }, - "value": "*", - "raw": "*" + "prefix": { + "type": "Identifier", + "span": { + "start": 17, + "end": 20, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } } }, "subclassSelectors": [] @@ -263,31 +275,38 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 26, "end": 29, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 26, - "end": 26, - "ctxt": 0 - }, - "value": "", - "raw": "" - }, - "name": { - "type": "Identifier", - "span": { - "start": 27, "end": 29, "ctxt": 0 }, - "value": "h1", - "raw": "h1" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 26, + "end": 27, + "ctxt": 0 + }, + "prefix": null + }, + "value": { + "type": "Identifier", + "span": { + "start": 27, + "end": 29, + "ctxt": 0 + }, + "value": "h1", + "raw": "h1" + } } }, "subclassSelectors": [] @@ -338,31 +357,47 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 33, "end": 37, "ctxt": 0 }, - "prefix": { - "type": "Identifier", + "name": { + "type": "WqName", "span": { "start": 33, - "end": 34, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - }, - "name": { - "type": "Identifier", - "span": { - "start": 35, "end": 37, "ctxt": 0 }, - "value": "h1", - "raw": "h1" + "prefix": { + "type": "NsPrefix", + "span": { + "start": 33, + "end": 35, + "ctxt": 0 + }, + "prefix": { + "type": "Identifier", + "span": { + "start": 33, + "end": 34, + "ctxt": 0 + }, + "value": "*", + "raw": "*" + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 35, + "end": 37, + "ctxt": 0 + }, + "value": "h1", + "raw": "h1" + } } }, "subclassSelectors": [] @@ -413,22 +448,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 41, "end": 43, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 41, "end": 43, "ctxt": 0 }, - "value": "h1", - "raw": "h1" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 41, + "end": 43, + "ctxt": 0 + }, + "value": "h1", + "raw": "h1" + } } }, "subclassSelectors": [] @@ -479,22 +522,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 47, "end": 51, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 47, "end": 51, "ctxt": 0 }, - "value": "-", - "raw": "\\2d " + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 47, + "end": 51, + "ctxt": 0 + }, + "value": "-", + "raw": "\\2d " + } } }, "subclassSelectors": [] @@ -545,22 +596,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 54, "end": 59, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 54, "end": 59, "ctxt": 0 }, - "value": "-a", - "raw": "\\2d a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 54, + "end": 59, + "ctxt": 0 + }, + "value": "-a", + "raw": "\\2d a" + } } }, "subclassSelectors": [] @@ -611,22 +670,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 63, "end": 74, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 63, "end": 74, "ctxt": 0 }, - "value": "div:before", - "raw": "div\\:before" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 63, + "end": 74, + "ctxt": 0 + }, + "value": "div:before", + "raw": "div\\:before" + } } }, "subclassSelectors": [] @@ -677,22 +744,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 78, "end": 82, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 78, "end": 82, "ctxt": 0 }, - "value": "div", - "raw": "d\\iv" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 78, + "end": 82, + "ctxt": 0 + }, + "value": "div", + "raw": "d\\iv" + } } }, "subclassSelectors": [] @@ -743,22 +818,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 86, "end": 99, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 86, "end": 99, "ctxt": 0 }, - "value": "foreignObject", - "raw": "foreignObject" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 86, + "end": 99, + "ctxt": 0 + }, + "value": "foreignObject", + "raw": "foreignObject" + } } }, "subclassSelectors": [] @@ -809,22 +892,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 103, "end": 107, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 103, "end": 107, "ctxt": 0 }, - "value": "html", - "raw": "html" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 103, + "end": 107, + "ctxt": 0 + }, + "value": "html", + "raw": "html" + } } }, "subclassSelectors": [] @@ -847,22 +938,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 108, "end": 116, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 108, "end": 116, "ctxt": 0 }, - "value": "textPath", - "raw": "textPath" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 108, + "end": 116, + "ctxt": 0 + }, + "value": "textPath", + "raw": "textPath" + } } }, "subclassSelectors": [] @@ -913,22 +1012,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 120, "end": 123, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 120, "end": 123, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 120, + "end": 123, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [ @@ -998,23 +1105,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 133, "end": 134, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 133, - "end": 134, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [] } @@ -1064,23 +1161,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 138, "end": 139, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 138, - "end": 139, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [] }, @@ -1169,23 +1256,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 148, "end": 149, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 148, - "end": 149, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [ { @@ -1293,23 +1370,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 162, "end": 163, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 162, - "end": 163, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [] } @@ -1398,23 +1465,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 172, "end": 173, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 172, - "end": 173, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [] } @@ -1464,23 +1521,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 177, "end": 178, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 177, - "end": 178, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [ { @@ -1549,23 +1596,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 186, "end": 187, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 186, - "end": 187, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [ { @@ -1575,18 +1612,34 @@ "end": 197, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 188, "end": 192, "ctxt": 0 }, - "value": "lang", - "raw": "lang" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 188, + "end": 192, + "ctxt": 0 + }, + "value": "lang", + "raw": "lang" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 192, + "end": 194, + "ctxt": 0 + }, + "value": "^=" }, - "matcher": "^=", "value": { "type": "Identifier", "span": { @@ -1647,23 +1700,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 201, "end": 202, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 201, - "end": 202, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [ { @@ -1733,23 +1776,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 212, "end": 213, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 212, - "end": 213, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [ { @@ -1819,23 +1852,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 225, "end": 226, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 225, - "end": 226, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [] }, @@ -1857,23 +1880,13 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "UniversalSelector", "span": { "start": 227, "end": 228, "ctxt": 0 }, - "prefix": null, - "name": { - "type": "Identifier", - "span": { - "start": 227, - "end": 228, - "ctxt": 0 - }, - "value": "*", - "raw": "*" - } + "prefix": null }, "subclassSelectors": [ { diff --git a/crates/swc_css_parser/tests/fixture/selector/type/span.rust-debug b/crates/swc_css_parser/tests/fixture/selector/type/span.rust-debug index defec225625..b00bbaeaf64 100644 --- a/crates/swc_css_parser/tests/fixture/selector/type/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/selector/type/span.rust-debug @@ -46,18 +46,24 @@ error: TypeSelector 1 | *|* {} | ^^^ +error: UniversalSelector + --> $DIR/tests/fixture/selector/type/input.css:1:1 + | +1 | *|* {} + | ^^^ + +error: NsPrefix + --> $DIR/tests/fixture/selector/type/input.css:1:1 + | +1 | *|* {} + | ^^ + error: Ident --> $DIR/tests/fixture/selector/type/input.css:1:1 | 1 | *|* {} | ^ -error: Ident - --> $DIR/tests/fixture/selector/type/input.css:1:3 - | -1 | *|* {} - | ^ - error: Block --> $DIR/tests/fixture/selector/type/input.css:1:5 | @@ -100,6 +106,24 @@ error: TypeSelector 2 | foo|h1 {} | ^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/type/input.css:2:1 + | +2 | foo|h1 {} + | ^^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/type/input.css:2:1 + | +2 | foo|h1 {} + | ^^^^^^ + +error: NsPrefix + --> $DIR/tests/fixture/selector/type/input.css:2:1 + | +2 | foo|h1 {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/type/input.css:2:1 | @@ -154,18 +178,24 @@ error: TypeSelector 3 | foo|* {} | ^^^^^ +error: UniversalSelector + --> $DIR/tests/fixture/selector/type/input.css:3:1 + | +3 | foo|* {} + | ^^^^^ + +error: NsPrefix + --> $DIR/tests/fixture/selector/type/input.css:3:1 + | +3 | foo|* {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/type/input.css:3:1 | 3 | foo|* {} | ^^^ -error: Ident - --> $DIR/tests/fixture/selector/type/input.css:3:5 - | -3 | foo|* {} - | ^ - error: Block --> $DIR/tests/fixture/selector/type/input.css:3:7 | @@ -208,7 +238,19 @@ error: TypeSelector 4 | |h1 {} | ^^^ -error: Ident +error: TagNameSelector + --> $DIR/tests/fixture/selector/type/input.css:4:1 + | +4 | |h1 {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/type/input.css:4:1 + | +4 | |h1 {} + | ^^^ + +error: NsPrefix --> $DIR/tests/fixture/selector/type/input.css:4:1 | 4 | |h1 {} @@ -262,6 +304,24 @@ error: TypeSelector 5 | *|h1 {} | ^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/type/input.css:5:1 + | +5 | *|h1 {} + | ^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/type/input.css:5:1 + | +5 | *|h1 {} + | ^^^^ + +error: NsPrefix + --> $DIR/tests/fixture/selector/type/input.css:5:1 + | +5 | *|h1 {} + | ^^ + error: Ident --> $DIR/tests/fixture/selector/type/input.css:5:1 | @@ -316,6 +376,18 @@ error: TypeSelector 6 | h1 {} | ^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/type/input.css:6:1 + | +6 | h1 {} + | ^^ + +error: WqName + --> $DIR/tests/fixture/selector/type/input.css:6:1 + | +6 | h1 {} + | ^^ + error: Ident --> $DIR/tests/fixture/selector/type/input.css:6:1 | @@ -364,6 +436,18 @@ error: TypeSelector 7 | \2d {} | ^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/type/input.css:7:1 + | +7 | \2d {} + | ^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/type/input.css:7:1 + | +7 | \2d {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/type/input.css:7:1 | @@ -412,6 +496,18 @@ error: TypeSelector 8 | \2d a {} | ^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/type/input.css:8:1 + | +8 | \2d a {} + | ^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/type/input.css:8:1 + | +8 | \2d a {} + | ^^^^^ + error: Ident --> $DIR/tests/fixture/selector/type/input.css:8:1 | @@ -460,6 +556,18 @@ error: TypeSelector 9 | div\:before {} | ^^^^^^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/type/input.css:9:1 + | +9 | div\:before {} + | ^^^^^^^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/type/input.css:9:1 + | +9 | div\:before {} + | ^^^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/type/input.css:9:1 | @@ -508,6 +616,18 @@ error: TypeSelector 10 | d\iv {} | ^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/type/input.css:10:1 + | +10 | d\iv {} + | ^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/type/input.css:10:1 + | +10 | d\iv {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/type/input.css:10:1 | @@ -556,6 +676,18 @@ error: TypeSelector 11 | foreignObject {} | ^^^^^^^^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/type/input.css:11:1 + | +11 | foreignObject {} + | ^^^^^^^^^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/type/input.css:11:1 + | +11 | foreignObject {} + | ^^^^^^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/type/input.css:11:1 | @@ -604,6 +736,18 @@ error: TypeSelector 12 | html textPath {} | ^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/type/input.css:12:1 + | +12 | html textPath {} + | ^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/type/input.css:12:1 + | +12 | html textPath {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/type/input.css:12:1 | @@ -628,6 +772,18 @@ error: TypeSelector 12 | html textPath {} | ^^^^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/type/input.css:12:6 + | +12 | html textPath {} + | ^^^^^^^^ + +error: WqName + --> $DIR/tests/fixture/selector/type/input.css:12:6 + | +12 | html textPath {} + | ^^^^^^^^ + error: Ident --> $DIR/tests/fixture/selector/type/input.css:12:6 | @@ -676,6 +832,18 @@ error: TypeSelector 13 | div#thing {} | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/selector/type/input.css:13:1 + | +13 | div#thing {} + | ^^^ + +error: WqName + --> $DIR/tests/fixture/selector/type/input.css:13:1 + | +13 | div#thing {} + | ^^^ + error: Ident --> $DIR/tests/fixture/selector/type/input.css:13:1 | @@ -742,7 +910,7 @@ error: TypeSelector 14 | * {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/type/input.css:14:1 | 14 | * {} @@ -790,7 +958,7 @@ error: TypeSelector 15 | * #foo {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/type/input.css:15:1 | 15 | * #foo {} @@ -868,7 +1036,7 @@ error: TypeSelector 16 | *#foo {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/type/input.css:16:1 | 16 | *#foo {} @@ -964,7 +1132,7 @@ error: TypeSelector 17 | #foo * {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/type/input.css:17:6 | 17 | #foo * {} @@ -1042,7 +1210,7 @@ error: TypeSelector 18 | .bar * {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/type/input.css:18:6 | 18 | .bar * {} @@ -1090,7 +1258,7 @@ error: TypeSelector 19 | *.bar {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/type/input.css:19:1 | 19 | *.bar {} @@ -1156,7 +1324,7 @@ error: TypeSelector 20 | *[lang^=en] {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/type/input.css:20:1 | 20 | *[lang^=en] {} @@ -1168,18 +1336,36 @@ error: SubclassSelector 20 | *[lang^=en] {} | ^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/selector/type/input.css:20:2 | 20 | *[lang^=en] {} | ^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/selector/type/input.css:20:3 + | +20 | *[lang^=en] {} + | ^^^^ + error: Ident --> $DIR/tests/fixture/selector/type/input.css:20:3 | 20 | *[lang^=en] {} | ^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/selector/type/input.css:20:7 + | +20 | *[lang^=en] {} + | ^^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/selector/type/input.css:20:9 + | +20 | *[lang^=en] {} + | ^^ + error: Ident --> $DIR/tests/fixture/selector/type/input.css:20:9 | @@ -1228,7 +1414,7 @@ error: TypeSelector 21 | *:hover {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/type/input.css:21:1 | 21 | *:hover {} @@ -1294,7 +1480,7 @@ error: TypeSelector 22 | *::before {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/type/input.css:22:1 | 22 | *::before {} @@ -1360,7 +1546,7 @@ error: TypeSelector 23 | * *:not(*) {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/type/input.css:23:1 | 23 | * *:not(*) {} @@ -1384,7 +1570,7 @@ error: TypeSelector 23 | * *:not(*) {} | ^ -error: Ident +error: UniversalSelector --> $DIR/tests/fixture/selector/type/input.css:23:3 | 23 | * *:not(*) {} diff --git a/crates/swc_css_parser/tests/fixture/styled-jsx/selector/2/output.json b/crates/swc_css_parser/tests/fixture/styled-jsx/selector/2/output.json index afebce6a99a..7ceef00f28d 100644 --- a/crates/swc_css_parser/tests/fixture/styled-jsx/selector/2/output.json +++ b/crates/swc_css_parser/tests/fixture/styled-jsx/selector/2/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/styled-jsx/selector/2/span.rust-debug b/crates/swc_css_parser/tests/fixture/styled-jsx/selector/2/span.rust-debug index 8b487729459..ded25c65dcd 100644 --- a/crates/swc_css_parser/tests/fixture/styled-jsx/selector/2/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/styled-jsx/selector/2/span.rust-debug @@ -46,6 +46,18 @@ error: TypeSelector 1 | p :global(span:not(.test)) { | ^ +error: TagNameSelector + --> $DIR/tests/fixture/styled-jsx/selector/2/input.css:1:1 + | +1 | p :global(span:not(.test)) { + | ^ + +error: WqName + --> $DIR/tests/fixture/styled-jsx/selector/2/input.css:1:1 + | +1 | p :global(span:not(.test)) { + | ^ + error: Ident --> $DIR/tests/fixture/styled-jsx/selector/2/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/stylis/comma/01/output.json b/crates/swc_css_parser/tests/fixture/stylis/comma/01/output.json index 7db98ef05cd..1ab17149700 100644 --- a/crates/swc_css_parser/tests/fixture/stylis/comma/01/output.json +++ b/crates/swc_css_parser/tests/fixture/stylis/comma/01/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/stylis/comma/01/span.rust-debug b/crates/swc_css_parser/tests/fixture/stylis/comma/01/span.rust-debug index 3795d47f988..f1df8cac8c2 100644 --- a/crates/swc_css_parser/tests/fixture/stylis/comma/01/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/stylis/comma/01/span.rust-debug @@ -46,6 +46,18 @@ error: TypeSelector 1 | a { | ^ +error: TagNameSelector + --> $DIR/tests/fixture/stylis/comma/01/input.css:1:1 + | +1 | a { + | ^ + +error: WqName + --> $DIR/tests/fixture/stylis/comma/01/input.css:1:1 + | +1 | a { + | ^ + error: Ident --> $DIR/tests/fixture/stylis/comma/01/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/value/escaped/output.json b/crates/swc_css_parser/tests/fixture/value/escaped/output.json index fea8e803768..c7f49937f2c 100644 --- a/crates/swc_css_parser/tests/fixture/value/escaped/output.json +++ b/crates/swc_css_parser/tests/fixture/value/escaped/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 5, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 5, "ctxt": 0 }, - "value": "table", - "raw": "table" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 5, + "ctxt": 0 + }, + "value": "table", + "raw": "table" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/value/escaped/span.rust-debug b/crates/swc_css_parser/tests/fixture/value/escaped/span.rust-debug index 60f1e82dd4f..2943e4ca643 100644 --- a/crates/swc_css_parser/tests/fixture/value/escaped/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/value/escaped/span.rust-debug @@ -46,6 +46,18 @@ error: TypeSelector 1 | table { | ^^^^^ +error: TagNameSelector + --> $DIR/tests/fixture/value/escaped/input.css:1:1 + | +1 | table { + | ^^^^^ + +error: WqName + --> $DIR/tests/fixture/value/escaped/input.css:1:1 + | +1 | table { + | ^^^^^ + error: Ident --> $DIR/tests/fixture/value/escaped/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/value/percentage/output.json b/crates/swc_css_parser/tests/fixture/value/percentage/output.json index 2d0f26f3f3f..88494ba0475 100644 --- a/crates/swc_css_parser/tests/fixture/value/percentage/output.json +++ b/crates/swc_css_parser/tests/fixture/value/percentage/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] @@ -534,22 +542,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 207, "end": 210, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 207, "end": 210, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 207, + "end": 210, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/value/percentage/span.rust-debug b/crates/swc_css_parser/tests/fixture/value/percentage/span.rust-debug index 6a546086508..628e2977b91 100644 --- a/crates/swc_css_parser/tests/fixture/value/percentage/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/value/percentage/span.rust-debug @@ -58,6 +58,18 @@ error: TypeSelector 1 | div { | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/value/percentage/input.css:1:1 + | +1 | div { + | ^^^ + +error: WqName + --> $DIR/tests/fixture/value/percentage/input.css:1:1 + | +1 | div { + | ^^^ + error: Ident --> $DIR/tests/fixture/value/percentage/input.css:1:1 | @@ -515,6 +527,18 @@ error: TypeSelector 15 | div { | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/value/percentage/input.css:15:1 + | +15 | div { + | ^^^ + +error: WqName + --> $DIR/tests/fixture/value/percentage/input.css:15:1 + | +15 | div { + | ^^^ + error: Ident --> $DIR/tests/fixture/value/percentage/input.css:15:1 | diff --git a/crates/swc_css_parser/tests/fixture/value/quotes/output.json b/crates/swc_css_parser/tests/fixture/value/quotes/output.json index 026fb44d0cf..b3da6a9229b 100644 --- a/crates/swc_css_parser/tests/fixture/value/quotes/output.json +++ b/crates/swc_css_parser/tests/fixture/value/quotes/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -714,22 +722,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 880, "end": 881, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 880, "end": 881, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 880, + "end": 881, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -740,18 +756,34 @@ "end": 917, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 882, "end": 887, "ctxt": 0 }, - "value": "title", - "raw": "title" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 882, + "end": 887, + "ctxt": 0 + }, + "value": "title", + "raw": "title" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 887, + "end": 888, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { @@ -844,22 +876,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 938, "end": 939, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 938, "end": 939, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 938, + "end": 939, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [ @@ -870,18 +910,34 @@ "end": 973, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 940, "end": 945, "ctxt": 0 }, - "value": "title", - "raw": "title" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 940, + "end": 945, + "ctxt": 0 + }, + "value": "title", + "raw": "title" + } + }, + "matcher": { + "type": "AttributeSelectorMatcher", + "span": { + "start": 945, + "end": 946, + "ctxt": 0 + }, + "value": "=" }, - "matcher": "=", "value": { "type": "String", "span": { diff --git a/crates/swc_css_parser/tests/fixture/value/quotes/span.rust-debug b/crates/swc_css_parser/tests/fixture/value/quotes/span.rust-debug index 17dc9e79f1d..07625b7421a 100644 --- a/crates/swc_css_parser/tests/fixture/value/quotes/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/value/quotes/span.rust-debug @@ -58,6 +58,18 @@ error: TypeSelector 1 | a::before { | ^ +error: TagNameSelector + --> $DIR/tests/fixture/value/quotes/input.css:1:1 + | +1 | a::before { + | ^ + +error: WqName + --> $DIR/tests/fixture/value/quotes/input.css:1:1 + | +1 | a::before { + | ^ + error: Ident --> $DIR/tests/fixture/value/quotes/input.css:1:1 | @@ -744,6 +756,18 @@ error: TypeSelector 31 | a[title="a not s\ | ^ +error: TagNameSelector + --> $DIR/tests/fixture/value/quotes/input.css:31:1 + | +31 | a[title="a not s\ + | ^ + +error: WqName + --> $DIR/tests/fixture/value/quotes/input.css:31:1 + | +31 | a[title="a not s\ + | ^ + error: Ident --> $DIR/tests/fixture/value/quotes/input.css:31:1 | @@ -758,7 +782,7 @@ error: SubclassSelector 32 | | o very long title"] { | |___________________^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/value/quotes/input.css:31:2 | 31 | a[title="a not s\ @@ -766,12 +790,32 @@ error: AttrSelector 32 | | o very long title"] { | |___________________^ +error: WqName + --> $DIR/tests/fixture/value/quotes/input.css:31:3 + | +31 | a[title="a not s\ + | ^^^^^ + error: Ident --> $DIR/tests/fixture/value/quotes/input.css:31:3 | 31 | a[title="a not s\ | ^^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/value/quotes/input.css:31:8 + | +31 | a[title="a not s\ + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/value/quotes/input.css:31:9 + | +31 | a[title="a not s\ + | _________^ +32 | | o very long title"] { + | |__________________^ + error: Str --> $DIR/tests/fixture/value/quotes/input.css:31:9 | @@ -859,6 +903,18 @@ error: TypeSelector 35 | a[title="a not so very long title"] { | ^ +error: TagNameSelector + --> $DIR/tests/fixture/value/quotes/input.css:35:1 + | +35 | a[title="a not so very long title"] { + | ^ + +error: WqName + --> $DIR/tests/fixture/value/quotes/input.css:35:1 + | +35 | a[title="a not so very long title"] { + | ^ + error: Ident --> $DIR/tests/fixture/value/quotes/input.css:35:1 | @@ -871,18 +927,36 @@ error: SubclassSelector 35 | a[title="a not so very long title"] { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: AttrSelector +error: AttributeSelector --> $DIR/tests/fixture/value/quotes/input.css:35:2 | 35 | a[title="a not so very long title"] { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +error: WqName + --> $DIR/tests/fixture/value/quotes/input.css:35:3 + | +35 | a[title="a not so very long title"] { + | ^^^^^ + error: Ident --> $DIR/tests/fixture/value/quotes/input.css:35:3 | 35 | a[title="a not so very long title"] { | ^^^^^ +error: AttributeSelectorMatcher + --> $DIR/tests/fixture/value/quotes/input.css:35:8 + | +35 | a[title="a not so very long title"] { + | ^ + +error: AttributeSelectorValue + --> $DIR/tests/fixture/value/quotes/input.css:35:9 + | +35 | a[title="a not so very long title"] { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + error: Str --> $DIR/tests/fixture/value/quotes/input.css:35:9 | diff --git a/crates/swc_css_parser/tests/fixture/value/square-brackets/output.json b/crates/swc_css_parser/tests/fixture/value/square-brackets/output.json index 353f5188b0c..5ddd9d29ff3 100644 --- a/crates/swc_css_parser/tests/fixture/value/square-brackets/output.json +++ b/crates/swc_css_parser/tests/fixture/value/square-brackets/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/value/square-brackets/span.rust-debug b/crates/swc_css_parser/tests/fixture/value/square-brackets/span.rust-debug index 7fec1e76e63..c4afd11a517 100644 --- a/crates/swc_css_parser/tests/fixture/value/square-brackets/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/value/square-brackets/span.rust-debug @@ -58,6 +58,18 @@ error: TypeSelector 1 | div { | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/value/square-brackets/input.css:1:1 + | +1 | div { + | ^^^ + +error: WqName + --> $DIR/tests/fixture/value/square-brackets/input.css:1:1 + | +1 | div { + | ^^^ + error: Ident --> $DIR/tests/fixture/value/square-brackets/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/fixture/value/url/output.json b/crates/swc_css_parser/tests/fixture/value/url/output.json index 25a823a06d7..55a730c7cfe 100644 --- a/crates/swc_css_parser/tests/fixture/value/url/output.json +++ b/crates/swc_css_parser/tests/fixture/value/url/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/fixture/value/url/span.rust-debug b/crates/swc_css_parser/tests/fixture/value/url/span.rust-debug index 4f9ecb7eb31..fd1805da4a3 100644 --- a/crates/swc_css_parser/tests/fixture/value/url/span.rust-debug +++ b/crates/swc_css_parser/tests/fixture/value/url/span.rust-debug @@ -58,6 +58,18 @@ error: TypeSelector 1 | div { | ^^^ +error: TagNameSelector + --> $DIR/tests/fixture/value/url/input.css:1:1 + | +1 | div { + | ^^^ + +error: WqName + --> $DIR/tests/fixture/value/url/input.css:1:1 + | +1 | div { + | ^^^ + error: Ident --> $DIR/tests/fixture/value/url/input.css:1:1 | diff --git a/crates/swc_css_parser/tests/line-comment/css-in-js/1/output.json b/crates/swc_css_parser/tests/line-comment/css-in-js/1/output.json index 14bee5fe9e5..7ff11841bb4 100644 --- a/crates/swc_css_parser/tests/line-comment/css-in-js/1/output.json +++ b/crates/swc_css_parser/tests/line-comment/css-in-js/1/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 16, "end": 19, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 16, "end": 19, "ctxt": 0 }, - "value": "foo", - "raw": "foo" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 16, + "end": 19, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/line-comment/css-in-js/2/output.json b/crates/swc_css_parser/tests/line-comment/css-in-js/2/output.json index 046711ab5c2..7b6eb478e71 100644 --- a/crates/swc_css_parser/tests/line-comment/css-in-js/2/output.json +++ b/crates/swc_css_parser/tests/line-comment/css-in-js/2/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "foo", - "raw": "foo" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/line-comment/css-in-js/3/output.json b/crates/swc_css_parser/tests/line-comment/css-in-js/3/output.json index f3e5efc59f7..6322a478669 100644 --- a/crates/swc_css_parser/tests/line-comment/css-in-js/3/output.json +++ b/crates/swc_css_parser/tests/line-comment/css-in-js/3/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "foo", - "raw": "foo" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/line-comment/css-in-js/4/output.json b/crates/swc_css_parser/tests/line-comment/css-in-js/4/output.json index 77c006b1638..4d2d0fe5432 100644 --- a/crates/swc_css_parser/tests/line-comment/css-in-js/4/output.json +++ b/crates/swc_css_parser/tests/line-comment/css-in-js/4/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "foo", - "raw": "foo" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/line-comment/css-in-js/5/output.json b/crates/swc_css_parser/tests/line-comment/css-in-js/5/output.json index e132deaaf88..39626b04e09 100644 --- a/crates/swc_css_parser/tests/line-comment/css-in-js/5/output.json +++ b/crates/swc_css_parser/tests/line-comment/css-in-js/5/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 32, "end": 35, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 32, "end": 35, "ctxt": 0 }, - "value": "foo", - "raw": "foo" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 32, + "end": 35, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/line-comment/css-in-js/6/output.json b/crates/swc_css_parser/tests/line-comment/css-in-js/6/output.json index 7a8744e5f8a..957753596e3 100644 --- a/crates/swc_css_parser/tests/line-comment/css-in-js/6/output.json +++ b/crates/swc_css_parser/tests/line-comment/css-in-js/6/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "foo", - "raw": "foo" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "foo", + "raw": "foo" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/at-rule/layer/string-name-block/output.json b/crates/swc_css_parser/tests/recovery/at-rule/layer/string-name-block/output.json index e8cd19089ab..8e45c1c7dbb 100644 --- a/crates/swc_css_parser/tests/recovery/at-rule/layer/string-name-block/output.json +++ b/crates/swc_css_parser/tests/recovery/at-rule/layer/string-name-block/output.json @@ -602,22 +602,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 120, "end": 122, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 120, "end": 122, "ctxt": 0 }, - "value": "h1", - "raw": "h1" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 120, + "end": 122, + "ctxt": 0 + }, + "value": "h1", + "raw": "h1" + } } }, "subclassSelectors": [] @@ -641,22 +649,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 124, "end": 126, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 124, "end": 126, "ctxt": 0 }, - "value": "h2", - "raw": "h2" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 124, + "end": 126, + "ctxt": 0 + }, + "value": "h2", + "raw": "h2" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/output.json index 545f3a64fb0..e1f69390a55 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/double-quotes/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/output.json index b4150619d7c..7824e321862 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/invalid-escape/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/output.json index 186f74ec27e..994c2068d13 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/left-parenthesis/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/output.json index 7d898e0c7af..b387541b4ae 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/single-quotes/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/output.json index 99127000ab4..29489884851 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace-in-middle/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/output.json b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/output.json index f18a692e8d1..69c0a37733e 100644 --- a/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/output.json +++ b/crates/swc_css_parser/tests/recovery/bad-url-token/whitespace/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/comments/output.json b/crates/swc_css_parser/tests/recovery/comments/output.json index 85893f54dff..3874f59d726 100644 --- a/crates/swc_css_parser/tests/recovery/comments/output.json +++ b/crates/swc_css_parser/tests/recovery/comments/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/delim-token/ampersand/output.json b/crates/swc_css_parser/tests/recovery/delim-token/ampersand/output.json index 8fc0faaa156..acdd9ee0be6 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/ampersand/output.json +++ b/crates/swc_css_parser/tests/recovery/delim-token/ampersand/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/delim-token/asterisk/output.json b/crates/swc_css_parser/tests/recovery/delim-token/asterisk/output.json index feb76788066..8ff4e2f5e78 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/asterisk/output.json +++ b/crates/swc_css_parser/tests/recovery/delim-token/asterisk/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/delim-token/at-sign/output.json b/crates/swc_css_parser/tests/recovery/delim-token/at-sign/output.json index 9321f6eeea2..cb799fc1090 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/at-sign/output.json +++ b/crates/swc_css_parser/tests/recovery/delim-token/at-sign/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/delim-token/bang/output.json b/crates/swc_css_parser/tests/recovery/delim-token/bang/output.json index c931f9215c3..59eeb555d85 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/bang/output.json +++ b/crates/swc_css_parser/tests/recovery/delim-token/bang/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/delim-token/bar/output.json b/crates/swc_css_parser/tests/recovery/delim-token/bar/output.json index 2073ac9c202..a998a353275 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/bar/output.json +++ b/crates/swc_css_parser/tests/recovery/delim-token/bar/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/delim-token/caret/output.json b/crates/swc_css_parser/tests/recovery/delim-token/caret/output.json index d432083d0c1..2c4923178c7 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/caret/output.json +++ b/crates/swc_css_parser/tests/recovery/delim-token/caret/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/delim-token/dollar/output.json b/crates/swc_css_parser/tests/recovery/delim-token/dollar/output.json index a50335fd3af..b15834b4833 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/dollar/output.json +++ b/crates/swc_css_parser/tests/recovery/delim-token/dollar/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/delim-token/equals/output.json b/crates/swc_css_parser/tests/recovery/delim-token/equals/output.json index d0c224ef353..79832b89a67 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/equals/output.json +++ b/crates/swc_css_parser/tests/recovery/delim-token/equals/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/delim-token/greater-than/output.json b/crates/swc_css_parser/tests/recovery/delim-token/greater-than/output.json index 3e3a8f77ab9..25d8a1ae18b 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/greater-than/output.json +++ b/crates/swc_css_parser/tests/recovery/delim-token/greater-than/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/delim-token/hash/output.json b/crates/swc_css_parser/tests/recovery/delim-token/hash/output.json index e98f54f21a8..b6e4b138acb 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/hash/output.json +++ b/crates/swc_css_parser/tests/recovery/delim-token/hash/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/delim-token/less-than/output.json b/crates/swc_css_parser/tests/recovery/delim-token/less-than/output.json index 7d92ac8f58c..9e5174f0ca2 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/less-than/output.json +++ b/crates/swc_css_parser/tests/recovery/delim-token/less-than/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/delim-token/minus/output.json b/crates/swc_css_parser/tests/recovery/delim-token/minus/output.json index b333899f75b..ea5a615ea3a 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/minus/output.json +++ b/crates/swc_css_parser/tests/recovery/delim-token/minus/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/delim-token/percent/output.json b/crates/swc_css_parser/tests/recovery/delim-token/percent/output.json index 5819ff4f31d..6b8c0d2d34d 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/percent/output.json +++ b/crates/swc_css_parser/tests/recovery/delim-token/percent/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/delim-token/plus/output.json b/crates/swc_css_parser/tests/recovery/delim-token/plus/output.json index 98bd11fb290..5287f60368c 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/plus/output.json +++ b/crates/swc_css_parser/tests/recovery/delim-token/plus/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/delim-token/question-mark/output.json b/crates/swc_css_parser/tests/recovery/delim-token/question-mark/output.json index e0372af420e..28b6fc19905 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/question-mark/output.json +++ b/crates/swc_css_parser/tests/recovery/delim-token/question-mark/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/delim-token/star/output.json b/crates/swc_css_parser/tests/recovery/delim-token/star/output.json index feb76788066..8ff4e2f5e78 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/star/output.json +++ b/crates/swc_css_parser/tests/recovery/delim-token/star/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/delim-token/tilde/output.json b/crates/swc_css_parser/tests/recovery/delim-token/tilde/output.json index e03212935ee..64a53c6704d 100644 --- a/crates/swc_css_parser/tests/recovery/delim-token/tilde/output.json +++ b/crates/swc_css_parser/tests/recovery/delim-token/tilde/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/function-token/output.json b/crates/swc_css_parser/tests/recovery/function-token/output.json index 3056661e246..8d94551885b 100644 --- a/crates/swc_css_parser/tests/recovery/function-token/output.json +++ b/crates/swc_css_parser/tests/recovery/function-token/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/function/output.json b/crates/swc_css_parser/tests/recovery/function/output.json index 26be38b2151..aaa5ff81eb1 100644 --- a/crates/swc_css_parser/tests/recovery/function/output.json +++ b/crates/swc_css_parser/tests/recovery/function/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/number/output.json b/crates/swc_css_parser/tests/recovery/number/output.json index 653d3693396..960a6cd18ff 100644 --- a/crates/swc_css_parser/tests/recovery/number/output.json +++ b/crates/swc_css_parser/tests/recovery/number/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/value/at-keyword/1/output.json b/crates/swc_css_parser/tests/recovery/value/at-keyword/1/output.json index d3e5fd1ada8..e26daaa6fe3 100644 --- a/crates/swc_css_parser/tests/recovery/value/at-keyword/1/output.json +++ b/crates/swc_css_parser/tests/recovery/value/at-keyword/1/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/value/at-keyword/2/output.json b/crates/swc_css_parser/tests/recovery/value/at-keyword/2/output.json index 2c6a54368c7..84e9a93829f 100644 --- a/crates/swc_css_parser/tests/recovery/value/at-keyword/2/output.json +++ b/crates/swc_css_parser/tests/recovery/value/at-keyword/2/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/value/at-keyword/3/output.json b/crates/swc_css_parser/tests/recovery/value/at-keyword/3/output.json index af6a793089e..735ed363d46 100644 --- a/crates/swc_css_parser/tests/recovery/value/at-keyword/3/output.json +++ b/crates/swc_css_parser/tests/recovery/value/at-keyword/3/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/value/at-keyword/4/output.json b/crates/swc_css_parser/tests/recovery/value/at-keyword/4/output.json index 6e353d8805f..e0a36061c77 100644 --- a/crates/swc_css_parser/tests/recovery/value/at-keyword/4/output.json +++ b/crates/swc_css_parser/tests/recovery/value/at-keyword/4/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/value/at-keyword/5/output.json b/crates/swc_css_parser/tests/recovery/value/at-keyword/5/output.json index b23dffdbeeb..e67c4803c35 100644 --- a/crates/swc_css_parser/tests/recovery/value/at-keyword/5/output.json +++ b/crates/swc_css_parser/tests/recovery/value/at-keyword/5/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/value/at-keyword/6/output.json b/crates/swc_css_parser/tests/recovery/value/at-keyword/6/output.json index e7414d2bf68..a28a10beada 100644 --- a/crates/swc_css_parser/tests/recovery/value/at-keyword/6/output.json +++ b/crates/swc_css_parser/tests/recovery/value/at-keyword/6/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/value/at-keyword/7/output.json b/crates/swc_css_parser/tests/recovery/value/at-keyword/7/output.json index 56a426f6843..dbf7072ed35 100644 --- a/crates/swc_css_parser/tests/recovery/value/at-keyword/7/output.json +++ b/crates/swc_css_parser/tests/recovery/value/at-keyword/7/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/value/quotes/output.json b/crates/swc_css_parser/tests/recovery/value/quotes/output.json index cb0ecee27a9..50e1496070c 100644 --- a/crates/swc_css_parser/tests/recovery/value/quotes/output.json +++ b/crates/swc_css_parser/tests/recovery/value/quotes/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "p", - "raw": "p" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "p", + "raw": "p" + } } }, "subclassSelectors": [ diff --git a/crates/swc_css_parser/tests/recovery/value/url/output.json b/crates/swc_css_parser/tests/recovery/value/url/output.json index c6b329154db..b44cd428705 100644 --- a/crates/swc_css_parser/tests/recovery/value/url/output.json +++ b/crates/swc_css_parser/tests/recovery/value/url/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 3, "ctxt": 0 }, - "value": "div", - "raw": "div" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 3, + "ctxt": 0 + }, + "value": "div", + "raw": "div" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_parser/tests/recovery/whitespaces/output.json b/crates/swc_css_parser/tests/recovery/whitespaces/output.json index 176bded4fc5..51c1c899da0 100644 --- a/crates/swc_css_parser/tests/recovery/whitespaces/output.json +++ b/crates/swc_css_parser/tests/recovery/whitespaces/output.json @@ -38,22 +38,30 @@ }, "nestingSelector": null, "typeSelector": { - "type": "TypeSelector", + "type": "TagNameSelector", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "prefix": null, "name": { - "type": "Identifier", + "type": "WqName", "span": { "start": 0, "end": 1, "ctxt": 0 }, - "value": "a", - "raw": "a" + "prefix": null, + "value": { + "type": "Identifier", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } } }, "subclassSelectors": [] diff --git a/crates/swc_css_visit/src/lib.rs b/crates/swc_css_visit/src/lib.rs index c41c80972df..94b16e24b35 100644 --- a/crates/swc_css_visit/src/lib.rs +++ b/crates/swc_css_visit/src/lib.rs @@ -226,10 +226,30 @@ define!({ pub value: CombinatorValue, } - pub struct TypeSelector { + pub enum TypeSelector { + TagName(TagNameSelector), + Universal(UniversalSelector), + } + + pub struct TagNameSelector { + pub span: Span, + pub name: WqName, + } + + pub struct UniversalSelector { + pub span: Span, + pub prefix: Option, + } + + pub struct NsPrefix { pub span: Span, pub prefix: Option, - pub name: Ident, + } + + pub struct WqName { + pub span: Span, + pub prefix: Option, + pub value: Ident, } pub struct NestingSelector { @@ -238,30 +258,34 @@ define!({ pub enum SubclassSelector { Id(IdSelector), - Class(ClassSelector), - - Attr(AttrSelector), - + Attribute(AttributeSelector), PseudoClass(PseudoClassSelector), - PseudoElement(PseudoElementSelector), - At(AtSelector), } - pub enum AttrSelectorValue { + pub struct AttributeSelector { + pub span: Span, + pub name: WqName, + pub matcher: Option, + pub value: Option, + pub modifier: Option, + } + + pub struct AttributeSelectorMatcher { + pub span: Span, + pub value: AttributeSelectorMatcherValue, + } + + pub enum AttributeSelectorValue { Str(Str), Ident(Ident), } - pub struct AttrSelector { + pub struct AttributeSelectorModifier { pub span: Span, - pub prefix: Option, - pub name: Ident, - pub matcher: Option, - pub value: Option, - pub modifier: Option, + pub value: Ident, } pub enum PseudoSelectorChildren { @@ -312,11 +336,6 @@ define!({ pub text: Ident, } - pub struct TagSelector { - pub span: Span, - pub text: Ident, - } - pub struct AtSelector { pub span: Span, pub text: Ident,