New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
panic: could not match regexp with string (translation_unit_decl) #885
Comments
Yes, those are good example of similar fixes. I'll explain whats going on. c2go calls clang to do the preprocessing, parsing and output a (rather unfriendly) text based representation of the AST of the source code. Having clang parse the source means that c2go doesn't have to have its own extremely complicated C parser and the clang output provides some extra insights (such as typing information) as well. On the flip side, the text-based clang AST output is not designed to be machine ingested, it's (normally) just for debugging. So the format changes all the time. c2go relies on regexps to parse this back into a structure in memory before transpiling. I decided to make c2go very strict about what it would accept so that nuanced cases would be caught rather than leading to bugs down the line. Of course, this also means that c2go can be very brittle as clang make changes to their parser. The solution you see in those PRs is to copy the line that is failing ( |
The text was updated successfully, but these errors were encountered: