hadronized / glsl

GLSL parser for Rust
190 stars 28 forks source link

Add missing do-while and for-init expr semicolons #151

Closed pau101 closed 7 months ago

pau101 commented 2 years ago

Both do-while statements and expression for-init statements would be output with incorrect syntax by show_translation_unit.

This PR adds the missing semicolons as needed.

Example Input:

do {
  a();
} while (true);
int i;
for (i = 0; ; ) {
}

Before:

do {
a();
}
 while (true)
int i;
for (i = 0; ) {
}

After:

do {
a();
}
 while (true);
int i;
for (i = 0; ; ) {
}
hadronized commented 7 months ago

Damn, I can’t believe I missed that in my notifications. Thanks!