[sword-svn] r3432 - in trunk: src/keys tests/testsuite
scribe at crosswire.org
scribe at crosswire.org
Tue Aug 16 17:50:58 MST 2016
Author: scribe
Date: 2016-08-16 17:50:58 -0700 (Tue, 16 Aug 2016)
New Revision: 3432
Modified:
trunk/src/keys/versekey.cpp
trunk/tests/testsuite/versekeytest.good
Log:
handled Verkey("Mat.1.1") chapter-- and verse-- per charcoal
handled Matt 5:4: {Lk 2:5-11; Jn 4:1-30} per Greg for NASB
Modified: trunk/src/keys/versekey.cpp
===================================================================
--- trunk/src/keys/versekey.cpp 2016-08-16 22:46:19 UTC (rev 3431)
+++ trunk/src/keys/versekey.cpp 2016-08-17 00:50:58 UTC (rev 3432)
@@ -597,6 +597,7 @@
comma = 0;
break;
}
+ goto terminate_range;
// otherwise drop down to next case
case ' ':
inTerm = true;
@@ -630,6 +631,7 @@
}
case ',': // on number new verse
case ';': // on number new chapter
+terminate_range:
number[tonumber] = 0;
tonumber = 0;
if (*number) {
@@ -1428,6 +1430,11 @@
}
if (chapter < (intros?0:1)) {
--book;
+ if (book < (intros?0:1)) {
+ if (--testament > 0) {
+ book += (BMAX[testament-1] + (intros?1:0));
+ }
+ }
chapter += (getChapterMax() + (intros?1:0));
continue;
}
@@ -1441,6 +1448,11 @@
if (verse < (intros?0:1)) {
if (--chapter < (intros?0:1)) {
--book;
+ if (book < (intros?0:1)) {
+ if (--testament > 0) {
+ book += (BMAX[testament-1] + (intros?1:0));
+ }
+ }
chapter += (getChapterMax() + (intros?1:0));
}
verse += (getVerseMax() + (intros?1:0));
@@ -1868,14 +1880,14 @@
memset(frag, 0, 800);
memset(preJunk, 0, 800);
memset(postJunk, 0, 800);
- while ((*startFrag) && (strchr(" {};,()[].", *startFrag))) {
+ while ((*startFrag) && (strchr(" {}:;,()[].", *startFrag))) {
outRef += *startFrag;
startFrag++;
}
memmove(frag, startFrag, ((const char *)element->userData - startFrag) + 1);
frag[((const char *)element->userData - startFrag) + 1] = 0;
int j;
- for (j = strlen(frag)-1; j && (strchr(" {};,()[].", frag[j])); j--);
+ for (j = strlen(frag)-1; j && (strchr(" {}:;,()[].", frag[j])); j--);
if (frag[j+1])
strcpy(postJunk, frag+j+1);
frag[j+1]=0;
Modified: trunk/tests/testsuite/versekeytest.good
===================================================================
--- trunk/tests/testsuite/versekeytest.good 2016-08-16 22:46:19 UTC (rev 3431)
+++ trunk/tests/testsuite/versekeytest.good 2016-08-17 00:50:58 UTC (rev 3432)
@@ -64,3 +64,13 @@
Matthew.1.1-- = Malachi 4:6
++ = Matthew 1:1
.setBook(.getBook() - 1) = Malachi 1:1
+
+Chapter math
+
+Matthew.1.1 - 1 chapter
+.setChapter(.getChapter() - 1) = Malachi 4:1
+
+Verse math
+
+Matthew.1.1 - 1 verse
+.setVerse(.getVerse() - 1) = Malachi 4:6
More information about the sword-cvs
mailing list