From 714ea20439a47287d31820eb71ef77e01a465d86 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 4 Nov 2010 20:37:01 -0700 Subject: [PATCH] CACHE: Implement command as no-op. Requested by Matej Kovacic . --- doc/utilities.texi | 11 ++++++++++ src/language/command.def | 1 + src/language/utilities/automake.mk | 1 + src/language/utilities/cache.c | 34 ++++++++++++++++++++++++++++++ tests/automake.mk | 1 + tests/language/utilities/cache.at | 8 +++++++ 6 files changed, 56 insertions(+) create mode 100644 src/language/utilities/cache.c create mode 100644 tests/language/utilities/cache.at diff --git a/doc/utilities.texi b/doc/utilities.texi index 9f57a767..bcb97618 100644 --- a/doc/utilities.texi +++ b/doc/utilities.texi @@ -10,6 +10,7 @@ encountered in the input. @menu * ADD DOCUMENT:: Add documentary text to the active file. +* CACHE:: Ignored for compatibility. * CD:: Change the current directory. * COMMENT:: Document your syntax file. * DOCUMENT:: Document the active file. @@ -52,6 +53,16 @@ DOCUMENTS}. Each line of documentary text must be enclosed in quotation marks, and may not be more than 80 bytes long. @xref{DOCUMENT}. +@node CACHE +@section CACHE +@vindex CACHE + +@display +CACHE. +@end display + +This command is accepted, for compatibility, but it has no effect. + @node CD @section CD @vindex CD diff --git a/src/language/command.def b/src/language/command.def index adfaa950..c87f37f6 100644 --- a/src/language/command.def +++ b/src/language/command.def @@ -17,6 +17,7 @@ /* Utility commands acceptable anywhere. */ DEF_CMD (S_ANY, F_ENHANCED, "CLOSE FILE HANDLE", cmd_close_file_handle) DEF_CMD (S_ANY, F_KEEP_FINAL_TOKEN, "COMMENT", cmd_comment) +DEF_CMD (S_ANY, 0, "CACHE", cmd_cache) DEF_CMD (S_ANY, 0, "CD", cmd_cd) DEF_CMD (S_ANY, 0, "ECHO", cmd_echo) DEF_CMD (S_ANY, 0, "ERASE", cmd_erase) diff --git a/src/language/utilities/automake.mk b/src/language/utilities/automake.mk index 3a3e16d5..46fe09c4 100644 --- a/src/language/utilities/automake.mk +++ b/src/language/utilities/automake.mk @@ -5,6 +5,7 @@ src_language_utilities_built_sources = \ src/language/utilities/set.c language_utilities_sources = \ + src/language/utilities/cache.c \ src/language/utilities/cd.c \ src/language/utilities/date.c \ src/language/utilities/echo.c \ diff --git a/src/language/utilities/cache.c b/src/language/utilities/cache.c new file mode 100644 index 00000000..2d818af8 --- /dev/null +++ b/src/language/utilities/cache.c @@ -0,0 +1,34 @@ +/* PSPP - a program for statistical analysis. + Copyright (C) 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 + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +#include +#include + +#include "language/command.h" +#include "language/lexer/lexer.h" + +#include "gettext.h" +#define _(msgid) gettext (msgid) + +/* Parses the CACHE command. */ +int +cmd_cache (struct lexer *lexer, struct dataset *ds UNUSED) +{ + return lex_end_of_command (lexer); +} + diff --git a/tests/automake.mk b/tests/automake.mk index 017e573e..8be58e18 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -277,6 +277,7 @@ TESTSUITE_AT = \ tests/language/stats/roc.at \ tests/language/stats/sort-cases.at \ tests/language/stats/t-test.at \ + tests/language/utilities/cache.at \ tests/language/utilities/date.at \ tests/language/utilities/insert.at \ tests/language/utilities/permissions.at \ diff --git a/tests/language/utilities/cache.at b/tests/language/utilities/cache.at new file mode 100644 index 00000000..2edda09d --- /dev/null +++ b/tests/language/utilities/cache.at @@ -0,0 +1,8 @@ +AT_BANNER([CACHE]) + +AT_SETUP([CACHE]) +AT_DATA([cache.sps], [dnl +CACHE. +]) +AT_CHECK([pspp -O format=csv cache.sps]) +AT_CLEANUP -- 2.30.2