Closed ishaangandhi closed 3 years ago
The Parameter Length attribute is unique amongst parameter expansions (https://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_02) in that the parameter identifier occurs after the the operator. (Eg, compare ${#parameter} with ${parameter:+word} or ${parameter=word}.
${#parameter}
${parameter:+word}
${parameter=word}
Currently, Morbig incorrectly parses the # as the identifier name, then puts the actual identifier name in the ParameterLength variable_attribute type. This pull request fixes that.
#
The corresponding change in Morsmall is https://github.com/colis-anr/morsmall/pull/13
Thank you for your contribution, @Ishaangandhi !
Thank you for merging, @yurug !
The Parameter Length attribute is unique amongst parameter expansions (https://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_02) in that the parameter identifier occurs after the the operator. (Eg, compare
${#parameter}
with${parameter:+word}
or${parameter=word}
.Currently, Morbig incorrectly parses the
#
as the identifier name, then puts the actual identifier name in the ParameterLength variable_attribute type. This pull request fixes that.