in lib/parser.js [686:730]
exceptionBody() {
// exceptionBody = "{" [ exceptionFields ] "}"
const begin = this.getIndex();
this.match('{');
const nodes = [];
if (this.is('}')) {
const end = this.getIndex();
this.move();
return {
type: 'exceptionBody',
nodes: nodes,
tokenRange: [begin, end]
};
}
var node = this.exceptionField();
nodes.push(node);
while (!this.is('}')) {
if (this.is(',')) {
this.move();
if (this.is('}')) {
// only one fields
break;
}
let node = this.exceptionField();
nodes.push(node);
} else {
this.error('expect ","');
}
}
const end = this.getIndex();
this.match('}');
return {
type: 'exceptionBody',
nodes: nodes,
tokenRange: [begin, end]
};
}