From 7ac7adeb67ae6591c4f8e657f01f14b1c5f15742 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sun, 27 Nov 2011 15:03:40 -0800 Subject: [PATCH] syntax: add note to #! docs --- core/syntax/syntax-docs.factor | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/syntax/syntax-docs.factor b/core/syntax/syntax-docs.factor index 81d24079b0..469ea33fd4 100644 --- a/core/syntax/syntax-docs.factor +++ b/core/syntax/syntax-docs.factor @@ -657,9 +657,16 @@ HELP: ! { POSTPONE: ! POSTPONE: #! } related-words HELP: #! -{ $syntax "#! comment..." } +{ $syntax "#!comment..." } { $values { "comment" "characters" } } -{ $description "Discards all input until the end of the line." } ; +{ $description "Discards all input until the end of the line." } +{ $notes "To allow Unix-style \"shebang\" scripts to work as expected, " { $snippet "#!" } " is parsed as a separate token regardless of following whitespace if it appears at the beginning of a line." +{ $example + "#!/usr/bin/env/factor" + "USING: io ;" + "\"Hello world\" print" + "Hello world" +} } ; HELP: NAN: { $syntax "NAN: payload" }