colis-anr / morbig

A static parser for POSIX Shell
Other
192 stars 8 forks source link

Paramter length bug fix #121

Closed ishaangandhi closed 3 years ago

ishaangandhi commented 4 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}.

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.

ishaangandhi commented 4 years ago

The corresponding change in Morsmall is https://github.com/colis-anr/morsmall/pull/13

yurug commented 3 years ago

Thank you for your contribution, @Ishaangandhi !

ishaangandhi commented 3 years ago

Thank you for merging, @yurug !