summaryrefslogtreecommitdiff
path: root/include/lex.h
diff options
context:
space:
mode:
authorStefan Eßer <se@FreeBSD.org>2023-02-24 22:14:58 +0000
committerStefan Eßer <se@FreeBSD.org>2023-02-24 22:14:58 +0000
commit61e1a12bb6c3bfdb0a4e499c88e8eaa2b548e427 (patch)
tree86bf7579a17d0deeccf9d4a705c36eed3b1e3273 /include/lex.h
parentaaf1213c6f70af0b517f6aa13cd837d3468a7a0d (diff)
vendor/bc: import version 6.3.1vendor/bc/6.3.1
This version adds a command to dc to query whether extended registers are enabled or not.
Diffstat (limited to 'include/lex.h')
-rw-r--r--include/lex.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/include/lex.h b/include/lex.h
index 54d704f8b447..ac9b7b6ea69c 100644
--- a/include/lex.h
+++ b/include/lex.h
@@ -49,11 +49,11 @@
* @param l The lexer.
* @param e The error.
*/
-#ifndef NDEBUG
+#if BC_DEBUG
#define bc_lex_err(l, e) (bc_vm_handleError((e), __FILE__, __LINE__, (l)->line))
-#else // NDEBUG
+#else // BC_DEBUG
#define bc_lex_err(l, e) (bc_vm_handleError((e), (l)->line))
-#endif // NDEBUG
+#endif // BC_DEBUG
/**
* A convenience macro for throwing errors in lex code. This takes care of
@@ -61,12 +61,12 @@
* @param l The lexer.
* @param e The error.
*/
-#ifndef NDEBUG
+#if BC_DEBUG
#define bc_lex_verr(l, e, ...) \
(bc_vm_handleError((e), __FILE__, __LINE__, (l)->line, __VA_ARGS__))
-#else // NDEBUG
+#else // BC_DEBUG
#define bc_lex_verr(l, e, ...) (bc_vm_handleError((e), (l)->line, __VA_ARGS__))
-#endif // NDEBUG
+#endif // BC_DEBUG
// BC_LEX_NEG_CHAR returns the char that corresponds to negative for the
// current calculator.
@@ -409,6 +409,9 @@ typedef enum BcLexType
#if DC_ENABLED
+ /// dc extended registers keyword.
+ BC_LEX_EXTENDED_REGISTERS,
+
/// A special token for dc to calculate equal without a register.
BC_LEX_EQ_NO_REG,
@@ -533,7 +536,7 @@ void
bc_lex_init(BcLex* l);
/**
- * Frees a lexer. This is not guarded by #ifndef NDEBUG because a separate
+ * Frees a lexer. This is not guarded by #if BC_DEBUG because a separate
* parser is created at runtime to parse read() expressions and dc strings, and
* that parser needs a lexer.
* @param l The lexer to free.