Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function names that start with colon have weird behavior with first non label compatible character #8908

Closed
msftrncs opened this issue Feb 18, 2019 · 4 comments
Labels
Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-No Activity Issue has had no activity for 6 months or more WG-Language parser, language semantics

Comments

@msftrncs
Copy link
Contributor

Steps to reproduce

Note the different requirements:

function :hello" {} # allowed single double-quote
function hello"" {} #required matching double-quotes
function global::hello"" {} #also requires matching double quotes
function :hello` more {} # error, 'more' was not expected.
`function hello` more {} # works fine, function name is 'hello more'

Expected behavior

All to be consistent.

Actual behavior

It seems that some rules for labels are being applied to functions who's name token directly start with a colon, as the rules seem to match, such that any character that would fail as a label character just gets consumed in to the name with no regard to the rules of that character, such as the double-quote in the first statement above, or the backtick in the 4th statement.

I noticed this while trying to correct the PowerShell/EditorSyntax for function names, see PowerShell/EditorSyntax#156 for my work. I've noticed that a label can also be a function, and that is difficult to properly detect in a TM grammar, so I was double checking some of my matches when I noticed this, and at first thought I had the rules to function names wrong.

Environment data

Tested on 5.1 Windows PowerShell and 6.2 preview

Name                           Value
----                           -----
PSVersion                      6.2.0-preview.4
PSEdition                      Core
GitCommitId                    6.2.0-preview.4
OS                             Microsoft Windows 10.0.18334
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
@msftrncs msftrncs added the Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a label Feb 18, 2019
@iSazonov iSazonov added the WG-Language parser, language semantics label Feb 18, 2019
Copy link
Contributor

This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

2 similar comments
Copy link
Contributor

This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

Copy link
Contributor

This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

@microsoft-github-policy-service microsoft-github-policy-service bot added Resolution-No Activity Issue has had no activity for 6 months or more labels Nov 16, 2023
Copy link
Contributor

This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-No Activity Issue has had no activity for 6 months or more WG-Language parser, language semantics
Projects
None yet
Development

No branches or pull requests

2 participants