X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fhelper.c;h=0203999d653b38f6b0a343c82750cea1382f0f61;hb=610159421fde49f3f24622c60e193cf415086a64;hp=98bd41798445025d2c9ca0b42b9a8121b34863de;hpb=32884aab5da9ba8455d482dc1f52989ff7de4ee6;p=pspp-builds.git diff --git a/src/ui/gui/helper.c b/src/ui/gui/helper.c index 98bd4179..0203999d 100644 --- a/src/ui/gui/helper.c +++ b/src/ui/gui/helper.c @@ -41,7 +41,7 @@ #include #include "psppire-data-store.h" #include - +#include "output-viewer.h" #include @@ -104,7 +104,7 @@ get_widget_assert (GladeXML *xml, const gchar *name) w = glade_xml_get_widget (xml, name); if ( !w ) - g_warning ("Widget \"%s\" could not be found\n", name); + g_critical ("Widget \"%s\" could not be found\n", name); return w; } @@ -165,26 +165,35 @@ extern struct dataset *the_dataset; extern struct source_stream *the_source_stream; extern PsppireDataStore *the_data_store; -void +gboolean execute_syntax (struct getl_interface *sss) { struct lexer *lexer; + gboolean retval = TRUE; struct casereader *reader = psppire_data_store_get_reader (the_data_store); proc_set_active_file_data (the_dataset, reader); - g_return_if_fail (proc_has_active_file (the_dataset)); + g_return_val_if_fail (proc_has_active_file (the_dataset), FALSE); lexer = lex_create (the_source_stream); - getl_append_source (the_source_stream, sss); + getl_append_source (the_source_stream, sss, GETL_BATCH, ERRMODE_CONTINUE); for (;;) { - int result = cmd_parse (lexer, the_dataset); + enum cmd_result result = cmd_parse (lexer, the_dataset); - if (result == CMD_EOF || result == CMD_FINISH) + if ( cmd_result_is_failure (result)) + { + retval = FALSE; + if ( source_stream_current_error_mode (the_source_stream) + == ERRMODE_STOP ) + break; + } + + if ( result == CMD_EOF || result == CMD_FINISH) break; } @@ -204,6 +213,10 @@ execute_syntax (struct getl_interface *sss) proc_set_active_file_data (the_dataset, NULL); som_flush (); + + reload_the_viewer (); + + return retval; }