From 9a55bfb5a291fce99c18ae4215cda3718d732204 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 28 Nov 2011 11:46:15 -0800 Subject: [PATCH] regexp: trivial refactoring --- basis/regexp/negation/negation.factor | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/basis/regexp/negation/negation.factor b/basis/regexp/negation/negation.factor index 5f627b645e..86e4de2b54 100644 --- a/basis/regexp/negation/negation.factor +++ b/basis/regexp/negation/negation.factor @@ -46,8 +46,11 @@ CONSTANT: fail-state -1 [ final-states>> members first ] [ nfa-table get [ transitions>> ] bi@ swap assoc-union! drop ] tri ; +: ast>nfa ( parse-tree -- minimal-dfa ) + construct-nfa disambiguate ; + : ast>dfa ( parse-tree -- minimal-dfa ) - construct-nfa disambiguate construct-dfa minimize ; + ast>nfa construct-dfa minimize ; M: negation nfa-node ( node -- start end ) term>> ast>dfa negate-table adjoin-dfa ;