for (int c = 0; c >= 0; end++) {
if (s[end] == '(')
c++;
- if (c == 0 && last != end && (s[end] == ',' || s[end] == ')')) {
+ if (c == 0 && last != end && (s[end] == ',' || s[end] == ')' || s[end] == '\0')) {
argcount++;
char *arg = strnclone(s + last, end - last);
uint32_t parenidx = ooffset;
ops[parenidx] = (variable *)(OP_MAGIC | count);
last = end + 1;
}
- if (s[end] == ')')
+ if (s[end] == ')' || s[end] == '\0')
c--;
}
if (s[end] != '\0')
*/
void inew_cfunc(instance *it, const char *name, func_t func);
+/**
+ * Creates a script-accessible float number.
+ * @param it the current instance
+ * @param name the name of the new variable
+ * @param f the variable's initial value
+ */
+void inew_number(instance *it, const char *name, float f);
+
/**
* Pops a word from the instance's stack.
* @param it the current instance