Syntax based folding