X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Ftests%2Fformat-guesser-test.c;h=cd7ca52475591aed781542582ef6de17c55aa3fa;hb=9ade26c8349b4434008c46cf09bc7473ec743972;hp=728080153c8565c8f6daf033acf3f6102d446de7;hpb=3e3d825afe59ad43699664a74ca04e2e1b836786;p=pspp-builds.git diff --git a/src/language/tests/format-guesser-test.c b/src/language/tests/format-guesser-test.c index 72808015..cd7ca524 100644 --- a/src/language/tests/format-guesser-test.c +++ b/src/language/tests/format-guesser-test.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008, 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 @@ -18,11 +18,11 @@ #include -#include -#include -#include -#include -#include +#include "data/format.h" +#include "data/format-guesser.h" +#include "language/command.h" +#include "language/lexer/lexer.h" +#include "libpspp/message.h" /* Executes the DEBUG FORMAT GUESSER command. */ int @@ -33,10 +33,10 @@ cmd_debug_format_guesser (struct lexer *lexer, struct dataset *ds UNUSED) char format_string[FMT_STRING_LEN_MAX + 1]; g = fmt_guesser_create (); - while (lex_token (lexer) == T_STRING) + while (lex_is_string (lexer)) { - fprintf (stderr, "\"%s\" ", ds_cstr (lex_tokstr (lexer))); - fmt_guesser_add (g, ds_ss (lex_tokstr (lexer))); + fprintf (stderr, "\"%s\" ", lex_tokcstr (lexer)); + fmt_guesser_add (g, lex_tokss (lexer)); lex_get (lexer); } @@ -53,5 +53,5 @@ cmd_debug_format_guesser (struct lexer *lexer, struct dataset *ds UNUSED) msg_enable (); putc ('\n', stderr); - return lex_end_of_command (lexer); + return CMD_SUCCESS; }