I keep getting errors in odd places. My simple scripts run fine, but when I put the same commands into large scripts, the syntax is off. I can't figure out what it is that is incorrect about this one:
>;herb all
--- Lich: herb active.
--- SyntaxError: compile error
herb:19: syntax error, unexpected $end, expecting kEND
herb:19:in `create_block'
--- Lich: cannot execute herb, aborting.
--- Lich: herb has exited.
and this is the script: line 19 is the blank line after the matchwait. If I delete the blank line, it generates the same error at line 18.
def herbcount (name, noun)
match 'zero', 'referring'
match 'one', 'There is only one part'
match 'two', 'There are two parts'
match 'three', 'There are three parts'
match 'four', 'There are four parts'
match 'five', 'There are five parts'
match 'six', 'There are six parts'
match 'seven', 'There are seven parts'
match 'eight', 'There are eight parts'
match 'nine', 'There are nine parts'
match 'ten', 'There are ten parts'
match 'eleven', 'There are eleven parts'
match 'twelve', 'There are twelve parts'
match 'thirteen', 'There are thirteen parts'
match 'fourteen', 'There are fourteen parts'
put "count my #{name} #{noun}"
matchwait
zero:
herb = 0
goto 'count0'