Skip to content Search Apps Documentation Source Content 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

textbookPatterns

[]string (len=4)

Fixed inputs, never chain state: a demo whose output moves with the block height cannot be pinned by an example test.

Open
OID
068320…e118:4
textbookPatterns details (len=4)

+4 more Inspect slice

textbookText

string

Fixed inputs, never chain state: a demo whose output moves with the block height cannot be pinned by an example test.

Value

"ushers"

dictPatterns

[]string (len=5)

Fixed inputs, never chain state: a demo whose output moves with the block height cannot be pinned by an example test.

Open
OID
068320…e118:7
dictPatterns details (len=5)

+5 more Inspect slice

sentence

string

Fixed inputs, never chain state: a demo whose output moves with the block height cannot be pinned by an example test.

Value

"the quick brown fox jumps over the lazy dog"

textbook

*v0.Matcher

Fixed inputs, never chain state: a demo whose output moves with the block height cannot be pinned by an example test.

Open
OID
068320…e118:10
textbook details

Inspect pointer

dict

*v0.Matcher

Fixed inputs, never chain state: a demo whose output moves with the block height cannot be pinned by an example test.

Open
OID
068320…e118:45
dict details

Inspect pointer

Render

func(path string) string

Render renders the demo for gnoweb. Render("") / Render("/") -> the textbook automaton and the sentence scan Render("/<text>") -> scan that text with the same dictionary

Open
OID
068320…e118:99
Render details

Inspect func

renderScan

func(arg string) string

renderScan scans the visitor's text with the sentence dictionary. The argument is the visitor's text and it is shown inside a code span, so it goes through md.InlineCode and not ui.Cell: a cell escaper backslashes a backtick, and a backslash does not close a backtick inside a span. Only a fence wider than anything in the argument does, which is what md.InlineCode picks. The table itself only ever holds offsets and dictionary words, never a slice of the argument.

Open
OID
068320…e118:101
renderScan details

Inspect func

matchTable

func(m *v0.Matcher, text string) string

matchTable renders every match as offsets plus the pattern that matched. It never echoes a slice of the scanned text: the pattern is already the matched bytes, and it comes from the fixed dictionary rather than from the caller.

Open
OID
068320…e118:102
matchTable details

Inspect func

stats

func(m *v0.Matcher, text string) string

stats says what the pass actually cost, which is the whole claim: the text is read once whatever the dictionary holds.

Open
OID
068320…e118:103
stats details

Inspect func

list

func(patterns []string) string

list renders a pattern set as code spans. The patterns are this file's own constants, never the caller's.

Open
OID
068320…e118:104
list details

Inspect func

parseArg

func(path string) string

parseArg takes the one routing slash off and nothing else. It does not cut at a later slash and it does not trim: a page that offers to scan what the caller typed either scans that string or says it found nothing, and never quietly substitutes a shorter or tidier one.

Open
OID
068320…e118:105
parseArg details

Inspect func
textbookPatterns : []string (len=4) Inspect
textbookText : string ="ushers"
dictPatterns : []string (len=5) Inspect
sentence : string ="the quick brown fox jumps over the lazy dog"
textbook : *v0.Matcher Inspect
dict : *v0.Matcher Inspect
Render : func(path string) string Inspect
renderScan : func(arg string) string Inspect
matchTable : func(m *v0.Matcher, text string) string Inspect
stats : func(m *v0.Matcher, text string) string Inspect
list : func(patterns []string) string Inspect
parseArg : func(path string) string Inspect