[sword-cvs] sword/src/keys versekey.cpp,1.58,1.59
sword@www.crosswire.org
sword@www.crosswire.org
Fri, 30 Jan 2004 17:09:33 -0700
Update of /cvs/core/sword/src/keys
In directory www:/tmp/cvs-serv30041/src/keys
Modified Files:
versekey.cpp
Log Message:
Updated for new strong: prefix and added some parsing logic for NASB
Index: versekey.cpp
===================================================================
RCS file: /cvs/core/sword/src/keys/versekey.cpp,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- versekey.cpp 27 Jun 2003 01:41:07 -0000 1.58
+++ versekey.cpp 31 Jan 2004 00:09:31 -0000 1.59
@@ -400,14 +400,6 @@
while (*buf) {
switch (*buf) {
- case ':':
- number[tonumber] = 0;
- tonumber = 0;
- if (*number)
- chap = atoi(number);
- *number = 0;
- break;
-
case ' ':
inTerm = true;
while (true) {
@@ -423,6 +415,17 @@
book[tobook++] = ' ';
break;
}
+ case ':':
+ if (buf[1] != ' ') { // for silly Mat 1:1: this verse....
+ number[tonumber] = 0;
+ tonumber = 0;
+ if (*number)
+ chap = atoi(number);
+ *number = 0;
+ break;
+ }
+ // otherwise drop down to next case
+
case '-':
case ',': // on number new verse
case ';': // on number new chapter
@@ -454,29 +457,29 @@
break;
}
- for (loop = strlen(book) - 1; loop+1; loop--) {
+ for (loop = strlen(book) - 1; loop+1; loop--) {
if (book[loop] == ' ') {
if (isroman(&book[loop+1])) {
if (verse == -1) {
verse = chap;
chap = from_rom(&book[loop+1]);
book[loop] = 0;
- }
- }
+ }
+ }
break;
- }
- }
+ }
+ }
- if ((!stricmp(book, "V")) || (!stricmp(book, "VER"))) { // Verse abbrev
- if (verse == -1) {
- verse = chap;
- chap = VerseKey(tmpListKey).Chapter();
- *book = 0;
- }
- }
- if ((!stricmp(book, "ch")) || (!stricmp(book, "chap"))) { // Verse abbrev
+ if ((!stricmp(book, "V")) || (!stricmp(book, "VER"))) { // Verse abbrev
+ if (verse == -1) {
+ verse = chap;
+ chap = VerseKey(tmpListKey).Chapter();
+ *book = 0;
+ }
+ }
+ if ((!stricmp(book, "ch")) || (!stricmp(book, "chap"))) { // Verse abbrev
strcpy(book, VerseKey(tmpListKey).getBookName());
- }
+ }
bookno = getBookAbbrev(book);
}
if (((bookno > -1) || (!*book)) && ((*book) || (chap >= 0) || (verse >= 0))) {
@@ -573,6 +576,8 @@
case ']':
case '(':
case ')':
+ case '{':
+ case '}':
break;
case '.':
if (buf > orig) // ignore (break) if preceeding char is not a digit