Page 1 of 1

Please fix the parser to support the PowerShell language specification for intl character sets

Posted: Sun Mar 08, 2020 8:41 am
by Jehoschua
Product: PowerShell Studio 2020 (64 Bit)
Build: v5.7.173
OS: Windows 10 Enterprise (64 Bit)
Build: v10.0.18363.0


Hello

At least, since the language specification for PowerShell Specification 3.0, we have the great freedom to use PowerShell everywhere on the World - with almost every language :)

Unfortunately, Sapien does not support this freedom: function names are still limited to a subset of the supported characters:
2020-03-08_15-59-20.png
2020-03-08_15-59-20.png (60.59 KiB) Viewed 894 times
The PowerShell Language Specificaton 3.0 defines, that a Function Name is valid by using:
  • Any Unicode character except:
  • { } ( ) ; , | & $
  • ` (The backtick character U+0060)
  • double-quote-character
  • single-quote-character
  • whitespace
  • new-line-character
Therefore, this function name is perfectly valid:

Code: Select all

Function §Retry-Command { }
and it works without problems, but it is not supported in Sapien PowerShell Studio IDE, e.g. we get the wrong context menu items and e.g. renaming does not work.

Can you please plan to fix it?

Thanks a lot, kind regards,
Thomas

Re: Please fix the parser to support the PowerShell language specification for intl character sets

Posted: Sun Mar 08, 2020 11:09 am
by Alexander Riedel
I will make sure your request is received at the correct place.

Re: Please fix the parser to support the PowerShell language specification for intl character sets

Posted: Sun Mar 08, 2020 12:11 pm
by Alexander Riedel
Just a few comments on this topic for anyone lurking here.

"the great freedom to use PowerShell everywhere on the World - with almost every language" - By using culture and localized keyboard specific characters you are negating that freedom. Anyone wanting to use your functions would need to switch to YOUR keyboard to produce that character. Best practices exist to prevent that. While language specifications may allow it, that does not make it a good idea.

It is misleading to state that "after 10 years SAPIEN still does not support international character sets" - You found one character on your localized keyboard that poses a problem. That is all.
As a matter of fact SAPIEN tools have supported unicode and international character sets for longer than PowerShell existed.

The "old ASCII characters" are, well, just the regular characters all western languages use. They maybe old, but your are implying that it is outdated to support them, which is incorrect.

PowerShell Studio's parser does not "stop support for international character sets". That is an incorrect statement. Again, because you found one key on your keyboard that poses a problem, it is incorrect to state we do not support international character sets altogether.

Last but not least, Visual Studio Code does not support your local special character either at this point in time.
illegal legal character.png
illegal legal character.png (52.75 KiB) Viewed 877 times
As you can see neither the function keyword nor the identifier are colored.
Script Analyzer correctly identifies your function name as a non-standard verb.

I am not saying this character should not be supported in function names. Technically it is absolutely within the language specifications to use it, that much is correct.
Is it a good idea? Best practices suggest no. Stick to the characters everyone has on their keyboard for identifiers.