From 20375a187e7434ec0eb4475497150ed2794540c1 Mon Sep 17 00:00:00 2001 From: Bram Gotink Date: Fri, 17 Jan 2025 18:54:19 +0100 Subject: [PATCH] align prose text on initial identifier characters with grammar (#464) --- SPEC.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/SPEC.md b/SPEC.md index 6db5d09..8f73c55 100644 --- a/SPEC.md +++ b/SPEC.md @@ -342,10 +342,17 @@ The following characters cannot be the first character in an * Any decimal digit (0-9) * Any [non-identifier characters](#non-identifier-characters) -Additionally, the `-` character can only be used as an initial character if -the second character is *not* a digit. This allows identifiers to look like -`--this`, and removes the ambiguity of having an identifier look like a -negative number. +Additionally, the following initial characters impose limitations on subsequent +characters: + +* the `+` and `-` characters can only be used as an initial character if + the second character is *not* a digit. If the second character is `.`, then + the third character must *not* be a digit. +* the `.` character can only be used as an initial character if + the second character is *not* a digit. + +This allows identifiers to look like `--this` or `.md`, and removes the +ambiguity of having an identifier look like a number. #### Non-identifier characters