! Copyright (C) 2005, 2009 Daniel Ehrenberg ! See http://factorcode.org/license.txt for BSD license. USING: words assocs kernel accessors parser effects.parser sequences summary lexer splitting combinators locals xml.data memoize sequences.deep xml.data xml.state xml namespaces present arrays generalizations strings make math macros multiline inverse combinators.short-circuit sorting fry unicode.categories effects hashtables ; IN: xml.syntax alist 2dup delete-at* [ drop [ no-tag new throw ] ] unless suffix '[ dup url>> _ case ] ; : compile-tags ( word xtable -- quot ) >alist [ make-namespace-case ] assoc-map swap '[ _ no-tag boa throw ] suffix '[ dup main>> _ case ] ; : define-tags ( word effect -- ) [ dup dup "xtable" word-prop compile-tags ] dip define-declared ; :: define-tag ( tag namespace word quot -- ) quot namespace tag word "xtable" word-prop [ ?set-at ] change-at word word stack-effect define-tags ; PRIVATE> SYNTAX: TAGS: CREATE-WORD complete-effect [ drop H{ } clone "xtable" set-word-prop ] [ define-tags ] 2bi ; SYNTAX: TAG: scan f scan-word parse-definition define-tag ; SYNTAX: TAG-NS: scan scan scan-word parse-definition define-tag ;