]> gitweb.factorcode.org Git - factor.git/commitdiff
a syntax pearl for literal string arrays
authorJoe Groff <arcata@gmail.com>
Sun, 26 Apr 2009 00:22:47 +0000 (19:22 -0500)
committerJoe Groff <arcata@gmail.com>
Sun, 26 Apr 2009 00:22:47 +0000 (19:22 -0500)
extra/qw/authors.txt [new file with mode: 0644]
extra/qw/qw-docs.factor [new file with mode: 0644]
extra/qw/qw-tests.factor [new file with mode: 0644]
extra/qw/qw.factor [new file with mode: 0644]
extra/qw/summary.txt [new file with mode: 0644]

diff --git a/extra/qw/authors.txt b/extra/qw/authors.txt
new file mode 100644 (file)
index 0000000..f13c9c1
--- /dev/null
@@ -0,0 +1 @@
+Joe Groff
diff --git a/extra/qw/qw-docs.factor b/extra/qw/qw-docs.factor
new file mode 100644 (file)
index 0000000..8af2c14
--- /dev/null
@@ -0,0 +1,11 @@
+USING: help.markup help.syntax multiline ;
+IN: qw
+
+HELP: qw{
+{ $syntax "qw{ lorem ipsum }" }
+{ $description "Marks the beginning of a literal array of strings. Component strings are delimited by whitespace." }
+{ $examples
+{ $unchecked-example <" USING: prettyprint qw ;
+qw{ pop quiz my hive of big wild ex tranny jocks } . ">
+<" { "pop" "quiz" "my" "hive" "of" "big" "wild" "ex" "tranny" "jocks" } "> }
+} ;
diff --git a/extra/qw/qw-tests.factor b/extra/qw/qw-tests.factor
new file mode 100644 (file)
index 0000000..c9d9208
--- /dev/null
@@ -0,0 +1,5 @@
+! (c)2009 Joe Groff bsd license
+USING: qw tools.test ;
+IN: qw.tests
+
+[ { "zippity" "doo" "dah" } ] [ qw{ zippity doo dah } ] unit-test
diff --git a/extra/qw/qw.factor b/extra/qw/qw.factor
new file mode 100644 (file)
index 0000000..ce96587
--- /dev/null
@@ -0,0 +1,5 @@
+! (c)2009 Joe Groff bsd license
+USING: lexer parser ;
+IN: qw
+
+SYNTAX: qw{ "}" parse-tokens parsed ;
diff --git a/extra/qw/summary.txt b/extra/qw/summary.txt
new file mode 100644 (file)
index 0000000..8c31961
--- /dev/null
@@ -0,0 +1 @@
+Perlish syntax for literal arrays of whitespace-delimited strings (qw{ foo bar })