peggyjs / peggy

Peggy: Parser generator for JavaScript
https://peggyjs.org/
MIT License
906 stars 64 forks source link

Example Javascript grammar has inconsistent indentation #445

Closed frostburn closed 6 months ago

frostburn commented 8 months ago

Most of the lines in the Javascript example seem to be indented with multiples of two spaces, but in the rule for ObjectLiteral there's a line that starts with seven spaces just to give an example of odd indentation: https://github.com/peggyjs/peggy/blob/main/examples/javascript.pegjs#L543

hildjj commented 8 months ago

Are you proposing that those lines be out-dented by 1 space? if so, that makes sense to me.

frostburn commented 8 months ago

Any direction by 1 space is fine by me. It's just that my code editor was freaking out when I edited those lines for my own variant of the grammar. Didn't check other lines, but obviously all odd multiples of indenting spaces should be evened out in some direction.