File tree Expand file tree Collapse file tree 4 files changed +866
-5
lines changed Expand file tree Collapse file tree 4 files changed +866
-5
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,20 +19,33 @@ 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 "(" :
29
32
case ")" :
30
33
case ":" :
31
34
case "=" :
35
+ case "|" :
36
+ case "&" :
37
+ case "^" :
38
+ case "-" :
39
+ case "+" :
40
+ case "*" :
41
+ case "%" :
42
+ case "~" :
43
+ case "<" :
44
+ case ">" :
45
+ case "!" :
32
46
return this . consume_TOKEN ( ) ;
33
47
case "[" :
34
- listDepth ++ ;
48
+ this . attributeListDepth [ this . attributeIndex ] ++ ;
35
49
return "[" ;
36
50
case "," :
37
51
return "," ;
@@ -45,6 +59,8 @@ module.exports = {
45
59
} else if ( this . _input [ this . offset ] === "*" ) {
46
60
this . input ( ) ;
47
61
return this . T_DOC_COMMENT ( ) ;
62
+ } else {
63
+ return this . consume_TOKEN ( ) ;
48
64
}
49
65
}
50
66
if ( this . is_LABEL_START ( ) || ch === "\\" ) {
@@ -55,7 +71,7 @@ module.exports = {
55
71
break ;
56
72
}
57
73
}
58
- return this . tok . T_STRING ;
74
+ return this . T_STRING ( ) ;
59
75
} else if ( this . is_NUM ( ) ) {
60
76
return this . consume_NUM ( ) ;
61
77
}
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