fix: handle empty assignment correctly in PKGBUILD

This commit is contained in:
arcanis committed 2026-10-25 02:09:13 +03:00
1 parent 2080f1e06f
commit 27cfcd07eb
3 files changed
+251 -163

No files matched your search

@@ -169,6 +169,11 @@ class PkgbuildParser(Iterable[PkgbuildPatch]):
value = cast(Node, node.child_by_field_name(PkgbuildNodeField.Value))
key = self._text(name)
# bash permits assignments without a value (for example ``IFS=``).
# tree-sitter represents those assignments without a value node.
if value is None:
return PkgbuildPatch(key, "")
match value.type:
case PkgbuildNodeType.Array:
array_values = []