Skip to content

fix(parser): report unclosed multiline comments - #924

Merged
Laupetin merged 2 commits into
Laupetin:mainfrom
michaeloliverx:fix-parser
Jul 23, 2026
Merged

fix(parser): report unclosed multiline comments#924
Laupetin merged 2 commits into
Laupetin:mainfrom
michaeloliverx:fix-parser

Conversation

@michaeloliverx

Copy link
Copy Markdown
Contributor

When OAT builds this project:

https://github.com/reaaLx/iw3styledmenu/tree/master

It prints:

ERROR: In "ui_mp/menu_cac_assault.menu": Unclosed menu at end of file!
ERROR: Could not read menu file "ui_mp/menu_cac_assault.menu"

The menu has matching braces. The real fault lies in ui_mp/cac_loadout.inc, which ends with /* but has no */. This makes OAT treat the rest of the menu, including its closing braces, as a comment.

This fix makes OAT track where each block comment starts. If OAT reaches EOF before */, it now prints the right file and line:

ERROR: ui_mp/cac_loadout.inc L244:2 Unclosed multi-line comment
ERROR: Parsing menu file failed!
ERROR: Could not read menu file "ui_mp/menu_cac_assault.menu"

The new test covers an unclosed block comment at EOF.

Relates to #160

@michaeloliverx
michaeloliverx force-pushed the fix-parser branch 2 times, most recently from 86d1709 to 8d19ca9 Compare July 21, 2026 11:25
@Laupetin
Laupetin force-pushed the fix-parser branch 3 times, most recently from 97a681a to 1aae804 Compare July 23, 2026 16:27

@Laupetin Laupetin left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much :) Just changed the variable names a bit since i got confused and hurt myself trying to merge the two variables that should not be merged

@Laupetin
Laupetin merged commit 52f557a into Laupetin:main Jul 23, 2026
8 checks passed
@michaeloliverx
michaeloliverx deleted the fix-parser branch July 23, 2026 16:57
@Laupetin Laupetin added the bug Something isn't working label Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants