align prose text on initial identifier characters with grammar

This commit is contained in:
Bram Gotink 2025-01-05 13:28:23 +01:00
parent 757eb5517a
commit 53d795021d
No known key found for this signature in database
1 changed files with 11 additions and 4 deletions

15
SPEC.md
View File

@ -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