idank / bashlex

Python parser for bash
GNU General Public License v3.0
550 stars 94 forks source link

Fix elif clause by extending parts to include previous elif parts #49

Open sereysethy opened 5 years ago

sereysethy commented 5 years ago

Last elif clause node is created and added to parts as a list. When parsing the next elif (bottom-up order), as the last part is a list, then it wrongly created a ReservedWord node and add the previous list as word. The solution is to extend parts to include previous parts.

idank commented 5 years ago

Hey, thanks for separating this. Can you please add a test? You had an example in the original pull request, something simple along those lines can work. Thanks!