X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Flexer%2Flexer.c;h=938d26675066fa488f250f959c19ab5835e27521;hb=086322fd8c85a303ba6f552950d6f057f2867add;hp=4a899bdff91b7b9b13d8a57d8f1b6c1f521a96ff;hpb=55e6e7ba37a30570f5a31e2d78c22dfa7b61a36f;p=pspp-builds.git diff --git a/src/language/lexer/lexer.c b/src/language/lexer/lexer.c index 4a899bdf..938d2667 100644 --- a/src/language/lexer/lexer.c +++ b/src/language/lexer/lexer.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2006, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2006, 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ #include -#include "lexer.h" +#include "language/lexer/lexer.h" + #include #include #include @@ -25,16 +26,17 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include "xalloc.h" +#include "data/settings.h" +#include "language/command.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" + +#include "gl/xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) @@ -781,17 +783,6 @@ lex_put_back (struct lexer *lexer, enum token_type t) save_token (lexer); lexer->token = t; } - -/* Makes the current token become the next token to be read; the - current token is set to the identifier ID. */ -void -lex_put_back_id (struct lexer *lexer, const char *id) -{ - assert (lex_id_to_token (ss_cstr (id)) == T_ID); - save_token (lexer); - lexer->token = T_ID; - ds_assign_cstr (&lexer->tokstr, id); -} /* Weird line processing functions. */ @@ -917,8 +908,7 @@ lex_preprocess_line (struct string *line, { strip_comments (line); ds_rtrim (line, ss_cstr (CC_SPACES)); - *line_ends_command = (ds_chomp (line, settings_get_endcmd ()) - || (ds_is_empty (line) && settings_get_nulline ())); + *line_ends_command = ds_chomp_byte (line, '.') || ds_is_empty (line); *line_starts_command = false; if (syntax == GETL_BATCH) { @@ -978,6 +968,7 @@ lex_token_name (enum token_type token) case T_POS_NUM: case T_NEG_NUM: case T_STRING: + case TOKEN_N_TYPES: NOT_REACHED (); case T_STOP: