33 for (
int scriptIndex = 0; scriptIndex <
numberOfScripts(); scriptIndex++) {
38 if (scriptContent ==
nullptr) {
55 const char *
id = structID(pns);
59 storeFunction(context,
id, scriptIndex);
67 const char *
id = structID(pns);
71 storeVariable(context,
id, scriptIndex);
88 for (
size_t i = 0; i < n; i++) {
93 const char *
id = structID(child_pns);
97 storeFunction(context,
id, scriptIndex);
99 const char *
id = structID(child_pns);
103 storeVariable(context,
id, scriptIndex);
136 if (childNodesCount < 1) {
const char * qstr_str(qstr q)
Ion::Storage::Record::ErrorStatus addScriptFromTemplate(const ScriptTemplate *scriptTemplate)
#define MP_PARSE_NODE_STRUCT_KIND(pns)
#define MP_PARSE_NODE_LEAF_KIND(pn)
static constexpr int k_maxNumberOfScripts
Record::ErrorStatus createRecord(const char *name, const void *data, size_t size)
mp_lexer_t * mp_lexer_new_from_str_len(qstr src_name, const char *str, size_t len, size_t free_len)
size_t strlcpy(char *dst, const char *src, size_t len)
uintptr_t mp_parse_node_t
const char * readContent() const
#define MP_PARSE_NODE_STRUCT_NUM_NODES(pns)
static Storage * sharedStorage()
Script scriptNamed(const char *name)
const char * contentOfScript(const char *name) override
size_t strlen(const char *s)
Script scriptAtIndex(int index)
static const ScriptTemplate * Mandelbrot()
void scanScriptsForFunctionsAndVariables(void *context, ScanCallback storeFunction, ScanCallback storeVariable)
mp_parse_tree_t mp_parse(struct _mp_lexer_t *lex, mp_parse_input_kind_t input_kind)
#define MP_PARSE_NODE_LEAF_ARG(pn)
const char * content() const
#define MP_PARSE_NODE_IS_STRUCT(pn)
const char * name() const
static const ScriptTemplate * Factorial()
#define MP_PARSE_NODE_IS_LEAF(pn)
void mp_parse_tree_clear(mp_parse_tree_t *tree)
static constexpr char k_defaultScriptName[]
static const ScriptTemplate * Polynomial()
static constexpr char k_scriptExtension[]
static constexpr size_t k_importationStatusSize