1
0
mirror of https://github.com/thangisme/notes.git synced 2024-11-01 04:17:33 -04:00
notes/node_modules/postcss-less/dist/tokenizer/tokenize-backslash.js

29 lines
997 B
JavaScript
Raw Normal View History

2017-03-09 13:16:08 -05:00
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = tokenizeBackslash;
var _globals = require('./globals');
function tokenizeBackslash(state) {
state.nextPos = state.pos;
state.escape = true;
while (state.css.charCodeAt(state.nextPos + 1) === _globals.backslash) {
state.nextPos += 1;
state.escape = !state.escape;
}
state.symbolCode = state.css.charCodeAt(state.nextPos + 1);
if (state.escape && state.symbolCode !== _globals.slash && state.symbolCode !== _globals.space && state.symbolCode !== _globals.newline && state.symbolCode !== _globals.tab && state.symbolCode !== _globals.carriageReturn && state.symbolCode !== _globals.feed) {
state.nextPos += 1;
}
state.tokens.push(['word', state.css.slice(state.pos, state.nextPos + 1), state.line, state.pos - state.offset, state.line, state.nextPos - state.offset]);
state.pos = state.nextPos;
}
module.exports = exports['default'];