lexer: Change the functions for retrieving token strings.
[pspp-builds.git] / src / language / data-io / file-handle.q
index ba84a15dc54f2127576227a13e95a22aecd95be8..5f2a44075a78835d36afe933184cb7e4bf6c6ec9 100644 (file)
@@ -57,7 +57,7 @@ cmd_file_handle (struct lexer *lexer, struct dataset *ds)
 
   if (!lex_force_id (lexer))
     return CMD_CASCADING_FAILURE;
-  str_copy_trunc (handle_name, sizeof handle_name, lex_tokid (lexer));
+  str_copy_trunc (handle_name, sizeof handle_name, lex_tokcstr (lexer));
 
   handle = fh_from_id (handle_name);
   if (handle != NULL)
@@ -159,7 +159,7 @@ cmd_close_file_handle (struct lexer *lexer, struct dataset *ds UNUSED)
 
   if (!lex_force_id (lexer))
     return CMD_CASCADING_FAILURE;
-  handle = fh_from_id (lex_tokid (lexer));
+  handle = fh_from_id (lex_tokcstr (lexer));
   if (handle == NULL)
     return CMD_CASCADING_FAILURE;
 
@@ -208,14 +208,15 @@ fh_parse (struct lexer *lexer, enum fh_referent referent_mask)
 
       handle = NULL;
       if (lex_token (lexer) == T_ID)
-        handle = fh_from_id (lex_tokid (lexer));
+        handle = fh_from_id (lex_tokcstr (lexer));
       if (handle == NULL)
         {
-          if (lex_token (lexer) != T_ID || lex_tokid (lexer)[0] != '#' || settings_get_syntax () != ENHANCED)
-            handle = fh_create_file (NULL, ds_cstr (lex_tokstr (lexer)),
+          if (lex_token (lexer) != T_ID || lex_tokcstr (lexer)[0] != '#'
+              || settings_get_syntax () != ENHANCED)
+            handle = fh_create_file (NULL, lex_tokcstr (lexer),
                                      fh_default_properties ());
           else
-            handle = fh_create_scratch (lex_tokid (lexer));
+            handle = fh_create_scratch (lex_tokcstr (lexer));
         }
       lex_get (lexer);
     }