From 662917ce0be963665aaf6f17a33941f1f8674fcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Thu, 17 Apr 2025 11:52:14 -0700 Subject: [PATCH] Update draft-marchan-kdl2.md Co-authored-by: Tab Atkins Jr. --- draft-marchan-kdl2.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/draft-marchan-kdl2.md b/draft-marchan-kdl2.md index 9c19b6e..0bfea57 100644 --- a/draft-marchan-kdl2.md +++ b/draft-marchan-kdl2.md @@ -272,6 +272,16 @@ annotation as a "suffix", instead of prepending it between `(` and `)`. This makes it possible to, for example, write `10px`, `10.5%`, `512GiB`, etc., which are equivalent to `(px)10`, `(%)5`, and `(GiB)512`, respectively. +Most suffixes can be appended directly to the number +(a ({{bare-suffix-type-annotation}})), +as shown in the previous paragraph. +To avoid parsing ambiguity, there are some restrictions on this; +an ({{explicit-suffix-type-annotation}}) avoids all these restrictions +by using an additional `#` to explicitly indicate it. +For example, `10.0u8` is invalid, but `10.0#u8` is valid +and equivalent to `(u8)10.0`. +See the "Bare Suffix Type Annotation" section for the full list of restrictions. + An implementation that finds BOTH a parenthesized and a suffix ({{type-annotation}}) on the same ({{number}}) MUST yield a syntax error.