Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from mirage/documentation
Browse files Browse the repository at this point in the history
Add an internal documentation about ldh-str token
dinosaure authored Jul 26, 2021
2 parents 097cb19 + 916ecf7 commit d9ff80c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/domain.ml
Original file line number Diff line number Diff line change
@@ -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) <> '-'

0 comments on commit d9ff80c

Please sign in to comment.