ERROR: bad-number ;
: ensure-number ( n -- n )
- [ bad-number ] unless* ;
+ [ throw-bad-number ] unless* ;
:: at-error ( key assoc quot: ( key -- replacement ) -- value )
key assoc at* [ drop key quot call ] unless ; inline
{ [ "script=" ?head ] [
dup simple-script-table at
[ <script-class> ]
- [ "script=" prepend bad-class ] ?if
+ [ "script=" prepend throw-bad-class ] ?if
] }
- [ bad-class ]
+ [ throw-bad-class ]
} cond ;
: unicode-class ( name -- class )
- dup parse-unicode-class [ ] [ bad-class ] ?if ;
+ dup parse-unicode-class [ ] [ throw-bad-class ] ?if ;
: name>class ( name -- class )
>string simple {
ERROR: nonexistent-option name ;
: ch>option ( ch -- singleton )
- dup options-assoc at [ ] [ nonexistent-option ] ?if ;
+ dup options-assoc at [ ] [ throw-nonexistent-option ] ?if ;
: option>ch ( option -- string )
options-assoc value-at ;
Times = "," Number:n "}" => [[ 0 n <from-to> ]]
| Number:n ",}" => [[ n <at-least> ]]
| Number:n "}" => [[ n n <from-to> ]]
- | "}" => [[ bad-number ]]
+ | "}" => [[ throw-bad-number ]]
| Number:n "," Number:m "}" => [[ n m <from-to> ]]
Repeated = Element:e "{" Times:t => [[ e t <times> ]]