php-c-parser icon indicating copy to clipboard operation
php-c-parser copied to clipboard

Support directives #pragma and #include_next in PreProcessor::skipIf

Open dirx opened this issue 5 years ago • 1 comments

Even though there is no support for

  • include_next
  • pragma

currently, it would be nice to add at least support for them in skipIf to "work around" them.

Maybe also skip:

  • ident
  • line
  • sccs
  • assert
  • unassert
  • import

dirx avatar May 01 '20 12:05 dirx

Totally okay adding ignores for ones that are logically no-ops. Example: ident, we aren't generating binaries from these headers, so if we encounter it we can safely ignore it.

However something like include_next definitely alters the behavior and would need support. I think I'd rather hard-error if it's not implemented rather than generate wrong or incomplete code by not handling it...

Looking at that list, ident, sccs, and line fit that bill.

Assert likely doesn't though, since it can prevent errors and things like that.

Import should likely be supported out of the box (and shouldn't be that hard either)...

ircmaxell avatar May 01 '20 12:05 ircmaxell