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 1
1
import { error } from '../../../errors.js' ;
2
2
3
3
const REGEX_MATCHER = / ^ [ ~ ^ $ * | ] ? = / ;
4
- const REGEX_CLOSING_PAREN = / (?< ! \\ ) \) / ; // \) is a way of escaping a closing paren, so we need to exclude it
5
4
const REGEX_CLOSING_BRACKET = / [ \s \] ] / ;
6
5
const REGEX_ATTRIBUTE_FLAGS = / ^ [ a - z A - Z ] + / ; // only `i` and `s` are valid today, but make it future-proof
7
6
const REGEX_COMBINATOR_WHITESPACE = / ^ \s * ( \+ | ~ | > | \| \| ) \s * / ;
@@ -161,7 +160,7 @@ function read_selector_list(parser, inside_pseudo_class = false) {
161
160
162
161
parser . allow_whitespace ( ) ;
163
162
164
- if ( parser . match ( '{ ' ) || ( inside_pseudo_class && parser . match ( ')' ) ) ) {
163
+ if ( inside_pseudo_class ? parser . match ( ') ' ) : parser . match ( '{' ) ) {
165
164
return {
166
165
type : 'SelectorList' ,
167
166
start,
@@ -310,7 +309,7 @@ function read_selector(parser, inside_pseudo_class = false) {
310
309
const index = parser . index ;
311
310
parser . allow_whitespace ( ) ;
312
311
313
- if ( parser . match ( '{ ' ) || parser . match ( ', ' ) || ( inside_pseudo_class && parser . match ( ') ' ) ) ) {
312
+ if ( parser . match ( ', ' ) || ( inside_pseudo_class ? parser . match ( ') ' ) : parser . match ( '{ ' ) ) ) {
314
313
parser . index = index ;
315
314
316
315
return {
You can’t perform that action at this time.
0 commit comments