Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/third_party/GMSH2Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,16 @@ bool GMSH2Parser::parsePeriodic() {
getNextToken();
[[maybe_unused]] const std::size_t entityIdentifyId = expectNonNegativeInt();

// fixed to 16; the main difference to MSH4.1
const std::size_t affineSize = 16;
for (std::size_t i = 0; i < affineSize; ++i) {
getNextToken();
if (curTok == GMSHToken::string) {
// Gmsh msh2 may write: "Affine a11 a12 ... a44" (16 values)
constexpr std::size_t affineSize = 16;
for (std::size_t i = 0; i < affineSize; ++i) {
getNextToken();
[[maybe_unused]] const double affineValue = expectNumber();
}
getNextToken();
[[maybe_unused]] const double affineValue = expectNumber();
}

getNextToken();
const std::size_t identifySize = expectNonNegativeInt();

for (std::size_t i = 0; i < identifySize; ++i) {
Expand Down
9 changes: 9 additions & 0 deletions src/third_party/GMSHLexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@ GMSHToken GMSHLexer::getToken() {
advance();
return GMSHToken::string;
}
if (isalpha(lastChar)) {
do {
advance();
} while (isalpha(lastChar));
return GMSHToken::string;
}
// Always consume at least one character for unknown tokens to avoid
// getting stuck in an infinite tokenization loop.
advance();
return GMSHToken::unknown_token;
}

Expand Down
Loading