From d99604749d658f5f344d53e77dd52fbb0f6d176c Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 1 Jun 2022 12:36:44 +0200 Subject: syntax: adjust number literal parsing and string to number conversion - Recognize new number literal prefixes `0o` and `0O` for octal as well as `0b` and `0B` for binary number literals - Treat number literals with leading zeros as octal while parsing but as decimal ones on implicit number conversions, means `012` will yield `10` while `+"012"` or `"012" + 0` will yield `12` Signed-off-by: Jo-Philipp Wich --- include/ucode/vallist.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/ucode/vallist.h b/include/ucode/vallist.h index fb46677..3dc5720 100644 --- a/include/ucode/vallist.h +++ b/include/ucode/vallist.h @@ -34,6 +34,7 @@ typedef enum { } uc_value_type_t; uc_value_t *uc_number_parse(const char *buf, char **end); +uc_value_t *uc_number_parse_octal(const char *buf, char **end); bool uc_double_pack(double d, char *buf, bool little_endian); double uc_double_unpack(const char *buf, bool little_endian); -- cgit v1.2.3