forked from mom-ocean/MOM6
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Makedep: Better handling of parentheses
The makedep tool was updated to handle parentheses in preprocessor expressions. The expression `#if (defined a)` could not be parsed due to poor ad-hoc handling of parentheses, making it impossible to build the AM2-based coupled models with makedep, The tool has has been significantly overhauled to include better overall unary operator support. * `defined` is now more of an operation than an exception, since it is pushed to the stack like any other operator. * Parentheses are now handled as "operators", with `)` triggering an operator stack push and `(` conducting the actual operation (in this case simply returning the contents). * In order to handle the possibility of macros within parentheses, macros are now evaluated only immediately before used in expressions, rather than the instant they are first encountered. This redesign has allowed for many edge cases to be consolidated into the general purpose parser, greatly simplifying the code.
- Loading branch information
1 parent
a200f5f
commit 1829b7f
Showing
1 changed file
with
43 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters