@@ -120,11 +120,9 @@ Lexer.prototype = {
120
120
121
121
lex : function ( text ) {
122
122
this . text = text ;
123
-
124
123
this . index = 0 ;
125
124
this . ch = undefined ;
126
125
this . lastCh = ':' ; // can start regexp
127
-
128
126
this . tokens = [ ] ;
129
127
130
128
while ( this . index < this . text . length ) {
@@ -243,7 +241,6 @@ Lexer.prototype = {
243
241
this . tokens . push ( {
244
242
index : start ,
245
243
text : number ,
246
- literal : true ,
247
244
constant : true ,
248
245
fn : function ( ) { return number ; }
249
246
} ) ;
@@ -296,7 +293,6 @@ Lexer.prototype = {
296
293
// OPERATORS is our own object so we don't need to use special hasOwnPropertyFn
297
294
if ( OPERATORS . hasOwnProperty ( ident ) ) {
298
295
token . fn = OPERATORS [ ident ] ;
299
- token . literal = true ;
300
296
token . constant = true ;
301
297
} else {
302
298
var getter = getterFn ( ident , this . options , this . text ) ;
@@ -313,7 +309,7 @@ Lexer.prototype = {
313
309
314
310
if ( methodName ) {
315
311
this . tokens . push ( {
316
- index :lastDot ,
312
+ index : lastDot ,
317
313
text : '.'
318
314
} ) ;
319
315
this . tokens . push ( {
@@ -356,7 +352,6 @@ Lexer.prototype = {
356
352
index : start ,
357
353
text : rawString ,
358
354
string : string ,
359
- literal : true ,
360
355
constant : true ,
361
356
fn : function ( ) { return string ; }
362
357
} ) ;
@@ -391,7 +386,6 @@ Parser.prototype = {
391
386
392
387
parse : function ( text ) {
393
388
this . text = text ;
394
-
395
389
this . tokens = this . lexer . lex ( text ) ;
396
390
397
391
var value = this . statements ( ) ;
@@ -421,8 +415,10 @@ Parser.prototype = {
421
415
if ( ! primary ) {
422
416
this . throwError ( 'not a primary expression' , token ) ;
423
417
}
424
- primary . literal = ! ! token . literal ;
425
- primary . constant = ! ! token . constant ;
418
+ if ( token . constant ) {
419
+ primary . constant = true ;
420
+ primary . literal = true ;
421
+ }
426
422
}
427
423
428
424
var next , context ;
0 commit comments