[towel-db commit] r30 - trunk/c

0 views
Skip to first unread message

codesite...@google.com

unread,
Jun 17, 2008, 10:06:44 AM6/17/08
to toweldb...@googlegroups.com
Author: i80and
Date: Tue Jun 17 07:06:27 2008
New Revision: 30

Modified:
trunk/c/parser.c

Log:
Fix our first parsing loop to get the start of each token rather than
the end.


Modified: trunk/c/parser.c
==============================================================================
--- trunk/c/parser.c (original)
+++ trunk/c/parser.c Tue Jun 17 07:06:27 2008
@@ -98,8 +98,10 @@
cur_node->next = NULL;
}

- /* Mark the location of the end of the token */
- cur_node->key_loc = current_char;
+ /* Mark the location of the end of the token. We have to subtract
+ * the length of our token to get the start of it instead of the
+ * end. */
+ cur_node->key_loc = ( current_char - TOWELDB_PHASE_FINISH );

/* It's official: we are in a key */
rec_component = TOWELDB_COMPONENT_KEY;
@@ -133,7 +135,6 @@
if( rec_component == TOWELDB_COMPONENT_KEY )
{
cur_node->key_len++;
- printf( "%c\n", rec_contents[current_char] );
}
else if( rec_component == TOWELDB_COMPONENT_DATA )
{

Reply all
Reply to author
Forward
0 new messages