projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lexer: Reimplement for better testability and internationalization.
[pspp-builds.git]
/
src
/
language
/
tests
/
moments-test.c
diff --git
a/src/language/tests/moments-test.c
b/src/language/tests/moments-test.c
index 91a679394ca20a22a8bc3d9927c1f4bb7678861d..af328928abddbff93e5cb6ac59ef955ef4367e0f 100644
(file)
--- a/
src/language/tests/moments-test.c
+++ b/
src/language/tests/moments-test.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000
, 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
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
@@
-15,16
+15,19
@@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
-#include <stdio.h>
-#include "gettext.h"
-#include <language/command.h>
-#include <language/lexer/lexer.h>
-#include <math/moments.h>
+
#include <math.h>
#include <math.h>
+#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
-#include "xalloc.h"
-#include <libpspp/compiler.h>
+#include "language/command.h"
+#include "language/lexer/lexer.h"
+#include "libpspp/compiler.h"
+#include "math/moments.h"
+
+#include "gl/xalloc.h"
+
+#include "gettext.h"
#define _(msgid) gettext (msgid)
static bool
#define _(msgid) gettext (msgid)
static bool
@@
-40,7
+43,7
@@
read_values (struct lexer *lexer, double **values, double **weights, size_t *cnt
double value = lex_tokval (lexer);
double weight = 1.;
lex_get (lexer);
double value = lex_tokval (lexer);
double weight = 1.;
lex_get (lexer);
- if (lex_match (lexer,
'*'
))
+ if (lex_match (lexer,
T_ASTERISK
))
{
if (!lex_is_number (lexer))
{
{
if (!lex_is_number (lexer))
{
@@
-79,12
+82,11
@@
cmd_debug_moments (struct lexer *lexer, struct dataset *ds UNUSED)
if (lex_match_id (lexer, "ONEPASS"))
two_pass = 0;
if (lex_match_id (lexer, "ONEPASS"))
two_pass = 0;
- if (lex_token (lexer) !=
'/'
)
+ if (lex_token (lexer) !=
T_SLASH
)
{
{
- lex_force_match (lexer,
'/'
);
+ lex_force_match (lexer,
T_SLASH
);
goto done;
}
goto done;
}
- fprintf (stderr, "%s => ", lex_rest_of_line (lexer));
lex_get (lexer);
if (two_pass)
lex_get (lexer);
if (two_pass)
@@
-133,7
+135,7
@@
cmd_debug_moments (struct lexer *lexer, struct dataset *ds UNUSED)
}
fprintf (stderr, "\n");
}
fprintf (stderr, "\n");
- retval =
lex_end_of_command (lexer)
;
+ retval =
CMD_SUCCESS
;
done:
free (values);
done:
free (values);