mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
spelling: comments in src/System.Management.Automation/engine/parser
This commit is contained in:
1 parent
1e1a69a291
commit
721abf09dc
12 files changed
+62
-62
No files matched your search
@@ -1857,7 +1857,7 @@ namespace System.Management.Automation.Language
|
||||
exprs.Add(Expression.Call(oldPipe, CachedReflectionInfo.Pipe_SetVariableListForTemporaryPipe, s_getCurrentPipe));
|
||||
if (generateRedirectExprs != null)
|
||||
{
|
||||
// Add merge redirection expressions if delgate is provided.
|
||||
// Add merge redirection expressions if delegate is provided.
|
||||
generateRedirectExprs(exprs, finallyExprs);
|
||||
}
|
||||
exprs.Add(Compile(ast));
|
||||
@@ -2427,7 +2427,7 @@ namespace System.Management.Automation.Language
|
||||
exprs.Add(Expression.Assign(LocalVariablesParameter,
|
||||
Expression.Field(_functionContext, CachedReflectionInfo.FunctionContext__localsTuple).Cast(this.LocalVariablesTupleType)));
|
||||
|
||||
// Compiling a single expression (a default argument, or an locally evalutated argument in a ScriptBlock=>PowerShell conversion)
|
||||
// Compiling a single expression (a default argument, or an locally evaluated argument in a ScriptBlock=>PowerShell conversion)
|
||||
// does not support debugging, so skip calling EnterScriptFunction.
|
||||
if (!_compilingSingleExpression)
|
||||
{
|
||||
@@ -2647,7 +2647,7 @@ namespace System.Management.Automation.Language
|
||||
// "Should continue here"
|
||||
// In this example, the trap just continues, but we want to continue after the 'if' statement, not after
|
||||
// the 'throw' statement.
|
||||
// We push null onto the active trap handlers to let ExceptionHandlingOps.CheckActionPrefence know it
|
||||
// We push null onto the active trap handlers to let ExceptionHandlingOps.CheckActionPreference know it
|
||||
// shouldn't process traps (but should still query the user if appropriate), and just rethrow so we can
|
||||
// unwind to the block with the trap.
|
||||
|
||||
@@ -3040,7 +3040,7 @@ namespace System.Management.Automation.Language
|
||||
|
||||
// The redirections are passed as a CommandRedirection[][] - one dimension for each command in the pipe,
|
||||
// one dimension because each command may have multiple redirections. Here we create the array for
|
||||
// each command in the pipe, either a compile time constant or created at runtime if necesary.
|
||||
// each command in the pipe, either a compile time constant or created at runtime if necessary.
|
||||
Expression redirectionExpr;
|
||||
if (commandRedirections.Any(r => r is Expression))
|
||||
{
|
||||
@@ -3093,7 +3093,7 @@ namespace System.Management.Automation.Language
|
||||
return null;
|
||||
}
|
||||
|
||||
// Most redirections will be instannces of CommandRedirection, but non-constant filenames
|
||||
// Most redirections will be instances of CommandRedirection, but non-constant filenames
|
||||
// will generated a Linq.Expression, so we store objects.
|
||||
object[] compiledRedirections = new object[count];
|
||||
for (int i = 0; i < count; ++i)
|
||||
@@ -3233,7 +3233,7 @@ namespace System.Management.Automation.Language
|
||||
exprs.Add(Compile(subExpr.SubExpression));
|
||||
if (resultList != null)
|
||||
{
|
||||
// If there is no resultList, we wrote our results of the subexperssion directly to the pipe
|
||||
// If there is no resultList, we wrote our results of the subexpression directly to the pipe
|
||||
// instead of being collected to be written here.
|
||||
result = Expression.Call(CachedReflectionInfo.PipelineOps_PipelineResult, resultList);
|
||||
}
|
||||
@@ -3871,7 +3871,7 @@ namespace System.Management.Automation.Language
|
||||
if (dataStatementAst.CommandsAllowed.Count > 0)
|
||||
{
|
||||
// If CommandsAllowed was specified, we need to check the language mode - the data section runs
|
||||
// in restriced language mode and we don't want to allow disallowed commands to run if we were in
|
||||
// in restricted language mode and we don't want to allow disallowed commands to run if we were in
|
||||
// constrained language mode.
|
||||
exprs.Add(
|
||||
Expression.Call(
|
||||
|
||||
@@ -252,7 +252,7 @@ namespace System.Management.Automation.Language
|
||||
{
|
||||
// A script block expression is a constant when we're generating metadata, but when
|
||||
// we're generating code, we need to create new script blocks so we can't use a constant.
|
||||
// Also - we have no way to desribe a script block when generating .Net metadata, so
|
||||
// Also - we have no way to describe a script block when generating .Net metadata, so
|
||||
// we must disallow script blocks as attribute arguments on/inside a class.
|
||||
return CheckingAttributeArgument && !CheckingClassAttributeArguments;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace System.Management.Automation.Language
|
||||
|
||||
/// <summary>
|
||||
/// The parser that parses PowerShell script and returns a <see cref="ScriptBlockAst"/>, tokens, and error messages
|
||||
/// if the script cannot be parsed successfullly.
|
||||
/// if the script cannot be parsed successfully.
|
||||
/// </summary>
|
||||
public sealed class Parser
|
||||
{
|
||||
@@ -4126,7 +4126,7 @@ namespace System.Management.Automation.Language
|
||||
{
|
||||
// Incompleted input like:
|
||||
// class foo { $private: }
|
||||
// Error message already emmited by tokenizer ScanVariable
|
||||
// Error message already emitted by tokenizer ScanVariable
|
||||
|
||||
RecordErrorAsts(attributeList, ref astsOnError);
|
||||
RecordErrorAsts(typeConstraint, ref astsOnError);
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace System.Management.Automation.Language
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A few utilty functions for script positions.
|
||||
/// A few utility functions for script positions.
|
||||
/// </summary>
|
||||
internal static class PositionUtilities
|
||||
{
|
||||
@@ -116,7 +116,7 @@ namespace System.Management.Automation.Language
|
||||
public static IScriptPosition EmptyPosition { get; } = new EmptyScriptPosition();
|
||||
|
||||
/// <summary>
|
||||
/// Return a unique extent repesenting an empty or missing extent.
|
||||
/// Return a unique extent representing an empty or missing extent.
|
||||
/// </summary>
|
||||
public static IScriptExtent EmptyExtent { get; } = new EmptyScriptExtent();
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace System.Management.Automation.Language
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// AstVisitor is used for basic scenarios requiring traveral of the nodes in an Ast.
|
||||
/// AstVisitor is used for basic scenarios requiring traversal of the nodes in an Ast.
|
||||
/// An implementation of AstVisitor does not explicitly traverse the Ast, instead,
|
||||
/// the engine traverses all nodes in the Ast and calls the appropriate method on each node.
|
||||
/// </summary>
|
||||
|
||||
@@ -1173,7 +1173,7 @@ namespace System.Management.Automation.Language
|
||||
public override AstVisitAction VisitConfigurationDefinition(ConfigurationDefinitionAst configurationDefinitionAst)
|
||||
{
|
||||
//
|
||||
// Check if the ScirptBlockAst contains NamedBlockAst other than the End block
|
||||
// Check if the ScriptBlockAst contains NamedBlockAst other than the End block
|
||||
//
|
||||
ScriptBlockAst configBody = configurationDefinitionAst.Body.ScriptBlock;
|
||||
if (configBody.BeginBlock != null || configBody.ProcessBlock != null || configBody.DynamicParamBlock != null)
|
||||
@@ -1447,7 +1447,7 @@ namespace System.Management.Automation.Language
|
||||
/// </summary>
|
||||
/// <param name="parser"></param>
|
||||
/// <param name="functionMemberAst">The function member AST</param>
|
||||
/// <param name="hasGet">True if it is a Get method with qualified return type and signaure; otherwise, false. </param>
|
||||
/// <param name="hasGet">True if it is a Get method with qualified return type and signature; otherwise, false. </param>
|
||||
private static void CheckGet(Parser parser, FunctionMemberAst functionMemberAst, ref bool hasGet)
|
||||
{
|
||||
if (hasGet)
|
||||
@@ -1484,7 +1484,7 @@ namespace System.Management.Automation.Language
|
||||
/// Check if it is a Test method with correct return type and signature
|
||||
/// </summary>
|
||||
/// <param name="functionMemberAst">The function member AST</param>
|
||||
/// <param name="hasTest">True if it is a Test method with qualified return type and signaure; otherwise, false.</param>
|
||||
/// <param name="hasTest">True if it is a Test method with qualified return type and signature; otherwise, false.</param>
|
||||
private static void CheckTest(FunctionMemberAst functionMemberAst, ref bool hasTest)
|
||||
{
|
||||
if (hasTest) return;
|
||||
@@ -1497,7 +1497,7 @@ namespace System.Management.Automation.Language
|
||||
/// Check if it is a Set method with correct return type and signature
|
||||
/// </summary>
|
||||
/// <param name="functionMemberAst">The function member AST</param>
|
||||
/// <param name="hasSet">True if it is a Set method with qualified return type and signaure; otherwise, false.</param>
|
||||
/// <param name="hasSet">True if it is a Set method with qualified return type and signature; otherwise, false.</param>
|
||||
private static void CheckSet(FunctionMemberAst functionMemberAst, ref bool hasSet)
|
||||
{
|
||||
if (hasSet) return;
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace System.Management.Automation.Language
|
||||
{
|
||||
// Duplicate members are an error, but we catch that later after all types
|
||||
// have been resolved. We could report errors for properties here, but
|
||||
// we couldn't compare methods becaues overloads can't be compared until types
|
||||
// we couldn't compare methods because overloads can't be compared until types
|
||||
// are resolved.
|
||||
if (!_variableTable.ContainsKey(propertyMember.Name))
|
||||
{
|
||||
@@ -423,7 +423,7 @@ namespace System.Management.Automation.Language
|
||||
|
||||
/// <summary>
|
||||
/// Resolves using module to a collection of PSModuleInfos. Doesn't throw.
|
||||
/// PSModuleInfo objects are retunred in the right order: i.e. if multiply verions of the module
|
||||
/// PSModuleInfo objects are returned in the right order: i.e. if multiply versions of the module
|
||||
/// is presented on the system and user didn't specify version, we will return all of them, but newer one would go first.
|
||||
/// </summary>
|
||||
/// <param name="usingStatementAst">using statement</param>
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace System.Management.Automation.Language
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inherited from InvalidCastException, because it happens in [string] -> [Type] convertion.
|
||||
/// Inherited from InvalidCastException, because it happens in [string] -> [Type] conversion.
|
||||
/// </summary>
|
||||
internal class AmbiguousTypeException : InvalidCastException
|
||||
{
|
||||
@@ -202,7 +202,7 @@ namespace System.Management.Automation.Language
|
||||
try
|
||||
{
|
||||
// We shouldn't really bother looking for the type in System namespace, but
|
||||
// we've always done that. We explictily are not supporting arbitrary
|
||||
// we've always done that. We explicitly are not supporting arbitrary
|
||||
// 'using namespace' here because there is little value, if you need the assembly
|
||||
// qualifier, it's best to just fully specify the type.
|
||||
var result = Type.GetType(typeName.FullName, false, true) ??
|
||||
@@ -266,14 +266,14 @@ namespace System.Management.Automation.Language
|
||||
// Consider this code
|
||||
// Add-Type 'public class Q {}' # ok
|
||||
// Add-Type 'public class Q { }' # get error about the same name
|
||||
// [Q] # we would get error about ambigious type, because we added assembly with duplicated type
|
||||
// [Q] # we would get error about ambiguous type, because we added assembly with duplicated type
|
||||
// # before we can report TYPE_ALREADY_EXISTS error.
|
||||
//
|
||||
// Add-Type 'public class Q2 {}' # ok
|
||||
// [Q2] # caching Q2 type
|
||||
// Add-Type 'public class Q2 { }' # get error about the same name
|
||||
// [Q2] # we don't get an error about ambigious type, because it's cached already
|
||||
// 2) NuGet (VS Package Management console) uses MEF extensability model.
|
||||
// [Q2] # we don't get an error about ambiguous type, because it's cached already
|
||||
// 2) NuGet (VS Package Management console) uses MEF extensibility model.
|
||||
// Different assemblies includes same interface (i.e. NuGet.VisualStudio.IVsPackageInstallerServices),
|
||||
// where they include only methods that they are interested in the interface declaration (result interfaces are different!).
|
||||
// Then, at runtime VS provides an instance. Everything work as far as instance has compatible API.
|
||||
@@ -751,14 +751,14 @@ namespace System.Management.Automation
|
||||
|
||||
/// <summary>
|
||||
/// A class to view and modify the type accelerators used by the PowerShell engine. Builtin
|
||||
/// type accelerators are read only, but user defined type accerators may be added.
|
||||
/// type accelerators are read only, but user defined type accelerators may be added.
|
||||
/// </summary>
|
||||
internal static class TypeAccelerators
|
||||
{
|
||||
// builtins are not exposed publicly in a direct manner so they can't be changed at all
|
||||
internal static Dictionary<string, Type> builtinTypeAccelerators = new Dictionary<string, Type>(64, StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
// users can add to user added accelerators (but not currently remove any.) Keeping a seperate
|
||||
// users can add to user added accelerators (but not currently remove any.) Keeping a separate
|
||||
// list allows us to add removing in the future w/o worrying about breaking the builtins.
|
||||
internal static Dictionary<string, Type> userTypeAccelerators = new Dictionary<string, Type>(64, StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
@@ -847,7 +847,7 @@ namespace System.Management.Automation
|
||||
/// to the dictionary will not affect PowerShell scripts in any way. Use
|
||||
/// <see cref="TypeAccelerators.Add"/> and
|
||||
/// <see cref="TypeAccelerators.Remove"/> to
|
||||
/// affect the type resolutin in PowerShell scripts.
|
||||
/// affect the type resolution in PowerShell scripts.
|
||||
/// </remarks>
|
||||
public static Dictionary<string, Type> Get
|
||||
{
|
||||
|
||||
@@ -1615,7 +1615,7 @@ namespace System.Management.Automation.Language
|
||||
// left operand is always evaluated, visit it's expression in the current block.
|
||||
binaryExpressionAst.Left.Accept(this);
|
||||
|
||||
// The right operand is condtionally evaluated. We aren't generating any code here, just
|
||||
// The right operand is conditionally evaluated. We aren't generating any code here, just
|
||||
// modeling the flow graph, so we just visit the right operand in a new block, and have
|
||||
// both the current and new blocks both flow to a post-expression block.
|
||||
var targetBlock = new Block();
|
||||
|
||||
@@ -506,7 +506,7 @@ namespace System.Management.Automation.Language
|
||||
public Token Kind { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The flags specifid and their value. The value is null if it's not specified.
|
||||
/// The flags specified and their value. The value is null if it's not specified.
|
||||
/// e.g. switch -regex -file c:\demo.txt ---> regex -- null
|
||||
/// file -- { c:\demo.txt }
|
||||
/// </summary>
|
||||
@@ -749,7 +749,7 @@ namespace System.Management.Automation.Language
|
||||
public ReadOnlyCollection<PSSnapInSpecification> RequiresPSSnapIns { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// The aseemblies this script requires, specified like:
|
||||
/// The assemblies this script requires, specified like:
|
||||
/// <code>#requires -Assembly path\to\foo.dll</code>
|
||||
/// <code>#requires -Assembly "System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"</code>
|
||||
/// If no assemblies are required, this property is an empty collection.
|
||||
@@ -757,7 +757,7 @@ namespace System.Management.Automation.Language
|
||||
public ReadOnlyCollection<string> RequiredAssemblies { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Specifies if this script requires elevated privelges, specified like:
|
||||
/// Specifies if this script requires elevated privileges, specified like:
|
||||
/// <code>#requires -RunAsAdministrator</code>
|
||||
/// If nothing is specified, this property is false.
|
||||
/// </summary>
|
||||
@@ -1206,7 +1206,7 @@ namespace System.Management.Automation.Language
|
||||
"Caller makes sure the section is within the ScriptBlockAst");
|
||||
|
||||
List<VariableExpressionAst> usingVars = usingVariablesTuple.Item1; // A list of using variables
|
||||
string newParams = usingVariablesTuple.Item2; // The new parameters are seperated by the comma
|
||||
string newParams = usingVariablesTuple.Item2; // The new parameters are separated by the comma
|
||||
|
||||
// astElements contains
|
||||
// -- UsingVariable
|
||||
@@ -1943,7 +1943,7 @@ namespace System.Management.Automation.Language
|
||||
public abstract class AttributeBaseAst : Ast
|
||||
{
|
||||
/// <summary>
|
||||
/// Initiale the common fields for an attribute.
|
||||
/// Initialize the common fields for an attribute.
|
||||
/// </summary>
|
||||
/// <param name="extent">The extent of the attribute, from the opening '[' to the closing ']'.</param>
|
||||
/// <param name="typeName">The type named by the attribute.</param>
|
||||
@@ -2268,7 +2268,7 @@ namespace System.Management.Automation.Language
|
||||
/// A parameter name cannot be a using variable, but its default value could contain any number of UsingExpressions, for example:
|
||||
/// function bar ($x = (Get-X @using:defaultSettings.Parameters)) { ... }
|
||||
/// This method goes through the ParameterAst text and replace each $using variable with its new synthetic name (remove the $using prefix).
|
||||
/// This method is used when we call Invoke-Command targetting a PSv2 remote machine. In that case, we might need to call this method
|
||||
/// This method is used when we call Invoke-Command targeting a PSv2 remote machine. In that case, we might need to call this method
|
||||
/// to process the script block text, since $using prefix cannot be recognized by PSv2.
|
||||
/// </summary>
|
||||
/// <param name="orderedUsingVar">A sorted enumerator of using variable asts, ascendingly sorted based on StartOffSet</param>
|
||||
@@ -2661,7 +2661,7 @@ namespace System.Management.Automation.Language
|
||||
// REVIEW: should old visitors completely skip the attributes and
|
||||
// bodies of methods, or should they get a chance to see them. If
|
||||
// we want to skip them, the code below needs to move up into the
|
||||
// above test 'vistitor2 != null'.
|
||||
// above test 'visitor2 != null'.
|
||||
if (action == AstVisitAction.Continue)
|
||||
{
|
||||
for (int index = 0; index < Attributes.Count; index++)
|
||||
@@ -4098,7 +4098,7 @@ namespace System.Management.Automation.Language
|
||||
public abstract class LabeledStatementAst : StatementAst
|
||||
{
|
||||
/// <summary>
|
||||
/// Initialize the properties commmon to labeled statements.
|
||||
/// Initialize the properties common to labeled statements.
|
||||
/// </summary>
|
||||
/// <param name="extent">The extent of the statement.</param>
|
||||
/// <param name="label">The optionally null label for the statement.</param>
|
||||
@@ -4363,7 +4363,7 @@ namespace System.Management.Automation.Language
|
||||
public PipelineBaseAst Initializer { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The ast for the iteration experssion of a for statement, or null if none was specified.
|
||||
/// The ast for the iteration expression of a for statement, or null if none was specified.
|
||||
/// </summary>
|
||||
public PipelineBaseAst Iterator { get; private set; }
|
||||
|
||||
@@ -4679,7 +4679,7 @@ namespace System.Management.Automation.Language
|
||||
|
||||
/// <summary>
|
||||
/// A possibly empty collection of conditions and statement blocks representing the cases of the switch statement.
|
||||
/// If the colleciton is empty, the default clause is not null.
|
||||
/// If the collection is empty, the default clause is not null.
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
|
||||
public ReadOnlyCollection<SwitchClause> Clauses { get; private set; }
|
||||
@@ -5435,7 +5435,7 @@ namespace System.Management.Automation.Language
|
||||
#region Pipelines
|
||||
|
||||
/// <summary>
|
||||
/// An abstract base class for statements that include command invocations, pipelines, expressions, and assignements.
|
||||
/// An abstract base class for statements that include command invocations, pipelines, expressions, and assignments.
|
||||
/// Any statement that does not begin with a keyword is derives from PipelineBastAst.
|
||||
/// </summary>
|
||||
public abstract class PipelineBaseAst : StatementAst
|
||||
@@ -5462,7 +5462,7 @@ namespace System.Management.Automation.Language
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The ast that repesents a PowerShell pipeline, e.g. <c>gci -re . *.cs | select-string Foo</c> or <c> 65..90 | % { [char]$_ }</c>.
|
||||
/// The ast that represents a PowerShell pipeline, e.g. <c>gci -re . *.cs | select-string Foo</c> or <c> 65..90 | % { [char]$_ }</c>.
|
||||
/// A pipeline must have at least 1 command. The first command may be an expression or a command invocation.
|
||||
/// </summary>
|
||||
public class PipelineAst : PipelineBaseAst
|
||||
@@ -5808,7 +5808,7 @@ namespace System.Management.Automation.Language
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If this command was synthesiszed out of a dynamic keyword, this property will point to the DynamicKeyword
|
||||
/// If this command was synthesized out of a dynamic keyword, this property will point to the DynamicKeyword
|
||||
/// data structure that was used to create this command.
|
||||
/// </summary>
|
||||
public DynamicKeyword DefiningKeyword { get; set; }
|
||||
@@ -6290,7 +6290,7 @@ namespace System.Management.Automation.Language
|
||||
public class AssignmentStatementAst : PipelineBaseAst
|
||||
{
|
||||
/// <summary>
|
||||
/// Construct an assignement statement.
|
||||
/// Construct an assignment statement.
|
||||
/// </summary>
|
||||
/// <param name="extent">The extent of the assignment statement.</param>
|
||||
/// <param name="left">The value being assigned.</param>
|
||||
@@ -6564,7 +6564,7 @@ namespace System.Management.Automation.Language
|
||||
internal List<DynamicKeyword> DefinedKeywords { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Generate ast that definies a function for this <see cref="ConfigurationDefinitionAst"/> object
|
||||
/// Generate ast that defines a function for this <see cref="ConfigurationDefinitionAst"/> object
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// The <see cref="PipelineAst"/> that defines a function for this <see cref="ConfigurationDefinitionAst"/> object
|
||||
@@ -6627,7 +6627,7 @@ namespace System.Management.Automation.Language
|
||||
cea.Add(new CommandParameterAst(LCurlyToken.Extent, "InstanceName", new VariableExpressionAst(LCurlyToken.Extent, "InstanceName", false), LCurlyToken.Extent));
|
||||
|
||||
//
|
||||
// copy the configuration paramter to the new function parameter
|
||||
// copy the configuration parameter to the new function parameter
|
||||
// the new set-item created function will have below parameters
|
||||
// [cmdletbinding()]
|
||||
// param(
|
||||
@@ -7062,13 +7062,13 @@ namespace System.Management.Automation.Language
|
||||
//
|
||||
// The second type, where the DirectCall flag is set to true, simply calls the command directly.
|
||||
// In the original source, the keyword body will be a property collection where the allowed properties
|
||||
// in the collection corresond to the parameters on the actual called function.
|
||||
// in the collection correspond to the parameters on the actual called function.
|
||||
//
|
||||
var cea = new Collection<CommandElementAst>();
|
||||
|
||||
//
|
||||
// First add the name of the command to call. If a module name has been provided
|
||||
// then use the module-quilified form of the command name..
|
||||
// then use the module-qualified form of the command name..
|
||||
//
|
||||
if (string.IsNullOrEmpty(Keyword.ImplementingModule))
|
||||
{
|
||||
@@ -7225,7 +7225,7 @@ namespace System.Management.Automation.Language
|
||||
LCurly.Extent));
|
||||
|
||||
//
|
||||
// Add the -SourceMetadata parametere
|
||||
// Add the -SourceMetadata parameter
|
||||
//
|
||||
string sourceMetadata = FunctionName.Extent.File
|
||||
+ "::" + FunctionName.Extent.StartLineNumber
|
||||
@@ -7874,7 +7874,7 @@ namespace System.Management.Automation.Language
|
||||
/// <param name="expression">The expression before the member access operator '.' or '::'.</param>
|
||||
/// <param name="member">The name or expression naming the member to access.</param>
|
||||
/// <param name="static">True if the '::' operator was used, false if '.' is used.
|
||||
/// True if the member access is for a static member, using '::', false if accessing a member on an instace using '.'.
|
||||
/// True if the member access is for a static member, using '::', false if accessing a member on an instance using '.'.
|
||||
/// </param>
|
||||
/// <exception cref="PSArgumentNullException">
|
||||
/// If <paramref name="extent"/>, <paramref name="expression"/>, or <paramref name="member"/> is null.
|
||||
@@ -8164,7 +8164,7 @@ namespace System.Management.Automation.Language
|
||||
/// <param name="method">The method to invoke.</param>
|
||||
/// <param name="arguments">The arguments to pass to the method.</param>
|
||||
/// <param name="static">
|
||||
/// True if the invocation is for a static method, using '::', false if invoking a method on an instace using '.'.
|
||||
/// True if the invocation is for a static method, using '::', false if invoking a method on an instance using '.'.
|
||||
/// </param>
|
||||
/// <exception cref="PSArgumentNullException">
|
||||
/// If <paramref name="extent"/> is null.
|
||||
@@ -9302,7 +9302,7 @@ namespace System.Management.Automation.Language
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Construct a variable reference with an exising VariablePath (rather than construct a new one.)
|
||||
/// Construct a variable reference with an existing VariablePath (rather than construct a new one.)
|
||||
/// </summary>
|
||||
/// <exception cref="PSArgumentNullException">
|
||||
/// If <paramref name="extent"/> or <paramref name="variablePath"/> is null.
|
||||
@@ -9417,7 +9417,7 @@ namespace System.Management.Automation.Language
|
||||
{
|
||||
// Assume (because we're looking at $_ and we're inside a script block that is an
|
||||
// argument to some command) that the type we're getting is actually unrolled.
|
||||
// This might not be right in all cases, but with our simple analysis, it'r
|
||||
// This might not be right in all cases, but with our simple analysis, it's
|
||||
// right more often than it's wrong.
|
||||
if (result.Type.IsArray)
|
||||
{
|
||||
@@ -9950,7 +9950,7 @@ namespace System.Management.Automation.Language
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The ast that repesents a double quoted string (here string or normal string) and can have nested variable
|
||||
/// The ast that represents a double quoted string (here string or normal string) and can have nested variable
|
||||
/// references or sub-expressions, e.g. <c>"Name: $name`nAge: $([DateTime]::Now.Year - $dob.Year)"</c>.
|
||||
/// </summary>
|
||||
public class ExpandableStringExpressionAst : ExpressionAst
|
||||
@@ -10333,7 +10333,7 @@ namespace System.Management.Automation.Language
|
||||
yield return new PSTypeName(typeof(Hashtable));
|
||||
}
|
||||
|
||||
// Indicates that this ast was consructed as part of a schematized object instead of just a plain hash literal.
|
||||
// Indicates that this ast was constructed as part of a schematized object instead of just a plain hash literal.
|
||||
internal bool IsSchemaElement { get; set; }
|
||||
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ namespace System.Management.Automation.Language
|
||||
/// <summary>The subtraction assignment operator '-='.</summary>
|
||||
MinusEquals = 44,
|
||||
|
||||
/// <summary>The multiplcation assignment operator '*='.</summary>
|
||||
/// <summary>The multiplication assignment operator '*='.</summary>
|
||||
MultiplyEquals = 45,
|
||||
|
||||
/// <summary>The division assignment operator '/='.</summary>
|
||||
@@ -598,7 +598,7 @@ namespace System.Management.Automation.Language
|
||||
|
||||
/// <summary>
|
||||
/// The precedence of comparison operators including: '-eq', '-ne', '-ge', '-gt', '-lt', '-le', '-like', '-notlike',
|
||||
/// '-match', '-notmatch', '-replace', '-containts', '-notcontains', '-in', '-notin', '-split', '-join', '-is', '-isnot', '-as',
|
||||
/// '-match', '-notmatch', '-replace', '-contains', '-notcontains', '-in', '-notin', '-split', '-join', '-is', '-isnot', '-as',
|
||||
/// and all of the case sensitive variants of these operators, if they exists.
|
||||
/// </summary>
|
||||
BinaryPrecedenceComparison = 3,
|
||||
@@ -792,7 +792,7 @@ namespace System.Management.Automation.Language
|
||||
/* Equals */ TokenFlags.AssignmentOperator,
|
||||
/* PlusEquals */ TokenFlags.AssignmentOperator,
|
||||
/* MinusEquals */ TokenFlags.AssignmentOperator,
|
||||
/* MultipyEquals */ TokenFlags.AssignmentOperator,
|
||||
/* MultiplyEquals */ TokenFlags.AssignmentOperator,
|
||||
/* DivideEquals */ TokenFlags.AssignmentOperator,
|
||||
/* RemainderEquals */ TokenFlags.AssignmentOperator,
|
||||
/* Redirection */ TokenFlags.DisallowedInRestrictedMode,
|
||||
@@ -990,7 +990,7 @@ namespace System.Management.Automation.Language
|
||||
/* Equals */ "=",
|
||||
/* PlusEquals */ "+=",
|
||||
/* MinusEquals */ "-=",
|
||||
/* MultipyEquals */ "*=",
|
||||
/* MultiplyEquals */ "*=",
|
||||
/* DivideEquals */ "/=",
|
||||
/* RemainderEquals */ "%=",
|
||||
/* Redirection */ "redirection",
|
||||
|
||||
@@ -188,7 +188,7 @@ namespace System.Management.Automation.Language
|
||||
|
||||
/// <summary>
|
||||
/// Remove a single entry from the dynamic keyword collection
|
||||
/// and clean up any assoicated data.
|
||||
/// and clean up any associated data.
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
public static void RemoveKeyword(string name)
|
||||
@@ -306,7 +306,7 @@ namespace System.Management.Automation.Language
|
||||
public bool MetaStatement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicate that the keyword is reservce for future use by powershell
|
||||
/// Indicate that the keyword is reserved for future use by powershell
|
||||
/// </summary>
|
||||
public bool IsReservedKeyword { get; set; }
|
||||
|
||||
@@ -1497,7 +1497,7 @@ namespace System.Management.Automation.Language
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise, the edit distance is the minumum
|
||||
// Otherwise, the edit distance is the minimum
|
||||
// of doing an addition of a character, a deletion
|
||||
// of a character, or a substitution of a character
|
||||
distanceMap[row, column] = Math.Min(
|
||||
@@ -2115,7 +2115,7 @@ namespace System.Management.Automation.Language
|
||||
|
||||
private bool ScanAfterHereStringHeader(string header)
|
||||
{
|
||||
// On entry, we've see the header. We allow whitepace and require a newline before the actual string starts
|
||||
// On entry, we've see the header. We allow whitespace and require a newline before the actual string starts
|
||||
int headerOffset = _currentIndex - 2;
|
||||
|
||||
char c;
|
||||
@@ -3394,7 +3394,7 @@ namespace System.Management.Automation.Language
|
||||
internal Token GetLBracket()
|
||||
{
|
||||
// We know we want a '[' token or no token. We are in a context where we expect an attribute/type constraint
|
||||
// and allow any whitespace/commments before the '[', but nothing else (the caller has already skipped newlines
|
||||
// and allow any whitespace/comments before the '[', but nothing else (the caller has already skipped newlines
|
||||
// if appropriate.) This is handled specially because in command mode, a generic token may begin with '[', but
|
||||
// we don't want anything more than the '['.
|
||||
|
||||
|
||||
Reference in new issue
Block a user