]> gitweb.factorcode.org Git - factor.git/commitdiff
Move Joe's HEX{ syntax to byte-arrays.hex in basis
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 28 Jul 2009 16:20:28 +0000 (11:20 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 28 Jul 2009 16:20:28 +0000 (11:20 -0500)
basis/byte-arrays/hex/authors.txt [new file with mode: 0644]
basis/byte-arrays/hex/hex-docs.factor [new file with mode: 0644]
basis/byte-arrays/hex/hex.factor [new file with mode: 0644]
core/byte-arrays/byte-arrays-docs.factor
core/byte-arrays/byte-arrays.factor

diff --git a/basis/byte-arrays/hex/authors.txt b/basis/byte-arrays/hex/authors.txt
new file mode 100644 (file)
index 0000000..f13c9c1
--- /dev/null
@@ -0,0 +1 @@
+Joe Groff
diff --git a/basis/byte-arrays/hex/hex-docs.factor b/basis/byte-arrays/hex/hex-docs.factor
new file mode 100644 (file)
index 0000000..8c60dc2
--- /dev/null
@@ -0,0 +1,6 @@
+IN: byte-arrays.hex
+USING: byte-arrays help.markup help.syntax ;
+
+HELP: HEX{
+{ $syntax "HEX{ 0123 45 67 89abcdef }" }
+{ $description "Constructs a " { $link byte-array } " from data specified in hexadecimal format. Whitespace between the curly braces is ignored." } ;
diff --git a/basis/byte-arrays/hex/hex.factor b/basis/byte-arrays/hex/hex.factor
new file mode 100644 (file)
index 0000000..054c35d
--- /dev/null
@@ -0,0 +1,11 @@
+! Copyright (C) 2009 Joe Groff.
+! See http://factorcode.org/license.txt for BSD license.
+USING: grouping lexer ascii parser sequences kernel math.parser ;
+IN: byte-arrays.hex
+
+SYNTAX: HEX{
+    "}" parse-tokens "" join
+    [ blank? not ] filter
+    2 group [ hex> ] B{ } map-as
+    parsed ;
+
index 56832a56e5deee634af389a59256c5afff05a31a..f1d94a46f70bc6009af6f88c0024edb6976a1cce 100644 (file)
@@ -23,10 +23,6 @@ $nl
 
 ABOUT: "byte-arrays"
 
-HELP: HEX{
-{ $syntax "HEX{ 0123 45 67 89abcdef }" }
-{ $description "Constructs a " { $link byte-array } " from data specified in hexadecimal format. Whitespace between the curly braces is ignored." } ;
-
 HELP: byte-array
 { $description "The class of byte arrays. See " { $link "syntax-byte-arrays" } " for syntax and " { $link "byte-arrays" } " for general information." } ;
 
index b32060ec993390bea49a1b93ac073676704ba2cb..72989ac447069d04fd48c9460b1136010589bca4 100644 (file)
@@ -1,16 +1,9 @@
 ! Copyright (C) 2007, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors alien.accessors ascii grouping kernel
-kernel.private lexer math math.parser parser sequences
-sequences.private ;
+USING: accessors kernel kernel.private alien.accessors sequences
+sequences.private math ;
 IN: byte-arrays
 
-SYNTAX: HEX{
-    "}" parse-tokens "" join
-    [ blank? not ] filter
-    2 group [ hex> ] B{ } map-as
-    parsed ;
-
 M: byte-array clone (clone) ;
 M: byte-array length length>> ;
 M: byte-array nth-unsafe swap >fixnum alien-unsigned-1 ;