Skip to content

Commit

Permalink
fixed functionblock ast serialization to recursively perform empty ar…
Browse files Browse the repository at this point in the history
…gs sanity check for nested function calls
  • Loading branch information
andrei-pham committed Oct 4, 2022
1 parent ba187d1 commit a0538a2
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions tinycss2/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,15 +694,14 @@ def _serialize_to(self, write):
write(serialize_identifier(self.name))
write('(')
_serialize_to(self.arguments, write)
if self.arguments:
function = self
while isinstance(function, FunctionBlock):
eof_in_string = (
isinstance(function.arguments[-1], ParseError) and
function.arguments[-1].kind == 'eof-in-string')
if eof_in_string:
return
function = function.arguments[-1]
function = self
while isinstance(function, FunctionBlock) and function.arguments:
eof_in_string = (
isinstance(function.arguments[-1], ParseError) and
function.arguments[-1].kind == 'eof-in-string')
if eof_in_string:
return
function = function.arguments[-1]
write(')')


Expand Down

0 comments on commit a0538a2

Please sign in to comment.