lexer: New type enum token_type.
[pspp-builds.git] / src / language / data-io / file-handle.q
index 3e053ed57262eb5f6e94d404ed5686253e640a16..ba84a15dc54f2127576227a13e95a22aecd95be8 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1997-9, 2000, 2006, 2010 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
    along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
 #include <config.h>
+
 #include <limits.h>
-#include <language/data-io/file-handle.h>
-#include <libpspp/message.h>
 #include <errno.h>
 #include <stdlib.h>
 #include <data/file-name.h>
 #include <language/command.h>
+#include <language/data-io/file-handle.h>
 #include <language/lexer/lexer.h>
 #include <libpspp/assertion.h>
 #include <libpspp/message.h>
@@ -69,7 +69,7 @@ cmd_file_handle (struct lexer *lexer, struct dataset *ds)
     }
 
   lex_get (lexer);
-  if (!lex_force_match (lexer, '/'))
+  if (!lex_force_match (lexer, T_SLASH))
     return CMD_CASCADING_FAILURE;
 
   if (!parse_file_handle (lexer, ds, &cmd, NULL))
@@ -129,7 +129,7 @@ cmd_file_handle (struct lexer *lexer, struct dataset *ds)
         {
           if (cmd.n_lrecl[0] == LONG_MIN)
             msg (SE, _("The specified file mode requires LRECL.  "
-                       "Assuming %d-character records."),
+                       "Assuming %zu-character records."),
                  properties.record_width);
           else if (cmd.n_lrecl[0] < 1 || cmd.n_lrecl[0] >= (1UL << 31))
             msg (SE, _("Record length (%ld) must be between 1 and %lu bytes.  "
@@ -200,7 +200,7 @@ fh_parse (struct lexer *lexer, enum fh_referent referent_mask)
     handle = fh_inline_file ();
   else
     {
-      if (lex_token (lexer) != T_ID && lex_token (lexer) != T_STRING)
+      if (lex_token (lexer) != T_ID && !lex_is_string (lexer))
         {
           lex_error (lexer, _("expecting a file name or handle name"));
           return NULL;