diff --git a/ase/stx/class.c b/ase/stx/class.c index a3f11960..10921013 100644 --- a/ase/stx/class.c +++ b/ase/stx/class.c @@ -1,5 +1,5 @@ /* - * $Id: class.c,v 1.11 2005-06-30 12:07:02 bacon Exp $ + * $Id: class.c,v 1.12 2005-06-30 15:11:00 bacon Exp $ */ #include @@ -72,7 +72,6 @@ int xp_stx_get_instance_variable_index ( if (class_obj->header.class == stx->class_metaclass) { /* metaclass */ /* TODO: can a metaclas have instance variables? */ - *index = index_super; } else { @@ -88,17 +87,18 @@ int xp_stx_get_instance_variable_index ( } } *index = size + index_super; - */ - if (class_obj->variables != stx->nil) { + + if (class_obj->variables == stx->nil) *index = 0; + else { string = XP_STX_CHAR_OBJECT(stx, class_obj->variables); if (xp_stx_strword (string->data, name, index) != XP_NULL) { *index += index_super; return 0; } - *index = size + index_super; } - else *index = index_super; + + *index += index_super; } return -1; diff --git a/ase/stx/misc.c b/ase/stx/misc.c index 60aba668..d9c1f9b6 100644 --- a/ase/stx/misc.c +++ b/ase/stx/misc.c @@ -1,5 +1,5 @@ /* - * $Id: misc.c,v 1.5 2005-06-30 12:07:02 bacon Exp $ + * $Id: misc.c,v 1.6 2005-06-30 15:11:00 bacon Exp $ */ #include @@ -37,8 +37,7 @@ xp_word_t xp_stx_strxhash (const xp_char_t* str, xp_word_t len) } xp_char_t* xp_stx_strword ( - const xp_char_t* str, const xp_char_t* word, - xp_word_t* word_index, xp_word_t* word_count) + const xp_char_t* str, const xp_char_t* word, xp_word_t* word_index) { xp_char_t* p = (xp_char_t*)str; xp_char_t* tok; @@ -55,6 +54,6 @@ xp_char_t* xp_stx_strword ( index++; } - *word_count = index; + *word_index = index; return XP_NULL; } diff --git a/ase/stx/misc.h b/ase/stx/misc.h index 1d9816f3..e8c34625 100644 --- a/ase/stx/misc.h +++ b/ase/stx/misc.h @@ -1,5 +1,5 @@ /* - * $Id: misc.h,v 1.8 2005-06-30 12:07:02 bacon Exp $ + * $Id: misc.h,v 1.9 2005-06-30 15:11:00 bacon Exp $ */ #ifndef _XP_STX_MISC_H_ @@ -42,8 +42,7 @@ xp_word_t xp_stx_strhash (const xp_char_t* str); xp_word_t xp_stx_strxhash (const xp_char_t* str, xp_word_t len); xp_char_t* xp_stx_strword ( - const xp_char_t* str, const xp_char_t* word, - xp_word_t* word_index, xp_word_t* word_count); + const xp_char_t* str, const xp_char_t* word, xp_word_t* word_index); #ifdef __cplusplus } diff --git a/ase/test/stx/test.st b/ase/test/stx/test.st index a2cf6d60..39efa597 100644 --- a/ase/test/stx/test.st +++ b/ase/test/stx/test.st @@ -8,7 +8,7 @@ perform: method with: x with: y with: z with: a with: b with: c a := #xxx niceMethod. " b := -30 xxx nil this. - name := 10. + instanceClass := 10. (jjj xxx: 10 xy) zzz: (10 fuck: 20 you: 40) yyy: kkk. [ spec plus: 20]