FictionTools/z88dk/src/sccz80/goto.c
/*
 * dogoto, parse goto, this is where things can go completely wrong!
 */
dogoto, parse goto, this is where things can go completely wrong!
dogoto parse goto this is where things can go completely wrong!
void dogoto()
{
    SYMBOL* ptr;
    char sname[NAMESIZE];
    int stkmod = 0;
    int label;
    if (symname(sname) == 0)
        illname(sname);
    debug(DBG_GOTO, "goto is -->%s<--\n", sname);
    if ((ptr = findgoto(sname)) && ptr->ident == ID_GOTOLABEL) {
        if (ptr->type == KIND_PTR) {
            label = ptr->size;
            stkmod = ptr->offset.i;
        } else {
            debug(DBG_GOTO, "Sym found but still on goto\n");
            label = AddGoto(ptr);
        }
    } else {
        ptr = addgotosym(sname);
        debug(DBG_GOTO, "Adding symbol to table\n");
        ptr->offset.i = 0;
        label = AddGoto(ptr);
    }
    if (stkmod)
        modstk(stkmod, KIND_NONE, NO, YES);
    jump(label);
}
void dogoto ( ) { SYMBOL * ptr ; char sname [ NAMESIZE ] ; int stkmod = 0 ; int label ; if ( symname ( sname ) == 0 ) illname ( sname ) ; debug ( DBG_GOTO , " \n " , sname ) ; if ( ( ptr = findgoto ( sname ) ) && ptr -> ident == ID_GOTOLABEL ) { if ( ptr -> type == KIND_PTR ) { label = ptr -> size ; stkmod = ptr -> offset . i ; } else { debug ( DBG_GOTO , " \n " ) ; label = AddGoto ( ptr ) ; } } else { ptr = addgotosym ( sname ) ; debug ( DBG_GOTO , " \n " ) ; ptr -> offset . i = 0 ; label = AddGoto ( ptr ) ; } if ( stkmod ) modstk ( stkmod , KIND_NONE , NO , YES ) ; jump ( label ) ; }
dogoto, parse goto, this is where things can go completely wrong!
dogoto parse goto this is where things can go completely wrong!
/*
 *      Should find symbol, and if a goto expr obtain the level from
 *      ptr->size, and modify the stack accordingly..
 */ /* Label found, but is it actually defined? */ /* Not defined, add into the goto queue */