1501
1502
while (this.currentToken().type !== TokenType.FlowMapEnd && this.currentToken().type !== TokenType.EOF) {
1503
>
// Parse key (must be a scalar)
yaml.ts
1504
>
let key: YamlScalarNode;
1505
>
if (this.currentToken().type === TokenType.Scalar) {
1506
>
key = this.parseFlowScalar();
1507
>
} else {
1508
this.emitError(localize('expectedMappingKey', 'Expected mapping key'), this.currentToken().startOffset, this.currentToken().endOffset, 'expected-key');
1509
break;
1510
}
1512
>
this.skipFlowWhitespace();
1513
>
1514
>
// Check for colon - if missing, the key has an empty value (terminated by comma or })
1515
>
let value: YamlNode;
1516
>
if (this.currentToken().type === TokenType.Colon) {
1517
>
this.advance();
1518
>
this.skipFlowWhitespace();
1519
>
1520
>
// Parse value
1521
>
value = this.parseFlowValue();
1522
>
} else {
1523
// Key without value (e.g., { key, other: val })
1524
value = this.makeEmptyScalar(key.endOffset);
1525
}
1527
>
properties.push({ key, value });
1528
>
1529
>
this.skipFlowWhitespace();
1530
>
1531
>
// Consume comma if present
1532
>
if (this.currentToken().type === TokenType.Comma) {
1533
this.advance();
1534
this.skipFlowWhitespace();
1535
}
1537
1538
const endToken = this.currentToken();