Skip to content

Commit

Permalink
Fix registry.dtd to not use alternatives in function, formatSignature…
Browse files Browse the repository at this point in the history
…, matchSignature

A spin-off from unicode-org#420, in which @mihnita noticed that `registry.dtd` uses alternatives in a wrong way. For example, `<!ELEMENT formatSignature (input?|option*)>` means that `formatSignature` is allowed to have as children either: at most one `input` OR any number of `options`, but not both.

Instead, @mihnita suggested using sequences: `<!ELEMENT formatSignature (input?,option*)>`, which this PR does. Note that sequences require the children to appear in a specific order, which isn't something that's useful to us. However, I'm not aware of any way of lifting this requirement that also allows to enforce at most on `input` or exactly one `description`.
  • Loading branch information
stasm committed Jul 23, 2023
1 parent 45be5e9 commit 8af9999
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/registry.dtd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!ELEMENT registry (function*|pattern*)>
<!ELEMENT registry (function|pattern)*>

<!ELEMENT function (description|(formatSignature|matchSignature)+)>
<!ELEMENT function (description,(formatSignature|matchSignature)+)>
<!ATTLIST function name NMTOKEN #REQUIRED>

<!ELEMENT description (#PCDATA)>
Expand All @@ -9,11 +9,11 @@
<!ATTLIST pattern id ID #REQUIRED>
<!ATTLIST pattern regex CDATA #REQUIRED>

<!ELEMENT formatSignature (input?|option*)>
<!ELEMENT formatSignature (input?,option*)>
<!ATTLIST formatSignature position (open|close|standalone) "standalone">
<!ATTLIST formatSignature locales NMTOKENS #IMPLIED>

<!ELEMENT matchSignature (input?|option*|match*)>
<!ELEMENT matchSignature (input?,option*,match*)>
<!ATTLIST matchSignature locales NMTOKENS #IMPLIED>

<!ELEMENT input EMPTY>
Expand Down

0 comments on commit 8af9999

Please sign in to comment.