textbookPatterns
[]stringFixed inputs, never chain state: a demo whose output moves with the block height cannot be pinned by an example test.
- OID
- 068320…e118:4
textbookPatterns details
textbookText
stringFixed inputs, never chain state: a demo whose output moves with the block height cannot be pinned by an example test.
Value
"ushers"
dictPatterns
[]stringFixed inputs, never chain state: a demo whose output moves with the block height cannot be pinned by an example test.
- OID
- 068320…e118:7
dictPatterns details
sentence
stringFixed 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.MatcherFixed inputs, never chain state: a demo whose output moves with the block height cannot be pinned by an example test.
- OID
- 068320…e118:10
textbook details
dict
*v0.MatcherFixed inputs, never chain state: a demo whose output moves with the block height cannot be pinned by an example test.
- OID
- 068320…e118:45
dict details
Render
func(path string) stringRender renders the demo for gnoweb. Render("") / Render("/") -> the textbook automaton and the sentence scan Render("/<text>") -> scan that text with the same dictionary
- OID
- 068320…e118:99
Render details
renderScan
func(arg string) stringrenderScan 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.
- OID
- 068320…e118:101
renderScan details
matchTable
func(m *v0.Matcher, text string) stringmatchTable 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.
- OID
- 068320…e118:102
matchTable details
stats
func(m *v0.Matcher, text string) stringstats says what the pass actually cost, which is the whole claim: the text is read once whatever the dictionary holds.
- OID
- 068320…e118:103
stats details
list
func(patterns []string) stringlist renders a pattern set as code spans. The patterns are this file's own constants, never the caller's.
- OID
- 068320…e118:104
list details
parseArg
func(path string) stringparseArg 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.
- OID
- 068320…e118:105