/
opt
/
canhelp
/
node_modules
/
postcss
/
lib
/
/opt/canhelp/node_modules/postcss/lib
mkdir
upload
Name
Size
Mode
Actions
at-rule.d.ts
3360
0644
edit
dl
rm
at-rule.js
471
0644
edit
dl
rm
comment.d.ts
1684
0644
edit
dl
rm
comment.js
203
0644
edit
dl
rm
container.d.ts
14047
0644
edit
dl
rm
container.js
10647
0644
edit
dl
rm
css-syntax-error.d.ts
6451
0644
edit
dl
rm
css-syntax-error.js
3402
0644
edit
dl
rm
declaration.d.ts
3837
0644
edit
dl
rm
declaration.js
495
0644
edit
dl
rm
document.d.ts
1888
0644
edit
dl
rm
document.js
654
0644
edit
dl
rm
fromJSON.d.ts
162
0644
edit
dl
rm
fromJSON.js
1506
0644
edit
dl
rm
input.d.ts
5130
0644
edit
dl
rm
input.js
6752
0644
edit
dl
rm
lazy-result.d.ts
4941
0644
edit
dl
rm
lazy-result.js
13562
0644
edit
dl
rm
list.d.ts
1426
0644
edit
dl
rm
list.js
1227
0644
edit
dl
rm
map-generator.js
10031
0644
edit
dl
rm
no-work-result.d.ts
1507
0644
edit
dl
rm
no-work-result.js
2621
0644
edit
dl
rm
node.d.ts
14698
0644
edit
dl
rm
node.js
10719
0644
edit
dl
rm
parse.d.ts
135
0644
edit
dl
rm
parse.js
1147
0644
edit
dl
rm
parser.js
14846
0644
edit
dl
rm
postcss.d.mts
1049
0644
edit
dl
rm
postcss.d.ts
11461
0644
edit
dl
rm
postcss.js
2898
0644
edit
dl
rm
postcss.mjs
980
0644
edit
dl
rm
previous-map.d.ts
1761
0644
edit
dl
rm
previous-map.js
3984
0644
edit
dl
rm
processor.d.ts
3349
0644
edit
dl
rm
processor.js
1738
0644
edit
dl
rm
result.d.ts
4350
0644
edit
dl
rm
result.js
738
0644
edit
dl
rm
root.d.ts
2257
0644
edit
dl
rm
root.js
1239
0644
edit
dl
rm
rule.d.ts
2901
0644
edit
dl
rm
rule.js
569
0644
edit
dl
rm
stringifier.d.ts
1364
0644
edit
dl
rm
stringifier.js
8220
0644
edit
dl
rm
stringify.d.ts
165
0644
edit
dl
rm
stringify.js
213
0644
edit
dl
rm
symbols.js
91
0644
edit
dl
rm
terminal-highlight.js
1399
0644
edit
dl
rm
tokenize.js
6538
0644
edit
dl
rm
warn-once.js
256
0644
edit
dl
rm
warning.d.ts
2928
0644
edit
dl
rm
warning.js
739
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/postcss/lib/tokenize.js
(6538B)
'use strict' const SINGLE_QUOTE = "'".charCodeAt(0) const DOUBLE_QUOTE = '"'.charCodeAt(0) const BACKSLASH = '\\'.charCodeAt(0) const SLASH = '/'.charCodeAt(0) const NEWLINE = '\n'.charCodeAt(0) const SPACE = ' '.charCodeAt(0) const FEED = '\f'.charCodeAt(0) const TAB = '\t'.charCodeAt(0) const CR = '\r'.charCodeAt(0) const OPEN_SQUARE = '['.charCodeAt(0) const CLOSE_SQUARE = ']'.charCodeAt(0) const OPEN_PARENTHESES = '('.charCodeAt(0) const CLOSE_PARENTHESES = ')'.charCodeAt(0) const OPEN_CURLY = '{'.charCodeAt(0) const CLOSE_CURLY = '}'.charCodeAt(0) const SEMICOLON = ';'.charCodeAt(0) const ASTERISK = '*'.charCodeAt(0) const COLON = ':'.charCodeAt(0) const AT = '@'.charCodeAt(0) const RE_AT_END = /[\t\n\f\r "#'()/;[\\\]{}]/g const RE_WORD_END = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g const RE_BAD_BRACKET = /.[\r\n"'(/\\]/ const RE_HEX_ESCAPE = /[\da-f]/i module.exports = function tokenizer(input, options = {}) { let css = input.css.valueOf() let ignore = options.ignoreErrors let code, content, escape, next, quote let currentToken, escaped, escapePos, n, prev let length = css.length let pos = 0 let buffer = [] let returned = [] function position() { return pos } function unclosed(what) { throw input.error('Unclosed ' + what, pos) } function endOfFile() { return returned.length === 0 && pos >= length } function nextToken(opts) { if (returned.length) return returned.pop() if (pos >= length) return let ignoreUnclosed = opts ? opts.ignoreUnclosed : false code = css.charCodeAt(pos) switch (code) { case NEWLINE: case SPACE: case TAB: case CR: case FEED: { next = pos do { next += 1 code = css.charCodeAt(next) } while ( code === SPACE || code === NEWLINE || code === TAB || code === CR || code === FEED ) currentToken = ['space', css.slice(pos, next)] pos = next - 1 break } case OPEN_SQUARE: case CLOSE_SQUARE: case OPEN_CURLY: case CLOSE_CURLY: case COLON: case SEMICOLON: case CLOSE_PARENTHESES: { let controlChar = String.fromCharCode(code) currentToken = [controlChar, controlChar, pos] break } case OPEN_PARENTHESES: { prev = buffer.length ? buffer.pop()[1] : '' n = css.charCodeAt(pos + 1) if ( prev === 'url' && n !== SINGLE_QUOTE && n !== DOUBLE_QUOTE && n !== SPACE && n !== NEWLINE && n !== TAB && n !== FEED && n !== CR ) { next = pos do { escaped = false next = css.indexOf(')', next + 1) if (next === -1) { if (ignore || ignoreUnclosed) { next = pos break } else { unclosed('bracket') } } escapePos = next while (css.charCodeAt(escapePos - 1) === BACKSLASH) { escapePos -= 1 escaped = !escaped } } while (escaped) currentToken = ['brackets', css.slice(pos, next + 1), pos, next] pos = next } else { next = css.indexOf(')', pos + 1) content = css.slice(pos, next + 1) if (next === -1 || RE_BAD_BRACKET.test(content)) { currentToken = ['(', '(', pos] } else { currentToken = ['brackets', content, pos, next] pos = next } } break } case SINGLE_QUOTE: case DOUBLE_QUOTE: { quote = code === SINGLE_QUOTE ? "'" : '"' next = pos do { escaped = false next = css.indexOf(quote, next + 1) if (next === -1) { if (ignore || ignoreUnclosed) { next = pos + 1 break } else { unclosed('string') } } escapePos = next while (css.charCodeAt(escapePos - 1) === BACKSLASH) { escapePos -= 1 escaped = !escaped } } while (escaped) currentToken = ['string', css.slice(pos, next + 1), pos, next] pos = next break } case AT: { RE_AT_END.lastIndex = pos + 1 RE_AT_END.test(css) if (RE_AT_END.lastIndex === 0) { next = css.length - 1 } else { next = RE_AT_END.lastIndex - 2 } currentToken = ['at-word', css.slice(pos, next + 1), pos, next] pos = next break } case BACKSLASH: { next = pos escape = true while (css.charCodeAt(next + 1) === BACKSLASH) { next += 1 escape = !escape } code = css.charCodeAt(next + 1) if ( escape && code !== SLASH && code !== SPACE && code !== NEWLINE && code !== TAB && code !== CR && code !== FEED ) { next += 1 if (RE_HEX_ESCAPE.test(css.charAt(next))) { while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) { next += 1 } if (css.charCodeAt(next + 1) === SPACE) { next += 1 } } } currentToken = ['word', css.slice(pos, next + 1), pos, next] pos = next break } default: { if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) { next = css.indexOf('*/', pos + 2) + 1 if (next === 0) { if (ignore || ignoreUnclosed) { next = css.length } else { unclosed('comment') } } currentToken = ['comment', css.slice(pos, next + 1), pos, next] pos = next } else { RE_WORD_END.lastIndex = pos + 1 RE_WORD_END.test(css) if (RE_WORD_END.lastIndex === 0) { next = css.length - 1 } else { next = RE_WORD_END.lastIndex - 2 } currentToken = ['word', css.slice(pos, next + 1), pos, next] buffer.push(currentToken) pos = next } break } } pos++ return currentToken } function back(token) { returned.push(token) } return { back, endOfFile, nextToken, position } }
Save
cmd:
run