Файловый менеджер - Редактировать - /home/wuectly/www/03cbe/sass.tar
Назад
sass.js 0000604 00000026541 15245663635 0006076 0 ustar 00 // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror"), require("../css/css")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror", "../css/css"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; CodeMirror.defineMode("sass", function(config) { var cssMode = CodeMirror.mimeModes["text/css"]; var propertyKeywords = cssMode.propertyKeywords || {}, colorKeywords = cssMode.colorKeywords || {}, valueKeywords = cssMode.valueKeywords || {}, fontProperties = cssMode.fontProperties || {}; function tokenRegexp(words) { return new RegExp("^" + words.join("|")); } var keywords = ["true", "false", "null", "auto"]; var keywordsRegexp = new RegExp("^" + keywords.join("|")); var operators = ["\\(", "\\)", "=", ">", "<", "==", ">=", "<=", "\\+", "-", "\\!=", "/", "\\*", "%", "and", "or", "not", ";","\\{","\\}",":"]; var opRegexp = tokenRegexp(operators); var pseudoElementsRegexp = /^::?[a-zA-Z_][\w\-]*/; var word; function isEndLine(stream) { return !stream.peek() || stream.match(/\s+$/, false); } function urlTokens(stream, state) { var ch = stream.peek(); if (ch === ")") { stream.next(); state.tokenizer = tokenBase; return "operator"; } else if (ch === "(") { stream.next(); stream.eatSpace(); return "operator"; } else if (ch === "'" || ch === '"') { state.tokenizer = buildStringTokenizer(stream.next()); return "string"; } else { state.tokenizer = buildStringTokenizer(")", false); return "string"; } } function comment(indentation, multiLine) { return function(stream, state) { if (stream.sol() && stream.indentation() <= indentation) { state.tokenizer = tokenBase; return tokenBase(stream, state); } if (multiLine && stream.skipTo("*/")) { stream.next(); stream.next(); state.tokenizer = tokenBase; } else { stream.skipToEnd(); } return "comment"; }; } function buildStringTokenizer(quote, greedy) { if (greedy == null) { greedy = true; } function stringTokenizer(stream, state) { var nextChar = stream.next(); var peekChar = stream.peek(); var previousChar = stream.string.charAt(stream.pos-2); var endingString = ((nextChar !== "\\" && peekChar === quote) || (nextChar === quote && previousChar !== "\\")); if (endingString) { if (nextChar !== quote && greedy) { stream.next(); } if (isEndLine(stream)) { state.cursorHalf = 0; } state.tokenizer = tokenBase; return "string"; } else if (nextChar === "#" && peekChar === "{") { state.tokenizer = buildInterpolationTokenizer(stringTokenizer); stream.next(); return "operator"; } else { return "string"; } } return stringTokenizer; } function buildInterpolationTokenizer(currentTokenizer) { return function(stream, state) { if (stream.peek() === "}") { stream.next(); state.tokenizer = currentTokenizer; return "operator"; } else { return tokenBase(stream, state); } }; } function indent(state) { if (state.indentCount == 0) { state.indentCount++; var lastScopeOffset = state.scopes[0].offset; var currentOffset = lastScopeOffset + config.indentUnit; state.scopes.unshift({ offset:currentOffset }); } } function dedent(state) { if (state.scopes.length == 1) return; state.scopes.shift(); } function tokenBase(stream, state) { var ch = stream.peek(); // Comment if (stream.match("/*")) { state.tokenizer = comment(stream.indentation(), true); return state.tokenizer(stream, state); } if (stream.match("//")) { state.tokenizer = comment(stream.indentation(), false); return state.tokenizer(stream, state); } // Interpolation if (stream.match("#{")) { state.tokenizer = buildInterpolationTokenizer(tokenBase); return "operator"; } // Strings if (ch === '"' || ch === "'") { stream.next(); state.tokenizer = buildStringTokenizer(ch); return "string"; } if(!state.cursorHalf){// state.cursorHalf === 0 // first half i.e. before : for key-value pairs // including selectors if (ch === "-") { if (stream.match(/^-\w+-/)) { return "meta"; } } if (ch === ".") { stream.next(); if (stream.match(/^[\w-]+/)) { indent(state); return "qualifier"; } else if (stream.peek() === "#") { indent(state); return "tag"; } } if (ch === "#") { stream.next(); // ID selectors if (stream.match(/^[\w-]+/)) { indent(state); return "builtin"; } if (stream.peek() === "#") { indent(state); return "tag"; } } // Variables if (ch === "$") { stream.next(); stream.eatWhile(/[\w-]/); return "variable-2"; } // Numbers if (stream.match(/^-?[0-9\.]+/)) return "number"; // Units if (stream.match(/^(px|em|in)\b/)) return "unit"; if (stream.match(keywordsRegexp)) return "keyword"; if (stream.match(/^url/) && stream.peek() === "(") { state.tokenizer = urlTokens; return "atom"; } if (ch === "=") { // Match shortcut mixin definition if (stream.match(/^=[\w-]+/)) { indent(state); return "meta"; } } if (ch === "+") { // Match shortcut mixin definition if (stream.match(/^\+[\w-]+/)){ return "variable-3"; } } if(ch === "@"){ if(stream.match('@extend')){ if(!stream.match(/\s*[\w]/)) dedent(state); } } // Indent Directives if (stream.match(/^@(else if|if|media|else|for|each|while|mixin|function)/)) { indent(state); return "def"; } // Other Directives if (ch === "@") { stream.next(); stream.eatWhile(/[\w-]/); return "def"; } if (stream.eatWhile(/[\w-]/)){ if(stream.match(/ *: *[\w-\+\$#!\("']/,false)){ word = stream.current().toLowerCase(); var prop = state.prevProp + "-" + word; if (propertyKeywords.hasOwnProperty(prop)) { return "property"; } else if (propertyKeywords.hasOwnProperty(word)) { state.prevProp = word; return "property"; } else if (fontProperties.hasOwnProperty(word)) { return "property"; } return "tag"; } else if(stream.match(/ *:/,false)){ indent(state); state.cursorHalf = 1; state.prevProp = stream.current().toLowerCase(); return "property"; } else if(stream.match(/ *,/,false)){ return "tag"; } else{ indent(state); return "tag"; } } if(ch === ":"){ if (stream.match(pseudoElementsRegexp)){ // could be a pseudo-element return "variable-3"; } stream.next(); state.cursorHalf=1; return "operator"; } } // cursorHalf===0 ends here else{ if (ch === "#") { stream.next(); // Hex numbers if (stream.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)){ if (isEndLine(stream)) { state.cursorHalf = 0; } return "number"; } } // Numbers if (stream.match(/^-?[0-9\.]+/)){ if (isEndLine(stream)) { state.cursorHalf = 0; } return "number"; } // Units if (stream.match(/^(px|em|in)\b/)){ if (isEndLine(stream)) { state.cursorHalf = 0; } return "unit"; } if (stream.match(keywordsRegexp)){ if (isEndLine(stream)) { state.cursorHalf = 0; } return "keyword"; } if (stream.match(/^url/) && stream.peek() === "(") { state.tokenizer = urlTokens; if (isEndLine(stream)) { state.cursorHalf = 0; } return "atom"; } // Variables if (ch === "$") { stream.next(); stream.eatWhile(/[\w-]/); if (isEndLine(stream)) { state.cursorHalf = 0; } return "variable-2"; } // bang character for !important, !default, etc. if (ch === "!") { stream.next(); state.cursorHalf = 0; return stream.match(/^[\w]+/) ? "keyword": "operator"; } if (stream.match(opRegexp)){ if (isEndLine(stream)) { state.cursorHalf = 0; } return "operator"; } // attributes if (stream.eatWhile(/[\w-]/)) { if (isEndLine(stream)) { state.cursorHalf = 0; } word = stream.current().toLowerCase(); if (valueKeywords.hasOwnProperty(word)) { return "atom"; } else if (colorKeywords.hasOwnProperty(word)) { return "keyword"; } else if (propertyKeywords.hasOwnProperty(word)) { state.prevProp = stream.current().toLowerCase(); return "property"; } else { return "tag"; } } //stream.eatSpace(); if (isEndLine(stream)) { state.cursorHalf = 0; return null; } } // else ends here if (stream.match(opRegexp)) return "operator"; // If we haven't returned by now, we move 1 character // and return an error stream.next(); return null; } function tokenLexer(stream, state) { if (stream.sol()) state.indentCount = 0; var style = state.tokenizer(stream, state); var current = stream.current(); if (current === "@return" || current === "}"){ dedent(state); } if (style !== null) { var startOfToken = stream.pos - current.length; var withCurrentIndent = startOfToken + (config.indentUnit * state.indentCount); var newScopes = []; for (var i = 0; i < state.scopes.length; i++) { var scope = state.scopes[i]; if (scope.offset <= withCurrentIndent) newScopes.push(scope); } state.scopes = newScopes; } return style; } return { startState: function() { return { tokenizer: tokenBase, scopes: [{offset: 0, type: "sass"}], indentCount: 0, cursorHalf: 0, // cursor half tells us if cursor lies after (1) // or before (0) colon (well... more or less) definedVars: [], definedMixins: [] }; }, token: function(stream, state) { var style = tokenLexer(stream, state); state.lastToken = { style: style, content: stream.current() }; return style; }, indent: function(state) { return state.scopes[0].offset; }, blockCommentStart: "/*", blockCommentEnd: "*/", lineComment: "//", fold: "indent" }; }, "css"); CodeMirror.defineMIME("text/x-sass", "sass"); }); sass.min.js 0000604 00000011211 15245663635 0006644 0 ustar 00 !(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../css/css"],a):a(CodeMirror)})((function(a){"use strict";a.defineMode("sass",(function(b){function c(a){return!a.peek()||a.match(/\s+$/,!1)}function d(a,b){var c=a.peek();return")"===c?(a.next(),b.tokenizer=j,"operator"):"("===c?(a.next(),a.eatSpace(),"operator"):"'"===c||'"'===c?(b.tokenizer=f(a.next()),"string"):(b.tokenizer=f(")",!1),"string")}function e(a,b){return function(c,d){return c.sol()&&c.indentation()<=a?(d.tokenizer=j,j(c,d)):(b&&c.skipTo("*/")?(c.next(),c.next(),d.tokenizer=j):c.skipToEnd(),"comment")}}function f(a,b){function d(e,f){var h=e.next(),i=e.peek(),k=e.string.charAt(e.pos-2);return"\\"!==h&&i===a||h===a&&"\\"!==k?(h!==a&&b&&e.next(),c(e)&&(f.cursorHalf=0),f.tokenizer=j,"string"):"#"===h&&"{"===i?(f.tokenizer=g(d),e.next(),"operator"):"string"}return null==b&&(b=!0),d}function g(a){return function(b,c){return"}"===b.peek()?(b.next(),c.tokenizer=a,"operator"):j(b,c)}}function h(a){if(0==a.indentCount){a.indentCount++;var c=a.scopes[0].offset,d=c+b.indentUnit;a.scopes.unshift({offset:d})}}function i(a){1!=a.scopes.length&&a.scopes.shift()}function j(a,b){var k=a.peek();if(a.match("/*"))return b.tokenizer=e(a.indentation(),!0),b.tokenizer(a,b);if(a.match("//"))return b.tokenizer=e(a.indentation(),!1),b.tokenizer(a,b);if(a.match("#{"))return b.tokenizer=g(j),"operator";if('"'===k||"'"===k)return a.next(),b.tokenizer=f(k),"string";if(b.cursorHalf){if("#"===k&&(a.next(),a.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)))return c(a)&&(b.cursorHalf=0),"number";if(a.match(/^-?[0-9\.]+/))return c(a)&&(b.cursorHalf=0),"number";if(a.match(/^(px|em|in)\b/))return c(a)&&(b.cursorHalf=0),"unit";if(a.match(s))return c(a)&&(b.cursorHalf=0),"keyword";if(a.match(/^url/)&&"("===a.peek())return b.tokenizer=d,c(a)&&(b.cursorHalf=0),"atom";if("$"===k)return a.next(),a.eatWhile(/[\w-]/),c(a)&&(b.cursorHalf=0),"variable-2";if("!"===k)return a.next(),b.cursorHalf=0,a.match(/^[\w]+/)?"keyword":"operator";if(a.match(u))return c(a)&&(b.cursorHalf=0),"operator";if(a.eatWhile(/[\w-]/))return c(a)&&(b.cursorHalf=0),l=a.current().toLowerCase(),p.hasOwnProperty(l)?"atom":o.hasOwnProperty(l)?"keyword":n.hasOwnProperty(l)?(b.prevProp=a.current().toLowerCase(),"property"):"tag";if(c(a))return b.cursorHalf=0,null}else{if("-"===k&&a.match(/^-\w+-/))return"meta";if("."===k){if(a.next(),a.match(/^[\w-]+/))return h(b),"qualifier";if("#"===a.peek())return h(b),"tag"}if("#"===k){if(a.next(),a.match(/^[\w-]+/))return h(b),"builtin";if("#"===a.peek())return h(b),"tag"}if("$"===k)return a.next(),a.eatWhile(/[\w-]/),"variable-2";if(a.match(/^-?[0-9\.]+/))return"number";if(a.match(/^(px|em|in)\b/))return"unit";if(a.match(s))return"keyword";if(a.match(/^url/)&&"("===a.peek())return b.tokenizer=d,"atom";if("="===k&&a.match(/^=[\w-]+/))return h(b),"meta";if("+"===k&&a.match(/^\+[\w-]+/))return"variable-3";if("@"===k&&a.match("@extend")&&(a.match(/\s*[\w]/)||i(b)),a.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return h(b),"def";if("@"===k)return a.next(),a.eatWhile(/[\w-]/),"def";if(a.eatWhile(/[\w-]/)){if(a.match(/ *: *[\w-\+\$#!\("']/,!1)){l=a.current().toLowerCase();var m=b.prevProp+"-"+l;return n.hasOwnProperty(m)?"property":n.hasOwnProperty(l)?(b.prevProp=l,"property"):q.hasOwnProperty(l)?"property":"tag"}return a.match(/ *:/,!1)?(h(b),b.cursorHalf=1,b.prevProp=a.current().toLowerCase(),"property"):a.match(/ *,/,!1)?"tag":(h(b),"tag")}if(":"===k)return a.match(v)?"variable-3":(a.next(),b.cursorHalf=1,"operator")}return a.match(u)?"operator":(a.next(),null)}function k(a,c){a.sol()&&(c.indentCount=0);var d=c.tokenizer(a,c),e=a.current();if("@return"!==e&&"}"!==e||i(c),null!==d){for(var f=a.pos-e.length,g=f+b.indentUnit*c.indentCount,h=[],j=0;j<c.scopes.length;j++){var k=c.scopes[j];k.offset<=g&&h.push(k)}c.scopes=h}return d}var l,m=a.mimeModes["text/css"],n=m.propertyKeywords||{},o=m.colorKeywords||{},p=m.valueKeywords||{},q=m.fontProperties||{},r=["true","false","null","auto"],s=new RegExp("^"+r.join("|")),t=["\\(","\\)","=",">","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"],u=(function(a){return new RegExp("^"+a.join("|"))})(t),v=/^::?[a-zA-Z_][\w\-]*/;return{startState:function(){return{tokenizer:j,scopes:[{offset:0,type:"sass"}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(a,b){var c=k(a,b);return b.lastToken={style:c,content:a.current()},c},indent:function(a){return a.scopes[0].offset},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"indent"}}),"css"),a.defineMIME("text/x-sass","sass")}));
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка