Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

v0 state

Back to all declarations

grammar

[]struct{...} (len=6)

grammar is the token table, each row paired with a subject that exercises it.

Open
OID
00fe0e…4314:4
grammar details (len=6)

+6 more Inspect slice

modes

[]struct{...} (len=5)

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.

Open
OID
00fe0e…4314:12
modes details (len=5)

+5 more Inspect slice

allow

[]string (len=2)

allow is the worked allowlist: what a realm would store to decide which package paths a delegated key may call.

Open
OID
00fe0e…4314:19
allow details (len=2)

+2 more Inspect slice

subjects

[]string (len=6)

subjects 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.

Open
OID
00fe0e…4314:21
subjects details (len=6)

+6 more Inspect slice

patterns

[]string (len=6)

patterns is the validity table: three well-formed, three typos.

Open
OID
00fe0e…4314:23
patterns details (len=6)

+6 more Inspect slice

Render

func(path string) string

Render renders the demo for gnoweb. Render("") / Render("/") -> the full demo

Open
OID
00fe0e…4314:24
Render details

Inspect func

bomb

untyped string

bomb 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) bool

naivePrefix 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.

Open
OID
00fe0e…4314:26
naivePrefix details

Inspect func

verdict

func(ok bool) string

verdict renders a boolean as a symbol, so a column of them reads at a glance.

Open
OID
00fe0e…4314:27
verdict details

Inspect func

code

func(s string) string

code 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.

Open
OID
00fe0e…4314:28
code details

Inspect func
grammar : []struct{...} (len=6) Inspect
modes : []struct{...} (len=5) Inspect
allow : []string (len=2) Inspect
subjects : []string (len=6) Inspect
patterns : []string (len=6) Inspect
Render : func(path string) string Inspect
bomb : untyped string ="a*a*a*a*a*a*b"
naivePrefix : func(path string) bool Inspect
verdict : func(ok bool) string Inspect
code : func(s string) string Inspect