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

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 4 years and 2 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
Jehoschua
Posts: 64
Last visit: Fri Mar 01, 2024 3:24 am

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

Post 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 1879 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
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

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

Post by Alexander Riedel »

I will make sure your request is received at the correct place.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

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

Post 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 1862 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.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 4 years and 2 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.