Input and edge cases

stdin, wait, exit, multi-statement lines, colons, story vs script anti-patterns.

Input (stdin)

Listen words: listen, listens, listening, sniff, sniffs, perk, perks, hear, hears, eavesdrop, eavesdrops, ask, asks, prompt, prompts, await, awaits.

LineParses asNeed to know
the labrador listensListen[labrador]Reads one stdin line into that dog's name storage

Wait

Wait words: wait, waits, waiting, sleep, sleeps, sleeping, nap, naps, napping, doze, dozes, dozing, snooze, snoozes, snoozing, settle, settles, settling, rest, rests, resting, lounge, lounges, lounging, pause, pauses, pausing, linger, lingers, lingering, loiter, loiters, loitering, dream, dreams, dreaming.

LineParses asNeed to know
wait 2 secondsWait[2]Number optional; default 1 second
sleepWait[1]lazy trait doubles wait time

Negative wait time throws an error.

Exit

Exit words: escape, leave, depart, scram, wander.

LineParses as
escapeExit

Multiple statements on one line

When one line contains two heard actions, the parser may build a LineGroup:

LineParses asNeed to know
she whimpers as she wants the first biscuit from her cookie jarLineGroup[Print, TakeFromStash]Whimper + take

Most lines should stay one statement. This is mainly for take + mood print.

Colons and glue

LineParses asNeed to know
bark: "hello"PrintColon before value ignored
her cookie jar holds some items: "a", "b"StashInitsome items is glue

Story vs script

StoryScriptNotes
her cookie jarcookie_jarSpaces → underscores
the laundry basketlaundry_basketNo pile filler in script
her cookie jar holds "a", "b"cookie_jar holds "a", "b"No stash filler in script
her cookie jar is emptycookie_jar emptyPrefer empty, not starving
she whimpers … first biscuit from her cookie jarwhimper first from cookie_jarOrdinal + from + name
she woof how many toys she hasbark how many toys the labrador hasName the dog in script
when she has 2 toys then she woof "hi"when labrador has 2 toys then bark "hi" bury
for each treat from her cookie jar thenfor each treat from cookie_jar then

Prefer story phrasing in shipped examples/woof/. Underscore script lines are fine in tests and scratch files.

Script anti-patterns

WrongWhy
cookie_jar stash holds …stash is glue, confuses parser
cookie_jar stash starvingUse cookie_jar empty
whimper cookie_jar firstParses as print-all, not first slot

Use whimper first from cookie_jar instead.

Comments

// scene note
# act two

Strict mode

bark --strict story.woof warns on lines that parsed as story-only glue with no effect. Useful when a sentence looks right but does nothing.

Hearing rules summary: Writing stories.