02111-1307, USA. */
#include <config.h>
+#include "lexer.h"
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include "command.h"
#include "error.h"
#include "getline.h"
-#include "lexer.h"
#include "magic.h"
#include "settings.h"
#include "str.h"
-/*#define DUMP_TOKENS 1*/
+/*
+#define DUMP_TOKENS 1
+*/
\f
/* Global variables. */
}
}
+
/* Actually parse the token. */
cp = prog;
ds_clear (&tokstr);
assert (lex_integer_p ());
return tokval;
}
+/* Returns nonzero if the current token is an floating point. */
+int
+lex_double_p (void)
+{
+ return ( token == T_NUM
+ && tokval != NOT_DOUBLE );
+}
+
+/* Returns the value of the current token, which must be a
+ floating point number. */
+double
+lex_double (void)
+{
+ assert (lex_double_p ());
+ return tokval;
+}
+
\f
/* Token matching functions. */