mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/code] Fix VariableBoxController::addNodesFromImportMaybe
Scenario: write a ascrip "from matplotlib.pyplot0 import *" than open the variable box
This commit is contained in:
@@ -766,6 +766,10 @@ bool VariableBoxController::addNodesFromImportMaybe(mp_parse_node_struct_t * par
|
||||
if (loadAllSourceContent) {
|
||||
assert(childNodesCount > 0);
|
||||
const char * importationSourceName = importationSourceNameFromNode(parseNode->nodes[0]);
|
||||
if (importationSourceName == nullptr) {
|
||||
// For instance, the name is a "dotted name" but not matplotlib.pyplot
|
||||
return true;
|
||||
}
|
||||
int numberOfModuleChildren = 0;
|
||||
const ToolboxMessageTree * moduleChildren = nullptr;
|
||||
if (importationSourceIsModule(importationSourceName, &moduleChildren, &numberOfModuleChildren)) {
|
||||
@@ -805,7 +809,7 @@ const char * VariableBoxController::importationSourceNameFromNode(mp_parse_node_
|
||||
// The importation source is "simple", for instance: from math import *
|
||||
return qstr_str(MP_PARSE_NODE_LEAF_ARG(node));
|
||||
}
|
||||
if (MP_PARSE_NODE_IS_STRUCT(node)) {
|
||||
if (MP_PARSE_NODE_IS_STRUCT(node)) { //TODO replace this with an assert?
|
||||
mp_parse_node_struct_t * nodePNS = (mp_parse_node_struct_t *)node;
|
||||
uint nodeStructKind = MP_PARSE_NODE_STRUCT_KIND(nodePNS);
|
||||
if (nodeStructKind != PN_dotted_name) {
|
||||
|
||||
Reference in New Issue
Block a user