Odin icon indicating copy to clipboard operation
Odin copied to clipboard

Syntax Error: 'else' unattached to an 'if' statement

Open AlectronikForge opened this issue 3 years ago • 1 comments

I wanted to give the odin-binding-generator a try and stumbled upon these errors:

/run/media/nix/BtrStorage/LinData/GitHub/2-Languages/Odin/odin-binding-generator/bindgen/c-parser-evaluate.odin(135:5) Syntax Error: 'else' unattached to an 'if' statement
/run/media/nix/BtrStorage/LinData/GitHub/2-Languages/Odin/odin-binding-generator/bindgen/c-parser-evaluate.odin(139:5) Syntax Error: 'else' unattached to an 'if' statement
/run/media/nix/BtrStorage/LinData/GitHub/2-Languages/Odin/odin-binding-generator/bindgen/c-parser-evaluate.odin(143:5) Syntax Error: 'else' unattached to an 'if' statement
/run/media/nix/BtrStorage/LinData/GitHub/2-Languages/Odin/odin-binding-generator/bindgen/c-parser-evaluate.odin(147:5) Syntax Error: 'else' unattached to an 'if' statement
/run/media/nix/BtrStorage/LinData/GitHub/2-Languages/Odin/odin-binding-generator/bindgen/c-parser-evaluate.odin(182:5) Syntax Error: 'else' unattached to an 'if' statement
/run/media/nix/BtrStorage/LinData/GitHub/2-Languages/Odin/odin-binding-generator/bindgen/c-parser-evaluate.odin(234:5) Syntax Error: 'else' unattached to an 'if' statement
/run/media/nix/BtrStorage/LinData/GitHub/2-Languages/Odin/odin-binding-generator/bindgen/c-parser.odin(428:5) Syntax Error: 'else' unattached to an 'if' statement
/run/media/nix/BtrStorage/LinData/GitHub/2-Languages/Odin/odin-binding-generator/bindgen/c-parser.odin(447:5) Syntax Error: 'else' unattached to an 'if' statement
/run/media/nix/BtrStorage/LinData/GitHub/2-Languages/Odin/odin-binding-generator/bindgen/c-parser.odin(713:5) Syntax Error: 'else' unattached to an 'if' statement

etc. The compiler doesn't recognize the else branch when there's more than just a newline in-between (e.g. comments). So this does work: } else if condi == tion { but this not:

} 
// here we handle whatever 
else if condition == true {

Compiler is version dev-2021-09 on Arch Linux.

AlectronikForge avatar Sep 02 '21 15:09 AlectronikForge

Hello!

I am marking this issue as stale as it has not received any engagement from the community or maintainers 120 days. That does not imply that the issue has no merit! If you feel strongly about this issue

  • open a PR referencing and resolving the issue;
  • leave a comment on it and discuss ideas how you could contribute towards resolving it;
  • leave a comment and describe in detail why this issue is critical for your use case;
  • open a new issue with updated details and a plan on resolving the issue.

The motivation for this automation is to help prioritize issues in the backlog and not ignore, reject, or belittle anyone..

github-actions[bot] avatar Jul 24 '22 21:07 github-actions[bot]