postcss-less
Advanced tools
Comparing version 1.1.5 to 2.0.0
@@ -35,3 +35,5 @@ 'use strict'; | ||
var pageSelectorPattern = exports.pageSelectorPattern = /^@page[^\w-]+/; | ||
var variableSpaceColonPattern = exports.variableSpaceColonPattern = /^\s*:/; | ||
var variablePattern = exports.variablePattern = /^@[^:\(\{]+:/; | ||
var hashColorPattern = exports.hashColorPattern = /^#[0-9a-fA-F]{6}$|^#[0-9a-fA-F]{3}$/; |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var singleQuote=exports.singleQuote="'".charCodeAt(0),doubleQuote=exports.doubleQuote='"'.charCodeAt(0),backslash=exports.backslash="\\".charCodeAt(0),backTick=exports.backTick="`".charCodeAt(0),slash=exports.slash="/".charCodeAt(0),newline=exports.newline="\n".charCodeAt(0),space=exports.space=" ".charCodeAt(0),feed=exports.feed="\f".charCodeAt(0),tab=exports.tab="\t".charCodeAt(0),carriageReturn=exports.carriageReturn="\r".charCodeAt(0),openedParenthesis=exports.openedParenthesis="(".charCodeAt(0),closedParenthesis=exports.closedParenthesis=")".charCodeAt(0),openedCurlyBracket=exports.openedCurlyBracket="{".charCodeAt(0),closedCurlyBracket=exports.closedCurlyBracket="}".charCodeAt(0),openSquareBracket=exports.openSquareBracket="[".charCodeAt(0),closeSquareBracket=exports.closeSquareBracket="]".charCodeAt(0),semicolon=exports.semicolon=";".charCodeAt(0),asterisk=exports.asterisk="*".charCodeAt(0),colon=exports.colon=":".charCodeAt(0),comma=exports.comma=",".charCodeAt(0),dot=exports.dot=".".charCodeAt(0),atRule=exports.atRule="@".charCodeAt(0),tilde=exports.tilde="~".charCodeAt(0),hash=exports.hash="#".charCodeAt(0),atEndPattern=exports.atEndPattern=/[ \n\t\r\f\{\(\)'"\\;\/\[\]#]/g,wordEndPattern=exports.wordEndPattern=/[ \n\t\r\f\(\)\{\}:,;@!'"\\\]\[#]|\/(?=\*)/g,badBracketPattern=exports.badBracketPattern=/.[\\\/\("'\n]/,variablePattern=exports.variablePattern=/^@[^:\(\{]+:/,hashColorPattern=exports.hashColorPattern=/^#[0-9a-fA-F]{6}$|^#[0-9a-fA-F]{3}$/; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var singleQuote=exports.singleQuote="'".charCodeAt(0),doubleQuote=exports.doubleQuote='"'.charCodeAt(0),backslash=exports.backslash="\\".charCodeAt(0),backTick=exports.backTick="`".charCodeAt(0),slash=exports.slash="/".charCodeAt(0),newline=exports.newline="\n".charCodeAt(0),space=exports.space=" ".charCodeAt(0),feed=exports.feed="\f".charCodeAt(0),tab=exports.tab="\t".charCodeAt(0),carriageReturn=exports.carriageReturn="\r".charCodeAt(0),openedParenthesis=exports.openedParenthesis="(".charCodeAt(0),closedParenthesis=exports.closedParenthesis=")".charCodeAt(0),openedCurlyBracket=exports.openedCurlyBracket="{".charCodeAt(0),closedCurlyBracket=exports.closedCurlyBracket="}".charCodeAt(0),openSquareBracket=exports.openSquareBracket="[".charCodeAt(0),closeSquareBracket=exports.closeSquareBracket="]".charCodeAt(0),semicolon=exports.semicolon=";".charCodeAt(0),asterisk=exports.asterisk="*".charCodeAt(0),colon=exports.colon=":".charCodeAt(0),comma=exports.comma=",".charCodeAt(0),dot=exports.dot=".".charCodeAt(0),atRule=exports.atRule="@".charCodeAt(0),tilde=exports.tilde="~".charCodeAt(0),hash=exports.hash="#".charCodeAt(0),atEndPattern=exports.atEndPattern=/[ \n\t\r\f\{\(\)'"\\;\/\[\]#]/g,wordEndPattern=exports.wordEndPattern=/[ \n\t\r\f\(\)\{\}:,;@!'"\\\]\[#]|\/(?=\*)/g,badBracketPattern=exports.badBracketPattern=/.[\\\/\("'\n]/,pageSelectorPattern=exports.pageSelectorPattern=/^@page[^\w-]+/,variableSpaceColonPattern=exports.variableSpaceColonPattern=/^\s*:/,variablePattern=exports.variablePattern=/^@[^:\(\{]+:/,hashColorPattern=exports.hashColorPattern=/^#[0-9a-fA-F]{6}$|^#[0-9a-fA-F]{3}$/; |
@@ -48,3 +48,14 @@ 'use strict'; | ||
} else { | ||
state.nextPos = _globals.atEndPattern.lastIndex - 2; | ||
// the first condition below is special for variable in less | ||
// some one may write code like `@testVar : #fff` | ||
// we should detect this kind of existence. | ||
var rest = state.css.slice(_globals.atEndPattern.lastIndex); | ||
var potentialPageRule = state.css.slice(state.pos, _globals.atEndPattern.lastIndex + 1); | ||
// we have to handle special selector like `@page :left` | ||
if (_globals.variableSpaceColonPattern.test(rest) && !_globals.pageSelectorPattern.test(potentialPageRule)) { | ||
state.nextPos = _globals.atEndPattern.lastIndex + rest.search(':'); | ||
} else { | ||
state.nextPos = _globals.atEndPattern.lastIndex - 2; | ||
} | ||
} | ||
@@ -51,0 +62,0 @@ |
@@ -1,1 +0,1 @@ | ||
"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function tokenizeAtRule(e){e.css.charCodeAt(e.pos+1)===_globals.openedCurlyBracket?(e.nextPos=e.css.indexOf("}",e.pos+2),-1===e.nextPos&&(0,_unclosed2.default)(e,"interpolation"),e.cssPart=e.css.slice(e.pos,e.nextPos+1),e.lines=e.cssPart.split("\n"),e.lastLine=e.lines.length-1,e.lastLine>0?(e.nextLine=e.line+e.lastLine,e.nextOffset=e.nextPos-e.lines[e.lastLine].length):(e.nextLine=e.line,e.nextOffset=e.offset),e.tokens.push(["word",e.cssPart,e.line,e.pos-e.offset,e.nextLine,e.nextPos-e.nextOffset]),e.offset=e.nextOffset,e.line=e.nextLine):(_globals.atEndPattern.lastIndex=e.pos+1,_globals.atEndPattern.test(e.css),0===_globals.atEndPattern.lastIndex?e.nextPos=e.css.length-1:e.nextPos=_globals.atEndPattern.lastIndex-2,e.cssPart=e.css.slice(e.pos,e.nextPos+1),e.token="at-word",_globals.variablePattern.test(e.cssPart)&&(_globals.wordEndPattern.lastIndex=e.pos+1,_globals.wordEndPattern.test(e.css),0===_globals.wordEndPattern.lastIndex?e.nextPos=e.css.length-1:e.nextPos=_globals.wordEndPattern.lastIndex-2,e.cssPart=e.css.slice(e.pos,e.nextPos+1),e.token="word"),e.tokens.push([e.token,e.cssPart,e.line,e.pos-e.offset,e.line,e.nextPos-e.offset])),e.pos=e.nextPos}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=tokenizeAtRule;var _globals=require("./globals"),_unclosed=require("./unclosed"),_unclosed2=_interopRequireDefault(_unclosed);module.exports=exports.default; | ||
"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function tokenizeAtRule(e){if(e.css.charCodeAt(e.pos+1)===_globals.openedCurlyBracket)e.nextPos=e.css.indexOf("}",e.pos+2),-1===e.nextPos&&(0,_unclosed2.default)(e,"interpolation"),e.cssPart=e.css.slice(e.pos,e.nextPos+1),e.lines=e.cssPart.split("\n"),e.lastLine=e.lines.length-1,e.lastLine>0?(e.nextLine=e.line+e.lastLine,e.nextOffset=e.nextPos-e.lines[e.lastLine].length):(e.nextLine=e.line,e.nextOffset=e.offset),e.tokens.push(["word",e.cssPart,e.line,e.pos-e.offset,e.nextLine,e.nextPos-e.nextOffset]),e.offset=e.nextOffset,e.line=e.nextLine;else{if(_globals.atEndPattern.lastIndex=e.pos+1,_globals.atEndPattern.test(e.css),0===_globals.atEndPattern.lastIndex)e.nextPos=e.css.length-1;else{var t=e.css.slice(_globals.atEndPattern.lastIndex),s=e.css.slice(e.pos,_globals.atEndPattern.lastIndex+1);_globals.variableSpaceColonPattern.test(t)&&!_globals.pageSelectorPattern.test(s)?e.nextPos=_globals.atEndPattern.lastIndex+t.search(":"):e.nextPos=_globals.atEndPattern.lastIndex-2}e.cssPart=e.css.slice(e.pos,e.nextPos+1),e.token="at-word",_globals.variablePattern.test(e.cssPart)&&(_globals.wordEndPattern.lastIndex=e.pos+1,_globals.wordEndPattern.test(e.css),0===_globals.wordEndPattern.lastIndex?e.nextPos=e.css.length-1:e.nextPos=_globals.wordEndPattern.lastIndex-2,e.cssPart=e.css.slice(e.pos,e.nextPos+1),e.token="word"),e.tokens.push([e.token,e.cssPart,e.line,e.pos-e.offset,e.line,e.nextPos-e.offset])}e.pos=e.nextPos}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=tokenizeAtRule;var _globals=require("./globals"),_unclosed=require("./unclosed"),_unclosed2=_interopRequireDefault(_unclosed);module.exports=exports.default; |
{ | ||
"name": "postcss-less", | ||
"version": "1.1.5", | ||
"version": "2.0.0", | ||
"description": "LESS parser for PostCSS", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
93922
1168