//
// Tests to make sure that the user isn't trying to do something stupid.
//if(newItem.getName().compareToIgnoreCase("else") == 0 && lastIsElse)
if(itemIsElse && lastIsElse)
{
parseMessages.addMessage(new ParseMessage(newItem.getLineNumber(), newItem.getStartPosition(), newItem.getEndPosition(), newItem.getItemData(),
"<cfif> already has a <cfelse>"));
addOkay = false;
}
//else if(newItem.getName().compareToIgnoreCase("elseif") == 0 && lastIsElse)
else if(itemIsElseIf && lastIsElse)
{
parseMessages.addMessage(new ParseMessage(newItem.getLineNumber(), newItem.getStartPosition(), newItem.getEndPosition(), newItem.getItemData(),
"<cfelseif> after <cfelse>"));
addOkay = false;
}
else if((lastIsElseIf || lastIsElse) && !(itemIsElse || itemIsElseIf) ) // Is the previous item an else/elseif and the current item isn't one?
mostRecentItem.addChild(newItem);