Skip to content

Commit 01679c8

Browse files
committed
BIP88: clarifications, mistype fixes
1 parent 3d9a359 commit 01679c8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

bip-0088.mediawiki

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,17 @@ installation of malicious or incorrect profiles, though.
9191

9292
The format for the template was choosen to make it easy to read, convenient and visually unambigous.
9393

94-
Template starts with optional prefix "m/", and then one or more sections delimited by the slash character ("/").
94+
Template starts with optional prefix "m/", and then one or more sections delimited by the slash character (<code>/</code>).
9595

9696
Implementations MAY limit the maximum number of sections.
9797

98-
Each section consists of ''index template'', optionally followed by the hardened marker: either an apostrophe ("'") or letter "h".
98+
Each section consists of ''index template'', optionally followed by the hardened marker: either an apostrophe (<code>'</code>) or letter "h".
9999

100100
Index template can be:
101101

102102
* An integer value from 0 to 2147483647 ("Unit index template")
103103
* A single "*" character, which denotes any value from 0 to 2147483647 ("Wildcard index template")
104-
* The <nowiki>"{"</nowiki> character, followed by a number of ''index ranges'' delimited by commas (","), followed by <nowiki>"}"</nowiki> character ("Ranged index template")
104+
* The <nowiki>"{"</nowiki> character, followed by a number of ''index ranges'' delimited by commas (<code>,</code>), followed by <nowiki>"}"</nowiki> character ("Ranged index template")
105105
106106
Implementations MAY limit the maximum number of index ranges within the Ranged index template.
107107

@@ -125,12 +125,12 @@ Constraints:
125125
# To avoid ambiguity, whitespace MUST NOT appear within the path template.
126126
# Commas within the Ranged index template MUST only appear in between index ranges.
127127
# To avoid ambiguity, an index range that matches a single value MUST be specified as Unit range.
128-
# To avoid ambiguity, an index template that matches any value from 0 to 2147483647 MUST be specified as Wildcard index template
128+
# To avoid ambiguity, an index range <code>0-2147483647</code> is not allowed, and MUST be specified as Wildcard index template instead
129129
# For Non-unit range, range_end MUST be larger than range_start.
130130
# If there is more than one index range within the Ranged index template, range_start of the second and any subsequent range MUST be larger than the range_end of the preceeding range.
131131
# To avoid ambiguity, all representations of integer values larger than 0 MUST NOT start with character "0" (no leading zeroes allowed).
132132
# If hardened marker appears within any section in the path template, all preceding sections MUST also specify hardened matching.
133-
# To avoid ambiguity, if a hardened marker appears within any section in the path template, all preceding sections MUST also use the same hardened marker (either "h" or "'").
133+
# To avoid ambiguity, if a hardened marker appears within any section in the path template, all preceding sections MUST also use the same hardened marker (either <code>h</code> or <code>'</code>).
134134
# To avoid ambiguity, trailing slashes (for example, "1/2/") and duplicate slashes (for example, "0//1") MUST NOT appear in the template.
135135
136136
It may be desireable to have fully unambiguous encoding, where for each valid path template string, there is no other valid template string that matches the exact same set of paths. This would enable someone to compare templates for equality through a simple string equality check, without any parsing.
@@ -139,7 +139,7 @@ To achieve this, two extra rules are needed:
139139

140140
* Within Ranged index template, subsequent range MUST NOT start with the value that is equal to the end of the previous range plus one. Thus, <nowiki>"{1,2,3-5}"</nowiki> is not allowed, and should be specified as <nowiki>"{1-5}"</nowiki> instead. This rule might make templates less convenient for frequent edits, though.
141141
142-
* Only one type of hardened marker should be allowed (either "h" or "'").
142+
* Only one type of hardened marker should be allowed (either <code>h</code> or <code>'</code>).
143143
144144
Instead of requiring the second extra rule, implementations can simply replace one type of marker with another in the template strings before comparing them.
145145

@@ -191,7 +191,7 @@ The specification can be used with TLC checker and accompanying script to genera
191191

192192
While the formal specification specifies an FSM, which would be convenient for implementation without access to rich string handling facilities, when such facilities are available, the implementation might use the whole-string deconstruction approach where the templates are first split into sections, then sections are split into index templates, and then each index template are parsed individually.
193193

194-
A FSM-based approach can be made close to the formal specification, though, and the test data generated with TLC checker would give much better coverage for a FSM based implementation. If the template string contains several errors, an implementation that uses deconstruction apporach might detect some of these errors earlier than FSM-based implementation, and vise versa.
194+
A FSM-based approach can be made close to the formal specification, though, and the test data generated with TLC checker would give much better coverage for a FSM based implementation. If the template string contains several errors, an implementation that uses deconstruction approach might detect some of these errors earlier than FSM-based implementation, and vise versa.
195195

196196
At the moment, three implementations exist:
197197

0 commit comments

Comments
 (0)