//返回数组 private CodeArray GetArray() { ReadLeftBracket(); Token token = PeekToken(); CodeArray ret = new CodeArray(); while (token.Type != TokenType.RightBracket) { if (PeekToken().Type == TokenType.RightBracket) break; ret.Elements.Add(GetObject()); token = PeekToken(); if (token.Type == TokenType.Comma) { ReadComma(); } else if (token.Type == TokenType.RightBracket) { break; } else throw new ParserException("Comma ',' or right parenthesis ']' expected in array object.", token); } ReadRightBracket(); return ret; }
ScriptArray ParseArray(CodeArray array) { ScriptArray ret = m_script.CreateArray(); foreach (CodeObject ele in array.Elements) { ret.Add(ResolveOperand(ele)); } return ret; }
ScriptArray ParseArray(CodeArray array) { ScriptArray ret = m_script.CreateArray(); int num = array.Elements.Count; for (int i = 0; i < num; ++i) { ret.Add(ResolveOperand(array.Elements[i])); } return ret; }