From 916ecf72c54bb3eb4efd322a8a91a03c653b93a4 Mon Sep 17 00:00:00 2001 From: Romain Calascibetta Date: Mon, 26 Jul 2021 13:59:02 +0200 Subject: [PATCH] Add an internal documentation about ldh-str token --- src/domain.ml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/domain.ml b/src/domain.ml index ff40f0b..ce12e59 100644 --- a/src/domain.ml +++ b/src/domain.ml @@ -65,6 +65,12 @@ module Decoder = struct let let_dig = satisfy (is_alpha or is_digit) + (* XXX(dinosaure): Ldh-str = *( ALPHA / DIGIT / "-" ) Let-dig + * and Let-dig = ALPHA / DIGIT + * + * This [ldh_str] does not strictly follow the definition but just + * eats [*( ALPHA / DIGIT / "-" )] and check that the last character + * **is not** a dash. *) let ldh_str = take_while1 (is_alpha or is_digit or is_dash) >>= fun res -> if String.get res (String.length res - 1) <> '-'