Paste: table-syntax
Author: | anatoo |
Mode: | factor |
Date: | Tue, 14 Apr 2009 07:46:01 |
Plain Text |
IN: table-syntax
USING: parser arrays sequences splitting kernel ;
DEFER: |
DEFER: |}
: (split-|_|) ( ex seq -- seq' )
{ | | } split1 [ suffix ] dip dup [ (split-|_|) ] [ drop ] if ;
: split-|_| ( seq -- seq' ) { } swap (split-|_|) ;
: split-| ( seq -- seq' ) { | } split ;
: 1array>first ( array -- array/first ) dup length 1 = [ first ] when ;
: process ( array -- array' ) split-|_| [ split-| 1array>first ] map 1array>first ;
: {| \ |} [ >array process ] parse-literal ; parsing
New Annotation