"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parserTokens = void 0;
const const_1 = require("./const.js");
exports.parserTokens = {
    [const_1.ListNode.ListItem]: {
        name: const_1.ListNode.ListItem,
        type: 'block',
        getAttrs: (token) => ({ [const_1.ListsAttr.Markup]: token.markup }),
    },
    [const_1.ListNode.BulletList]: {
        name: const_1.ListNode.BulletList,
        type: 'block',
        getAttrs: (token, tokens, i) => ({
            [const_1.ListsAttr.Tight]: listIsTight(tokens, i),
            [const_1.ListsAttr.Markup]: token.markup,
        }),
    },
    [const_1.ListNode.OrderedList]: {
        name: const_1.ListNode.OrderedList,
        type: 'block',
        getAttrs: (token, tokens, i) => ({
            [const_1.ListsAttr.Order]: Number(token.attrGet('start')) || 1,
            [const_1.ListsAttr.Tight]: listIsTight(tokens, i),
            [const_1.ListsAttr.Markup]: token.markup,
        }),
    },
};
function listIsTight(tokens, i) {
    while (++i < tokens.length) {
        if (tokens[i].type !== 'list_item_open')
            return tokens[i].hidden;
    }
    return false;
}
//# sourceMappingURL=parser.js.map
