projects
/
pspp-builds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f89de8c
)
Eliminated global variable getl_buf
author
John Darrington
<john@darrington.wattle.id.au>
Sat, 28 Oct 2006 08:31:22 +0000
(08:31 +0000)
committer
John Darrington
<john@darrington.wattle.id.au>
Sat, 28 Oct 2006 08:31:22 +0000
(08:31 +0000)
14 files changed:
po/de.po
patch
|
blob
|
history
po/pspp.pot
patch
|
blob
|
history
src/language/ChangeLog
patch
|
blob
|
history
src/language/control/ChangeLog
patch
|
blob
|
history
src/language/control/repeat.c
patch
|
blob
|
history
src/language/data-io/ChangeLog
patch
|
blob
|
history
src/language/data-io/data-reader.c
patch
|
blob
|
history
src/language/lexer/ChangeLog
patch
|
blob
|
history
src/language/lexer/lexer.c
patch
|
blob
|
history
src/language/lexer/lexer.h
patch
|
blob
|
history
src/language/line-buffer.c
patch
|
blob
|
history
src/language/line-buffer.h
patch
|
blob
|
history
src/ui/terminal/main.c
patch
|
blob
|
history
tests/command/do-repeat.sh
patch
|
blob
|
history
diff --git
a/po/de.po
b/po/de.po
index 080863ae8ad511316049d954d0cb408fdccd394a..daab46357bc78138f5f2c2ad5c225ae82c92c963 100644
(file)
--- a/
po/de.po
+++ b/
po/de.po
@@
-10,7
+10,7
@@
msgid ""
msgstr ""
"Project-Id-Version: PSPP 0.4.2\n"
"Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
msgstr ""
"Project-Id-Version: PSPP 0.4.2\n"
"Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
-"POT-Creation-Date: 2006-10-26 1
4:25
+0800\n"
+"POT-Creation-Date: 2006-10-26 1
6:30
+0800\n"
"PO-Revision-Date: 2006-05-26 17:49+0800\n"
"Last-Translator: John Darrington <john@darrington.wattle.id.au>\n"
"Language-Team: German <pspp-dev@gnu.org>\n"
"PO-Revision-Date: 2006-05-26 17:49+0800\n"
"Last-Translator: John Darrington <john@darrington.wattle.id.au>\n"
"Language-Team: German <pspp-dev@gnu.org>\n"
@@
-1070,7
+1070,7
@@
msgstr ""
#: 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/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:4
48
src/language/stats/autorecode.c:154
+#: src/language/lexer/lexer.c:4
56
src/language/stats/autorecode.c:154
#: src/language/xforms/select-if.c:62
msgid "expecting end of command"
msgstr ""
#: src/language/xforms/select-if.c:62
msgid "expecting end of command"
msgstr ""
@@
-1115,16
+1115,16
@@
msgid ""
"specified."
msgstr ""
"specified."
msgstr ""
-#: src/language/control/repeat.c:39
3
+#: src/language/control/repeat.c:39
9
#, c-format
msgid "%ld TO %ld is an invalid range."
msgstr ""
#, c-format
msgid "%ld TO %ld is an invalid range."
msgstr ""
-#: src/language/control/repeat.c:4
29
+#: src/language/control/repeat.c:4
35
msgid "String expected."
msgstr ""
msgid "String expected."
msgstr ""
-#: src/language/control/repeat.c:4
48
+#: src/language/control/repeat.c:4
54
msgid "No matching DO REPEAT."
msgstr ""
msgid "No matching DO REPEAT."
msgstr ""
@@
-1234,27
+1234,27
@@
msgid ""
"by itself on a single line with exactly one space between words."
msgstr ""
"by itself on a single line with exactly one space between words."
msgstr ""
-#: src/language/data-io/data-reader.c:20
6
-#: src/language/data-io/data-reader.c:21
8
+#: src/language/data-io/data-reader.c:20
7
+#: src/language/data-io/data-reader.c:21
9
#, c-format
msgid "Error reading file %s: %s."
msgstr ""
#, c-format
msgid "Error reading file %s: %s."
msgstr ""
-#: src/language/data-io/data-reader.c:22
1
+#: src/language/data-io/data-reader.c:22
2
#, c-format
msgid "%s: Partial record at end of file."
msgstr ""
#, c-format
msgid "%s: Partial record at end of file."
msgstr ""
-#: src/language/data-io/data-reader.c:27
2
+#: src/language/data-io/data-reader.c:27
3
#, c-format
msgid "Attempt to read beyond end-of-file on file %s."
msgstr ""
#, c-format
msgid "Attempt to read beyond end-of-file on file %s."
msgstr ""
-#: src/language/data-io/data-reader.c:27
5
+#: src/language/data-io/data-reader.c:27
6
msgid "Attempt to read beyond END DATA."
msgstr ""
msgid "Attempt to read beyond END DATA."
msgstr ""
-#: src/language/data-io/data-reader.c:43
3
+#: src/language/data-io/data-reader.c:43
4
msgid ""
"This command is not valid here since the current input program does not "
"access the inline file."
msgid ""
"This command is not valid here since the current input program does not "
"access the inline file."
@@
-2032,11
+2032,11
@@
msgid ""
"s."
msgstr ""
"s."
msgstr ""
-#: src/language/dictionary/value-labels.c:158 src/language/lexer/lexer.c:5
85
+#: src/language/dictionary/value-labels.c:158 src/language/lexer/lexer.c:5
93
msgid "expecting string"
msgstr ""
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 ""
msgid "expecting integer"
msgstr ""
@@
-2265,94
+2265,94
@@
msgstr ""
msgid "expecting format type"
msgstr ""
msgid "expecting format type"
msgstr ""
-#: src/language/lexer/lexer.c:2
59
+#: src/language/lexer/lexer.c:2
67
#, c-format
msgid "%s does not form a valid number."
msgstr ""
#, c-format
msgid "%s does not form a valid number."
msgstr ""
-#: src/language/lexer/lexer.c:3
63
+#: src/language/lexer/lexer.c:3
71
#, c-format
msgid "Bad character in input: `%c'."
msgstr ""
#, c-format
msgid "Bad character in input: `%c'."
msgstr ""
-#: src/language/lexer/lexer.c:3
65
+#: src/language/lexer/lexer.c:3
73
#, c-format
msgid "Bad character in input: `\\%o'."
msgstr ""
#, 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 ""
#, c-format
msgid "Subcommand %s may only be specified once."
msgstr ""
-#: src/language/lexer/lexer.c:4
04
+#: src/language/lexer/lexer.c:4
12
#, c-format
msgid "missing required subcommand %s"
msgstr ""
#, c-format
msgid "missing required subcommand %s"
msgstr ""
-#: src/language/lexer/lexer.c:4
33
+#: src/language/lexer/lexer.c:4
41
#, c-format
msgid "Syntax error %s at %s."
msgstr ""
#, c-format
msgid "Syntax error %s at %s."
msgstr ""
-#: src/language/lexer/lexer.c:4
36
+#: src/language/lexer/lexer.c:4
44
#, c-format
msgid "Syntax error at %s."
msgstr ""
#, c-format
msgid "Syntax error at %s."
msgstr ""
-#: src/language/lexer/lexer.c:5
54 src/language/lexer/lexer.c:571
+#: src/language/lexer/lexer.c:5
62 src/language/lexer/lexer.c:579
#, c-format
msgid "expecting `%s'"
msgstr ""
#, c-format
msgid "expecting `%s'"
msgstr ""
-#: src/language/lexer/lexer.c:6
13
+#: src/language/lexer/lexer.c:6
21
msgid "expecting number"
msgstr ""
msgid "expecting number"
msgstr ""
-#: src/language/lexer/lexer.c:6
27
+#: src/language/lexer/lexer.c:6
35
msgid "expecting identifier"
msgstr ""
msgid "expecting identifier"
msgstr ""
-#: src/language/lexer/lexer.c:10
03
+#: src/language/lexer/lexer.c:10
20
msgid "binary"
msgstr ""
msgid "binary"
msgstr ""
-#: src/language/lexer/lexer.c:10
08
+#: src/language/lexer/lexer.c:10
25
msgid "octal"
msgstr ""
msgid "octal"
msgstr ""
-#: src/language/lexer/lexer.c:10
13
+#: src/language/lexer/lexer.c:10
30
msgid "hex"
msgstr ""
msgid "hex"
msgstr ""
-#: src/language/lexer/lexer.c:10
23
+#: src/language/lexer/lexer.c:10
40
#, c-format
msgid "String of %s digits has %d characters, which is not a multiple of %d."
msgstr ""
#, c-format
msgid "String of %s digits has %d characters, which is not a multiple of %d."
msgstr ""
-#: src/language/lexer/lexer.c:10
52
+#: src/language/lexer/lexer.c:10
69
#, c-format
msgid "`%c' is not a valid %s digit."
msgstr ""
#, c-format
msgid "`%c' is not a valid %s digit."
msgstr ""
-#: src/language/lexer/lexer.c:1
083
+#: src/language/lexer/lexer.c:1
100
msgid "Unterminated string constant."
msgstr ""
msgid "Unterminated string constant."
msgstr ""
-#: src/language/lexer/lexer.c:11
37
+#: src/language/lexer/lexer.c:11
54
msgid "Unexpected end of file in string concatenation."
msgstr ""
msgid "Unexpected end of file in string concatenation."
msgstr ""
-#: src/language/lexer/lexer.c:11
45
+#: src/language/lexer/lexer.c:11
62
msgid "String expected following `+'."
msgstr ""
msgid "String expected following `+'."
msgstr ""
-#: src/language/lexer/lexer.c:11
58
+#: src/language/lexer/lexer.c:11
75
#, c-format
msgid "String exceeds 255 characters in length (%d characters)."
msgstr ""
#, c-format
msgid "String exceeds 255 characters in length (%d characters)."
msgstr ""
-#: src/language/lexer/lexer.c:11
73
+#: src/language/lexer/lexer.c:11
90
msgid ""
"Sorry, literal strings may not contain null characters. Replacing with "
"spaces."
msgid ""
"Sorry, literal strings may not contain null characters. Replacing with "
"spaces."
@@
-2459,17
+2459,17
@@
msgstr ""
msgid "Closing `%s': %s."
msgstr ""
msgid "Closing `%s': %s."
msgstr ""
-#: src/language/line-buffer.c:44
7
+#: src/language/line-buffer.c:44
6
#, c-format
msgid "opening \"%s\" as syntax file"
msgstr ""
#, c-format
msgid "opening \"%s\" as syntax file"
msgstr ""
-#: src/language/line-buffer.c:45
2
+#: src/language/line-buffer.c:45
1
#, c-format
msgid "Opening `%s': %s."
msgstr ""
#, c-format
msgid "Opening `%s': %s."
msgstr ""
-#: src/language/line-buffer.c:46
5
+#: src/language/line-buffer.c:46
4
#, c-format
msgid "Reading `%s': %s."
msgstr ""
#, c-format
msgid "Reading `%s': %s."
msgstr ""
diff --git
a/po/pspp.pot
b/po/pspp.pot
index 9b1eaa0ed30b6b24a0ad4f832d2311440b41e89e..99ea521f1f9567ae8b13128a172b896c0832d448 100644
(file)
--- a/
po/pspp.pot
+++ b/
po/pspp.pot
@@
-8,7
+8,7
@@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
-"POT-Creation-Date: 2006-10-26 1
4:25
+0800\n"
+"POT-Creation-Date: 2006-10-26 1
6:30
+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@
-1069,7
+1069,7
@@
msgstr ""
#: 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/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:4
48
src/language/stats/autorecode.c:154
+#: src/language/lexer/lexer.c:4
56
src/language/stats/autorecode.c:154
#: src/language/xforms/select-if.c:62
msgid "expecting end of command"
msgstr ""
#: src/language/xforms/select-if.c:62
msgid "expecting end of command"
msgstr ""
@@
-1114,16
+1114,16
@@
msgid ""
"specified."
msgstr ""
"specified."
msgstr ""
-#: src/language/control/repeat.c:39
3
+#: src/language/control/repeat.c:39
9
#, c-format
msgid "%ld TO %ld is an invalid range."
msgstr ""
#, c-format
msgid "%ld TO %ld is an invalid range."
msgstr ""
-#: src/language/control/repeat.c:4
29
+#: src/language/control/repeat.c:4
35
msgid "String expected."
msgstr ""
msgid "String expected."
msgstr ""
-#: src/language/control/repeat.c:4
48
+#: src/language/control/repeat.c:4
54
msgid "No matching DO REPEAT."
msgstr ""
msgid "No matching DO REPEAT."
msgstr ""
@@
-1233,27
+1233,27
@@
msgid ""
"by itself on a single line with exactly one space between words."
msgstr ""
"by itself on a single line with exactly one space between words."
msgstr ""
-#: src/language/data-io/data-reader.c:20
6
-#: src/language/data-io/data-reader.c:21
8
+#: src/language/data-io/data-reader.c:20
7
+#: src/language/data-io/data-reader.c:21
9
#, c-format
msgid "Error reading file %s: %s."
msgstr ""
#, c-format
msgid "Error reading file %s: %s."
msgstr ""
-#: src/language/data-io/data-reader.c:22
1
+#: src/language/data-io/data-reader.c:22
2
#, c-format
msgid "%s: Partial record at end of file."
msgstr ""
#, c-format
msgid "%s: Partial record at end of file."
msgstr ""
-#: src/language/data-io/data-reader.c:27
2
+#: src/language/data-io/data-reader.c:27
3
#, c-format
msgid "Attempt to read beyond end-of-file on file %s."
msgstr ""
#, c-format
msgid "Attempt to read beyond end-of-file on file %s."
msgstr ""
-#: src/language/data-io/data-reader.c:27
5
+#: src/language/data-io/data-reader.c:27
6
msgid "Attempt to read beyond END DATA."
msgstr ""
msgid "Attempt to read beyond END DATA."
msgstr ""
-#: src/language/data-io/data-reader.c:43
3
+#: src/language/data-io/data-reader.c:43
4
msgid ""
"This command is not valid here since the current input program does not "
"access the inline file."
msgid ""
"This command is not valid here since the current input program does not "
"access the inline file."
@@
-2031,11
+2031,11
@@
msgid ""
"s."
msgstr ""
"s."
msgstr ""
-#: src/language/dictionary/value-labels.c:158 src/language/lexer/lexer.c:5
85
+#: src/language/dictionary/value-labels.c:158 src/language/lexer/lexer.c:5
93
msgid "expecting string"
msgstr ""
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 ""
msgid "expecting integer"
msgstr ""
@@
-2264,94
+2264,94
@@
msgstr ""
msgid "expecting format type"
msgstr ""
msgid "expecting format type"
msgstr ""
-#: src/language/lexer/lexer.c:2
59
+#: src/language/lexer/lexer.c:2
67
#, c-format
msgid "%s does not form a valid number."
msgstr ""
#, c-format
msgid "%s does not form a valid number."
msgstr ""
-#: src/language/lexer/lexer.c:3
63
+#: src/language/lexer/lexer.c:3
71
#, c-format
msgid "Bad character in input: `%c'."
msgstr ""
#, c-format
msgid "Bad character in input: `%c'."
msgstr ""
-#: src/language/lexer/lexer.c:3
65
+#: src/language/lexer/lexer.c:3
73
#, c-format
msgid "Bad character in input: `\\%o'."
msgstr ""
#, 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 ""
#, c-format
msgid "Subcommand %s may only be specified once."
msgstr ""
-#: src/language/lexer/lexer.c:4
04
+#: src/language/lexer/lexer.c:4
12
#, c-format
msgid "missing required subcommand %s"
msgstr ""
#, c-format
msgid "missing required subcommand %s"
msgstr ""
-#: src/language/lexer/lexer.c:4
33
+#: src/language/lexer/lexer.c:4
41
#, c-format
msgid "Syntax error %s at %s."
msgstr ""
#, c-format
msgid "Syntax error %s at %s."
msgstr ""
-#: src/language/lexer/lexer.c:4
36
+#: src/language/lexer/lexer.c:4
44
#, c-format
msgid "Syntax error at %s."
msgstr ""
#, c-format
msgid "Syntax error at %s."
msgstr ""
-#: src/language/lexer/lexer.c:5
54 src/language/lexer/lexer.c:571
+#: src/language/lexer/lexer.c:5
62 src/language/lexer/lexer.c:579
#, c-format
msgid "expecting `%s'"
msgstr ""
#, c-format
msgid "expecting `%s'"
msgstr ""
-#: src/language/lexer/lexer.c:6
13
+#: src/language/lexer/lexer.c:6
21
msgid "expecting number"
msgstr ""
msgid "expecting number"
msgstr ""
-#: src/language/lexer/lexer.c:6
27
+#: src/language/lexer/lexer.c:6
35
msgid "expecting identifier"
msgstr ""
msgid "expecting identifier"
msgstr ""
-#: src/language/lexer/lexer.c:10
03
+#: src/language/lexer/lexer.c:10
20
msgid "binary"
msgstr ""
msgid "binary"
msgstr ""
-#: src/language/lexer/lexer.c:10
08
+#: src/language/lexer/lexer.c:10
25
msgid "octal"
msgstr ""
msgid "octal"
msgstr ""
-#: src/language/lexer/lexer.c:10
13
+#: src/language/lexer/lexer.c:10
30
msgid "hex"
msgstr ""
msgid "hex"
msgstr ""
-#: src/language/lexer/lexer.c:10
23
+#: src/language/lexer/lexer.c:10
40
#, c-format
msgid "String of %s digits has %d characters, which is not a multiple of %d."
msgstr ""
#, c-format
msgid "String of %s digits has %d characters, which is not a multiple of %d."
msgstr ""
-#: src/language/lexer/lexer.c:10
52
+#: src/language/lexer/lexer.c:10
69
#, c-format
msgid "`%c' is not a valid %s digit."
msgstr ""
#, c-format
msgid "`%c' is not a valid %s digit."
msgstr ""
-#: src/language/lexer/lexer.c:1
083
+#: src/language/lexer/lexer.c:1
100
msgid "Unterminated string constant."
msgstr ""
msgid "Unterminated string constant."
msgstr ""
-#: src/language/lexer/lexer.c:11
37
+#: src/language/lexer/lexer.c:11
54
msgid "Unexpected end of file in string concatenation."
msgstr ""
msgid "Unexpected end of file in string concatenation."
msgstr ""
-#: src/language/lexer/lexer.c:11
45
+#: src/language/lexer/lexer.c:11
62
msgid "String expected following `+'."
msgstr ""
msgid "String expected following `+'."
msgstr ""
-#: src/language/lexer/lexer.c:11
58
+#: src/language/lexer/lexer.c:11
75
#, c-format
msgid "String exceeds 255 characters in length (%d characters)."
msgstr ""
#, c-format
msgid "String exceeds 255 characters in length (%d characters)."
msgstr ""
-#: src/language/lexer/lexer.c:11
73
+#: src/language/lexer/lexer.c:11
90
msgid ""
"Sorry, literal strings may not contain null characters. Replacing with "
"spaces."
msgid ""
"Sorry, literal strings may not contain null characters. Replacing with "
"spaces."
@@
-2458,17
+2458,17
@@
msgstr ""
msgid "Closing `%s': %s."
msgstr ""
msgid "Closing `%s': %s."
msgstr ""
-#: src/language/line-buffer.c:44
7
+#: src/language/line-buffer.c:44
6
#, c-format
msgid "opening \"%s\" as syntax file"
msgstr ""
#, c-format
msgid "opening \"%s\" as syntax file"
msgstr ""
-#: src/language/line-buffer.c:45
2
+#: src/language/line-buffer.c:45
1
#, c-format
msgid "Opening `%s': %s."
msgstr ""
#, c-format
msgid "Opening `%s': %s."
msgstr ""
-#: src/language/line-buffer.c:46
5
+#: src/language/line-buffer.c:46
4
#, c-format
msgid "Reading `%s': %s."
msgstr ""
#, c-format
msgid "Reading `%s': %s."
msgstr ""
diff --git
a/src/language/ChangeLog
b/src/language/ChangeLog
index 2d49a13b8dc0e63bc46aa6ab23b020068f0c24d4..69f3be37f3084c790de52a32816e91ffe27bc5c7 100644
(file)
--- a/
src/language/ChangeLog
+++ b/
src/language/ChangeLog
@@
-1,3
+1,8
@@
+Sat Oct 28 16:15:56 WST 2006 John Darrington <john@darrington.wattle.id.au>
+
+ * linebuffer.c linebuffer.h: Moved getl_buf from here, into
+ lexer/lexer.c
+
Thu Oct 26 20:19:00 2006 Ben Pfaff <blp@gnu.org>
* command.def: Add DEBUG FLOAT FORMAT.
Thu Oct 26 20:19:00 2006 Ben Pfaff <blp@gnu.org>
* command.def: Add DEBUG FLOAT FORMAT.
diff --git
a/src/language/control/ChangeLog
b/src/language/control/ChangeLog
index c245942610161383f47fb42fb02bc87162a386e7..50707bd4f244b089565f727bdc1045836e3e9faf 100644
(file)
--- a/
src/language/control/ChangeLog
+++ b/
src/language/control/ChangeLog
@@
-1,3
+1,7
@@
+Sat Oct 28 16:18:48 WST 2006 John Darrington <john@darrington.wattle.id.au>
+
+ * repeat.c: Eliminated references to extern variable getl_buf.
+
Sun May 7 18:18:33 2006 Ben Pfaff <blp@gnu.org>
Fix memory leaks.
Sun May 7 18:18:33 2006 Ben Pfaff <blp@gnu.org>
Fix memory leaks.
diff --git
a/src/language/control/repeat.c
b/src/language/control/repeat.c
index 285acd7cd4c6dd1fcdc9fe4734356bdcb0700a1c..d812c12fc70b352328c4f9db695b640659ccf8ac 100644
(file)
--- a/
src/language/control/repeat.c
+++ b/
src/language/control/repeat.c
@@
-281,9
+281,10
@@
parse_lines (struct repeat_block *block)
const char *cur_file_name;
int cur_line_number;
struct line_list *line;
const char *cur_file_name;
int cur_line_number;
struct line_list *line;
+ struct string cur_line_copy;
bool dot;
bool dot;
- if (!
getl_read_line (NULL
))
+ if (!
lex_get_line_raw (
))
return false;
/* If the current file has changed then record the fact. */
return false;
/* If the current file has changed then record the fact. */
@@
-292,27
+293,32
@@
parse_lines (struct repeat_block *block)
|| !strcmp (cur_file_name, previous_file_name))
previous_file_name = pool_strdup (block->pool, cur_file_name);
|| !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++;
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 ();
{
if (nesting_level-- == 0)
{
lex_discard_line ();
+ ds_destroy (&cur_line_copy);
return true;
}
}
if (dot)
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 = *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;
last_line = &line->next;
+
+ ds_destroy (&cur_line_copy);
}
lex_discard_line ();
}
lex_discard_line ();
@@
-463,7
+469,8
@@
find_substitution (struct repeat_block *block, const char *name, size_t length)
return NULL;
}
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_)
{
static void
do_repeat_filter (struct string *line, void *block_)
{
diff --git
a/src/language/data-io/ChangeLog
b/src/language/data-io/ChangeLog
index 0fb80cbc9cea6790e2c6afaa31662fb2ed690f45..24c932ab37c47d8a9b94485c36c4356c06686588 100644
(file)
--- a/
src/language/data-io/ChangeLog
+++ b/
src/language/data-io/ChangeLog
@@
-1,3
+1,7
@@
+Sat Oct 28 16:19:57 WST 2006 John Darrington <john@darrington.wattle.id.au>
+
+ * data-reader.c: Eliminated references to extern variable getl_buf
+
Sat Aug 5 08:25:07 2006 Ben Pfaff <blp@gnu.org>
Fix bug #17329 in REREAD parsing, reported by John Darrington.
Sat Aug 5 08:25:07 2006 Ben Pfaff <blp@gnu.org>
Fix bug #17329 in REREAD parsing, reported by John Darrington.
diff --git
a/src/language/data-io/data-reader.c
b/src/language/data-io/data-reader.c
index 6cd92882eb6c854faab2de03c332b49a767fa7b0..6458a82172b5b14c26958589a0c7671208e21a77 100644
(file)
--- a/
src/language/data-io/data-reader.c
+++ b/
src/language/data-io/data-reader.c
@@
-170,7
+170,7
@@
read_inline_record (struct dfm_reader *r)
getl_set_prompt_style (GETL_PROMPT_DATA);
}
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 "
{
msg (SE, _("Unexpected end-of-file while reading data in BEGIN "
"DATA. This probably indicates "
@@
-180,14
+180,15
@@
read_inline_record (struct dfm_reader *r)
return false;
}
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;
}
return false;
}
- ds_assign_string (&r->line, &getl_buf);
+ ds_assign_string (&r->line, lex_entire_line_ds () );
+
return true;
}
return true;
}
diff --git
a/src/language/lexer/ChangeLog
b/src/language/lexer/ChangeLog
index 7172c1b8e280640554c41a2215c39524ab525cc1..cee1fd94caf420d647514ea4339762ff142c303f 100644
(file)
--- a/
src/language/lexer/ChangeLog
+++ b/
src/language/lexer/ChangeLog
@@
-1,3
+1,8
@@
+Sat Oct 28 16:17:18 WST 2006 John Darrington <john@darrington.wattle.id.au>
+
+ * lexer.c lexer.h: Added a line_buffer (previously an external
+ reference called getl_buf).
+
Thu Oct 26 20:18:03 2006 Ben Pfaff <blp@gnu.org>
* lexer.c (parse_string): Make lexing of binary, hex, and octal
Thu Oct 26 20:18:03 2006 Ben Pfaff <blp@gnu.org>
* lexer.c (parse_string): Make lexing of binary, hex, and octal
diff --git
a/src/language/lexer/lexer.c
b/src/language/lexer/lexer.c
index 9f9e433815ef5bbb6a2219e619c549e31d307929..a1300418a8b0bce8f76d0c5009652f34b191fa34 100644
(file)
--- a/
src/language/lexer/lexer.c
+++ b/
src/language/lexer/lexer.c
@@
-61,7
+61,7
@@
struct string tokstr;
\f
/* Static variables. */
\f
/* 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. */
static char *prog;
/* True only if this line ends with a terminal dot. */
@@
-95,12
+95,19
@@
static void dump_token (void);
\f
/* Initialization. */
\f
/* Initialization. */
+static struct string line_buffer;
+
+static bool (*lex_read_line) (struct string *, bool *);
+
/* Initializes the lexer. */
void
/* 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 (&tokstr);
ds_init_empty (&put_tokstr);
+ ds_init_empty (&line_buffer);
+ lex_read_line = read_line_func;
+
if (!lex_get_line ())
eof = true;
}
if (!lex_get_line ())
eof = true;
}
@@
-110,6
+117,7
@@
lex_done (void)
{
ds_destroy (&put_tokstr);
ds_destroy (&tokstr);
{
ds_destroy (&put_tokstr);
ds_destroy (&tokstr);
+ ds_destroy (&line_buffer);
}
\f
}
\f
@@
-700,7
+708,13
@@
lex_put_back_id (const char *id)
const char *
lex_entire_line (void)
{
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
}
/* As lex_entire_line(), but only returns the part of the current line
@@
-720,18
+734,12
@@
lex_rest_of_line (int *end_dot)
void
lex_discard_line (void)
{
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;
}
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
/* Discards the rest of the current command.
When we're reading commands from a file, we skip tokens until
@@
-802,16
+810,24
@@
strip_comments (struct string *string)
}
}
}
}
+/* 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)
{
/* 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;
bool interactive;
- if (!
getl_read_line (
&interactive))
+ if (!
lex_read_line (line,
&interactive))
return false;
strip_comments (line);
return false;
strip_comments (line);
@@
-976,7
+992,8
@@
lex_skip_comment (void)
if (put_token == '.')
break;
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;
}
if (dot)
break;
}
diff --git
a/src/language/lexer/lexer.h
b/src/language/lexer/lexer.h
index 2ffd01c3e26a57f081bec67d7e53b1e9876a0a6a..c367bbb116b776281f693a706da2657f27734cba 100644
(file)
--- a/
src/language/lexer/lexer.h
+++ b/
src/language/lexer/lexer.h
@@
-35,7
+35,7
@@
extern struct string tokstr;
#include <stddef.h>
/* Initialization. */
#include <stddef.h>
/* Initialization. */
-void lex_init (
void
);
+void lex_init (
bool (*)(struct string *, bool*)
);
void lex_done (void);
/* Common functions. */
void lex_done (void);
/* Common functions. */
@@
-71,13
+71,14
@@
void lex_put_back_id (const char *tokid);
/* Weird line processing functions. */
const char *lex_entire_line (void);
/* 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);
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);
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);
/* Token names. */
const char *lex_token_name (int);
diff --git
a/src/language/line-buffer.c
b/src/language/line-buffer.c
index 146ca00a92847e93d5179a85a8180fa53f1946c2..0dcb70f94952bab00fdd98cf09db83f02d729d6e 100644
(file)
--- a/
src/language/line-buffer.c
+++ b/
src/language/line-buffer.c
@@
-98,7
+98,6
@@
static struct getl_source *last_source;
static struct string getl_include_path;
static struct string getl_include_path;
-struct string getl_buf;
static void close_source (void);
static void close_source (void);
@@
-106,16
+105,17
@@
static void init_prompts (void);
static void uninit_prompts (void);
static enum getl_prompt_style get_prompt_style (void);
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));
/* 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 ();
}
init_prompts ();
}
+
/* Delete everything from the include path. */
void
getl_clear_include_path (void)
/* Delete everything from the include path. */
void
getl_clear_include_path (void)
@@
-387,7
+387,6
@@
getl_uninitialize (void)
{
while (cur_source != NULL)
close_source ();
{
while (cur_source != NULL)
close_source ();
- ds_destroy (&getl_buf);
ds_destroy (&getl_include_path);
free(file_loc);
file_loc = NULL;
ds_destroy (&getl_include_path);
free(file_loc);
file_loc = NULL;
@@
-502,7
+501,7
@@
read_line_from_source (struct string *line, struct getl_source *s)
If INTERACTIVE is non-null, then when true is returned
*INTERACTIVE will be set to true if the line was obtained
interactively, false otherwise. */
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)
do_read_line (struct string *line, bool *interactive)
{
while (cur_source != NULL)
@@
-525,16
+524,6
@@
do_read_line (struct string *line, bool *interactive)
return false;
}
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);
-}
\f
/* Current prompts in each style. */
static char *prompts[GETL_PROMPT_CNT];
\f
/* Current prompts in each style. */
static char *prompts[GETL_PROMPT_CNT];
diff --git
a/src/language/line-buffer.h
b/src/language/line-buffer.h
index 25845ca836d03cd957f806fcf000aecfbdecf50b..ee3db55905f1507c7e8807a902164533d82deed4 100644
(file)
--- a/
src/language/line-buffer.h
+++ b/
src/language/line-buffer.h
@@
-31,9
+31,6
@@
enum getl_prompt_style
GETL_PROMPT_CNT
};
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);
void getl_initialize (void);
void getl_uninitialize (void);
@@
-66,5
+63,7
@@
void get_msg_location (struct msg_locator *loc);
void getl_location (const char **fn, int *ln);
void getl_location (const char **fn, int *ln);
+bool do_read_line (struct string *line, bool *interactive);
+
#endif /* line-buffer.h */
#endif /* line-buffer.h */
diff --git
a/src/ui/terminal/main.c
b/src/ui/terminal/main.c
index 6a861b70265c28588245add320a3398cea97d30c..6a7decd9d95d77192488ba0ba66ea8a2b0266154 100644
(file)
--- a/
src/ui/terminal/main.c
+++ b/
src/ui/terminal/main.c
@@
-100,7
+100,7
@@
main (int argc, char **argv)
if (parse_command_line (argc, argv))
{
outp_read_devices ();
if (parse_command_line (argc, argv))
{
outp_read_devices ();
- lex_init ();
+ lex_init (
do_read_line
);
for (;;)
{
for (;;)
{
diff --git
a/tests/command/do-repeat.sh
b/tests/command/do-repeat.sh
index 990704fe7c22d96f105a61dca201ee572075ba06..0a702633c120c070897a37ab812347484ff160e1 100755
(executable)
--- a/
tests/command/do-repeat.sh
+++ b/
tests/command/do-repeat.sh
@@
-66,9
+66,9
@@
END REPEAT.
VECTOR v(6).
COMPUTE #idx = 0.
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.
COMPUTE #idx = #idx + 1.
COMPUTE v(#idx) = #x.
END REPEAT.
@@
-80,7
+80,7
@@
EOF
if [ $? -ne 0 ] ; then no_result ; fi
activity="run program"
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"
if [ $? -ne 0 ] ; then no_result ; fi
activity="compare results"