diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-06-01 12:36:44 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-06-01 12:53:26 +0200 |
commit | d99604749d658f5f344d53e77dd52fbb0f6d176c (patch) | |
tree | 2e60555dc4ce9e81b42b7556dd2e2491473f776c /include | |
parent | 9efbe183d7805eb60652a3745ec48cd32682ef8d (diff) |
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 <jo@mein.io>
Diffstat (limited to 'include')
-rw-r--r-- | include/ucode/vallist.h | 1 |
1 files changed, 1 insertions, 0 deletions
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); |