File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
packages/svelte/src/compiler/phases/1-parse/read Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 11import { error } from '../../../errors.js' ;
22
33const REGEX_MATCHER = / ^ [ ~ ^ $ * | ] ? = / ;
4- const REGEX_CLOSING_PAREN = / (?< ! \\ ) \) / ; // \) is a way of escaping a closing paren, so we need to exclude it
54const REGEX_CLOSING_BRACKET = / [ \s \] ] / ;
65const REGEX_ATTRIBUTE_FLAGS = / ^ [ a - z A - Z ] + / ; // only `i` and `s` are valid today, but make it future-proof
76const REGEX_COMBINATOR_WHITESPACE = / ^ \s * ( \+ | ~ | > | \| \| ) \s * / ;
@@ -161,7 +160,7 @@ function read_selector_list(parser, inside_pseudo_class = false) {
161160
162161 parser . allow_whitespace ( ) ;
163162
164- if ( parser . match ( '{ ' ) || ( inside_pseudo_class && parser . match ( ')' ) ) ) {
163+ if ( inside_pseudo_class ? parser . match ( ') ' ) : parser . match ( '{' ) ) {
165164 return {
166165 type : 'SelectorList' ,
167166 start,
@@ -310,7 +309,7 @@ function read_selector(parser, inside_pseudo_class = false) {
310309 const index = parser . index ;
311310 parser . allow_whitespace ( ) ;
312311
313- if ( parser . match ( '{ ' ) || parser . match ( ', ' ) || ( inside_pseudo_class && parser . match ( ') ' ) ) ) {
312+ if ( parser . match ( ', ' ) || ( inside_pseudo_class ? parser . match ( ') ' ) : parser . match ( '{ ' ) ) ) {
314313 parser . index = index ;
315314
316315 return {
You can’t perform that action at this time.
0 commit comments