1
0
mirror of https://github.com/thangisme/notes.git synced 2024-11-01 03:17:30 -04:00
notes/node_modules/postcss-less/dist/tokenizer/tokenize-whitespace.js
Patrick Marsceill b7b0d0d7bf
Initial commit
2017-03-09 13:16:08 -05:00

26 lines
872 B
JavaScript

'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = tokenizeWhitespace;
var _globals = require('./globals');
function tokenizeWhitespace(state) {
state.nextPos = state.pos;
// collect all neighbour space symbols
do {
state.nextPos += 1;
state.symbolCode = state.css.charCodeAt(state.nextPos);
if (state.symbolCode === _globals.newline) {
state.offset = state.nextPos;
state.line += 1;
}
} while (state.symbolCode === _globals.space || state.symbolCode === _globals.newline || state.symbolCode === _globals.tab || state.symbolCode === _globals.carriageReturn || state.symbolCode === _globals.feed);
state.tokens.push(['space', state.css.slice(state.pos, state.nextPos)]);
state.pos = state.nextPos - 1;
}
module.exports = exports['default'];