Move "quiet" to parser-quiet? in parser.notes. Change a few places where quiet was handle wrong.
14 files changed:
combinators.short-circuit math.order math.private accessors
slots.private generic.single.private compiler.units
compiler.constants fry locals bootstrap.image.syntax
combinators.short-circuit math.order math.private accessors
slots.private generic.single.private compiler.units
compiler.constants fry locals bootstrap.image.syntax
+generalizations parser.notes ;
IN: bootstrap.image
: arch ( os cpu -- arch )
IN: bootstrap.image
: arch ( os cpu -- arch )
: make-image ( arch -- )
[
: make-image ( arch -- )
[
architecture set
"resource:/core/bootstrap/stage1.factor" run-file
build-image
architecture set
"resource:/core/bootstrap/stage1.factor" run-file
build-image
io.pathnames io.backend system parser vocabs sequences
vocabs.loader combinators splitting source-files strings
definitions assocs compiler.units math.parser
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
IN: bootstrap.stage2
SYMBOL: core-bootstrap-time
! We time bootstrap
nano-count
! We time bootstrap
nano-count
default-image-name "output-image" set-global
"math compiler threads help io tools ui ui.tools unicode handbook" "include" set-global
default-image-name "output-image" set-global
"math compiler threads help io tools ui ui.tools unicode handbook" "include" set-global
{ { $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 "-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"
} ;
ARTICLE: ".factor-boot-rc" "Bootstrap initialization file"
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
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
IN: command-line
SYMBOL: script
"=" split1 [ var-param ] [ bool-param ] if* ;
: run-script ( file -- )
"=" split1 [ var-param ] [ bool-param ] if* ;
: run-script ( file -- )
[ run-file ]
[ source-file main>> [ execute( -- ) ] when* ] bi
] with-variable ;
[ run-file ]
[ source-file main>> [ execute( -- ) ] when* ] bi
] with-variable ;
: default-cli-args ( -- )
global [
: default-cli-args ( -- )
global [
main-vocab "run" set
] bind ;
main-vocab "run" set
] bind ;
-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>
-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
-no-user-init suppress loading of .factor-rc
Enter
: command-line-startup ( -- )
(command-line) parse-command-line
"help" get "-help" get or "h" get or [ cli-usage ] [
: 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*
] if
output-stream get [ stream-flush ] when*
: (eval>string) ( str -- output )
[
: (eval>string) ( str -- output )
[
- "quiet" on
- parser-notes off
'[ _ (( -- )) (eval) ] [ print-error ] recover
] with-string-writer ;
: eval>string ( str -- output )
'[ _ (( -- )) (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 ;
: parse-template ( string -- quot )
[
[
: parse-template ( string -- quot )
[
[
- "quiet" on
- parser-notes off
"html.templates.fhtml" use-vocab
string-lines parse-template-lines
] with-file-vocabs
"html.templates.fhtml" use-vocab
string-lines parse-template-lines
] with-file-vocabs
- 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
"out.txt" temp-file >>stdout\r
try-process\r
] unit-test\r
namespaces parser lexer sequences strings io.styles
vectors words generic system combinators continuations debugger
definitions compiler.units accessors colors prettyprint fry
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 )
IN: listener
GENERIC: stream-read-quot ( stream -- quot/f )
] [ drop ] if ;
:: (listener) ( datastack -- )
] [ drop ] if ;
:: (listener) ( datastack -- )
error-summary? get [ error-summary ] when
visible-vars.
datastack datastack.
error-summary? get [ error-summary ] when
visible-vars.
datastack datastack.
dup find-vocab-root [ deploy* ] [ no-vocab ] if ;
: deploy-image-only ( vocab image -- )
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" ] }
{
{ [ os macosx? ] [ "tools.deploy.macosx" ] }
set-startup-quot ;
: startup-stripper ( -- )
set-startup-quot ;
: startup-stripper ( -- )
+ 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 ;
f output-stream set-global
[ V{ "resource:" } clone vocab-roots set-global ]
"vocabs.loader" startup-hooks get-global set-at ;
-USING: help.markup help.syntax io ;
+USING: help.markup help.syntax io 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." } ;
USING: namespaces kernel source-files lexer accessors io math.parser ;
IN: parser.notes
USING: namespaces kernel source-files lexer accessors io math.parser ;
IN: parser.notes
-t parser-notes set-global
-
-: parser-notes? ( -- ? )
- parser-notes get "quiet" get not and ;
+t parser-quiet? set-global
file get [ path>> write ":" write ] when*
lexer get [ line>> number>string write ": " write ] when*
"Note:" print dup print
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
combinators sorting splitting math.parser effects continuations
io.files vocabs io.encodings.utf8 source-files classes
hashtables compiler.units accessors sets lexer vocabs.parser
combinators sorting splitting math.parser effects continuations
io.files vocabs io.encodings.utf8 source-files classes
hashtables compiler.units accessors sets lexer vocabs.parser
IN: parser
: location ( -- loc )
IN: parser
: location ( -- loc )
] with-file-vocabs ;
: parsing-file ( file -- )
] 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 [
: filter-moved ( assoc1 assoc2 -- seq )
swap assoc-diff keys [