private void Traverse(LuaIndentState indentState, ParseTreeNode node, int level) { if (node.Token != null) { if (tokenMap.ContainsKey(node.Token.Location) == false) { tokenMap.Add(node.Token.Location, new LuaTokenInfo { Token = node.Token }); } } else { IAstNode astNode = node.AstNode as IAstNode; if (astNode != null) { astNode.Indent(indentState, tokenMap); } for (int i = 0; i < node.ChildNodes.Count; i++) { Traverse(indentState, node.ChildNodes[i], level + 1); } } }