rejectedsoftware / diet-ng

Compile-time indentation based, XML structured template system
MIT License
45 stars 24 forks source link

Better error message for missing comma inside attribute list #95

Open schveiguy opened 1 year ago

schveiguy commented 1 year ago
a(href="/blah/blah" target="_blank")

results in a very long series of errors that aren't actually in the code. An example from my project:

job/edit.dt(417,51): Error: found `target` when expecting `;` following `return` statement
job/edit.dt(417,57): Error: found `=` instead of statement
job/edit.dt(416,18): Error: found `target` when expecting `)`
job/edit.dt(416,24): Error: found `=` instead of statement
job/edit.dt(416,42): Error: found `target` when expecting `)`
job/edit.dt(416,48): Error: found `=` when expecting `)`
job/edit.dt(416,49): Error: found `"_blank"` when expecting `)`
job/edit.dt(416,57): Error: found `)` instead of statement
job/edit.dt(416,44): Error: found `target` when expecting `)`
job/edit.dt(416,59): Error: found `)` when expecting `;` following statement
job/edit.dt(416,60): Deprecation: use `{ }` for an empty statement, not `;`

It's not always the same set of errors.

It would be nice if the diet compiler could say "missing comma in attribute list" instead of generating invalid D code.

Note that pug files actually allow spaces, and I get confused because on another project, I'm actually using pug.