]> gitweb.factorcode.org Git - factor.git/commitdiff
Make "quiet" true by default. Disable quiet mode for listener, bootstrap, and deploy...
authorDoug Coleman <doug.coleman@gmail.com>
Tue, 6 Sep 2011 23:29:15 +0000 (16:29 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Wed, 7 Sep 2011 00:58:12 +0000 (17:58 -0700)
Move "quiet" to parser-quiet? in parser.notes. Change a few places where quiet was handle wrong.

14 files changed:
basis/bootstrap/image/image.factor
basis/bootstrap/stage2.factor
basis/command-line/command-line-docs.factor
basis/command-line/command-line.factor
basis/command-line/startup/startup.factor
basis/eval/eval.factor
basis/html/templates/fhtml/fhtml.factor
basis/io/launcher/windows/windows-tests.factor
basis/listener/listener.factor
basis/tools/deploy/deploy.factor
basis/tools/deploy/shaker/shaker.factor
core/parser/notes/notes-docs.factor
core/parser/notes/notes.factor
core/parser/parser.factor

index 279dd5c158c4fe64ab5624ea99f83e9b2a336561..4cd6cc24ed6caa7ee3670f1ff310e2fe1ce93a67 100755 (executable)
@@ -11,7 +11,7 @@ source-files definitions debugger quotations.private combinators
 combinators.short-circuit math.order math.private accessors
 slots.private generic.single.private compiler.units
 compiler.constants fry locals bootstrap.image.syntax
-generalizations ;
+generalizations parser.notes ;
 IN: bootstrap.image
 
 : arch ( os cpu -- arch )
@@ -606,6 +606,7 @@ PRIVATE>
 
 : make-image ( arch -- )
     [
+        f parser-quiet? set
         architecture set
         "resource:/core/bootstrap/stage1.factor" run-file
         build-image
index c70cf00df3ad810497e9a94154254658c7a33057..edea2252c2fcf7eef1b122011bed2ea0923a528f 100644 (file)
@@ -5,7 +5,7 @@ kernel.private math memory continuations kernel io.files
 io.pathnames io.backend system parser vocabs sequences
 vocabs.loader combinators splitting source-files strings
 definitions assocs compiler.units math.parser
-generic sets command-line ;
+generic sets command-line parser.notes ;
 IN: bootstrap.stage2
 
 SYMBOL: core-bootstrap-time
@@ -62,6 +62,8 @@ SYMBOL: bootstrap-time
     ! We time bootstrap
     nano-count
 
+    parser-quiet? off
+
     default-image-name "output-image" set-global
 
     "math compiler threads help io tools ui ui.tools unicode handbook" "include" set-global
index fa99a82073d32033eec0f0bf35d1b9e209c5de3b..8b48d500867d0c7e3356c91914c96e609c6251c3 100644 (file)
@@ -89,7 +89,6 @@ ARTICLE: "standard-cli-args" "Command line switches for general usage"
     { { $snippet "-e=" { $emphasis "code" } } { "This specifies a code snippet to evaluate. If you want Factor to exit immediately after, also specify " { $snippet "-run=none" } "." } }
     { { $snippet "-run=" { $emphasis "vocab" } } { { $snippet { $emphasis "vocab" } } " is the name of a vocabulary with a " { $link POSTPONE: MAIN: } " hook to run on startup, for example " { $vocab-link "listener" } ", " { $vocab-link "ui.tools" } " or " { $vocab-link "none" } "." } }
     { { $snippet "-no-user-init" } { "Inhibits the running of user initialization files on startup. See " { $link "rc-files" } "." } }
-    { { $snippet "-quiet" } { "If set, " { $link run-file } " and " { $link require } " will not print load messages." } }
 } ;
 
 ARTICLE: ".factor-boot-rc" "Bootstrap initialization file"
index e902bbc396f3cb2d9b7a3d9e66f147055f98f2a4..4bc899b2f16187ec9ee49a3d473ec394a0335110 100644 (file)
@@ -3,7 +3,7 @@
 USING: init continuations hashtables io io.encodings.utf8
 io.files io.pathnames kernel kernel.private namespaces parser
 sequences source-files strings system splitting vocabs.loader
-alien.strings accessors ;
+alien.strings accessors parser.notes ;
 IN: command-line
 
 SYMBOL: script
@@ -40,7 +40,7 @@ SYMBOL: command-line
     "=" split1 [ var-param ] [ bool-param ] if* ;
 
 : run-script ( file -- )
-    t "quiet" [
+    t parser-quiet? [
         [ run-file ]
         [ source-file main>> [ execute( -- ) ] when* ] bi
     ] with-variable ;
@@ -63,10 +63,8 @@ SYMBOL: main-vocab-hook
 
 : default-cli-args ( -- )
     global [
-        "quiet" off
         "e" off
         "user-init" on
-        embedded? "quiet" set
         main-vocab "run" set
     ] bind ;
 
index 1edf1696772c2ba46ac9465c4160a29def84f68d..797e6f4511e50e49fae71fcf79e4b450331e122e 100644 (file)
@@ -13,7 +13,6 @@ Common arguments:
     -i=<image>       load Factor image file <image> (default """ write vm file-name write """.image)
     -run=<vocab>     run the MAIN: entry point of <vocab>
     -e=<code>        evaluate <code>
-    -quiet           suppress "Loading vocab.factor" messages
     -no-user-init    suppress loading of .factor-rc
 
 Enter
@@ -25,17 +24,15 @@ from within Factor for more information.
 : command-line-startup ( -- )
     (command-line) parse-command-line
     "help" get "-help" get or "h" get or [ cli-usage ] [
-        "e" get script get or "quiet" [
-            load-vocab-roots
-            run-user-init
-
-            "e" get script get or [
-                "e" get [ eval( -- ) ] when*
-                script get [ run-script ] when*
-            ] [
-                "run" get run
-            ] if
-        ] with-variable
+        load-vocab-roots
+        run-user-init
+    
+        "e" get script get or [
+            "e" get [ eval( -- ) ] when*
+            script get [ run-script ] when*
+        ] [
+            "run" get run
+        ] if
     ] if
 
     output-stream get [ stream-flush ] when*
index 65f13261a97c54b5b68e0e922a6a5dd70ecc9efb..a4b5638c02172a12dd8dff12eeacab4208dc6394 100644 (file)
@@ -18,10 +18,9 @@ SYNTAX: eval( \ eval parse-call( ;
 
 : (eval>string) ( str -- output )
     [
-        "quiet" on
-        parser-notes off
+        parser-quiet? on
         '[ _ (( -- )) (eval) ] [ print-error ] recover
     ] with-string-writer ;
 
 : eval>string ( str -- output )
-    [ (eval>string) ] with-file-vocabs ;
\ No newline at end of file
+    [ (eval>string) ] with-file-vocabs ;
index bf272782130033949bff087ca5d63b8054229940..0fd802474731c4bcb659c4544547c6b9268e7f23 100644 (file)
@@ -59,8 +59,7 @@ SYNTAX: %> lexer get parse-%> ;
 : parse-template ( string -- quot )
     [
         [
-            "quiet" on
-            parser-notes off
+            parser-quiet? on
             "html.templates.fhtml" use-vocab
             string-lines parse-template-lines
         ] with-file-vocabs
index 39b5e36cbb77e84308c9d3f95792b44643e56d33..c4c5f405dee7653885930dc158d53539cbf7ab84 100644 (file)
@@ -51,7 +51,7 @@ IN: io.launcher.windows.tests
 \r
 [ ] [\r
     <process>\r
-        console-vm "-quiet" "-run=hello-world" 3array >>command\r
+        console-vm "-run=hello-world" 3array >>command\r
         "out.txt" temp-file >>stdout\r
     try-process\r
 ] unit-test\r
index f77c5262df83b68e2b96b4cc1122c558adb26f87..71b1457725e12592e562c68cccd617ace0fc2428 100644 (file)
@@ -4,7 +4,8 @@ USING: arrays hashtables io kernel math math.parser memory
 namespaces parser lexer sequences strings io.styles
 vectors words generic system combinators continuations debugger
 definitions compiler.units accessors colors prettyprint fry
-sets vocabs.parser source-files.errors locals vocabs vocabs.loader ;
+sets vocabs.parser source-files.errors locals vocabs vocabs.loader
+parser.notes ;
 IN: listener
 
 GENERIC: stream-read-quot ( stream -- quot/f )
@@ -107,6 +108,7 @@ t error-summary? set-global
     ] [ drop ] if ;
 
 :: (listener) ( datastack -- )
+    parser-quiet? off
     error-summary? get [ error-summary ] when
     visible-vars.
     datastack datastack.
index 2babdb2b535b0d705d9aeb913e534de08d7bf5bd..94ac7e635c03265ffcff36922f07f396d325375b 100644 (file)
@@ -8,7 +8,8 @@ IN: tools.deploy
     dup find-vocab-root [ deploy* ] [ no-vocab ] if ;
 
 : deploy-image-only ( vocab image -- ) 
-    [ vm ] 2dip swap dup deploy-config make-deploy-image drop ;
+    [ vm ] 2dip
+    swap dup deploy-config make-deploy-image drop ;
 
 {
     { [ os macosx? ] [ "tools.deploy.macosx" ] }
index dca9345cd1b6e73afb4e6a02e3b460420501a552..4aaf0478f31fbcc4d4689f757c7923e7c3a1b691 100755 (executable)
@@ -481,7 +481,7 @@ SYMBOL: deploy-vocab
     set-startup-quot ;
 
 : startup-stripper ( -- )
-    t "quiet" set-global
+    t parser-quiet? set-global
     f output-stream set-global
     [ V{ "resource:" } clone vocab-roots set-global ]
     "vocabs.loader" startup-hooks get-global set-at ;
index f9a86c69341fa84b2db09d0997ec3ab1d5bb3641..3f990ae52499b6e7cf61118299c6c004caf3b2c8 100644 (file)
@@ -1,10 +1,6 @@
-USING: help.markup help.syntax io ;
+USING: help.markup help.syntax io parser.notes ;
 IN: parser.notes
 
-HELP: parser-notes
-{ $var-description "A boolean controlling whether the parser will print various notes. Switched on by default. If a source file is being run for its effect on " { $link output-stream } ", this variable should be switched off, to prevent parser notes from polluting the output." } ;
-
-HELP: parser-notes?
-{ $values { "?" "a boolean" } }
-{ $description "Tests if the parser will print various notes and warnings. To disable parser notes, either set " { $link parser-notes } " to " { $link f } ", or pass the " { $snippet "-quiet" } " command line switch." } ;
+HELP: parser-quiet?
+{ $var-description "A boolean controlling whether the parser will print various notes. Switched on by default. If a source file is being run for its effect on " { $link output-stream } ", this variable should remain switched on, to prevent parser notes from polluting the output." } ;
 
index 3f702d375df9dc84ad6cc4c9cb8943a7235bb41f..e2ab2d14201ccb1e9f555eee2edab08737347ebb 100644 (file)
@@ -3,16 +3,13 @@
 USING: namespaces kernel source-files lexer accessors io math.parser ;
 IN: parser.notes
 
-SYMBOL: parser-notes
+SYMBOL: parser-quiet?
 
-t parser-notes set-global
-
-: parser-notes? ( -- ? )
-    parser-notes get "quiet" get not and ;
+t parser-quiet? set-global
 
 : note. ( str -- )
-    parser-notes? [
+    parser-quiet? get [
         file get [ path>> write ":" write ] when* 
         lexer get [ line>> number>string write ": " write ] when*
         "Note:" print dup print
-    ] when drop ;
\ No newline at end of file
+    ] unless drop ;
index be43979b31a6181b9f89cf5ab1096cfc89acad47..4f2d9b563442fcef9bc06e5e3a6d06a1ace7fcaf 100644 (file)
@@ -5,7 +5,7 @@ sequences strings vectors words words.symbol quotations io
 combinators sorting splitting math.parser effects continuations
 io.files vocabs io.encodings.utf8 source-files classes
 hashtables compiler.units accessors sets lexer vocabs.parser
- slots parser.notes ;
+slots parser.notes ;
 IN: parser
 
 : location ( -- loc )
@@ -135,7 +135,7 @@ print-use-hook [ [ ] ] initialize
     ] with-file-vocabs ;
 
 : parsing-file ( file -- )
-    "quiet" get [ drop ] [ "Loading " write print flush ] if ;
+    parser-quiet? get [ drop ] [ "Loading " write print flush ] if ;
 
 : filter-moved ( assoc1 assoc2 -- seq )
     swap assoc-diff keys [