Fix Compilation error in MessageStore.h#260
Conversation
Probable fix for compilation error encountered during IMessageControl.h MessageStore.h(56): parse error: can't insert namespace 'WPEFramework' into non-namespace block 'Metadata'
LuaGenerator ResultsNo changes detected. |
There was a problem hiding this comment.
Pull request overview
Fixes a CppParser issue where parser state (especially the current namespace/class block and pending annotation flags) leaked across file boundaries when processing translation units that span multiple files via #include. This caused parse errors like "can't insert namespace 'WPEFramework' into non-namespace block 'Metadata'" in MessageStore.h. The fix injects a synthetic @GLOBAL token at every @FILE: boundary and adds a handler that resets the parse context to the global namespace and clears all pending annotation flags.
Changes:
- Emit a
@GLOBALmarker token alongside each@FILE:marker during preprocessing. - Add a parser branch for
@GLOBALthat resetscurrent_blockto[global_namespace]and clears all pending state (omit/stub/json/event/template/etc.) before parsing continues in the new file.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
sebaszm
left a comment
There was a problem hiding this comment.
While this seems good direction, proper stubgen:include has been implemented in the meantime (inserts in-place), so this no longer needed and in fact could break parsing in certain conditions.
|
A better fix was found and updated. |
Probable fix for compilation error encountered during IMessageControl.h
Error message:
MessageStore.h(56): parse error: can't insert namespace 'WPEFramework' into non-namespace block 'Metadata'