From a32a61813ebaecf0c1e69fd1481bf09d8c8b1420 Mon Sep 17 00:00:00 2001
From: Eugen Wissner <belka@caraus.de>
Date: Tue, 14 Jul 2026 18:08:44 +0200
Subject: Support more floating point literals

---
 doc/language.tex | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

(limited to 'doc/language.tex')

diff --git a/doc/language.tex b/doc/language.tex
index 04f8613..b7b8d9d 100644
--- a/doc/language.tex
+++ b/doc/language.tex
@@ -51,9 +51,10 @@ preceded by a prefix and followed by a suffix. The prefixes \verb|0x| and
 indicate binary representation. Unsigned integers have the suffix \verb|u|,
 signed integers have no suffix.
 
-A \textit{real number} always contains a decimal point. Optionally it may
-also contain a decimal scale factor. The letters \verb|e| or \verb|E| is
-pronounced as `times ten to the power of'.
+A \textit{real number} contains either a decimal point, or a scale factor,
+or both. A decimal point must be followed by at least one digit. The letter
+\verb|e| (or \verb|E|) introduces the scale factor and is pronounced
+``times ten to the power of''.
 
 \begin{grammar}
 <integer-literal> = `0' | <counting-digit> \{<decimal-digit>\}.
@@ -62,8 +63,11 @@ pronounced as `times ten to the power of'.
 	\alt{} `0' (`X' | `x') <hex-digit> \{<hex-digit>\}
 	\alt{} `0' (`B' | `b') <binary-digit> \{<binary-digit>\}.
 
+<scale-factor> = (`e' | `E') [`+' | `-'] <decimal-digit> \{<decimal-digit>\}.
+
 <real-literal> = <integer-literal> `.\@' <decimal-digit> \{<decimal-digit>\}
-	\alt{} <integer-literal>\} `e' [`+' | `-'] <decimal-digit> \{<decimal-digit>\}.
+		[<scale-factor>]
+	\alt{} <integer-literal> <scale-factor>.
 \end{grammar}
 
 Examples:
-- 
cgit v1.2.3

