mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Code cleanup: Add space after closing brace where needed (#8530)
* Update TestService * Update WebListener * Update Controllers * Update ExpTest * Update MyApp * Update Logic * Update Logic * Update MyApp * Update Microsoft.Management.Infrastructure.CimCmdlets * Update Microsoft.PowerShell.Commands.Diagnostics * Update Microsoft.PowerShell.ScheduledJob * Update Microsoft.WSMan.Management * Update Microsoft.WSMan.Runtime * Update ResGen * Update TypeCatalogGen * Update commands * Update Eventing * Update Reader * Update utility * Update ShowCommand * Update trace * Update WebCmdlet * Update Common * Update CoreCLR * Update common * Update format-object * Update format-wide * Update out-file * Update out-printer * Update out-string * Update OutGridView * Update LocalAccounts * Update Commands * Update security * Update CoreCLR * Update DscSupport * Update engine * Update help * Update logging * Update namespaces * Update security * Update utils * Update config * Update perfCounters * Update tracing * Update cmdletization * Update other * Update cim * Update xml * Update CoreCLR * Update common * Update DefaultFormatters * Update out-console * Update out-textInterface * Update DisplayDatabase * Update Utilities * Update COM * Update ComInterop * Update CommandCompletion * Update debugger * Update ExperimentalFeature * Update hostifaces * Update interpreter * Update lang * Update Modules * Update parser * Update runtime * Update client * Update commands * Update common * Update fanin * Update server * Update WireDataFormat * Update Binding * Update Operations * Update interface * Update cmdletization * Update cim * Update management * Update WindowsTaskbarJumpList * Update msh
This commit is contained in:
1 parent
40223881cb
commit
4af3068566
766 files changed
+11208
-9
No files matched your search
@@ -55,6 +55,7 @@ namespace System.Management.Automation.Language
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -72,39 +73,73 @@ namespace System.Management.Automation.Language
|
||||
private readonly GetSafeValueVisitor.SafeValueContext _safeValueContext;
|
||||
|
||||
public object VisitErrorStatement(ErrorStatementAst errorStatementAst) { return false; }
|
||||
|
||||
public object VisitErrorExpression(ErrorExpressionAst errorExpressionAst) { return false; }
|
||||
|
||||
public object VisitScriptBlock(ScriptBlockAst scriptBlockAst) { return false; }
|
||||
|
||||
public object VisitParamBlock(ParamBlockAst paramBlockAst) { return false; }
|
||||
|
||||
public object VisitNamedBlock(NamedBlockAst namedBlockAst) { return false; }
|
||||
|
||||
public object VisitTypeConstraint(TypeConstraintAst typeConstraintAst) { return false; }
|
||||
|
||||
public object VisitAttribute(AttributeAst attributeAst) { return false; }
|
||||
|
||||
public object VisitNamedAttributeArgument(NamedAttributeArgumentAst namedAttributeArgumentAst) { return false; }
|
||||
|
||||
public object VisitParameter(ParameterAst parameterAst) { return false; }
|
||||
|
||||
public object VisitFunctionDefinition(FunctionDefinitionAst functionDefinitionAst) { return false; }
|
||||
|
||||
public object VisitIfStatement(IfStatementAst ifStmtAst) { return false; }
|
||||
|
||||
public object VisitTrap(TrapStatementAst trapStatementAst) { return false; }
|
||||
|
||||
public object VisitSwitchStatement(SwitchStatementAst switchStatementAst) { return false; }
|
||||
|
||||
public object VisitDataStatement(DataStatementAst dataStatementAst) { return false; }
|
||||
|
||||
public object VisitForEachStatement(ForEachStatementAst forEachStatementAst) { return false; }
|
||||
|
||||
public object VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst) { return false; }
|
||||
|
||||
public object VisitForStatement(ForStatementAst forStatementAst) { return false; }
|
||||
|
||||
public object VisitWhileStatement(WhileStatementAst whileStatementAst) { return false; }
|
||||
|
||||
public object VisitCatchClause(CatchClauseAst catchClauseAst) { return false; }
|
||||
|
||||
public object VisitTryStatement(TryStatementAst tryStatementAst) { return false; }
|
||||
|
||||
public object VisitBreakStatement(BreakStatementAst breakStatementAst) { return false; }
|
||||
|
||||
public object VisitContinueStatement(ContinueStatementAst continueStatementAst) { return false; }
|
||||
|
||||
public object VisitReturnStatement(ReturnStatementAst returnStatementAst) { return false; }
|
||||
|
||||
public object VisitExitStatement(ExitStatementAst exitStatementAst) { return false; }
|
||||
|
||||
public object VisitThrowStatement(ThrowStatementAst throwStatementAst) { return false; }
|
||||
|
||||
public object VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst) { return false; }
|
||||
|
||||
public object VisitAssignmentStatement(AssignmentStatementAst assignmentStatementAst) { return false; }
|
||||
|
||||
public object VisitCommand(CommandAst commandAst) { return false; }
|
||||
|
||||
public object VisitCommandExpression(CommandExpressionAst commandExpressionAst) { return false; }
|
||||
|
||||
public object VisitCommandParameter(CommandParameterAst commandParameterAst) { return false; }
|
||||
|
||||
public object VisitFileRedirection(FileRedirectionAst fileRedirectionAst) { return false; }
|
||||
|
||||
public object VisitMergingRedirection(MergingRedirectionAst mergingRedirectionAst) { return false; }
|
||||
|
||||
public object VisitAttributedExpression(AttributedExpressionAst attributedExpressionAst) { return false; }
|
||||
|
||||
public object VisitBlockStatement(BlockStatementAst blockStatementAst) { return false; }
|
||||
|
||||
public object VisitInvokeMemberExpression(InvokeMemberExpressionAst invokeMemberExpressionAst) { return false; }
|
||||
|
||||
public object VisitIndexExpression(IndexExpressionAst indexExpressionAst)
|
||||
@@ -124,6 +159,7 @@ namespace System.Management.Automation.Language
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return isSafe;
|
||||
}
|
||||
|
||||
@@ -138,12 +174,14 @@ namespace System.Management.Automation.Language
|
||||
isSafe = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!(bool)statement.Accept(this))
|
||||
{
|
||||
isSafe = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return isSafe;
|
||||
}
|
||||
|
||||
@@ -170,6 +208,7 @@ namespace System.Management.Automation.Language
|
||||
{
|
||||
_visitCount++;
|
||||
}
|
||||
|
||||
return unaryExpressionIsSafe;
|
||||
}
|
||||
|
||||
@@ -180,12 +219,14 @@ namespace System.Management.Automation.Language
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!type.IsSafePrimitive())
|
||||
{
|
||||
// Only do conversions to built-in types - other conversions might not
|
||||
// be safe to optimize.
|
||||
return false;
|
||||
}
|
||||
|
||||
_visitCount++;
|
||||
return (bool)convertExpressionAst.Child.Accept(this);
|
||||
}
|
||||
@@ -271,6 +312,7 @@ namespace System.Management.Automation.Language
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return hashtableAst.KeyValuePairs.All(pair => (bool)pair.Item1.Accept(this) && (bool)pair.Item2.Accept(this));
|
||||
}
|
||||
|
||||
@@ -316,45 +358,80 @@ namespace System.Management.Automation.Language
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
throw PSTraceSource.NewArgumentException("ast");
|
||||
}
|
||||
|
||||
private static ExecutionContext s_context;
|
||||
|
||||
public object VisitErrorStatement(ErrorStatementAst errorStatementAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitErrorExpression(ErrorExpressionAst errorExpressionAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitScriptBlock(ScriptBlockAst scriptBlockAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitParamBlock(ParamBlockAst paramBlockAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitNamedBlock(NamedBlockAst namedBlockAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitTypeConstraint(TypeConstraintAst typeConstraintAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitAttribute(AttributeAst attributeAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitNamedAttributeArgument(NamedAttributeArgumentAst namedAttributeArgumentAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitParameter(ParameterAst parameterAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitFunctionDefinition(FunctionDefinitionAst functionDefinitionAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitIfStatement(IfStatementAst ifStmtAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitTrap(TrapStatementAst trapStatementAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitSwitchStatement(SwitchStatementAst switchStatementAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitDataStatement(DataStatementAst dataStatementAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitForEachStatement(ForEachStatementAst forEachStatementAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitForStatement(ForStatementAst forStatementAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitWhileStatement(WhileStatementAst whileStatementAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitCatchClause(CatchClauseAst catchClauseAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitTryStatement(TryStatementAst tryStatementAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitBreakStatement(BreakStatementAst breakStatementAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitContinueStatement(ContinueStatementAst continueStatementAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitReturnStatement(ReturnStatementAst returnStatementAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitExitStatement(ExitStatementAst exitStatementAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitThrowStatement(ThrowStatementAst throwStatementAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitAssignmentStatement(AssignmentStatementAst assignmentStatementAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitCommand(CommandAst commandAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitCommandExpression(CommandExpressionAst commandExpressionAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitCommandParameter(CommandParameterAst commandParameterAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitFileRedirection(FileRedirectionAst fileRedirectionAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitMergingRedirection(MergingRedirectionAst mergingRedirectionAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitAttributedExpression(AttributedExpressionAst attributedExpressionAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitBlockStatement(BlockStatementAst blockStatementAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
public object VisitInvokeMemberExpression(InvokeMemberExpressionAst invokeMemberExpressionAst) { throw PSTraceSource.NewArgumentException("ast"); }
|
||||
|
||||
//
|
||||
@@ -373,8 +450,10 @@ namespace System.Management.Automation.Language
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return offset >= 0 ? targetString[offset] : targetString[targetString.Length + offset];
|
||||
}
|
||||
|
||||
var targetArray = target as object[];
|
||||
if (targetArray != null)
|
||||
{
|
||||
@@ -384,8 +463,10 @@ namespace System.Management.Automation.Language
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return offset >= 0 ? targetArray[offset] : targetArray[targetArray.Length + offset];
|
||||
}
|
||||
|
||||
var targetHashtable = target as Hashtable;
|
||||
if (targetHashtable != null)
|
||||
{
|
||||
@@ -424,10 +505,12 @@ namespace System.Management.Automation.Language
|
||||
{
|
||||
ofs = s_context.SessionState.PSVariable.GetValue("OFS") as string;
|
||||
}
|
||||
|
||||
if (ofs == null)
|
||||
{
|
||||
ofs = " ";
|
||||
}
|
||||
|
||||
for (int offset = 0; offset < safeValues.Length; offset++)
|
||||
{
|
||||
var result = expandableStringExpressionAst.NestedExpressions[offset].Accept(this);
|
||||
@@ -473,6 +556,7 @@ namespace System.Management.Automation.Language
|
||||
subExpressionResult[subExpressionOffset] = resultArray[subExpressionOffset];
|
||||
}
|
||||
}
|
||||
|
||||
safeValues[offset] = string.Join(ofs, subExpressionResult);
|
||||
}
|
||||
else
|
||||
@@ -510,6 +594,7 @@ namespace System.Management.Automation.Language
|
||||
throw PSTraceSource.NewArgumentException("ast");
|
||||
}
|
||||
}
|
||||
|
||||
return statementList.ToArray();
|
||||
}
|
||||
|
||||
@@ -520,6 +605,7 @@ namespace System.Management.Automation.Language
|
||||
{
|
||||
return expr.Accept(this);
|
||||
}
|
||||
|
||||
throw PSTraceSource.NewArgumentException("ast");
|
||||
}
|
||||
|
||||
@@ -641,6 +727,7 @@ namespace System.Management.Automation.Language
|
||||
{
|
||||
arrayElements.Add(element.Accept(this));
|
||||
}
|
||||
|
||||
return arrayElements.ToArray();
|
||||
}
|
||||
|
||||
@@ -653,6 +740,7 @@ namespace System.Management.Automation.Language
|
||||
var value = pair.Item2.Accept(this);
|
||||
hashtable.Add(key, value);
|
||||
}
|
||||
|
||||
return hashtable;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user