3 Object.defineProperty(exports, "__esModule", {
6 exports.default = tokenizeDefault;
8 var _globals = require('./globals');
10 var _findEndOfEscaping = require('./find-end-of-escaping');
12 var _findEndOfEscaping2 = _interopRequireDefault(_findEndOfEscaping);
14 var _isEscaping = require('./is-escaping');
16 var _isEscaping2 = _interopRequireDefault(_isEscaping);
18 var _tokenizeInlineComment = require('./tokenize-inline-comment');
20 var _tokenizeInlineComment2 = _interopRequireDefault(_tokenizeInlineComment);
22 var _tokenizeMultilineComment = require('./tokenize-multiline-comment');
24 var _tokenizeMultilineComment2 = _interopRequireDefault(_tokenizeMultilineComment);
26 var _unclosed = require('./unclosed');
28 var _unclosed2 = _interopRequireDefault(_unclosed);
30 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
32 function tokenizeDefault(state) {
33 var nextSymbolCode = state.css.charCodeAt(state.pos + 1);
35 if (state.symbolCode === _globals.slash && nextSymbolCode === _globals.asterisk) {
36 (0, _tokenizeMultilineComment2.default)(state);
37 } else if (state.symbolCode === _globals.slash && nextSymbolCode === _globals.slash) {
38 (0, _tokenizeInlineComment2.default)(state);
40 if ((0, _isEscaping2.default)(state)) {
41 var pos = (0, _findEndOfEscaping2.default)(state);
44 (0, _unclosed2.default)(state, 'escaping');
49 _globals.wordEndPattern.lastIndex = state.pos + 1;
50 _globals.wordEndPattern.test(state.css);
52 if (_globals.wordEndPattern.lastIndex === 0) {
53 state.nextPos = state.css.length - 1;
55 state.nextPos = _globals.wordEndPattern.lastIndex - 2;
59 state.cssPart = state.css.slice(state.pos, state.nextPos + 1);
61 state.tokens.push(['word', state.cssPart, state.line, state.pos - state.offset, state.line, state.nextPos - state.offset]);
63 state.pos = state.nextPos;
66 module.exports = exports['default'];