*improved importing directory detection.

This commit is contained in:
paladin-t 2016-02-25 15:36:25 +08:00
parent a9e7245be1
commit 9cad7c6992
2 changed files with 7 additions and 2 deletions

View File

@ -1,4 +1,5 @@
Feb. 25 2016
Improved importing directory detection
Fixed a bug with the END and RETURN statement with FOR loop
Fixed an array index calculation bug

View File

@ -4672,8 +4672,12 @@ static _data_e _get_symbol_type(mb_interpreter_t* s, char* sym, _raw_t* value) {
_post_import(s, lf, &pos, &row, &col);
}
} else {
if(!s->import_handler || s->import_handler(s, sym + 1) != MB_FUNC_OK) {
_handle_error_now(s, SE_PS_FILE_OPEN_FAILED, s->source_file, MB_FUNC_ERR);
if(!_ls_find(context->imported, (void*)(sym + 1), (_ls_compare)_ht_cmp_string, 0)) {
if(s->import_handler && s->import_handler(s, sym + 1) == MB_FUNC_OK) {
_ls_pushback(context->imported, mb_strdup(sym + 1, strlen(sym + 1) + 1));
} else {
_handle_error_now(s, SE_PS_FILE_OPEN_FAILED, s->source_file, MB_FUNC_ERR);
}
}
}