Actualizacion maquina principal
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / postcss-less / dist / find-extend-rule.js
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/postcss-less/dist/find-extend-rule.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/postcss-less/dist/find-extend-rule.js
new file mode 100644 (file)
index 0000000..79d70aa
--- /dev/null
@@ -0,0 +1,37 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.default = findExtendRule;
+var extendRuleKeyWords = ['&', ':', 'extend'];
+var extendRuleKeyWordsCount = extendRuleKeyWords.length;
+
+function findExtendRule(tokens) {
+  var start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
+
+  var stack = [];
+  var len = tokens.length;
+  var end = start;
+
+  while (end < len) {
+    var token = tokens[end];
+
+    if (extendRuleKeyWords.indexOf(token[1]) >= 0) {
+      stack.push(token[1]);
+    } else if (token[0] !== 'space') {
+      break;
+    }
+
+    end++;
+  }
+
+  for (var index = 0; index < extendRuleKeyWordsCount; index++) {
+    if (stack[index] !== extendRuleKeyWords[index]) {
+      return null;
+    }
+  }
+
+  return tokens.slice(start, end);
+}
+module.exports = exports['default'];
\ No newline at end of file