MCPcopy
hub / github.com/webpack/webpack / useSoaBackend

Function useSoaBackend

lib/css/syntax.js:1808–1856  ·  view source on GitHub ↗
(input, lc)

Source from the content-addressed store, hash-verified

1806 * @param {LocConverter} lc loc converter
1807 */
1808const useSoaBackend = (input, lc) => {
1809 _soaInput = input;
1810 _soaLC = lc;
1811 _soaN = 0;
1812 _mkLeaf = (type, start, end) => _soaAlloc(type, start, end);
1813 _mkUrl = (start, end, cs, ce) => {
1814 const r = _soaAlloc(T_URL, start, end);
1815 _soaA0[_ix(r)] = cs;
1816 _soaA1[_ix(r)] = ce;
1817 return r;
1818 };
1819 _mkContainer = (type, start, end) => _soaAlloc(type, start, end);
1820 _mkStylesheet = (start) => _soaAlloc(T_STYLESHEET, start, start);
1821 // name / nameStart are derived from start + nameEnd; only nameEnd is stored.
1822 _setName = (r, v, ns, ne) => {
1823 _soaA0[_ix(r)] = ne;
1824 };
1825 _setEnd = (r, v) => {
1826 _soaEn[_ix(r)] = v;
1827 };
1828 _setBlock = (r, bs, be) => {
1829 const i = _ix(r);
1830 _soaA1[i] = bs;
1831 _soaA2[i] = be;
1832 };
1833 _setImportant = (r) => {
1834 _soaFl[_ix(r)] |= 1;
1835 };
1836 // A simple block's token is derived from its opening char on read.
1837 _setToken = (r, ch) => {};
1838 _setValue = (r, list) => {
1839 _soaL0[_ix(r)] = list;
1840 };
1841 _setPrelude = (r, list) => {
1842 _soaL0[_ix(r)] = list;
1843 };
1844 _setBody = (r, decls, childRules) => {
1845 const i = _ix(r);
1846 _soaL1[i] = decls;
1847 _soaL2[i] = childRules;
1848 };
1849 _setRules = (r, list) => {
1850 _soaL0[_ix(r)] = list;
1851 };
1852 _nType = (r) => _soaTy[_ix(r)];
1853 _nStart = (r) => _soaSt[_ix(r)];
1854 _nValue = (r) => _soaValueOf(_ix(r));
1855 _nToken = (r) => /** @type {SimpleBlockToken} */ (_soaInput[_soaSt[_ix(r)]]);
1856};
1857
1858/**
1859 * Materialize a single non-block, non-function lexer token as its leaf AST node — the spec's "consume a token" result (§5.4.8 "anything else"), preserving stray closers / CDO / CDC.

Callers 1

grammarFunction · 0.85

Calls 3

_soaAllocFunction · 0.85
_ixFunction · 0.85
_soaValueOfFunction · 0.85

Tested by

no test coverage detected