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

selfPath

untyped string

selfPath is where this realm answers, used to build the try-it links.

Value

"/r/moul/x/daily/shuntingyarddemo/v0:"

worked

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

worked are the expressions on the root page. Each one is here because it groups in a way the naive left-to-right reading gets wrong.

Open
OID
053881…3dde:4
worked details (len=8)

+8 more Inspect slice

refused

[]string (len=7)

refused are the inputs worth showing precisely because nothing panics on them. A realm that renders a stored expression is one bad input away from a permanently broken page, and a public path cannot be redeployed.

Open
OID
053881…3dde:14
refused details (len=7)

+7 more Inspect slice

Render

func(path string) string

Render renders the demo for gnoweb. Render("") -> the demo page Render("?e=<expr>") -> the three stages for one expression

Open
OID
053881…3dde:15
Render details

Inspect func

renderIndex

func() string

renderIndex is the fixed page: what the algorithm does, and what it refuses.

Open
OID
053881…3dde:17
renderIndex details

Inspect func

renderOne

func(expr string) string

renderOne shows the three stages for one caller-supplied expression. The raw query string and every error message go through ui.Inline: both can carry whatever byte the caller sent, and until they are escaped they are attacker-controlled markdown. Tokens and the RPN do not, and are shown as code spans instead. Tokenize accepts a closed alphabet (digits, parentheses and the six operator bytes) and rejects everything else, so a token can only ever spell itself. Running those through ui.Inline would put a literal backslash inside a code span, where markdown does not process escapes, so escaping there makes the page wrong rather than safer.

Open
OID
053881…3dde:18
renderOne details

Inspect func

trace

func(expr string) (string, string)

trace returns the RPN and the value of an expression, as display strings. A failure renders as its error, because the refusals are part of the demo.

Open
OID
053881…3dde:19
trace details

Inspect func

kindName

func(k v0.Kind) string

kindName names a token kind for the table.

Open
OID
053881…3dde:21
kindName details

Inspect func
selfPath : untyped string ="/r/moul/x/daily/shuntingyarddemo/v0:"
worked : []struct{...} (len=8) Inspect
refused : []string (len=7) Inspect
Render : func(path string) string Inspect
renderIndex : func() string Inspect
renderOne : func(expr string) string Inspect
trace : func(expr string) (string, string) Inspect
kindName : func(k v0.Kind) string Inspect