lexer: New type enum token_type.
[pspp-builds.git] / src / language / data-io / file-handle.q
index 33aa1d168a5c4efce423688b3d8998193b8c7abc..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))
@@ -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;