protected override Boolean handleGotoCase(GotoCaseStatementNode gotoCase, HashSet <StatementNode> visited) { var info = gotoCase.getUserData(typeof(StatementInfo)); visitStatement(info.Target, visited); return(Boolean.FALSE); }
protected override Void handleGotoCase(GotoCaseStatementNode gotoCase, Void source) { var expression = gotoCase.Expression; if (expression != null) { context.DisableIgnoredErrorTracking = true; if (this.ExpressionValidator.handleExpressionNoError(expression, null, true)) { context.DisableIgnoredErrorTracking = false; var einfo = expression.getUserData(typeof(ExpressionInfo)); if (einfo != null) { if (!einfo.IsConstant) { throw context.error(CompileErrorId.ConstantValueExpected, expression); } TypeInfo type = ValidationHelper.getType(context, expression); switch (type.NumericTypeKind) { case Long: case Float: case Double: throw context.error(CompileErrorId.IntegerStringOrEnumExpected, expression); default: ValidationHelper.setBoxing(context, context.TypeSystem.IntType, expression); break; case None: if (type != context.TypeSystem.StringType) { throw context.error(CompileErrorId.IntegerStringOrEnumExpected, expression); } break; } } } else { context.DisableIgnoredErrorTracking = false; } } return(null); }