diff options
Diffstat (limited to 'dimension/realize.c')
-rw-r--r-- | dimension/realize.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/dimension/realize.c b/dimension/realize.c index 31fb021..810d86e 100644 --- a/dimension/realize.c +++ b/dimension/realize.c @@ -17,8 +17,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * *************************************************************************/ -#define _GNU_SOURCE /* For fmemopen */ - #include "realize.h" #include "parse.h" #include "utility.h" @@ -754,18 +752,14 @@ dmnsn_realize_string(const char *str, dmnsn_symbol_table *symtable) if (!symtable) { symtable = dmnsn_new_symbol_table(); } - if (!dmnsn_find_symbol(symtable, "__file__")) { - dmnsn_declare_symbol(symtable, "__file__", - dmnsn_new_ast_string("<string>")); - } - FILE *file = fmemopen((void *)str, strlen(str), "r"); - if (!file) { + dmnsn_astree *astree = dmnsn_parse_string(str, symtable); + if (!astree) { return NULL; } - dmnsn_scene *scene = dmnsn_realize(file, symtable); + dmnsn_scene *scene = dmnsn_realize_astree(astree); - fclose(file); + dmnsn_delete_astree(astree); return scene; } |