private WithStatement ParseWithStmt() {
Eat(TokenKind.KeywordWith);
var withItem = ParseWithItem();
List<WithItem> items = null;
while (MaybeEat(TokenKind.Comma)) {
if (items == null) {
items = new List<WithItem>();
}
items.Add(ParseWithItem());
}
var header = GetEnd();
Statement body = ParseSuite();
if (items != null) {
for (int i = items.Count - 1; i >= 0; i--) {
var curItem = items[i];
var innerWith = new WithStatement(curItem.ContextManager, curItem.Variable, body);
innerWith.HeaderIndex = header;
innerWith.SetLoc(_globalParent, withItem.Start, GetEnd());
body = innerWith;
header = GetEnd();
}
}
WithStatement ret = new WithStatement(withItem.ContextManager, withItem.Variable, body);
ret.HeaderIndex = header;
ret.SetLoc(_globalParent, withItem.Start, GetEnd());
return ret;
}