リンク参照:底部の自動車ウィンドウがtoParse = "" ことを示すステートメントが実行されている場合、これはなぜ偽ですか? (C#)と
http://i.imgur.com/gFcamd8.png
お知らせ。しかしtoParse!= ""はとにかくtrueと評価され、アプリケーションをクラッシュさせます。このラインnewNode.parseString(inside)
は、それがコールスタックでありますことを意味強調表示され、クラッシュ前に呼び出された、画像で
public void parseString(string toParse)
{
while (toParse != "")
{
string nextLine = readLine(ref toParse);
if (nextLine.IndexOf("//") == 0)
{
comments.Add(nextLine);
continue;
}
if (nextLine.IndexOf(".") == 0)
{
string[] declarationParts = nextLine.Split(' ');
string declarationString = declarationParts[0].Substring(1, declarationParts[0].Length - 1);
declarationString = char.ToUpper(declarationString[0]) + declarationString.Substring(1);
DirectiveEnum type = (DirectiveEnum)Enum.Parse(typeof(DirectiveEnum), declarationString);
string[] attributes = declarationParts.Skip(1).ToArray();
MSILNode newNode = new MSILNode(type);
newNode.addAttributes(attributes);
toParse = toParse.Trim();
if (toParse != "")
{
while (toParse[0] != '{' && toParse[0] != '.' && toParse.IndexOf("//") != 0)
{
nextLine = readLine(ref toParse);
attributes = nextLine.Split(' ');
newNode.addAttributes(attributes);
}
if (toParse[0] == '{')
{
readLine(ref toParse);
string inside = separate(ref toParse, "}");
newNode.parseString(inside);
}
}
subNodes.Add(newNode);
continue;
}
Console.WriteLine(nextLine);
}
}
toParseの値は何ですか? –
'toParse'の長さは何ですか? – siride
参照op:toParse = "" –