mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
now can handle multiple depths of parenthesis
This commit is contained in:
parent
9413e46998
commit
d7904f7a13
1 changed files with 11 additions and 2 deletions
13
src/cell.cpp
13
src/cell.cpp
|
|
@ -866,8 +866,17 @@ bool CSGCell::contains_complex(
|
|||
// skip a section or break
|
||||
if (next_token >= OP_UNION && token != next_token) {
|
||||
if (next_token == OP_LEFT_PAREN) {
|
||||
it =
|
||||
std::find(it, region_no_complements_.end() - 1, OP_RIGHT_PAREN);
|
||||
int depth = 1;
|
||||
while (depth > 0) {
|
||||
it++;
|
||||
if (*it > OP_COMPLEMENT) {
|
||||
if (*it == OP_RIGHT_PAREN) {
|
||||
depth--;
|
||||
} else {
|
||||
depth++;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue