mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/code] The console marks imported script for the var box
After lauching the console, if we fetch a script we mark it as fetched. When the variable box displays variables from imported scripts, it scans all the variables from the scripts marked as fetched.
This commit is contained in:
@@ -288,7 +288,7 @@ void nlr_jump_fail(void *val) {
|
||||
|
||||
mp_lexer_t * mp_lexer_new_from_file(const char * filename) {
|
||||
if (sScriptProvider != nullptr) {
|
||||
const char * script = sScriptProvider->contentOfScript(filename);
|
||||
const char * script = sScriptProvider->contentOfScript(filename, true);
|
||||
if (script != nullptr) {
|
||||
return mp_lexer_new_from_str_len(qstr_from_str(filename), script, strlen(script), 0 /* size_t free_len*/);
|
||||
} else {
|
||||
@@ -300,7 +300,7 @@ mp_lexer_t * mp_lexer_new_from_file(const char * filename) {
|
||||
}
|
||||
|
||||
mp_import_stat_t mp_import_stat(const char *path) {
|
||||
if (sScriptProvider && sScriptProvider->contentOfScript(path)) {
|
||||
if (sScriptProvider && sScriptProvider->contentOfScript(path, false)) {
|
||||
return MP_IMPORT_STAT_FILE;
|
||||
}
|
||||
return MP_IMPORT_STAT_NO_EXIST;
|
||||
|
||||
@@ -12,7 +12,8 @@ namespace MicroPython {
|
||||
|
||||
class ScriptProvider {
|
||||
public:
|
||||
virtual const char * contentOfScript(const char * name) = 0;
|
||||
virtual const char * contentOfScript(const char * name, bool markAsFetched) = 0;
|
||||
virtual void clearFetchInformation() = 0;
|
||||
};
|
||||
|
||||
class ExecutionEnvironment {
|
||||
|
||||
Reference in New Issue
Block a user