private static bool IsJumpDead(LSLJumpStatementNode jump) { if (jump.IsDeadCode) { return(true); } var jumpParent = jump.Parent; var parentAsStatement = jumpParent as ILSLCodeStatement; while (parentAsStatement == null || !parentAsStatement.IsDeadCode) { jumpParent = jumpParent.Parent; if (jumpParent == null || jumpParent is ILSLEventHandlerNode || jumpParent is ILSLFunctionDeclarationNode) { break; } parentAsStatement = jumpParent as ILSLCodeStatement; if (parentAsStatement != null && parentAsStatement.IsDeadCode) { return(true); } } return(false); }
/// <summary> /// Adds a <see cref="JumpsToHere" /> reference from a given <see cref="LSLJumpStatementNode" /> /// </summary> /// <param name="jump"></param> public void AddJumpToHere(LSLJumpStatementNode jump) { _jumpsToHere.Add(jump); }