aboutsummaryrefslogtreecommitdiff
path: root/include/lex.h
diff options
context:
space:
mode:
authorStefan Eßer <se@FreeBSD.org>2020-07-07 07:02:33 +0000
committerStefan Eßer <se@FreeBSD.org>2020-07-07 07:02:33 +0000
commit3960d8924a1a0ba2f0f5e8510e73a10ee20d726b (patch)
tree068fa33f5b47453a5521c0ff1b2b613ff8a3452c /include/lex.h
parent1f958cfad78842ab9a1193471589231e25596cb3 (diff)
downloadsrc-3960d8924a1a0ba2f0f5e8510e73a10ee20d726b.tar.gz
src-3960d8924a1a0ba2f0f5e8510e73a10ee20d726b.zip
Update to release 3.1.1vendor/bc/3.1.1
This release fixes a regression from traditional bc behavior in FreeBSD with regard to "-e quit" being passed on the command line and add Spanish message catalogs.
Notes
Notes: svn path=/vendor/bc/dist/; revision=362984 svn path=/vendor/bc/3.1.1/; revision=362985; tag=vendor/bc/3.1.1
Diffstat (limited to 'include/lex.h')
-rw-r--r--include/lex.h35
1 files changed, 25 insertions, 10 deletions
diff --git a/include/lex.h b/include/lex.h
index fcc30ae53b9a..68b72a7f59bb 100644
--- a/include/lex.h
+++ b/include/lex.h
@@ -1,9 +1,9 @@
/*
* *****************************************************************************
*
- * Copyright (c) 2018-2020 Gavin D. Howard and contributors.
+ * SPDX-License-Identifier: BSD-2-Clause
*
- * All rights reserved.
+ * Copyright (c) 2018-2020 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -46,8 +46,23 @@
#define bc_lex_err(l, e) (bc_vm_error((e), (l)->line))
#define bc_lex_verr(l, e, ...) (bc_vm_error((e), (l)->line, __VA_ARGS__))
+#if BC_ENABLED
+
+#if DC_ENABLED
#define BC_LEX_NEG_CHAR (BC_IS_BC ? '-' : '_')
#define BC_LEX_LAST_NUM_CHAR (BC_IS_BC ? 'Z' : 'F')
+#else // DC_ENABLED
+#define BC_LEX_NEG_CHAR ('-')
+#define BC_LEX_LAST_NUM_CHAR ('Z')
+#endif // DC_ENABLED
+
+#else // BC_ENABLED
+
+#define BC_LEX_NEG_CHAR ('_')
+#define BC_LEX_LAST_NUM_CHAR ('F')
+
+#endif // BC_ENABLED
+
#define BC_LEX_NUM_CHAR(c, pt, int_only) \
(isdigit(c) || ((c) >= 'A' && (c) <= BC_LEX_LAST_NUM_CHAR) || \
((c) == '.' && !(pt) && !(int_only)))
@@ -142,27 +157,27 @@ typedef enum BcLexType {
BC_LEX_KW_IBASE,
BC_LEX_KW_OBASE,
BC_LEX_KW_SCALE,
-#if BC_ENABLE_EXTRA_MATH
+#if BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND
BC_LEX_KW_SEED,
-#endif // BC_ENABLE_EXTRA_MATH
+#endif // BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND
BC_LEX_KW_LENGTH,
BC_LEX_KW_PRINT,
BC_LEX_KW_SQRT,
BC_LEX_KW_ABS,
-#if BC_ENABLE_EXTRA_MATH
+#if BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND
BC_LEX_KW_IRAND,
-#endif // BC_ENABLE_EXTRA_MATH
+#endif // BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND
BC_LEX_KW_QUIT,
BC_LEX_KW_READ,
-#if BC_ENABLE_EXTRA_MATH
+#if BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND
BC_LEX_KW_RAND,
-#endif // BC_ENABLE_EXTRA_MATH
+#endif // BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND
BC_LEX_KW_MAXIBASE,
BC_LEX_KW_MAXOBASE,
BC_LEX_KW_MAXSCALE,
-#if BC_ENABLE_EXTRA_MATH
+#if BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND
BC_LEX_KW_MAXRAND,
-#endif // BC_ENABLE_EXTRA_MATH
+#endif // BC_ENABLE_EXTRA_MATH && BC_ENABLE_RAND
BC_LEX_KW_ELSE,
#if DC_ENABLED