! Copyright (C) 2008, 2009 Slava Pestov
! See http://factorcode.org/license.txt for BSD license.
-USING: kernel accessors strings namespaces assocs hashtables io
-mirrors math fry sequences words continuations
-xml.entities xml.writer xml.syntax ;
+USING: accessors assocs classes continuations hashtables kernel
+math mirrors namespaces sequences strings words xml.syntax
+xml.writer ;
IN: html.forms
TUPLE: form errors values validation-failed ;
[ clone ] change-values ;
: check-value-name ( name -- name )
- dup string? [ "Value name not a string" throw ] unless ;
+ string check-instance ;
: values ( -- assoc )
form get values>> ;
! Copyright (C) 2008, 2009 Doug Coleman, Daniel Ehrenberg.
! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays compiler.units kernel kernel.private
-lexer make math ranges namespaces regexp.ast
+USING: accessors arrays classes compiler.units kernel
+kernel.private lexer make math ranges namespaces regexp.ast
regexp.compiler regexp.negation regexp.parser sequences
sequences.private splitting strings vocabs.loader words ;
IN: regexp
ast>dfa dfa>reverse-shortest-word
'[ [ 1 - ] dip f _ execute ] ;
-: check-string ( string -- string )
- ! Make this configurable
- dup string? [ "String required" throw ] unless ;
-
: match-index-from ( i string regexp -- index/f )
! This word is unsafe. It assumes that i is a fixnum
! and that string is a string.
PRIVATE>
: matches? ( string regexp -- ? )
- [ check-string ] dip
+ [ string check-instance ] dip
[ end/start ] 2keep
match-index-from
[ = ] [ drop f ] if* ;
M: reverse-regexp match-iterator-start drop length ;
: prepare-match-iterator ( string regexp -- i string regexp )
- [ check-string ] dip [ match-iterator-start ] 2keep ; inline
+ [ string check-instance ] dip [ match-iterator-start ] 2keep ; inline
PRIVATE>
-USING: accessors assocs globs io.pathnames kernel memoize
-namespaces regexp sequences sorting splitting strings
+USING: accessors assocs classes globs io.pathnames kernel
+memoize namespaces regexp sequences sorting splitting strings
unicode xml xml.data xml.syntax xml.traversal xmode.loader
xmode.rules xmode.utilities ;
IN: xmode.catalog
: resolve-delegate ( rule -- )
dup delegate>> dup string? [
get-rule-set
- dup rule-set? [ "not a rule set" throw ] unless
+ rule-set check-instance
swap rule-sets [ dup finalize-rule-set ] with-variable
>>delegate drop
] [ 2drop ] if ;