From f6090efb549300e728f195769e92faf250ec8f5c Mon Sep 17 00:00:00 2001 From: "Joseph W. Brown" Date: Mon, 3 May 2021 22:43:04 -0400 Subject: [PATCH] support for interleave=[yes/no] --- ncl/nxscharactersblock.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/ncl/nxscharactersblock.cpp b/ncl/nxscharactersblock.cpp index aa25d8d..358c014 100644 --- a/ncl/nxscharactersblock.cpp +++ b/ncl/nxscharactersblock.cpp @@ -2180,7 +2180,29 @@ void NxsCharactersBlock::HandleFormat( else if (wIt->Equals("TRANSPOSE")) transposing = true; else if (wIt->Equals("INTERLEAVE")) - interleaving = true; + { + // check if followed by =yes/no (strictly, not Nexus-compliant) + wIt++; + if (wIt->Equals("=")) + { + wIt++; + if (wIt->Equals("YES")) + { + interleaving = true; + } + else if (wIt->Equals("NO")) + { + interleaving = false; + } + else + throw NxsException("Cannot parse interleave command", *wIt); // probably want a more informative error + } + else + { + wIt--; + interleaving = true; + } + } else if (wIt->Equals("ITEMS")) { DemandEquals(wIt, tvEnd, "after keyword ITEMS");