Finish build from yesterday.
This commit is contained in:
parent
b87fdfbd83
commit
b02e742c89
@ -19,7 +19,7 @@ export async function parse(lines) {
|
||||
if (match('version')) structure.version = tail().trim()
|
||||
if (match('license')) structure.license = tail().trim()
|
||||
// FIXME: Order of operations causes other parts to break if this doesn't run first?!
|
||||
if (match('exports')) structure.exports = await parseObjectKV(null, async () => {
|
||||
if (match('exports')) structure.exports = await buildObject([], async () => {
|
||||
const section = { import: null, require: null }
|
||||
|
||||
await each(() => {
|
||||
|
2
packages/js/core/dist/document.cjs
vendored
2
packages/js/core/dist/document.cjs
vendored
@ -1 +1 @@
|
||||
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./parser.cjs");function s(l,a=" "){let r=u.createLineData(null,a);const t={ended:!1,clone(){return s(l.clone(),a)},async next(){if(r.line=await l.next(),r.line===null)return!0;u.parseLine(r)},current(){return t},line(){var e;return(e=r.line)==null?void 0:e.slice(r.offsetHead)},head(){var e;return(e=r.line)==null?void 0:e.slice(r.offsetHead,r.offsetTail)},tail(){var e;return(e=r.line)==null?void 0:e.slice(r.offsetTail)},level(){return r.level},async content(e=-1,n=[]){var i;return e===-1&&(e=r.level+1),await t.next()||r.level<e?n:(n.push(((i=r.line)==null?void 0:i.slice(e))||""),t.content(e,n))},match(e){return e===t.head()},async each(e){const n=t.line()!==void 0?t.level():-1;for(;!(await t.next()||t.level()<=n||await e()););},async seek(e,n=-1){return n===-1&&(n=r.level),await t.next()?!1:t.head()===e?t:r.level<n?!1:t.seek(e,n)}};return t}exports.useDocument=s;
|
||||
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("./parser.cjs");function c(a,u=" "){let r=s.createLineData(null,u);const t={ended:!1,clone(){return c(a.clone(),u)},async next(){if(r.line=await a.next(),r.line===null)return!0;s.parseLine(r)},current(){return t},line(){var e;return(e=r.line)==null?void 0:e.slice(r.offsetHead)},head(){var e;return(e=r.line)==null?void 0:e.slice(r.offsetHead,r.offsetTail)},tail(){var e;return(e=r.line)==null?void 0:e.slice(r.offsetTail)},level(){return r.level},async content(e=-1,n=[]){var l;return e===-1&&(e=r.level+1),await t.next()||r.level<e?n:(n.push(((l=r.line)==null?void 0:l.slice(e))||""),t.content(e,n))},match(e){return e===t.head()},async each(e){const n=t.line()!==void 0?t.level():-1;for(;!(await t.next()||t.level()<=n||await e()););},async buildObject(e=[],n){n||(n=()=>t.tail().trim());const i={};return await t.each(async()=>{if(!!t.head()){if(!e.length||e.includes(t.head())){i[t.head()]=await n();return}if(e&&!e.includes(t.head())&&e.includes("#text")){i["#text"]=[t.line(),...await t.content(t.level())];return}}}),i},async seek(e,n=-1){return n===-1&&(n=r.level),await t.next()?!1:t.head()===e?t:r.level<n?!1:t.seek(e,n)}};return t}exports.useDocument=c;
|
||||
|
56
packages/js/core/dist/document.js
vendored
56
packages/js/core/dist/document.js
vendored
@ -1,51 +1,67 @@
|
||||
import { parseLine as f, createLineData as s } from "./parser.js";
|
||||
function c(l, a = " ") {
|
||||
let r = s(null, a);
|
||||
const n = {
|
||||
function c(a, u = " ") {
|
||||
let n = s(null, u);
|
||||
const t = {
|
||||
ended: !1,
|
||||
clone() {
|
||||
return c(l.clone(), a);
|
||||
return c(a.clone(), u);
|
||||
},
|
||||
async next() {
|
||||
if (r.line = await l.next(), r.line === null)
|
||||
if (n.line = await a.next(), n.line === null)
|
||||
return !0;
|
||||
f(r);
|
||||
f(n);
|
||||
},
|
||||
current() {
|
||||
return n;
|
||||
return t;
|
||||
},
|
||||
line() {
|
||||
var e;
|
||||
return (e = r.line) == null ? void 0 : e.slice(r.offsetHead);
|
||||
return (e = n.line) == null ? void 0 : e.slice(n.offsetHead);
|
||||
},
|
||||
head() {
|
||||
var e;
|
||||
return (e = r.line) == null ? void 0 : e.slice(r.offsetHead, r.offsetTail);
|
||||
return (e = n.line) == null ? void 0 : e.slice(n.offsetHead, n.offsetTail);
|
||||
},
|
||||
tail() {
|
||||
var e;
|
||||
return (e = r.line) == null ? void 0 : e.slice(r.offsetTail);
|
||||
return (e = n.line) == null ? void 0 : e.slice(n.offsetTail);
|
||||
},
|
||||
level() {
|
||||
return r.level;
|
||||
return n.level;
|
||||
},
|
||||
async content(e = -1, t = []) {
|
||||
var i;
|
||||
return e === -1 && (e = r.level + 1), await n.next() || r.level < e ? t : (t.push(((i = r.line) == null ? void 0 : i.slice(e)) || ""), n.content(e, t));
|
||||
async content(e = -1, r = []) {
|
||||
var l;
|
||||
return e === -1 && (e = n.level + 1), await t.next() || n.level < e ? r : (r.push(((l = n.line) == null ? void 0 : l.slice(e)) || ""), t.content(e, r));
|
||||
},
|
||||
match(e) {
|
||||
return e === n.head();
|
||||
return e === t.head();
|
||||
},
|
||||
async each(e) {
|
||||
const t = n.line() !== void 0 ? n.level() : -1;
|
||||
for (; !(await n.next() || n.level() <= t || await e()); )
|
||||
const r = t.line() !== void 0 ? t.level() : -1;
|
||||
for (; !(await t.next() || t.level() <= r || await e()); )
|
||||
;
|
||||
},
|
||||
async seek(e, t = -1) {
|
||||
return t === -1 && (t = r.level), await n.next() ? !1 : n.head() === e ? n : r.level < t ? !1 : n.seek(e, t);
|
||||
async buildObject(e = [], r) {
|
||||
r || (r = () => t.tail().trim());
|
||||
const i = {};
|
||||
return await t.each(async () => {
|
||||
if (!!t.head()) {
|
||||
if (!e.length || e.includes(t.head())) {
|
||||
i[t.head()] = await r();
|
||||
return;
|
||||
}
|
||||
if (e && !e.includes(t.head()) && e.includes("#text")) {
|
||||
i["#text"] = [t.line(), ...await t.content(t.level())];
|
||||
return;
|
||||
}
|
||||
}
|
||||
}), i;
|
||||
},
|
||||
async seek(e, r = -1) {
|
||||
return r === -1 && (r = n.level), await t.next() ? !1 : t.head() === e ? t : n.level < r ? !1 : t.seek(e, r);
|
||||
}
|
||||
};
|
||||
return n;
|
||||
return t;
|
||||
}
|
||||
export {
|
||||
c as useDocument
|
||||
|
Loading…
x
Reference in New Issue
Block a user