X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fsyntax-editor.c;h=a9564cb1a563fc959cee8f5c9dc80fe40d914f84;hb=09a1109ddc398f36fe720208e1d38053850cbd2a;hp=643013a3371c90c38c6442a8ae1823c12b2742d2;hpb=5023955f3e48b1b0a703a38d654467360c0794a6;p=pspp diff --git a/src/ui/gui/syntax-editor.c b/src/ui/gui/syntax-editor.c index 643013a337..a9564cb1a5 100644 --- a/src/ui/gui/syntax-editor.c +++ b/src/ui/gui/syntax-editor.c @@ -33,6 +33,7 @@ #include "window-manager.h" +#include #include #include #include @@ -214,14 +215,16 @@ static void execute_syntax (const struct syntax_editor *se, GtkTextIter start, GtkTextIter stop) { + g_return_if_fail (proc_has_source (the_dataset)); + getl_append_source (the_source_stream, create_syntax_editor_source (se, start, stop)); for (;;) { + const struct dictionary *dict = dataset_dict (the_dataset); int result = cmd_parse (se->lexer, the_dataset, - proc_has_source (the_dataset) - ? CMD_STATE_DATA : CMD_STATE_INITIAL); - + dict_get_var_cnt (dict) > 0 ? + CMD_STATE_DATA : CMD_STATE_INITIAL); if (result == CMD_EOF || result == CMD_FINISH) break; }