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
Generated Vendored
+10 -7
View File
@@ -15947,6 +15947,7 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError) {
if (ctx.atRoot) if (ctx.atRoot)
ctx.atRoot = false; ctx.atRoot = false;
let offset = bm.offset; let offset = bm.offset;
let commentEnd = null;
for (const collItem of bm.items) { for (const collItem of bm.items) {
const { start, key, sep, value } = collItem; const { start, key, sep, value } = collItem;
// key properties // key properties
@@ -15966,7 +15967,7 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError) {
onError(offset, 'BAD_INDENT', startColMsg); onError(offset, 'BAD_INDENT', startColMsg);
} }
if (!keyProps.anchor && !keyProps.tag && !sep) { if (!keyProps.anchor && !keyProps.tag && !sep) {
// TODO: assert being at last item? commentEnd = keyProps.end;
if (keyProps.comment) { if (keyProps.comment) {
if (map.comment) if (map.comment)
map.comment += '\n' + keyProps.comment; map.comment += '\n' + keyProps.comment;
@@ -16036,7 +16037,9 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError) {
map.items.push(pair); 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; return map;
} }
@@ -16264,6 +16267,7 @@ function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError) {
if (ctx.atRoot) if (ctx.atRoot)
ctx.atRoot = false; ctx.atRoot = false;
let offset = bs.offset; let offset = bs.offset;
let commentEnd = null;
for (const { start, value } of bs.items) { for (const { start, value } of bs.items) {
const props = resolveProps.resolveProps(start, { const props = resolveProps.resolveProps(start, {
indicator: 'seq-item-ind', indicator: 'seq-item-ind',
@@ -16272,16 +16276,15 @@ function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError) {
onError, onError,
startOnNewline: true startOnNewline: true
}); });
offset = props.end;
if (!props.found) { if (!props.found) {
if (props.anchor || props.tag || value) { if (props.anchor || props.tag || value) {
if (value && value.type === 'block-seq') 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 else
onError(offset, 'MISSING_CHAR', 'Sequence item without - indicator'); onError(offset, 'MISSING_CHAR', 'Sequence item without - indicator');
} }
else { else {
// TODO: assert being at last item? commentEnd = props.end;
if (props.comment) if (props.comment)
seq.comment = props.comment; seq.comment = props.comment;
continue; continue;
@@ -16289,13 +16292,13 @@ function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError) {
} }
const node = value const node = value
? composeNode(ctx, value, props, onError) ? composeNode(ctx, value, props, onError)
: composeEmptyNode(ctx, offset, start, null, props, onError); : composeEmptyNode(ctx, props.end, start, null, props, onError);
if (ctx.schema.compat) if (ctx.schema.compat)
utilFlowIndentCheck.flowIndentCheck(bs.indent, value, onError); utilFlowIndentCheck.flowIndentCheck(bs.indent, value, onError);
offset = node.range[2]; offset = node.range[2];
seq.items.push(node); seq.items.push(node);
} }
seq.range = [bs.offset, offset, offset]; seq.range = [bs.offset, offset, commentEnd ?? offset];
return seq; return seq;
} }
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long