From 53d795021de740ee8fb422af35dcc6235e3f95c3 Mon Sep 17 00:00:00 2001 From: Bram Gotink Date: Sun, 5 Jan 2025 13:28:23 +0100 Subject: [PATCH] align prose text on initial identifier characters with grammar --- SPEC.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/SPEC.md b/SPEC.md index 427b7bc..e6a2ffd 100644 --- a/SPEC.md +++ b/SPEC.md @@ -344,10 +344,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