File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 6
6
"use strict" ;
7
7
8
8
module . exports = {
9
+ attributeIndex : 0 ,
10
+ attributeListDepth : { } ,
9
11
matchST_ATTRIBUTE : function ( ) {
10
- let listDepth = 0 ;
11
12
let ch = this . input ( ) ;
12
13
if ( this . is_WHITESPACE ( ) ) {
13
14
do {
@@ -18,11 +19,13 @@ module.exports = {
18
19
}
19
20
switch ( ch ) {
20
21
case "]" :
21
- if ( listDepth === 0 ) {
22
+ if ( this . attributeListDepth [ this . attributeIndex ] === 0 ) {
23
+ delete this . attributeListDepth [ this . attributeIndex ] ;
24
+ this . attributeIndex -- ;
22
25
this . popState ( ) ;
23
26
} else {
24
27
/* istanbul ignore next */
25
- listDepth -- ;
28
+ this . attributeListDepth [ this . attributeIndex ] -- ;
26
29
}
27
30
return "]" ;
28
31
case "(" :
@@ -42,7 +45,7 @@ module.exports = {
42
45
case "!" :
43
46
return this . consume_TOKEN ( ) ;
44
47
case "[" :
45
- listDepth ++ ;
48
+ this . attributeListDepth [ this . attributeIndex ] ++ ;
46
49
return "[" ;
47
50
case "," :
48
51
return "," ;
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ module.exports = {
18
18
case "#" :
19
19
if ( this . version >= 800 && this . _input [ this . offset ] === "[" ) {
20
20
this . input ( ) ;
21
+ this . attributeListDepth [ ++ this . attributeIndex ] = 0 ;
21
22
this . begin ( "ST_ATTRIBUTE" ) ;
22
23
return this . tok . T_ATTRIBUTE ;
23
24
}
You can’t perform that action at this time.
0 commit comments