Skip to content

Commit

Permalink
For classes, add a field to the script object just like functions.
Browse files Browse the repository at this point in the history
Then, (external) classes can be found by the PA when they are imported. Otherwise, they cannot be found.
  • Loading branch information
khatchad committed Feb 16, 2024
1 parent 8904652 commit 3cb7b41
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,20 @@ protected void leaveTypeEntity(
.PutInstruction(code.cfg().getCurrentInstruction(), v, val, fr));
});
}

code.cfg()
.unknownInstructions(
() -> {
FieldReference fnField =
FieldReference.findOrCreate(
PythonTypes.Root,
Atom.findOrCreateUnicodeAtom(n.getName()),
PythonTypes.Root);
code.cfg()
.addInstruction(
Python.instructionFactory()
.PutInstruction(code.cfg().getCurrentInstruction(), 1, v, fnField));
});
}

@Override
Expand Down

0 comments on commit 3cb7b41

Please sign in to comment.