MCPcopy
hub / github.com/webpack/webpack / useObjectBackend

Function useObjectBackend

lib/css/syntax.js:1657–1704  ·  view source on GitHub ↗
(lc)

Source from the content-addressed store, hash-verified

1655};
1656/** @param {LocConverter} lc loc converter for this parse */
1657const useObjectBackend = (lc) => {
1658 _lc = lc;
1659 _mkLeaf = _objLeaf;
1660 _mkUrl = _objUrl;
1661 _mkContainer = _objContainer;
1662 _mkStylesheet = _objStylesheet;
1663 _setName = (r, v, ns, ne) => {
1664 const c = /** @type {Container} */ (r);
1665 c.name = v;
1666 c.nameStart = ns;
1667 c.nameEnd = ne;
1668 };
1669 _setEnd = (r, v) => {
1670 r.end = v;
1671 };
1672 _setBlock = (r, bs, be) => {
1673 const c = /** @type {Container} */ (r);
1674 c.blockStart = bs;
1675 c.blockEnd = be;
1676 };
1677 _setImportant = (r) => {
1678 /** @type {Container} */ (r).important = true;
1679 };
1680 _setToken = (r, ch) => {
1681 /** @type {Container} */ (r).token = ch;
1682 };
1683 _setValue = (r, list) => {
1684 /** @type {Container} */ (r).value = /** @type {ComponentValue[]} */ (list);
1685 };
1686 _setPrelude = (r, list) => {
1687 /** @type {Container} */ (r).prelude = /** @type {ComponentValue[]} */ (
1688 list
1689 );
1690 };
1691 _setBody = (r, decls, childRules) => {
1692 const c = /** @type {Container} */ (r);
1693 c.declarations = /** @type {Declaration[]} */ (decls);
1694 c.childRules = /** @type {Rule[]} */ (childRules);
1695 };
1696 _setRules = (r, list) => {
1697 /** @type {Stylesheet} */ (r).rules = /** @type {Rule[]} */ (list);
1698 };
1699 _nType = (r) => r.type;
1700 _nStart = (r) => r.start;
1701 _nValue = (r) => /** @type {Token} */ (r).value;
1702 _nToken = (r) =>
1703 /** @type {SimpleBlockToken} */ (/** @type {Container} */ (r).token);
1704};
1705
1706// -- struct-of-arrays backend: writes nodes into reused typed arrays --
1707// A node ref is its integer id; fields live in parallel arrays indexed by id.

Callers 8

parseAStylesheetFunction · 0.85
parseABlocksContentsFunction · 0.85
parseARuleFunction · 0.85
parseADeclarationFunction · 0.85
parseAComponentValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected