pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] pspp po/de.po po/pspp.pot src/language/ChangeLo...


From: John Darrington
Subject: [Pspp-cvs] pspp po/de.po po/pspp.pot src/language/ChangeLo...
Date: Sat, 28 Oct 2006 08:31:23 +0000

CVSROOT:        /sources/pspp
Module name:    pspp
Changes by:     John Darrington <jmd>   06/10/28 08:31:23

Modified files:
        po             : de.po pspp.pot 
        src/language   : ChangeLog line-buffer.c line-buffer.h 
        src/language/control: ChangeLog repeat.c 
        src/language/data-io: ChangeLog data-reader.c 
        src/language/lexer: ChangeLog lexer.c lexer.h 
        src/ui/terminal: main.c 
        tests/command  : do-repeat.sh 

Log message:
        Eliminated global variable getl_buf

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/po/de.po?cvsroot=pspp&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/pspp/po/pspp.pot?cvsroot=pspp&r1=1.102&r2=1.103
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/ChangeLog?cvsroot=pspp&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/line-buffer.c?cvsroot=pspp&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/line-buffer.h?cvsroot=pspp&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/control/ChangeLog?cvsroot=pspp&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/control/repeat.c?cvsroot=pspp&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/data-io/ChangeLog?cvsroot=pspp&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/data-io/data-reader.c?cvsroot=pspp&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/lexer/ChangeLog?cvsroot=pspp&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/lexer/lexer.c?cvsroot=pspp&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/lexer/lexer.h?cvsroot=pspp&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/terminal/main.c?cvsroot=pspp&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/pspp/tests/command/do-repeat.sh?cvsroot=pspp&r1=1.3&r2=1.4

Patches:
Index: po/de.po
===================================================================
RCS file: /sources/pspp/pspp/po/de.po,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- po/de.po    26 Oct 2006 06:29:10 -0000      1.17
+++ po/de.po    28 Oct 2006 08:31:22 -0000      1.18
@@ -10,7 +10,7 @@
 msgstr ""
 "Project-Id-Version: PSPP 0.4.2\n"
 "Report-Msgid-Bugs-To: address@hidden"
-"POT-Creation-Date: 2006-10-26 14:25+0800\n"
+"POT-Creation-Date: 2006-10-26 16:30+0800\n"
 "PO-Revision-Date: 2006-05-26 17:49+0800\n"
 "Last-Translator: John Darrington <address@hidden>\n"
 "Language-Team: German <address@hidden>\n"
@@ -1070,7 +1070,7 @@
 
 #: src/language/command.c:802 src/language/data-io/matrix-data.c:539
 #: src/language/data-io/print-space.c:75 src/language/dictionary/vector.c:203
-#: src/language/lexer/lexer.c:448 src/language/stats/autorecode.c:154
+#: src/language/lexer/lexer.c:456 src/language/stats/autorecode.c:154
 #: src/language/xforms/select-if.c:62
 msgid "expecting end of command"
 msgstr ""
@@ -1115,16 +1115,16 @@
 "specified."
 msgstr ""
 
-#: src/language/control/repeat.c:393
+#: src/language/control/repeat.c:399
 #, c-format
 msgid "%ld TO %ld is an invalid range."
 msgstr ""
 
-#: src/language/control/repeat.c:429
+#: src/language/control/repeat.c:435
 msgid "String expected."
 msgstr ""
 
-#: src/language/control/repeat.c:448
+#: src/language/control/repeat.c:454
 msgid "No matching DO REPEAT."
 msgstr ""
 
@@ -1234,27 +1234,27 @@
 "by itself on a single line with exactly one space between words."
 msgstr ""
 
-#: src/language/data-io/data-reader.c:206
-#: src/language/data-io/data-reader.c:218
+#: src/language/data-io/data-reader.c:207
+#: src/language/data-io/data-reader.c:219
 #, c-format
 msgid "Error reading file %s: %s."
 msgstr ""
 
-#: src/language/data-io/data-reader.c:221
+#: src/language/data-io/data-reader.c:222
 #, c-format
 msgid "%s: Partial record at end of file."
 msgstr ""
 
-#: src/language/data-io/data-reader.c:272
+#: src/language/data-io/data-reader.c:273
 #, c-format
 msgid "Attempt to read beyond end-of-file on file %s."
 msgstr ""
 
-#: src/language/data-io/data-reader.c:275
+#: src/language/data-io/data-reader.c:276
 msgid "Attempt to read beyond END DATA."
 msgstr ""
 
-#: src/language/data-io/data-reader.c:433
+#: src/language/data-io/data-reader.c:434
 msgid ""
 "This command is not valid here since the current input program does not "
 "access the inline file."
@@ -2032,11 +2032,11 @@
 "s."
 msgstr ""
 
-#: src/language/dictionary/value-labels.c:158 src/language/lexer/lexer.c:585
+#: src/language/dictionary/value-labels.c:158 src/language/lexer/lexer.c:593
 msgid "expecting string"
 msgstr ""
 
-#: src/language/dictionary/value-labels.c:167 src/language/lexer/lexer.c:599
+#: src/language/dictionary/value-labels.c:167 src/language/lexer/lexer.c:607
 msgid "expecting integer"
 msgstr ""
 
@@ -2265,94 +2265,94 @@
 msgid "expecting format type"
 msgstr ""
 
-#: src/language/lexer/lexer.c:259
+#: src/language/lexer/lexer.c:267
 #, c-format
 msgid "%s does not form a valid number."
 msgstr ""
 
-#: src/language/lexer/lexer.c:363
+#: src/language/lexer/lexer.c:371
 #, c-format
 msgid "Bad character in input: `%c'."
 msgstr ""
 
-#: src/language/lexer/lexer.c:365
+#: src/language/lexer/lexer.c:373
 #, c-format
 msgid "Bad character in input: `\\%o'."
 msgstr ""
 
-#: src/language/lexer/lexer.c:396
+#: src/language/lexer/lexer.c:404
 #, c-format
 msgid "Subcommand %s may only be specified once."
 msgstr ""
 
-#: src/language/lexer/lexer.c:404
+#: src/language/lexer/lexer.c:412
 #, c-format
 msgid "missing required subcommand %s"
 msgstr ""
 
-#: src/language/lexer/lexer.c:433
+#: src/language/lexer/lexer.c:441
 #, c-format
 msgid "Syntax error %s at %s."
 msgstr ""
 
-#: src/language/lexer/lexer.c:436
+#: src/language/lexer/lexer.c:444
 #, c-format
 msgid "Syntax error at %s."
 msgstr ""
 
-#: src/language/lexer/lexer.c:554 src/language/lexer/lexer.c:571
+#: src/language/lexer/lexer.c:562 src/language/lexer/lexer.c:579
 #, c-format
 msgid "expecting `%s'"
 msgstr ""
 
-#: src/language/lexer/lexer.c:613
+#: src/language/lexer/lexer.c:621
 msgid "expecting number"
 msgstr ""
 
-#: src/language/lexer/lexer.c:627
+#: src/language/lexer/lexer.c:635
 msgid "expecting identifier"
 msgstr ""
 
-#: src/language/lexer/lexer.c:1003
+#: src/language/lexer/lexer.c:1020
 msgid "binary"
 msgstr ""
 
-#: src/language/lexer/lexer.c:1008
+#: src/language/lexer/lexer.c:1025
 msgid "octal"
 msgstr ""
 
-#: src/language/lexer/lexer.c:1013
+#: src/language/lexer/lexer.c:1030
 msgid "hex"
 msgstr ""
 
-#: src/language/lexer/lexer.c:1023
+#: src/language/lexer/lexer.c:1040
 #, c-format
 msgid "String of %s digits has %d characters, which is not a multiple of %d."
 msgstr ""
 
-#: src/language/lexer/lexer.c:1052
+#: src/language/lexer/lexer.c:1069
 #, c-format
 msgid "`%c' is not a valid %s digit."
 msgstr ""
 
-#: src/language/lexer/lexer.c:1083
+#: src/language/lexer/lexer.c:1100
 msgid "Unterminated string constant."
 msgstr ""
 
-#: src/language/lexer/lexer.c:1137
+#: src/language/lexer/lexer.c:1154
 msgid "Unexpected end of file in string concatenation."
 msgstr ""
 
-#: src/language/lexer/lexer.c:1145
+#: src/language/lexer/lexer.c:1162
 msgid "String expected following `+'."
 msgstr ""
 
-#: src/language/lexer/lexer.c:1158
+#: src/language/lexer/lexer.c:1175
 #, c-format
 msgid "String exceeds 255 characters in length (%d characters)."
 msgstr ""
 
-#: src/language/lexer/lexer.c:1173
+#: src/language/lexer/lexer.c:1190
 msgid ""
 "Sorry, literal strings may not contain null characters.  Replacing with "
 "spaces."
@@ -2459,17 +2459,17 @@
 msgid "Closing `%s': %s."
 msgstr ""
 
-#: src/language/line-buffer.c:447
+#: src/language/line-buffer.c:446
 #, c-format
 msgid "opening \"%s\" as syntax file"
 msgstr ""
 
-#: src/language/line-buffer.c:452
+#: src/language/line-buffer.c:451
 #, c-format
 msgid "Opening `%s': %s."
 msgstr ""
 
-#: src/language/line-buffer.c:465
+#: src/language/line-buffer.c:464
 #, c-format
 msgid "Reading `%s': %s."
 msgstr ""

Index: po/pspp.pot
===================================================================
RCS file: /sources/pspp/pspp/po/pspp.pot,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -b -r1.102 -r1.103
--- po/pspp.pot 26 Oct 2006 06:29:10 -0000      1.102
+++ po/pspp.pot 28 Oct 2006 08:31:22 -0000      1.103
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: address@hidden"
-"POT-Creation-Date: 2006-10-26 14:25+0800\n"
+"POT-Creation-Date: 2006-10-26 16:30+0800\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <address@hidden>\n"
 "Language-Team: LANGUAGE <address@hidden>\n"
@@ -1069,7 +1069,7 @@
 
 #: src/language/command.c:802 src/language/data-io/matrix-data.c:539
 #: src/language/data-io/print-space.c:75 src/language/dictionary/vector.c:203
-#: src/language/lexer/lexer.c:448 src/language/stats/autorecode.c:154
+#: src/language/lexer/lexer.c:456 src/language/stats/autorecode.c:154
 #: src/language/xforms/select-if.c:62
 msgid "expecting end of command"
 msgstr ""
@@ -1114,16 +1114,16 @@
 "specified."
 msgstr ""
 
-#: src/language/control/repeat.c:393
+#: src/language/control/repeat.c:399
 #, c-format
 msgid "%ld TO %ld is an invalid range."
 msgstr ""
 
-#: src/language/control/repeat.c:429
+#: src/language/control/repeat.c:435
 msgid "String expected."
 msgstr ""
 
-#: src/language/control/repeat.c:448
+#: src/language/control/repeat.c:454
 msgid "No matching DO REPEAT."
 msgstr ""
 
@@ -1233,27 +1233,27 @@
 "by itself on a single line with exactly one space between words."
 msgstr ""
 
-#: src/language/data-io/data-reader.c:206
-#: src/language/data-io/data-reader.c:218
+#: src/language/data-io/data-reader.c:207
+#: src/language/data-io/data-reader.c:219
 #, c-format
 msgid "Error reading file %s: %s."
 msgstr ""
 
-#: src/language/data-io/data-reader.c:221
+#: src/language/data-io/data-reader.c:222
 #, c-format
 msgid "%s: Partial record at end of file."
 msgstr ""
 
-#: src/language/data-io/data-reader.c:272
+#: src/language/data-io/data-reader.c:273
 #, c-format
 msgid "Attempt to read beyond end-of-file on file %s."
 msgstr ""
 
-#: src/language/data-io/data-reader.c:275
+#: src/language/data-io/data-reader.c:276
 msgid "Attempt to read beyond END DATA."
 msgstr ""
 
-#: src/language/data-io/data-reader.c:433
+#: src/language/data-io/data-reader.c:434
 msgid ""
 "This command is not valid here since the current input program does not "
 "access the inline file."
@@ -2031,11 +2031,11 @@
 "s."
 msgstr ""
 
-#: src/language/dictionary/value-labels.c:158 src/language/lexer/lexer.c:585
+#: src/language/dictionary/value-labels.c:158 src/language/lexer/lexer.c:593
 msgid "expecting string"
 msgstr ""
 
-#: src/language/dictionary/value-labels.c:167 src/language/lexer/lexer.c:599
+#: src/language/dictionary/value-labels.c:167 src/language/lexer/lexer.c:607
 msgid "expecting integer"
 msgstr ""
 
@@ -2264,94 +2264,94 @@
 msgid "expecting format type"
 msgstr ""
 
-#: src/language/lexer/lexer.c:259
+#: src/language/lexer/lexer.c:267
 #, c-format
 msgid "%s does not form a valid number."
 msgstr ""
 
-#: src/language/lexer/lexer.c:363
+#: src/language/lexer/lexer.c:371
 #, c-format
 msgid "Bad character in input: `%c'."
 msgstr ""
 
-#: src/language/lexer/lexer.c:365
+#: src/language/lexer/lexer.c:373
 #, c-format
 msgid "Bad character in input: `\\%o'."
 msgstr ""
 
-#: src/language/lexer/lexer.c:396
+#: src/language/lexer/lexer.c:404
 #, c-format
 msgid "Subcommand %s may only be specified once."
 msgstr ""
 
-#: src/language/lexer/lexer.c:404
+#: src/language/lexer/lexer.c:412
 #, c-format
 msgid "missing required subcommand %s"
 msgstr ""
 
-#: src/language/lexer/lexer.c:433
+#: src/language/lexer/lexer.c:441
 #, c-format
 msgid "Syntax error %s at %s."
 msgstr ""
 
-#: src/language/lexer/lexer.c:436
+#: src/language/lexer/lexer.c:444
 #, c-format
 msgid "Syntax error at %s."
 msgstr ""
 
-#: src/language/lexer/lexer.c:554 src/language/lexer/lexer.c:571
+#: src/language/lexer/lexer.c:562 src/language/lexer/lexer.c:579
 #, c-format
 msgid "expecting `%s'"
 msgstr ""
 
-#: src/language/lexer/lexer.c:613
+#: src/language/lexer/lexer.c:621
 msgid "expecting number"
 msgstr ""
 
-#: src/language/lexer/lexer.c:627
+#: src/language/lexer/lexer.c:635
 msgid "expecting identifier"
 msgstr ""
 
-#: src/language/lexer/lexer.c:1003
+#: src/language/lexer/lexer.c:1020
 msgid "binary"
 msgstr ""
 
-#: src/language/lexer/lexer.c:1008
+#: src/language/lexer/lexer.c:1025
 msgid "octal"
 msgstr ""
 
-#: src/language/lexer/lexer.c:1013
+#: src/language/lexer/lexer.c:1030
 msgid "hex"
 msgstr ""
 
-#: src/language/lexer/lexer.c:1023
+#: src/language/lexer/lexer.c:1040
 #, c-format
 msgid "String of %s digits has %d characters, which is not a multiple of %d."
 msgstr ""
 
-#: src/language/lexer/lexer.c:1052
+#: src/language/lexer/lexer.c:1069
 #, c-format
 msgid "`%c' is not a valid %s digit."
 msgstr ""
 
-#: src/language/lexer/lexer.c:1083
+#: src/language/lexer/lexer.c:1100
 msgid "Unterminated string constant."
 msgstr ""
 
-#: src/language/lexer/lexer.c:1137
+#: src/language/lexer/lexer.c:1154
 msgid "Unexpected end of file in string concatenation."
 msgstr ""
 
-#: src/language/lexer/lexer.c:1145
+#: src/language/lexer/lexer.c:1162
 msgid "String expected following `+'."
 msgstr ""
 
-#: src/language/lexer/lexer.c:1158
+#: src/language/lexer/lexer.c:1175
 #, c-format
 msgid "String exceeds 255 characters in length (%d characters)."
 msgstr ""
 
-#: src/language/lexer/lexer.c:1173
+#: src/language/lexer/lexer.c:1190
 msgid ""
 "Sorry, literal strings may not contain null characters.  Replacing with "
 "spaces."
@@ -2458,17 +2458,17 @@
 msgid "Closing `%s': %s."
 msgstr ""
 
-#: src/language/line-buffer.c:447
+#: src/language/line-buffer.c:446
 #, c-format
 msgid "opening \"%s\" as syntax file"
 msgstr ""
 
-#: src/language/line-buffer.c:452
+#: src/language/line-buffer.c:451
 #, c-format
 msgid "Opening `%s': %s."
 msgstr ""
 
-#: src/language/line-buffer.c:465
+#: src/language/line-buffer.c:464
 #, c-format
 msgid "Reading `%s': %s."
 msgstr ""

Index: src/language/ChangeLog
===================================================================
RCS file: /sources/pspp/pspp/src/language/ChangeLog,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- src/language/ChangeLog      28 Oct 2006 04:01:55 -0000      1.12
+++ src/language/ChangeLog      28 Oct 2006 08:31:22 -0000      1.13
@@ -1,3 +1,8 @@
+Sat Oct 28 16:15:56 WST 2006 John Darrington <address@hidden>
+
+       * linebuffer.c linebuffer.h: Moved getl_buf from here, into
+       lexer/lexer.c
+
 Thu Oct 26 20:19:00 2006  Ben Pfaff  <address@hidden>
 
        * command.def: Add DEBUG FLOAT FORMAT.

Index: src/language/line-buffer.c
===================================================================
RCS file: /sources/pspp/pspp/src/language/line-buffer.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- src/language/line-buffer.c  8 Jul 2006 03:05:51 -0000       1.15
+++ src/language/line-buffer.c  28 Oct 2006 08:31:22 -0000      1.16
@@ -98,7 +98,6 @@
 
 static struct string getl_include_path;
 
-struct string getl_buf;
 
 static void close_source (void);
 
@@ -106,16 +105,17 @@
 static void uninit_prompts (void);
 static enum getl_prompt_style get_prompt_style (void);
 
+
 /* Initialize getl. */
 void
 getl_initialize (void)
 {
   ds_init_cstr (&getl_include_path,
                 fn_getenv_default ("STAT_INCLUDE_PATH", include_path));
-  ds_init_empty (&getl_buf);
   init_prompts ();
 }
 
+
 /* Delete everything from the include path. */
 void
 getl_clear_include_path (void)
@@ -387,7 +387,6 @@
 {
   while (cur_source != NULL)
     close_source ();
-  ds_destroy (&getl_buf);
   ds_destroy (&getl_include_path);
   free(file_loc);
   file_loc = NULL;
@@ -502,7 +501,7 @@
    If INTERACTIVE is non-null, then when true is returned
    *INTERACTIVE will be set to true if the line was obtained
    interactively, false otherwise. */
-static bool
+bool
 do_read_line (struct string *line, bool *interactive)
 {
   while (cur_source != NULL)
@@ -525,16 +524,6 @@
   return false;
 }
 
-/* Reads a single line into getl_buf.
-   Returns true when a line has been read, false at end of input.
-   If INTERACTIVE is non-null, then when true is returned
-   *INTERACTIVE will be set to true if the line was obtained
-   interactively, false otherwise. */
-bool
-getl_read_line (bool *interactive)
-{
-  return do_read_line (&getl_buf, interactive);
-}
 
 /* Current prompts in each style. */
 static char *prompts[GETL_PROMPT_CNT];

Index: src/language/line-buffer.h
===================================================================
RCS file: /sources/pspp/pspp/src/language/line-buffer.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- src/language/line-buffer.h  10 Jul 2006 09:28:14 -0000      1.5
+++ src/language/line-buffer.h  28 Oct 2006 08:31:22 -0000      1.6
@@ -31,9 +31,6 @@
     GETL_PROMPT_CNT
   };
 
-/* Current line.  This line may be modified by modules other than
-   getl.c, and by lexer.c in particular.  (Ugh.) */
-extern struct string getl_buf;
 
 void getl_initialize (void);
 void getl_uninitialize (void);
@@ -66,5 +63,7 @@
 
 void getl_location (const char **fn, int *ln);
 
+bool do_read_line (struct string *line, bool *interactive);
+
 
 #endif /* line-buffer.h */

Index: src/language/control/ChangeLog
===================================================================
RCS file: /sources/pspp/pspp/src/language/control/ChangeLog,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- src/language/control/ChangeLog      8 May 2006 01:21:38 -0000       1.3
+++ src/language/control/ChangeLog      28 Oct 2006 08:31:23 -0000      1.4
@@ -1,3 +1,7 @@
+Sat Oct 28 16:18:48 WST 2006 John Darrington <address@hidden>
+
+       * repeat.c: Eliminated references to extern variable getl_buf.
+
 Sun May  7 18:18:33 2006  Ben Pfaff  <address@hidden>
 
        Fix memory leaks.

Index: src/language/control/repeat.c
===================================================================
RCS file: /sources/pspp/pspp/src/language/control/repeat.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- src/language/control/repeat.c       26 Oct 2006 06:16:36 -0000      1.13
+++ src/language/control/repeat.c       28 Oct 2006 08:31:23 -0000      1.14
@@ -281,9 +281,10 @@
       const char *cur_file_name;
       int cur_line_number;
       struct line_list *line;
+      struct string cur_line_copy;
       bool dot;
 
-      if (!getl_read_line (NULL))
+      if (! lex_get_line_raw ())
         return false;
 
       /* If the current file has changed then record the fact. */
@@ -292,27 +293,32 @@
           || !strcmp (cur_file_name, previous_file_name))
         previous_file_name = pool_strdup (block->pool, cur_file_name);
 
-      ds_rtrim (&getl_buf, ss_cstr (CC_SPACES));
-      dot = ds_chomp (&getl_buf, get_endcmd ());
-      if (recognize_do_repeat (ds_cstr (&getl_buf))) 
+      ds_init_string (&cur_line_copy, lex_entire_line_ds () );
+      ds_rtrim (&cur_line_copy, ss_cstr (CC_SPACES));
+      dot = ds_chomp (&cur_line_copy, get_endcmd ());
+
+      if (recognize_do_repeat (ds_cstr (&cur_line_copy)))
         nesting_level++; 
-      else if (recognize_end_repeat (ds_cstr (&getl_buf), &block->print)) 
+      else if (recognize_end_repeat (ds_cstr (&cur_line_copy), &block->print)) 
         {
         if (nesting_level-- == 0)
           {
             lex_discard_line ();
+           ds_destroy (&cur_line_copy);
             return true;
           } 
         }
       if (dot)
-        ds_put_char (&getl_buf, get_endcmd ());
+        ds_put_char (&cur_line_copy, get_endcmd ());
       
       line = *last_line = pool_alloc (block->pool, sizeof *line);
       line->next = NULL;
       line->file_name = previous_file_name;
       line->line_number = cur_line_number;
-      line->line = pool_strdup (block->pool, ds_cstr (&getl_buf));
+      line->line = pool_strdup (block->pool, ds_cstr (&cur_line_copy) );
       last_line = &line->next;
+
+      ds_destroy (&cur_line_copy);
     }
 
   lex_discard_line ();
@@ -463,7 +469,8 @@
   return NULL;
 }
 
-/* Makes appropriate DO REPEAT macro substitutions within getl_buf. */
+/* Makes appropriate DO REPEAT macro substitutions within the 
+   repeated lines. */
 static void
 do_repeat_filter (struct string *line, void *block_)
 {

Index: src/language/data-io/ChangeLog
===================================================================
RCS file: /sources/pspp/pspp/src/language/data-io/ChangeLog,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- src/language/data-io/ChangeLog      5 Aug 2006 15:28:12 -0000       1.27
+++ src/language/data-io/ChangeLog      28 Oct 2006 08:31:23 -0000      1.28
@@ -1,3 +1,7 @@
+Sat Oct 28 16:19:57 WST 2006 John Darrington <address@hidden>
+
+       * data-reader.c: Eliminated references to extern variable getl_buf
+
 Sat Aug  5 08:25:07 2006  Ben Pfaff  <address@hidden>
 
        Fix bug #17329 in REREAD parsing, reported by John Darrington.

Index: src/language/data-io/data-reader.c
===================================================================
RCS file: /sources/pspp/pspp/src/language/data-io/data-reader.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- src/language/data-io/data-reader.c  26 Oct 2006 06:16:36 -0000      1.14
+++ src/language/data-io/data-reader.c  28 Oct 2006 08:31:23 -0000      1.15
@@ -170,7 +170,7 @@
       getl_set_prompt_style (GETL_PROMPT_DATA);
     }
       
-  if (!getl_read_line (NULL))
+  if (!lex_get_line_raw ())
     {
       msg (SE, _("Unexpected end-of-file while reading data in BEGIN "
                  "DATA.  This probably indicates "
@@ -180,14 +180,15 @@
       return false;
     }
 
-  if (ds_length (&getl_buf) >= 8
-      && !strncasecmp (ds_cstr (&getl_buf), "end data", 8))
+  if (ds_length (lex_entire_line_ds() ) >= 8
+      && !strncasecmp (lex_entire_line (), "end data", 8))
     {
-      lex_set_prog (ds_end (&getl_buf));
+      lex_discard_line ();
       return false;
     }
 
-  ds_assign_string (&r->line, &getl_buf);
+  ds_assign_string (&r->line, lex_entire_line_ds () );
+
   return true;
 }
 

Index: src/language/lexer/ChangeLog
===================================================================
RCS file: /sources/pspp/pspp/src/language/lexer/ChangeLog,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- src/language/lexer/ChangeLog        28 Oct 2006 04:01:55 -0000      1.14
+++ src/language/lexer/ChangeLog        28 Oct 2006 08:31:23 -0000      1.15
@@ -1,3 +1,8 @@
+Sat Oct 28 16:17:18 WST 2006 John Darrington <address@hidden>
+
+       * lexer.c lexer.h: Added a line_buffer (previously an external
+       reference called getl_buf). 
+
 Thu Oct 26 20:18:03 2006  Ben Pfaff  <address@hidden>
 
        * lexer.c (parse_string): Make lexing of binary, hex, and octal

Index: src/language/lexer/lexer.c
===================================================================
RCS file: /sources/pspp/pspp/src/language/lexer/lexer.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- src/language/lexer/lexer.c  28 Oct 2006 04:01:55 -0000      1.10
+++ src/language/lexer/lexer.c  28 Oct 2006 08:31:23 -0000      1.11
@@ -61,7 +61,7 @@
 
 /* Static variables. */
 
-/* Pointer to next token in getl_buf. */
+/* Pointer to next token in line_buffer. */
 static char *prog;
 
 /* True only if this line ends with a terminal dot. */
@@ -95,12 +95,19 @@
 
 /* Initialization. */
 
+static struct string line_buffer;
+
+static bool (*lex_read_line) (struct string *, bool *);
+
 /* Initializes the lexer. */
 void
-lex_init (void)
+lex_init (bool (*read_line_func) (struct string *, bool *))
 {
   ds_init_empty (&tokstr);
   ds_init_empty (&put_tokstr);
+  ds_init_empty (&line_buffer);
+  lex_read_line = read_line_func;
+
   if (!lex_get_line ())
     eof = true;
 }
@@ -110,6 +117,7 @@
 {
   ds_destroy (&put_tokstr);
   ds_destroy (&tokstr);
+  ds_destroy (&line_buffer);
 }
 
 
@@ -700,7 +708,13 @@
 const char *
 lex_entire_line (void)
 {
-  return ds_cstr (&getl_buf);
+  return ds_cstr (&line_buffer);
+}
+
+const struct string *
+lex_entire_line_ds (void)
+{
+  return &line_buffer;
 }
 
 /* As lex_entire_line(), but only returns the part of the current line
@@ -720,18 +734,12 @@
 void
 lex_discard_line (void)
 {
-  prog = ds_end (&getl_buf);
+  ds_cstr (&line_buffer);  /* Ensures ds_end points to something valid */
+  prog = ds_end (&line_buffer);
   dot = false;
   put_token = 0;
 }
 
-/* Sets the current position in the current line to P, which must be
-   in getl_buf. */
-void
-lex_set_prog (char *p)
-{
-  prog = p;
-}
 
 /* Discards the rest of the current command.
    When we're reading commands from a file, we skip tokens until
@@ -802,16 +810,24 @@
     }
 }
 
+/* Reads a line, without performing any preprocessing */
+bool 
+lex_get_line_raw (void)
+{
+  bool dummy;
+  return lex_read_line (&line_buffer, &dummy);
+}
+
 /* Reads a line for use by the tokenizer, and preprocesses it by
    removing comments, stripping trailing whitespace and the
    terminal dot, and removing leading indentors. */
 bool
 lex_get_line (void)
 {
-  struct string *line = &getl_buf;
+  struct string *line = &line_buffer;
   bool interactive;
 
-  if (!getl_read_line (&interactive))
+  if (!lex_read_line (line, &interactive))
     return false;
 
   strip_comments (line);
@@ -976,7 +992,8 @@
       if (put_token == '.')
        break;
 
-      prog = ds_end (&getl_buf);
+      ds_cstr (&line_buffer); /* Ensures ds_end will point to a valid char */
+      prog = ds_end (&line_buffer);
       if (dot)
        break;
     }

Index: src/language/lexer/lexer.h
===================================================================
RCS file: /sources/pspp/pspp/src/language/lexer/lexer.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- src/language/lexer/lexer.h  14 Oct 2006 00:25:20 -0000      1.6
+++ src/language/lexer/lexer.h  28 Oct 2006 08:31:23 -0000      1.7
@@ -35,7 +35,7 @@
 #include <stddef.h>
 
 /* Initialization. */
-void lex_init (void);
+void lex_init (bool (*)(struct string *, bool*));
 void lex_done (void);
 
 /* Common functions. */
@@ -71,13 +71,14 @@
 
 /* Weird line processing functions. */
 const char *lex_entire_line (void);
+const struct string *lex_entire_line_ds (void);
 const char *lex_rest_of_line (int *end_dot);
 void lex_discard_line (void);
-void lex_set_prog (char *p);
 void lex_discard_rest_of_command (void);
 
 /* Weird line reading functions. */
 bool lex_get_line (void);
+bool lex_get_line_raw (void);
 
 /* Token names. */
 const char *lex_token_name (int);

Index: src/ui/terminal/main.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/terminal/main.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- src/ui/terminal/main.c      26 Oct 2006 06:16:36 -0000      1.16
+++ src/ui/terminal/main.c      28 Oct 2006 08:31:23 -0000      1.17
@@ -100,7 +100,7 @@
   if (parse_command_line (argc, argv)) 
     {
       outp_read_devices ();
-      lex_init ();
+      lex_init (do_read_line);
 
       for (;;)
         {

Index: tests/command/do-repeat.sh
===================================================================
RCS file: /sources/pspp/pspp/tests/command/do-repeat.sh,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- tests/command/do-repeat.sh  8 May 2006 01:16:40 -0000       1.3
+++ tests/command/do-repeat.sh  28 Oct 2006 08:31:23 -0000      1.4
@@ -66,9 +66,9 @@
 
 VECTOR v(6).
 COMPUTE #idx = 0.
-DO REPEAT a = 1 TO 2.
-       DO REPEAT b = 3 TO 5.
-               COMPUTE #x = a + b.
+DO REPEAT i = 1 TO 2.
+       DO REPEAT j = 3 TO 5.
+               COMPUTE #x = i + j.
                COMPUTE #idx = #idx + 1.
                COMPUTE v(#idx) = #x.
        END REPEAT.
@@ -80,7 +80,7 @@
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="run program"
-$SUPERVISOR $PSPP --testing-mode -o raw-ascii $TESTFILE >/dev/null 2>&1
+$SUPERVISOR $PSPP --testing-mode -o raw-ascii $TESTFILE 
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="compare results"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]