From e2fdb0783c5b11e07a208090425b88f62885aa80 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 18 Mar 2009 17:07:19 -0500 Subject: [PATCH] Separate regexp.prettyprint from regexp to reduce deployed image size --- basis/regexp/prettyprint/authors.txt | 1 + basis/regexp/prettyprint/prettyprint.factor | 13 +++++++++++++ basis/regexp/regexp.factor | 18 +++++++----------- 3 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 basis/regexp/prettyprint/authors.txt create mode 100644 basis/regexp/prettyprint/prettyprint.factor diff --git a/basis/regexp/prettyprint/authors.txt b/basis/regexp/prettyprint/authors.txt new file mode 100644 index 0000000000..d4f5d6b3ae --- /dev/null +++ b/basis/regexp/prettyprint/authors.txt @@ -0,0 +1 @@ +Slava Pestov \ No newline at end of file diff --git a/basis/regexp/prettyprint/prettyprint.factor b/basis/regexp/prettyprint/prettyprint.factor new file mode 100644 index 0000000000..7af762a34e --- /dev/null +++ b/basis/regexp/prettyprint/prettyprint.factor @@ -0,0 +1,13 @@ +! Copyright (C) 2008, 2009 Doug Coleman, Daniel Ehrenberg. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors kernel make prettyprint.backend +prettyprint.custom regexp regexp.parser regexp.private ; +IN: regexp.prettyprint + +M: regexp pprint* + [ + [ + [ raw>> dup find-regexp-syntax swap % swap % % ] + [ options>> options>string % ] bi + ] "" make + ] keep present-text ; \ No newline at end of file diff --git a/basis/regexp/regexp.factor b/basis/regexp/regexp.factor index 5889b19e47..33499b1437 100644 --- a/basis/regexp/regexp.factor +++ b/basis/regexp/regexp.factor @@ -1,10 +1,9 @@ ! Copyright (C) 2008, 2009 Doug Coleman, Daniel Ehrenberg. ! See http://factorcode.org/license.txt for BSD license. USING: accessors combinators kernel kernel.private math sequences -sequences.private strings sets assocs prettyprint.backend -prettyprint.custom make lexer namespaces parser arrays fry locals -regexp.parser splitting sorting regexp.ast regexp.negation -regexp.compiler compiler.units words math.ranges ; +sequences.private strings sets assocs make lexer namespaces parser +arrays fry locals regexp.parser splitting sorting regexp.ast +regexp.negation regexp.compiler compiler.units words math.ranges ; IN: regexp TUPLE: regexp @@ -217,11 +216,8 @@ PRIVATE> : R{ CHAR: } parsing-regexp ; parsing : R| CHAR: | parsing-regexp ; parsing -M: regexp pprint* - [ - [ - [ raw>> dup find-regexp-syntax swap % swap % % ] - [ options>> options>string % ] bi - ] "" make - ] keep present-text ; +USING: vocabs vocabs.loader ; +"prettyprint" vocab [ + "regexp.prettyprint" require +] when \ No newline at end of file