projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Consolidate quoting style in printed strings.
[pspp]
/
src
/
language
/
lexer
/
lexer.c
diff --git
a/src/language/lexer/lexer.c
b/src/language/lexer/lexer.c
index 8b3f2a48d00474811a09c090f8a82d1b75ed7546..9b879c71ec5d57484bb4105a0540e6db2b6b11d9 100644
(file)
--- a/
src/language/lexer/lexer.c
+++ b/
src/language/lexer/lexer.c
@@
-32,6
+32,7
@@
#include <libpspp/getl.h>
#include <libpspp/str.h>
#include <output/journal.h>
#include <libpspp/getl.h>
#include <libpspp/str.h>
#include <output/journal.h>
+#include <output/text-item.h>
#include "xalloc.h"
#include "xalloc.h"
@@
-175,19
+176,19
@@
lex_get (struct lexer *lexer)
return;
}
return;
}
- /* If a token was pushed ahead, return it. */
- if (lexer->put_token)
- {
- restore_token (lexer);
+
/* If a token was pushed ahead, return it. */
+
if (lexer->put_token)
+
{
+
restore_token (lexer);
#if DUMP_TOKENS
dump_token (lexer);
#endif
#if DUMP_TOKENS
dump_token (lexer);
#endif
- return;
- }
+
return;
+
}
- for (;;)
- {
- /* Skip whitespace. */
+
for (;;)
+
{
+
/* Skip whitespace. */
while (c_isspace ((unsigned char) *lexer->prog))
lexer->prog++;
while (c_isspace ((unsigned char) *lexer->prog))
lexer->prog++;
@@
-873,16
+874,16
@@
lex_preprocess_line (struct string *line,
}
}
}
}
-/* Reads a line, without performing any preprocessing.
- Sets *SYNTAX, if SYNTAX is non-null, to the line's syntax
- mode. */
+/* Reads a line, without performing any preprocessing. */
bool
lex_get_line_raw (struct lexer *lexer)
{
bool ok = getl_read_line (lexer->ss, &lexer->line_buffer);
bool
lex_get_line_raw (struct lexer *lexer)
{
bool ok = getl_read_line (lexer->ss, &lexer->line_buffer);
- enum syntax_mode mode = lex_current_syntax_mode (lexer);
- journal_write (mode == GETL_BATCH, ds_cstr (&lexer->line_buffer));
-
+ if (ok)
+ {
+ const char *line = ds_cstr (&lexer->line_buffer);
+ text_item_submit (text_item_create (TEXT_ITEM_SYNTAX, line));
+ }
return ok;
}
return ok;
}
@@
-1217,13
+1218,6
@@
finish:
if (type != CHARACTER_STRING)
convert_numeric_string_to_char_string (lexer, type);
if (type != CHARACTER_STRING)
convert_numeric_string_to_char_string (lexer, type);
- if (ds_length (&lexer->tokstr) > 255)
- {
- msg (SE, _("String exceeds 255 characters in length (%zu characters)."),
- ds_length (&lexer->tokstr));
- ds_truncate (&lexer->tokstr, 255);
- }
-
return T_STRING;
}
\f
return T_STRING;
}
\f
@@
-1255,7
+1249,7
@@
dump_token (struct lexer *lexer)
break;
case T_STRING:
break;
case T_STRING:
- fprintf (stderr, "STRING\t
\"%s\"
\n", ds_cstr (&lexer->tokstr));
+ fprintf (stderr, "STRING\t
`%s'
\n", ds_cstr (&lexer->tokstr));
break;
case T_STOP:
break;
case T_STOP: