I’m interested in writing a plugin to disallow alternative spelling/digraphs for operators and tokens. However I haven’t been able to find a way to access this information from a PluginASTAction.
I see that the digraphs (<: %: etc.) are handled in Lexer.cpp, but perhaps the only way to get the original spelling is Lexer::getSpelling(). Would I be able to get access to the Lexer, SourceLocation, SourceManager, etc. from a PluginASTAction in order to call this?
I also found the
CXX_KEYWORD_OPERATORs in TokenKinds.def, but it looks like these get mapped to the same token kinds as the regular operator spellings so I’m not sure how to distinguish them after the AST is built.
Any recommendations would be appreciated, thanks!