Title: Operators tokens remain flagged as operators after TokenKind is changed to Generic in Command Mode · Issue #10348 · PowerShell/PowerShell · GitHub
Open Graph Title: Operators tokens remain flagged as operators after TokenKind is changed to Generic in Command Mode · Issue #10348 · PowerShell/PowerShell
X Title: Operators tokens remain flagged as operators after TokenKind is changed to Generic in Command Mode · Issue #10348 · PowerShell/PowerShell
Description: While trying to understand why PSReadLine highlights operator tokens in command mode as operators (though they are not in that context) , I determined that the parser/tokenizer (Tokens Class) has a method that specifically resets the Tok...
Open Graph Description: While trying to understand why PSReadLine highlights operator tokens in command mode as operators (though they are not in that context) , I determined that the parser/tokenizer (Tokens Class) has a...
X Description: While trying to understand why PSReadLine highlights operator tokens in command mode as operators (though they are not in that context) , I determined that the parser/tokenizer (Tokens Class) has a...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/10348
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Operators tokens remain flagged as operators after TokenKind is changed to Generic in Command Mode","articleBody":"While trying to understand why PSReadLine highlights operator tokens in command mode as operators (though they are not in that context) , I determined that the parser/tokenizer (Tokens Class) has a method that specifically resets the TokenKind of a token, to 'Generic'. However it fails to remove the flags originally set from the original TokenKind. This most commonly occurs to the operators, which in command mode, are not operators and instead are treated as unquoted arguments. PSReadLine uses the TokenFlags UnaryOperator, BinaryOperator and AssignmentOperator to highlight operators, and so that is what it sees\r\n\r\n# Steps to reproduce\r\n\r\n```powershell\r\necho 1 + 2 + 3 (1 + 2 + 3)\r\n# ^ ^ not operators\r\n# ^ ^ operators!\r\n```\r\n","author":{"url":"https://github.com/msftrncs","@type":"Person","name":"msftrncs"},"datePublished":"2019-08-13T04:20:41Z","url":"https://github.com/PowerShell/PowerShell/issues/10348"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:bd8e85d0-f069-6eb5-92a9-8165f4adac44 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 94AC:1E69A9:16FEC0:201A05:6AFE16BB |
| html-safe-nonce | a65ecb5780d48e4d44420e41055fc8a057187b11a7e57bb0de908dd99062a718 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NEFDOjFFNjlBOToxNkZFQzA6MjAxQTA1OjZBRkUxNkJCIiwidmlzaXRvcl9pZCI6IjUwNTE5MzcxNDE3NzMxNzg1NTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 887072f80434b77e1514445487e8d02d5999c1978e66e6e44e90257aedf181e4 |
| hovercard-subject-tag | issue:479951927 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/10348/issue_layout |
| twitter:image | https://opengraph.githubassets.com/243a49cfed77e3012504e798fe18f73fbed0d7aa096aa79adf62257249a44d1f/PowerShell/PowerShell/issues/10348 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/243a49cfed77e3012504e798fe18f73fbed0d7aa096aa79adf62257249a44d1f/PowerShell/PowerShell/issues/10348 |
| og:image:alt | While trying to understand why PSReadLine highlights operator tokens in command mode as operators (though they are not in that context) , I determined that the parser/tokenizer (Tokens Class) has a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | msftrncs |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3cd8a1d79ccbf9aecac62781f79072482a49047fb982b8c9e2ad4aca8bf6a9af |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 05539640a34afe6142a519483d78ddd766a1304a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width