dup callable? [ ] [ [ call ] curry ] if ; inline
: [ncurry] ( n -- quot )
- [ V{ dup callable? [ >quotation ] unless } clone ] dip (ncurry) >quotation ;
+ [ V{ } clone ] dip (ncurry) >quotation ;
: [ndip] ( quot n -- quot' )
{
] [ f ] if
] [ f ] if ; inline
+: skip ( i seq ? -- n )
+ over length [
+ [ swap forbid-tab CHAR: \s eq? xor ] curry find-from drop
+ ] dip or ; inline
+
PRIVATE>
GENERIC: skip-blank ( lexer -- )
shebang? [
[ nip length ] change-lexer-column
] [
- [
- [ [ forbid-tab CHAR: \s eq? not ] find-from drop ]
- [ length or ] bi
- ] change-lexer-column
+ [ t skip ] change-lexer-column
] if ;
GENERIC: skip-word ( lexer -- )
M: lexer skip-word
[
- 2dup nth CHAR: \" eq? [ drop 1 + ] [
- [ [ forbid-tab CHAR: \s eq? ] find-from drop ]
- [ length or ] bi
- ] if
+ 2dup nth CHAR: \" eq? [ drop 1 + ] [ f skip ] if
] change-lexer-column ;
: still-parsing? ( lexer -- ? )