projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
q2c: Prefer lex_match_id() over lex_match_hyphenated_word() in emitted code.
[pspp-builds.git]
/
src
/
language
/
command.c
diff --git
a/src/language/command.c
b/src/language/command.c
index 80df91432962506524e4509c8f8fb71b7bf1abdb..3bf9571fa5a4065537ce1225a01fb42a1ff49559 100644
(file)
--- a/
src/language/command.c
+++ b/
src/language/command.c
@@
-173,7
+173,7
@@
do_parse_command (struct lexer *lexer,
result = CMD_EOF;
goto finish;
}
result = CMD_EOF;
goto finish;
}
- else if (lex_token (lexer) ==
'.'
)
+ else if (lex_token (lexer) ==
T_ENDCMD
)
{
/* Null commands can result from extra empty lines. */
result = CMD_SUCCESS;
{
/* Null commands can result from extra empty lines. */
result = CMD_SUCCESS;
@@
-270,8
+270,8
@@
parse_command_name (struct lexer *lexer)
struct string s;
if (lex_token (lexer) == T_EXP
struct string s;
if (lex_token (lexer) == T_EXP
- || lex_token (lexer) ==
'*'
- || lex_token (lexer) ==
'['
)
+ || lex_token (lexer) ==
T_ASTERISK
+ || lex_token (lexer) ==
T_LBRACK
)
{
static const struct command c = { S_ANY, 0, "COMMENT", cmd_comment };
return &c;
{
static const struct command c = { S_ANY, 0, "COMMENT", cmd_comment };
return &c;
@@
-282,13
+282,13
@@
parse_command_name (struct lexer *lexer)
ds_init_empty (&s);
for (;;)
{
ds_init_empty (&s);
for (;;)
{
- if (lex_token (lexer) ==
'-'
)
+ if (lex_token (lexer) ==
T_DASH
)
ds_put_byte (&s, '-');
else if (lex_token (lexer) == T_ID)
{
if (!ds_is_empty (&s) && ds_last (&s) != '-')
ds_put_byte (&s, ' ');
ds_put_byte (&s, '-');
else if (lex_token (lexer) == T_ID)
{
if (!ds_is_empty (&s) && ds_last (&s) != '-')
ds_put_byte (&s, ' ');
- ds_put_cstr (&s, lex_tok
id
(lexer));
+ ds_put_cstr (&s, lex_tok
cstr
(lexer));
}
else if (lex_is_integer (lexer) && lex_integer (lexer) >= 0)
{
}
else if (lex_is_integer (lexer) && lex_integer (lexer) >= 0)
{
@@
-510,14
+510,14
@@
cmd_erase (struct lexer *lexer, struct dataset *ds UNUSED)
if (!lex_force_match_id (lexer, "FILE"))
return CMD_FAILURE;
if (!lex_force_match_id (lexer, "FILE"))
return CMD_FAILURE;
- lex_match (lexer,
'='
);
+ lex_match (lexer,
T_EQUALS
);
if (!lex_force_string (lexer))
return CMD_FAILURE;
if (!lex_force_string (lexer))
return CMD_FAILURE;
- if (remove (
ds_cstr (lex_tokstr (lexer)
)) == -1)
+ if (remove (
lex_tokcstr (lexer
)) == -1)
{
msg (SW, _("Error removing `%s': %s."),
{
msg (SW, _("Error removing `%s': %s."),
-
ds_cstr (lex_tokstr (lexer)
), strerror (errno));
+
lex_tokcstr (lexer
), strerror (errno));
return CMD_FAILURE;
}
return CMD_FAILURE;
}