shFunctionStart references{} and (), also matchif; see shFunctionCmd)( and ) for shFunctionFour() token is optional, i.e.function reserved word is present.shFunctionFour definitions.\h) to equivalent[A-Za-z_]) for speed.@test:.do, done, etc. prefixes;shDoError and shIfError.Resolves: #19619
References:
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_09_04
https://gitweb.git.savannah.gnu.org/gitweb/?p=bash.git;a=blob_plain;f=doc/bash.html;hb=637f5c8696a6adc9b4519f1cd74aa78492266b7f
http://www.mirbsd.org/htman/i386/man1/mksh.htm
https://github.com/vim/vim/pull/19638
(22 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@JohnoKing, you seem to know your way around a garden
variety of Korn shells. Can you please take a look at the
proposed changes?
The new submitted tests aim to showcase working code only;
however, I don't have access to neither ksh2020 nor ksh88.
I resorted to blindly re-using composed mksh test cases for
both, which I could verify locally, hoping for current POSIX
compliance otherwise. Let me know if any tests contain
broken code.
Does any Korn shell support id_4 (sub-shelling) syntax?
id_1() { echo $1; } id_2() ( echo $1; ) function id_3() { echo $1; } function id_4() ( echo $1; )
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Does any Korn shell support
id_4(sub-shelling) syntax?
id_4 is invalid for all ksh implementations, whereas id_1 and id_2 are valid. id_3 is only valid for mksh; for other Korn shells the post-name () are invalid if the function keyword is used. Sub-shelling is only supported via id_2's syntax.
The syntax for the mksh and ksh88 scripts is valid (the ksh88 script fails to run, but that's because ksh88 requires $n be declared with typeset prior to ((...)), which is unrelated to syntax).
The syntax for the ksh2020 script is invalid (my previous PR was somewhat lax about discipline function syntax to avoid making the regex overly convoluted). In ksh93 and ksh2020 functions with a dot in their name are classified as discipline functions. These are used with variables to run code when a variable is expanded or altered (e.g., a kshrc script could have a PS1.get() { or function .sh.tilde.set {, or a regular script might use .sh.pid.unset() {).
The ksh2020 script has functions with the names .a. and ...(). The first one is invalid because function names can't end with a . (although they can start with a .). The second one technically isn't considered an actual name because ksh expects the discipline function to correspond to a variable, which ... doesn't specify. Double dots with no letters between them is also invalid, so foo..append() is invalid syntax, but parent.foo.append() is valid syntax. The valid discipline function types that ought follow the final dot are get, getn, set, append, and unset; other names past the last dot are invalid.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@zzzyxwvut pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Thank you for the detailed explanation.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@zzzyxwvut pushed 1 commit.
You are receiving this because you are subscribed to this thread.![]()