File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -76,11 +76,16 @@ const engine = function(options) {
7676 this . parser = new parser ( this . lexer , this . ast ) ;
7777 if ( options && typeof options === "object" ) {
7878 // disable php7 from lexer if already disabled from parser
79- if ( options . parser && options . parser . php7 === false ) {
79+ if ( options . parser ) {
8080 if ( ! options . lexer ) {
8181 options . lexer = { } ;
8282 }
83- options . lexer . php7 = false ;
83+ if ( options . parser . php7 === false ) {
84+ options . parser . php73 = false ;
85+ options . parser . php74 = false ;
86+ }
87+ options . lexer . php7 = options . parser . php7 ;
88+ options . lexer . php73 = options . parser . php73 ;
8489 }
8590 combine ( options , this ) ;
8691 }
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ const lexer = function(engine) {
3030 this . asp_tags = false ;
3131 this . short_tags = false ;
3232 this . php7 = true ;
33+ this . php73 = true ;
3334 this . yyprevcol = 0 ;
3435 this . keywords = {
3536 __class__ : this . tok . T_CLASS_C ,
Original file line number Diff line number Diff line change @@ -264,10 +264,6 @@ parser.prototype.parse = function(code, filename) {
264264 } else {
265265 this . _tokens = null ;
266266 }
267- if ( ! this . php7 ) {
268- this . php73 = false ;
269- this . php74 = false ;
270- }
271267 this . _docIndex = 0 ;
272268 this . _lastNode = null ;
273269 this . lexer . setInput ( code ) ;
You can’t perform that action at this time.
0 commit comments