grammar
[]struct{...}grammar is the token table, each row paired with a subject that exercises it.
- OID
- 00fe0e…4314:4
grammar details
modes
[]struct{...}modes is the pair of subjects that separate the two modes. Each row is run through both matchers, and the two columns disagree on purpose.
- OID
- 00fe0e…4314:12
modes details
allow
[]stringallow is the worked allowlist: what a realm would store to decide which package paths a delegated key may call.
- OID
- 00fe0e…4314:19
allow details
subjects
[]stringsubjects are the paths the allowlist is asked about. The last two are the point of the whole table: both pass a naive strings.HasPrefix check against the rules above, and neither is inside them.
- OID
- 00fe0e…4314:21
subjects details
patterns
[]stringpatterns is the validity table: three well-formed, three typos.
- OID
- 00fe0e…4314:23
patterns details
Render
func(path string) stringRender renders the demo for gnoweb. Render("") / Render("/") -> the full demo
- OID
- 00fe0e…4314:24
Render details
bomb
untyped stringbomb is the pattern that makes a recursive matcher blow up. Kept as a constant so the two rows of the last table cannot drift apart.
Value
"a*a*a*a*a*a*b"
naivePrefix
func(path string) boolnaivePrefix is the wrong implementation, kept so the page can show it being wrong rather than assert it. It is what an allowlist looks like before somebody notices that a prefix does not know where a segment ends.
- OID
- 00fe0e…4314:26
naivePrefix details
verdict
func(ok bool) stringverdict renders a boolean as a symbol, so a column of them reads at a glance.
- OID
- 00fe0e…4314:27
verdict details
code
func(s string) stringcode wraps s in a markdown code span. A pipe is escaped rather than passed to ui.Cell: inside a code span CommonMark performs no backslash escapes, so ui.Cell's output would render its own backslashes literally. Nothing on this page contains a pipe today, and the escape is here so that adding a pattern with one does not silently open a column.
- OID
- 00fe0e…4314:28