[cfe-dev] Custom pragma's

Jacques Pienaar jacques at japienaar.info
Thu Apr 4 19:26:00 PDT 2013


Hey,

I've been playing around with clang defining a custom pragma type. Does the
pragma need to consist of expressions? I don't know if I'm phrasing it
correctly, but I want to define a custom pragma such as
#pragma X b[i:j]
When I try to implement the HandlePragma method as some of the other
examples (using preprocessor's lex function) then I get "error: expected
']'" where the colon is. Something like '[i]' was expected. Is there a way
to do this via the lex function? Or would I need to do something like
DiscardUntilEndOfDirective and then work on the string "b[i:j]"?

Thanks,

Jacques
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130404/84fd101f/attachment.html>


More information about the cfe-dev mailing list