updating dist files

This commit is contained in:
Federico Builes
2022-10-06 14:41:07 +02:00
parent 8d974c4ee8
commit afbc15c97f
2 changed files with 11 additions and 8 deletions

17
dist/index.js generated vendored
View File

@@ -15947,6 +15947,7 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError) {
if (ctx.atRoot)
ctx.atRoot = false;
let offset = bm.offset;
let commentEnd = null;
for (const collItem of bm.items) {
const { start, key, sep, value } = collItem;
// key properties
@@ -15966,7 +15967,7 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError) {
onError(offset, 'BAD_INDENT', startColMsg);
}
if (!keyProps.anchor && !keyProps.tag && !sep) {
// TODO: assert being at last item?
commentEnd = keyProps.end;
if (keyProps.comment) {
if (map.comment)
map.comment += '\n' + keyProps.comment;
@@ -16036,7 +16037,9 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError) {
map.items.push(pair);
}
}
map.range = [bm.offset, offset, offset];
if (commentEnd && commentEnd < offset)
onError(commentEnd, 'IMPOSSIBLE', 'Map comment with trailing content');
map.range = [bm.offset, offset, commentEnd ?? offset];
return map;
}
@@ -16264,6 +16267,7 @@ function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError) {
if (ctx.atRoot)
ctx.atRoot = false;
let offset = bs.offset;
let commentEnd = null;
for (const { start, value } of bs.items) {
const props = resolveProps.resolveProps(start, {
indicator: 'seq-item-ind',
@@ -16272,16 +16276,15 @@ function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError) {
onError,
startOnNewline: true
});
offset = props.end;
if (!props.found) {
if (props.anchor || props.tag || value) {
if (value && value.type === 'block-seq')
onError(offset, 'BAD_INDENT', 'All sequence items must start at the same column');
onError(props.end, 'BAD_INDENT', 'All sequence items must start at the same column');
else
onError(offset, 'MISSING_CHAR', 'Sequence item without - indicator');
}
else {
// TODO: assert being at last item?
commentEnd = props.end;
if (props.comment)
seq.comment = props.comment;
continue;
@@ -16289,13 +16292,13 @@ function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError) {
}
const node = value
? composeNode(ctx, value, props, onError)
: composeEmptyNode(ctx, offset, start, null, props, onError);
: composeEmptyNode(ctx, props.end, start, null, props, onError);
if (ctx.schema.compat)
utilFlowIndentCheck.flowIndentCheck(bs.indent, value, onError);
offset = node.range[2];
seq.items.push(node);
}
seq.range = [bs.offset, offset, offset];
seq.range = [bs.offset, offset, commentEnd ?? offset];
return seq;
}

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long