projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
render: Add comment.
[pspp]
/
src
/
language
/
lexer
/
value-parser.c
diff --git
a/src/language/lexer/value-parser.c
b/src/language/lexer/value-parser.c
index 39f5eb68a9ffc6c881db6e83d99b00b8e5dc8ff5..55707f6ac576f9f82aba8b390f4b58a34947c3dc 100644
(file)
--- a/
src/language/lexer/value-parser.c
+++ b/
src/language/lexer/value-parser.c
@@
-79,7
+79,7
@@
parse_num_range (struct lexer *lexer,
{
if (*x == LOWEST)
{
{
if (*x == LOWEST)
{
- msg (SE, _("%s or %s must be part of a range."), "LO", "LOWE
E
ST");
+ msg (SE, _("%s or %s must be part of a range."), "LO", "LOWEST");
return false;
}
*y = *x;
return false;
}
*y = *x;
@@
-96,13
+96,7
@@
parse_num_range (struct lexer *lexer,
static bool
parse_number (struct lexer *lexer, double *x, const enum fmt_type *format)
{
static bool
parse_number (struct lexer *lexer, double *x, const enum fmt_type *format)
{
- if (lex_is_number (lexer))
- {
- *x = lex_number (lexer);
- lex_get (lexer);
- return true;
- }
- else if (lex_is_string (lexer) && format != NULL)
+ if (lex_is_string (lexer) && format != NULL)
{
union value v;
{
union value v;
@@
-120,14
+114,15
@@
parse_number (struct lexer *lexer, double *x, const enum fmt_type *format)
}
return true;
}
}
return true;
}
- else
+
+ if (lex_force_num (lexer))
{
{
- if (format != NULL)
- lex_error (lexer, _("expecting number or data string"));
- else
- lex_force_num (lexer);
- return false;
+ *x = lex_number (lexer);
+ lex_get (lexer);
+ return true;
}
}
+
+ return false;
}
/* Parses the current token from LEXER into value V, which must already have
}
/* Parses the current token from LEXER into value V, which must already have