homunculus
Advanced tools
Comparing version 0.9.5 to 0.9.6
{ | ||
"name": "homunculus", | ||
"version": "0.9.5", | ||
"version": "0.9.6", | ||
"description": "A lexer&parser by Javascript", | ||
@@ -5,0 +5,0 @@ "maintainers": [ |
@@ -15,3 +15,3 @@ var Lexer = require('./Lexer'); | ||
this.media = false; | ||
this.import = false; | ||
this.impt = false; | ||
this.value = false; | ||
@@ -24,3 +24,3 @@ this.parenthese = false; | ||
this.sel = true; | ||
this.var = false; | ||
this.va = false; | ||
this.cvar = false; | ||
@@ -89,6 +89,6 @@ this.page = false; | ||
this.number = false; | ||
this.var = false; | ||
this.va = false; | ||
switch(s) { | ||
case '@import': | ||
this.import = true; | ||
this.impt = true; | ||
break; | ||
@@ -124,3 +124,3 @@ case '@media': | ||
this.kw = false; | ||
this.var = false; | ||
this.va = false; | ||
this.number = false; | ||
@@ -136,3 +136,3 @@ this.page = false; | ||
this.url = false; | ||
this.var = false; | ||
this.va = false; | ||
this.sel = false; | ||
@@ -157,3 +157,3 @@ this.number = false; | ||
this.url = false; | ||
this.var = false; | ||
this.va = false; | ||
} | ||
@@ -167,3 +167,3 @@ else if(this.extend) { | ||
this.kw = false; | ||
this.var = false; | ||
this.va = false; | ||
} | ||
@@ -174,9 +174,9 @@ else if(this.page || this.kf || this.ns) { | ||
this.kw = false; | ||
this.var = false; | ||
this.va = false; | ||
this.value = false; | ||
} | ||
else if(this.var) { | ||
else if(this.va) { | ||
token.type(Token.VARS); | ||
this.url = false; | ||
this.var = false; | ||
this.va = false; | ||
} | ||
@@ -239,3 +239,3 @@ else if(this.supports) { | ||
this.url = false; | ||
this.var = false; | ||
this.va = false; | ||
} | ||
@@ -246,3 +246,3 @@ else if(this.rule.keyWords().hasOwnProperty(s) | ||
this.url = ['url', 'format', 'url-prefix', 'domain', 'regexp'].indexOf(s) > -1; | ||
this.var = s == 'var'; | ||
this.va = s == 'var'; | ||
} | ||
@@ -279,3 +279,3 @@ this.kw = false; | ||
this.url = false; | ||
this.var = false; | ||
this.va = false; | ||
} | ||
@@ -294,3 +294,3 @@ this.number = false; | ||
} | ||
this.var = false; | ||
this.va = false; | ||
this.page = false; | ||
@@ -309,3 +309,3 @@ this.kf = false; | ||
this.number = false; | ||
this.var = false; | ||
this.va = false; | ||
this.page = false; | ||
@@ -318,3 +318,3 @@ this.kf = false; | ||
this.url = false; | ||
this.var = false; | ||
this.va = false; | ||
this.page = false; | ||
@@ -334,7 +334,7 @@ this.kf = false; | ||
this.sel = false; | ||
this.var = false; | ||
this.va = false; | ||
break; | ||
case '(': | ||
this.parenthese = true; | ||
if(this.media || this.import || this.doc) { | ||
if(this.media || this.impt || this.doc) { | ||
this.value = false; | ||
@@ -358,3 +358,3 @@ } | ||
case ')': | ||
if(this.media || this.import || this.doc) { | ||
if(this.media || this.impt || this.doc) { | ||
this.value = true; | ||
@@ -364,3 +364,3 @@ } | ||
this.parenthese = false; | ||
this.var = false; | ||
this.va = false; | ||
//)之后可能跟单位,比如margin:(1+2)px | ||
@@ -386,3 +386,3 @@ this.number = true; | ||
this.url = false; | ||
this.var = false; | ||
this.va = false; | ||
break; | ||
@@ -395,3 +395,3 @@ case ']': | ||
this.url = false; | ||
this.var = false; | ||
this.va = false; | ||
break; | ||
@@ -403,6 +403,6 @@ case ';': | ||
this.value = false; | ||
this.import = false; | ||
this.impt = false; | ||
this.url = false; | ||
this.sel = false; | ||
this.var = false; | ||
this.va = false; | ||
this.cvar = false; | ||
@@ -416,6 +416,6 @@ this.extend = false; | ||
this.media = false; | ||
this.import = false; | ||
this.impt = false; | ||
this.url = false; | ||
this.sel = true; | ||
this.var = false; | ||
this.va = false; | ||
this.supports = false; | ||
@@ -429,7 +429,7 @@ this.cvar = false; | ||
this.media = false; | ||
this.import = false; | ||
this.impt = false; | ||
this.url = false; | ||
this.sel = true; | ||
this.depth--; | ||
this.var = false; | ||
this.va = false; | ||
this.cvar = false; | ||
@@ -476,3 +476,3 @@ this.extend = false; | ||
} | ||
this.var = false; | ||
this.va = false; | ||
break; | ||
@@ -486,3 +486,3 @@ case '-': | ||
this.sel = false; | ||
this.var = false; | ||
this.va = false; | ||
break; | ||
@@ -495,3 +495,3 @@ case '~': | ||
this.url = false; | ||
this.var = false; | ||
this.va = false; | ||
break; | ||
@@ -508,3 +508,3 @@ } | ||
this.url = false; | ||
this.var = false; | ||
this.va = false; | ||
this.page = false; | ||
@@ -527,3 +527,3 @@ this.kf = false; | ||
this.number = false; | ||
this.var = false; | ||
this.va = false; | ||
this.page = false; | ||
@@ -530,0 +530,0 @@ this.kf = false; |
@@ -15,3 +15,3 @@ define(function(require, exports, module) {var Lexer = require('./Lexer'); | ||
this.media = false; | ||
this.import = false; | ||
this.impt = false; | ||
this.value = false; | ||
@@ -24,3 +24,3 @@ this.parenthese = false; | ||
this.sel = true; | ||
this.var = false; | ||
this.va = false; | ||
this.cvar = false; | ||
@@ -89,6 +89,6 @@ this.page = false; | ||
this.number = false; | ||
this.var = false; | ||
this.va = false; | ||
switch(s) { | ||
case '@import': | ||
this.import = true; | ||
this.impt = true; | ||
break; | ||
@@ -124,3 +124,3 @@ case '@media': | ||
this.kw = false; | ||
this.var = false; | ||
this.va = false; | ||
this.number = false; | ||
@@ -136,3 +136,3 @@ this.page = false; | ||
this.url = false; | ||
this.var = false; | ||
this.va = false; | ||
this.sel = false; | ||
@@ -157,3 +157,3 @@ this.number = false; | ||
this.url = false; | ||
this.var = false; | ||
this.va = false; | ||
} | ||
@@ -167,3 +167,3 @@ else if(this.extend) { | ||
this.kw = false; | ||
this.var = false; | ||
this.va = false; | ||
} | ||
@@ -174,9 +174,9 @@ else if(this.page || this.kf || this.ns) { | ||
this.kw = false; | ||
this.var = false; | ||
this.va = false; | ||
this.value = false; | ||
} | ||
else if(this.var) { | ||
else if(this.va) { | ||
token.type(Token.VARS); | ||
this.url = false; | ||
this.var = false; | ||
this.va = false; | ||
} | ||
@@ -239,3 +239,3 @@ else if(this.supports) { | ||
this.url = false; | ||
this.var = false; | ||
this.va = false; | ||
} | ||
@@ -246,3 +246,3 @@ else if(this.rule.keyWords().hasOwnProperty(s) | ||
this.url = ['url', 'format', 'url-prefix', 'domain', 'regexp'].indexOf(s) > -1; | ||
this.var = s == 'var'; | ||
this.va = s == 'var'; | ||
} | ||
@@ -279,3 +279,3 @@ this.kw = false; | ||
this.url = false; | ||
this.var = false; | ||
this.va = false; | ||
} | ||
@@ -294,3 +294,3 @@ this.number = false; | ||
} | ||
this.var = false; | ||
this.va = false; | ||
this.page = false; | ||
@@ -309,3 +309,3 @@ this.kf = false; | ||
this.number = false; | ||
this.var = false; | ||
this.va = false; | ||
this.page = false; | ||
@@ -318,3 +318,3 @@ this.kf = false; | ||
this.url = false; | ||
this.var = false; | ||
this.va = false; | ||
this.page = false; | ||
@@ -334,7 +334,7 @@ this.kf = false; | ||
this.sel = false; | ||
this.var = false; | ||
this.va = false; | ||
break; | ||
case '(': | ||
this.parenthese = true; | ||
if(this.media || this.import || this.doc) { | ||
if(this.media || this.impt || this.doc) { | ||
this.value = false; | ||
@@ -358,3 +358,3 @@ } | ||
case ')': | ||
if(this.media || this.import || this.doc) { | ||
if(this.media || this.impt || this.doc) { | ||
this.value = true; | ||
@@ -364,3 +364,3 @@ } | ||
this.parenthese = false; | ||
this.var = false; | ||
this.va = false; | ||
//)之后可能跟单位,比如margin:(1+2)px | ||
@@ -386,3 +386,3 @@ this.number = true; | ||
this.url = false; | ||
this.var = false; | ||
this.va = false; | ||
break; | ||
@@ -395,3 +395,3 @@ case ']': | ||
this.url = false; | ||
this.var = false; | ||
this.va = false; | ||
break; | ||
@@ -403,6 +403,6 @@ case ';': | ||
this.value = false; | ||
this.import = false; | ||
this.impt = false; | ||
this.url = false; | ||
this.sel = false; | ||
this.var = false; | ||
this.va = false; | ||
this.cvar = false; | ||
@@ -416,6 +416,6 @@ this.extend = false; | ||
this.media = false; | ||
this.import = false; | ||
this.impt = false; | ||
this.url = false; | ||
this.sel = true; | ||
this.var = false; | ||
this.va = false; | ||
this.supports = false; | ||
@@ -429,7 +429,7 @@ this.cvar = false; | ||
this.media = false; | ||
this.import = false; | ||
this.impt = false; | ||
this.url = false; | ||
this.sel = true; | ||
this.depth--; | ||
this.var = false; | ||
this.va = false; | ||
this.cvar = false; | ||
@@ -476,3 +476,3 @@ this.extend = false; | ||
} | ||
this.var = false; | ||
this.va = false; | ||
break; | ||
@@ -486,3 +486,3 @@ case '-': | ||
this.sel = false; | ||
this.var = false; | ||
this.va = false; | ||
break; | ||
@@ -495,3 +495,3 @@ case '~': | ||
this.url = false; | ||
this.var = false; | ||
this.va = false; | ||
break; | ||
@@ -508,3 +508,3 @@ } | ||
this.url = false; | ||
this.var = false; | ||
this.va = false; | ||
this.page = false; | ||
@@ -527,3 +527,3 @@ this.kf = false; | ||
this.number = false; | ||
this.var = false; | ||
this.va = false; | ||
this.page = false; | ||
@@ -530,0 +530,0 @@ this.kf = false; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1281031