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

39 lines
1.1 KiB
JavaScript

'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = tokenizeQuotes;
var _globals = require('./globals');
var _unclosed = require('./unclosed');
var _unclosed2 = _interopRequireDefault(_unclosed);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function tokenizeQuotes(state) {
state.nextPos = state.pos;
do {
state.escaped = false;
state.nextPos = state.css.indexOf(state.symbol, state.nextPos + 1);
if (state.nextPos === -1) {
(0, _unclosed2.default)(state, 'quote');
}
state.escapePos = state.nextPos;
while (state.css.charCodeAt(state.escapePos - 1) === _globals.backslash) {
state.escapePos -= 1;
state.escaped = !state.escaped;
}
} while (state.escaped);
state.tokens.push(['string', 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'];