fix: fix parsing pkgbuild in case if comment starts with multiple sharps (#136)

This commit is contained in:
2024-11-13 17:56:27 +02:00
parent 8d53a59a6a
commit f09082dff2
5 changed files with 246 additions and 3 deletions

View File

@ -226,7 +226,7 @@ class PkgbuildParser(shlex.shlex):
pass
case PkgbuildToken.ArrayEnds:
break
case PkgbuildToken.Comment:
case comment if comment.startswith(PkgbuildToken.Comment):
self.instream.readline()
continue
@ -267,7 +267,7 @@ class PkgbuildParser(shlex.shlex):
counter -= 1
if counter == 0:
break
case PkgbuildToken.Comment:
case comment if comment.startswith(PkgbuildToken.Comment):
self.instream.readline()
if not 0 < start_position < end_position:
@ -303,7 +303,7 @@ class PkgbuildParser(shlex.shlex):
yield PkgbuildPatch(key, value)
return
if token == PkgbuildToken.Comment:
if token.startswith(PkgbuildToken.Comment):
self.instream.readline()
return