private void AddChildren(Tag parent) { List <Token> lineTokens; while ((lineTokens = this.GetLineTokens()) != null) { int count = lineTokens.Count; if (lineTokens[0].type == Type.END_BLOCK) { return; } if (lineTokens[count - 1].type == Type.START_BLOCK) { Tag tag = this.ConstructTag(lineTokens.GetRange(0, count - 1)); this.AddChildren(tag); parent.AddChild(tag); } else { parent.AddChild(this.ConstructTag(lineTokens)); } } this.ParseException("No close block (}).", this.lineNumber, -2); }
private void AddChildren(Tag parent) { List<Token> lineTokens; while ((lineTokens = this.GetLineTokens()) != null) { int count = lineTokens.Count; if (lineTokens[0].type == Type.END_BLOCK) return; if (lineTokens[count - 1].type == Type.START_BLOCK) { Tag tag = this.ConstructTag(lineTokens.GetRange(0, count - 1)); this.AddChildren(tag); parent.AddChild(tag); } else parent.AddChild(this.ConstructTag(lineTokens)); } this.ParseException("No close block (}).", this.lineNumber, -2); }