Support unbalanced curved braces inside conditional statements

Description

The following case of Pre-compiled directives

Notice how the braces for each of the IF statement started within the #idef's but the closing braces is
outside any condition. Although it's a valid syntax, i think the parser doesn't recognize it.

Suggest a possible fix before actually implementing.
I think one of the following:
1) Add missing brace(s) to close the scope when exiting a #if / #else / #endif block;
2) Invoke a preprocessor, or manually preprocess only #if / #else / #endif like directives as a configurable option (added to ConversionOptions).

Environment

None

Activity

Show:
Alex Petuschak
July 23, 2018, 3:05 PM

One of the approaches may be either running a C preprocessor or our own alternative to strip paths that should not be evaluated.
Example:

(vpx_encoder.h).

Alex Petuschak
July 23, 2018, 3:13 PM

Related (see attached `FMIceLink.h`):
need to deal with such cases, resulting in parser errors (obviously , unmatched `@end` is the result of preprocessor directives):

Assignee

Ivan Kochurkin

Reporter

Alex Petuschak

Labels

Git Branch Name

None

Components

Fix versions

Priority

Medium

Epic Name

Configure