mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-21 17:25:46 +01:00
Remove dependency to CPP: add support for conditional directives
It is now possible to use #ifdef/#ifndef to exclude some part of the file. The implementation uses a stack to track conditionals so it is possible to use nested constructs.
This commit is contained in:
committed by
Carlos R. Mafra
parent
9b792369cb
commit
4658f4f9a1
@@ -44,6 +44,16 @@ struct w_menu_parser {
|
||||
FILE *file_handle;
|
||||
int line_number;
|
||||
WParserMacro *macros;
|
||||
struct {
|
||||
/* Conditional text parsing is implemented using a stack of the
|
||||
skip states for each nested #if */
|
||||
int depth;
|
||||
struct {
|
||||
Bool skip;
|
||||
char name[8];
|
||||
int line;
|
||||
} stack[32];
|
||||
} cond;
|
||||
char *rd;
|
||||
char line_buffer[MAXLINE];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user