* local *= x;
* }
* return local;
- * }
+ * }
*/
static ast_value *value = NULL;
* float mod(float x, float y) {
* return x - y * floor(x / y);
* }
- */
+ */
static ast_value *value = NULL;
if (!value) {
* local = x;
*
* return (x != local);
- * }
- */
+ * }
+ */
static ast_value *value = NULL;
if (!value) {
ast_value *local = ast_value_new (parser_ctx(parser), "local", TYPE_FLOAT);
ast_block *body = ast_block_new (parser_ctx(parser));
ast_function *func = NULL;
-
+
INTRIN_VAL(value, "isnan", func, "<float>", TYPE_FLOAT);
vec_push(body->locals, local);
/*
* jesus fucking christ, Blub design something less fucking
* impossible to use, like a ast_is_builtin(ast_expression *), also
- * use a hashtable :P
- */
+ * use a hashtable :P
+ */
if ((find = (void*)parser_find_global(parser, name)) && ((ast_value*)find)->expression.vtype == TYPE_FUNCTION)
for (i = 0; i < vec_size(parser->functions); ++i)
if (((ast_value*)find)->name && !strcmp(parser->functions[i]->name, ((ast_value*)find)->name) && parser->functions[i]->builtin < 0)
- return find;
+ return (ast_expression*)find;
if ((find = util_htget(intrin_intrinsics(), name))) {
/* intrinsic is in table. This will "generate the function" so
* to speak (if it's not already generated).
- */
+ */
return ((intrin_t*)find)->intrin(parser);
}