scopeOffset :: SemanticUnit -> Symbol -> Int
scopeOffset su sym = case kd of
                        Method _ -> if syms' /= [] then 0 - (length syms') else error $ "symbol not found on stack: " ++ (show sym)
                        _ -> if syms == [sym]
                                then scopeOffsetPos (inheritFrom su)
                                else scopeOffset (inheritFrom su) sym
    where
        kd = kind su
        syms = symbolTable su
        syms' = dropWhile (sym /=) syms
scopeOffset :: SemanticUnit -> Symbol -> Int
scopeOffset su sym = case kd of
                        Method _ -> if syms' /= [] then 0 - (length syms') else error $ "symbol not found on stack: " ++ (show sym)
                        _ -> if syms == [sym]
                                then scopeOffsetPos (inheritFrom su)
                                else scopeOffset (inheritFrom su) sym
    where
        kd = kind su
        syms = symbolTable su
        syms' = dropWhile (sym /=) syms
scopeOffset su sym = case kd of
                        Method _ -> if syms' /= [] then 0 - (length syms') else error $ "symbol not found on stack: " ++ (show sym)
                        _ -> if syms == [sym]
                                then scopeOffsetPos (inheritFrom su)
                                else scopeOffset (inheritFrom su) sym
    where
        kd = kind su
        syms = symbolTable su
        syms' = dropWhile (sym /=) syms