]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/regexp/parser/parser.factor
ui.listener: document that ~/.factor-history persists input history
[factor.git] / basis / regexp / parser / parser.factor
index 28b99cfb094a3aad14c09a8cfb6f6276b1a2224c..f70c123f67a53cef49987708cfcd6487a1e51a26 100644 (file)
@@ -1,10 +1,9 @@
 ! Copyright (C) 2008, 2009 Doug Coleman, Daniel Ehrenberg.
-! See http://factorcode.org/license.txt for BSD license.
+! See https://factorcode.org/license.txt for BSD license.
 USING: accessors arrays assocs combinators
-combinators.short-circuit interval-maps kernel locals
-math.parser memoize multiline peg.ebnf regexp.ast regexp.classes
-sequences sets splitting strings unicode unicode.data
-unicode.script ;
+combinators.short-circuit interval-maps kernel math.parser
+multiline peg.ebnf regexp.ast regexp.classes sequences sets
+splitting strings unicode unicode.data unicode.script ;
 IN: regexp.parser
 
 : allowed-char? ( ch -- ? )
@@ -43,7 +42,7 @@ MEMO: simple-category-table ( -- table )
             simple-category-table at <category-class>
         ] }
         { [ "script=" ?head ] [
-            dup simple-script-table at
+            [ simple-script-table at ]
             [ <script-class> ]
             [ "script=" prepend bad-class ] ?if
         ] }
@@ -51,7 +50,7 @@ MEMO: simple-category-table ( -- table )
     } cond ;
 
 : unicode-class ( name -- class )
-    dup parse-unicode-class [ ] [ bad-class ] ?if ;
+    [ parse-unicode-class ] [ bad-class ] ?unless ;
 
 : name>class ( name -- class )
     >string simple {
@@ -107,7 +106,7 @@ MEMO: simple-category-table ( -- table )
 ERROR: nonexistent-option name ;
 
 : ch>option ( ch -- singleton )
-    dup options-assoc at [ ] [ nonexistent-option ] ?if ;
+    [ options-assoc at ] [ nonexistent-option ] ?unless ;
 
 : option>ch ( option -- string )
     options-assoc value-at ;