Handle folding and ranges directly in parser, also count opened braces to always close them all, for now only in PHP highlighter