along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+
#include "lexer.h"
-#include <libpspp/message.h>
#include <c-ctype.h>
#include <c-strtod.h>
#include <errno.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
-#include <libpspp/assertion.h>
#include <language/command.h>
-#include <libpspp/message.h>
#include <data/settings.h>
+#include <libpspp/assertion.h>
#include <libpspp/getl.h>
+#include <libpspp/message.h>
#include <libpspp/str.h>
#include <output/journal.h>
#include <output/text-item.h>
bool
lex_force_string (struct lexer *lexer)
{
- if (lexer->token == T_STRING)
+ if (lex_is_string (lexer))
return true;
else
{
const char *line = ds_cstr (&lexer->line_buffer);
text_item_submit (text_item_create (TEXT_ITEM_SYNTAX, line));
}
+ else
+ lexer->prog = NULL;
return ok;
}
bool line_starts_command;
if (!lex_get_line_raw (lexer))
- {
- lexer->prog = NULL;
- return false;
- }
+ return false;
lex_preprocess_line (&lexer->line_buffer,
lex_current_syntax_mode (lexer),