-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Are all TokenKind.Generic tokens actually StringToken? #10581
Copy link
Copy link
Closed
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
The following definition of
TokenKind.Genericwould indicate that all tokens ofTokenKind.Genericshould be aStringToken. (or specifically either StringLiteral or StringExpandable)PowerShell/src/System.Management.Automation/engine/parser/token.cs
Lines 65 to 72 in 22c6fb4
However, the method
Token.SetIsCommandArgumentdoes not guarantee that. This method is used to revert theTokenKindof special tokens when they appear as command names or arguments. Most all the special tokens that receive this treatment are notStringTokens.PowerShell/src/System.Management.Automation/engine/parser/token.cs
Lines 1200 to 1208 in 22c6fb4
Should the documentation above
TokenKind.Genericbe reworded?Reference PR #10295.