diff --git a/basis/alien/fortran/fortran.factor b/basis/alien/fortran/fortran.factor index bf8721b549..caa3b7a115 100644 --- a/basis/alien/fortran/fortran.factor +++ b/basis/alien/fortran/fortran.factor @@ -205,9 +205,6 @@ M: fortran-type (fortran-ret-type>c-type) (fortran-type>c-type) ; M: real-type (fortran-ret-type>c-type) drop real-functions-return-double? [ "double" ] [ "float" ] if ; -: suffix! ( seq elt -- seq ) over push ; inline -: append! ( seq-a seq-b -- seq-a ) over push-all ; inline - GENERIC: (fortran-arg>c-args) ( type -- main-quot added-quot ) : args?dims ( type quot -- main-quot added-quot ) diff --git a/basis/alien/syntax/syntax.factor b/basis/alien/syntax/syntax.factor index 7adf837841..c51a446b6c 100644 --- a/basis/alien/syntax/syntax.factor +++ b/basis/alien/syntax/syntax.factor @@ -7,11 +7,11 @@ effects assocs combinators lexer strings.parser alien.parser fry vocabs.parser words.constant alien.libraries ; IN: alien.syntax -SYNTAX: DLL" lexer get skip-blank parse-string dlopen parsed ; +SYNTAX: DLL" lexer get skip-blank parse-string dlopen suffix! ; -SYNTAX: ALIEN: 16 scan-base parsed ; +SYNTAX: ALIEN: 16 scan-base suffix! ; -SYNTAX: BAD-ALIEN parsed ; +SYNTAX: BAD-ALIEN suffix! ; SYNTAX: LIBRARY: scan "c-library" set ; diff --git a/basis/byte-arrays/hex/hex.factor b/basis/byte-arrays/hex/hex.factor index 5c381b7db0..ae9b9c8ba2 100644 --- a/basis/byte-arrays/hex/hex.factor +++ b/basis/byte-arrays/hex/hex.factor @@ -7,4 +7,4 @@ SYNTAX: HEX{ "}" parse-tokens "" join [ blank? not ] filter 2 group [ hex> ] B{ } map-as - parsed ; + suffix! ; diff --git a/basis/classes/struct/struct.factor b/basis/classes/struct/struct.factor index af23834383..417f188c3c 100755 --- a/basis/classes/struct/struct.factor +++ b/basis/classes/struct/struct.factor @@ -365,10 +365,10 @@ SYNTAX: UNION-STRUCT: parse-struct-definition define-union-struct-class ; SYNTAX: S{ - scan-word dup struct-slots parse-tuple-literal-slots parsed ; + scan-word dup struct-slots parse-tuple-literal-slots suffix! ; SYNTAX: S@ - scan-word scan-object swap memory>struct parsed ; + scan-word scan-object swap memory>struct suffix! ; ! functor support @@ -389,7 +389,7 @@ SYNTAX: S@ PRIVATE> FUNCTOR-SYNTAX: STRUCT: - scan-param parsed + scan-param suffix! [ 8 ] over push-all [ parse-struct-slots` ] [ ] while [ >array define-struct-class ] over push-all ; diff --git a/basis/cocoa/cocoa.factor b/basis/cocoa/cocoa.factor index ec5db31940..ec09f8f2ba 100644 --- a/basis/cocoa/cocoa.factor +++ b/basis/cocoa/cocoa.factor @@ -14,14 +14,14 @@ SYMBOL: sent-messages : remember-send ( selector -- ) sent-messages (remember-send) ; -SYNTAX: -> scan dup remember-send parsed \ send parsed ; +SYNTAX: -> scan dup remember-send suffix! \ send suffix! ; SYMBOL: super-sent-messages : remember-super-send ( selector -- ) super-sent-messages (remember-send) ; -SYNTAX: SUPER-> scan dup remember-super-send parsed \ super-send parsed ; +SYNTAX: SUPER-> scan dup remember-super-send suffix! \ super-send suffix! ; SYMBOL: frameworks diff --git a/basis/colors/constants/constants.factor b/basis/colors/constants/constants.factor index 8598fc0663..c17d1069b2 100644 --- a/basis/colors/constants/constants.factor +++ b/basis/colors/constants/constants.factor @@ -30,4 +30,4 @@ ERROR: no-such-color name ; : named-color ( name -- color ) dup colors at [ ] [ no-such-color ] ?if ; -SYNTAX: COLOR: scan named-color parsed ; \ No newline at end of file +SYNTAX: COLOR: scan named-color suffix! ; diff --git a/basis/compiler/cfg/registers/registers.factor b/basis/compiler/cfg/registers/registers.factor index 0d518735af..2f4f2a99e6 100644 --- a/basis/compiler/cfg/registers/registers.factor +++ b/basis/compiler/cfg/registers/registers.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2008, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors namespaces kernel parser assocs ; +USING: accessors namespaces kernel parser assocs sequences ; IN: compiler.cfg.registers ! Virtual registers, used by CFG and machine IRs, are just integers @@ -42,5 +42,5 @@ C: ds-loc TUPLE: rs-loc < loc ; C: rs-loc -SYNTAX: D scan-word parsed ; -SYNTAX: R scan-word parsed ; +SYNTAX: D scan-word suffix! ; +SYNTAX: R scan-word suffix! ; diff --git a/basis/cpu/ppc/linux/bootstrap.factor b/basis/cpu/ppc/linux/bootstrap.factor index cf6517b664..a5250414ab 100644 --- a/basis/cpu/ppc/linux/bootstrap.factor +++ b/basis/cpu/ppc/linux/bootstrap.factor @@ -1,10 +1,10 @@ ! Copyright (C) 2007, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: parser layouts system kernel ; +USING: parser layouts system kernel sequences ; IN: bootstrap.ppc : c-area-size ( -- n ) 10 bootstrap-cells ; : lr-save ( -- n ) bootstrap-cell ; -<< "vocab:cpu/ppc/bootstrap.factor" parse-file parsed >> +<< "vocab:cpu/ppc/bootstrap.factor" parse-file suffix! >> call diff --git a/basis/cpu/ppc/macosx/bootstrap.factor b/basis/cpu/ppc/macosx/bootstrap.factor index 0c383c2fb0..2aa0ddc4a2 100644 --- a/basis/cpu/ppc/macosx/bootstrap.factor +++ b/basis/cpu/ppc/macosx/bootstrap.factor @@ -1,10 +1,10 @@ ! Copyright (C) 2007, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: parser layouts system kernel ; +USING: parser layouts system kernel sequences ; IN: bootstrap.ppc : c-area-size ( -- n ) 14 bootstrap-cells ; : lr-save ( -- n ) 2 bootstrap-cells ; -<< "vocab:cpu/ppc/bootstrap.factor" parse-file parsed >> +<< "vocab:cpu/ppc/bootstrap.factor" parse-file suffix! >> call diff --git a/basis/cpu/x86/32/bootstrap.factor b/basis/cpu/x86/32/bootstrap.factor index c5f6975d33..e532d42dfe 100644 --- a/basis/cpu/x86/32/bootstrap.factor +++ b/basis/cpu/x86/32/bootstrap.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: bootstrap.image.private kernel namespaces system cpu.x86.assembler cpu.x86.assembler.operands layouts -vocabs parser compiler.constants ; +vocabs parser compiler.constants sequences ; IN: bootstrap.x86 4 \ cell set @@ -35,5 +35,5 @@ IN: bootstrap.x86 0 JMP rc-relative rt-primitive jit-rel ] jit-primitive jit-define -<< "vocab:cpu/x86/bootstrap.factor" parse-file parsed >> +<< "vocab:cpu/x86/bootstrap.factor" parse-file suffix! >> call diff --git a/basis/cpu/x86/64/bootstrap.factor b/basis/cpu/x86/64/bootstrap.factor index b42a38b2d2..662eaed3e0 100644 --- a/basis/cpu/x86/64/bootstrap.factor +++ b/basis/cpu/x86/64/bootstrap.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: bootstrap.image.private kernel namespaces system layouts vocabs parser compiler.constants math -cpu.x86.assembler cpu.x86.assembler.operands ; +cpu.x86.assembler cpu.x86.assembler.operands sequences ; IN: bootstrap.x86 8 \ cell set @@ -35,5 +35,5 @@ IN: bootstrap.x86 temp1 JMP ] jit-primitive jit-define -<< "vocab:cpu/x86/bootstrap.factor" parse-file parsed >> +<< "vocab:cpu/x86/bootstrap.factor" parse-file suffix! >> call diff --git a/basis/cpu/x86/64/unix/bootstrap.factor b/basis/cpu/x86/64/unix/bootstrap.factor index 2ad3a721af..238fad984a 100644 --- a/basis/cpu/x86/64/unix/bootstrap.factor +++ b/basis/cpu/x86/64/unix/bootstrap.factor @@ -1,12 +1,13 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: bootstrap.image.private kernel namespaces system -cpu.x86.assembler cpu.x86.assembler.operands layouts vocabs parser ; +USING: bootstrap.image.private cpu.x86.assembler +cpu.x86.assembler.operands kernel layouts namespaces parser +sequences system vocabs ; IN: bootstrap.x86 : stack-frame-size ( -- n ) 4 bootstrap-cells ; : arg1 ( -- reg ) RDI ; : arg2 ( -- reg ) RSI ; -<< "vocab:cpu/x86/64/bootstrap.factor" parse-file parsed >> +<< "vocab:cpu/x86/64/bootstrap.factor" parse-file suffix! >> call diff --git a/basis/cpu/x86/64/winnt/bootstrap.factor b/basis/cpu/x86/64/winnt/bootstrap.factor index 2dd3e889a5..723c9baf37 100644 --- a/basis/cpu/x86/64/winnt/bootstrap.factor +++ b/basis/cpu/x86/64/winnt/bootstrap.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: bootstrap.image.private kernel namespaces system -layouts vocabs parser cpu.x86.assembler +layouts vocabs sequences cpu.x86.assembler cpu.x86.assembler.operands ; IN: bootstrap.x86 @@ -9,5 +9,5 @@ IN: bootstrap.x86 : arg1 ( -- reg ) RCX ; : arg2 ( -- reg ) RDX ; -<< "vocab:cpu/x86/64/bootstrap.factor" parse-file parsed >> +<< "vocab:cpu/x86/64/bootstrap.factor" parse-file suffix! >> call diff --git a/basis/cpu/x86/bootstrap.factor b/basis/cpu/x86/bootstrap.factor index fb94445f78..7930970193 100644 --- a/basis/cpu/x86/bootstrap.factor +++ b/basis/cpu/x86/bootstrap.factor @@ -1,9 +1,9 @@ ! Copyright (C) 2007, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: bootstrap.image.private kernel kernel.private namespaces system -layouts compiler.units math math.private compiler.constants vocabs -slots.private words locals.backend make sequences combinators arrays - cpu.x86.assembler cpu.x86.assembler.operands ; +USING: bootstrap.image.private compiler.constants +compiler.units cpu.x86.assembler cpu.x86.assembler.operands +kernel kernel.private layouts locals.backend make math +math.private namespaces sequences slots.private vocabs ; IN: bootstrap.x86 big-endian off diff --git a/basis/functors/functors.factor b/basis/functors/functors.factor index dacd87507b..1d11d78b33 100644 --- a/basis/functors/functors.factor +++ b/basis/functors/functors.factor @@ -42,85 +42,85 @@ M: fake-call-next-method (fake-quotations>) M: object (fake-quotations>) , ; : parse-definition* ( accum -- accum ) - parse-definition >fake-quotations parsed + parse-definition >fake-quotations suffix! [ fake-quotations> first ] over push-all ; : parse-declared* ( accum -- accum ) complete-effect [ parse-definition* ] dip - parsed ; + suffix! ; FUNCTOR-SYNTAX: TUPLE: - scan-param parsed + scan-param suffix! scan { - { ";" [ tuple parsed f parsed ] } - { "<" [ scan-param parsed [ parse-tuple-slots ] { } make parsed ] } + { ";" [ tuple suffix! f suffix! ] } + { "<" [ scan-param suffix! [ parse-tuple-slots ] { } make suffix! ] } [ - [ tuple parsed ] dip + [ tuple suffix! ] dip [ parse-slot-name [ parse-tuple-slots ] when ] { } - make parsed + make suffix! ] } case - \ define-tuple-class parsed ; + \ define-tuple-class suffix! ; FUNCTOR-SYNTAX: SINGLETON: - scan-param parsed - \ define-singleton-class parsed ; + scan-param suffix! + \ define-singleton-class suffix! ; FUNCTOR-SYNTAX: MIXIN: - scan-param parsed - \ define-mixin-class parsed ; + scan-param suffix! + \ define-mixin-class suffix! ; FUNCTOR-SYNTAX: M: - scan-param parsed - scan-param parsed + scan-param suffix! + scan-param suffix! [ create-method-in dup method-body set ] over push-all parse-definition* - \ define* parsed ; + \ define* suffix! ; FUNCTOR-SYNTAX: C: - scan-param parsed - scan-param parsed + scan-param suffix! + scan-param suffix! complete-effect - [ [ [ boa ] curry ] over push-all ] dip parsed - \ define-declared* parsed ; + [ [ [ boa ] curry ] over push-all ] dip suffix! + \ define-declared* suffix! ; FUNCTOR-SYNTAX: : - scan-param parsed + scan-param suffix! parse-declared* - \ define-declared* parsed ; + \ define-declared* suffix! ; FUNCTOR-SYNTAX: SYMBOL: - scan-param parsed - \ define-symbol parsed ; + scan-param suffix! + \ define-symbol suffix! ; FUNCTOR-SYNTAX: SYNTAX: - scan-param parsed + scan-param suffix! parse-definition* - \ define-syntax parsed ; + \ define-syntax suffix! ; FUNCTOR-SYNTAX: INSTANCE: - scan-param parsed - scan-param parsed - \ add-mixin-instance parsed ; + scan-param suffix! + scan-param suffix! + \ add-mixin-instance suffix! ; FUNCTOR-SYNTAX: GENERIC: - scan-param parsed - complete-effect parsed - \ define-simple-generic* parsed ; + scan-param suffix! + complete-effect suffix! + \ define-simple-generic* suffix! ; FUNCTOR-SYNTAX: MACRO: - scan-param parsed + scan-param suffix! parse-declared* - \ define-macro parsed ; + \ define-macro suffix! ; FUNCTOR-SYNTAX: inline [ word make-inline ] over push-all ; -FUNCTOR-SYNTAX: call-next-method T{ fake-call-next-method } parsed ; +FUNCTOR-SYNTAX: call-next-method T{ fake-call-next-method } suffix! ; : (INTERPOLATE) ( accum quot -- accum ) [ scan interpolate-locals ] dip - '[ _ with-string-writer @ ] parsed ; + '[ _ with-string-writer @ ] suffix! ; PRIVATE> diff --git a/basis/html/templates/fhtml/fhtml.factor b/basis/html/templates/fhtml/fhtml.factor index a98a21f177..d4cb484a79 100644 --- a/basis/html/templates/fhtml/fhtml.factor +++ b/basis/html/templates/fhtml/fhtml.factor @@ -31,14 +31,14 @@ DEFER: <% delimiter : found-<% ( accum lexer col -- accum ) [ over line-text>> - [ column>> ] 2dip subseq parsed - \ write parsed + [ column>> ] 2dip subseq suffix! + \ write suffix! ] 2keep 2 + >>column drop ; : still-looking ( accum lexer -- accum ) [ [ line-text>> ] [ column>> ] bi tail - parsed \ print parsed + suffix! \ print suffix! ] keep next-line ; : parse-%> ( accum lexer -- accum ) diff --git a/basis/io/encodings/iso2022/iso2022.factor b/basis/io/encodings/iso2022/iso2022.factor index a057df28e0..1726426777 100644 --- a/basis/io/encodings/iso2022/iso2022.factor +++ b/basis/io/encodings/iso2022/iso2022.factor @@ -31,7 +31,7 @@ M: iso2022 M: iso2022 make-iso-coder ; -<< SYNTAX: ESC HEX: 16 parsed ; >> +<< SYNTAX: ESC HEX: 16 suffix! ; >> CONSTANT: switch-ascii B{ ESC CHAR: ( CHAR: B } CONSTANT: switch-jis201 B{ ESC CHAR: ( CHAR: J } diff --git a/basis/locals/locals.factor b/basis/locals/locals.factor index 9e26a8caaa..4f908aaf06 100644 --- a/basis/locals/locals.factor +++ b/basis/locals/locals.factor @@ -7,7 +7,7 @@ IN: locals SYNTAX: :> scan locals get [ :>-outside-lambda-error ] unless* - [ make-local ] bind parsed ; + [ make-local ] bind suffix! ; SYNTAX: [| parse-lambda over push-all ; diff --git a/basis/math/rectangles/rectangles.factor b/basis/math/rectangles/rectangles.factor index c8569dfdb9..bfde391884 100644 --- a/basis/math/rectangles/rectangles.factor +++ b/basis/math/rectangles/rectangles.factor @@ -8,7 +8,7 @@ TUPLE: rect { loc initial: { 0 0 } } { dim initial: { 0 0 } } ; : ( loc dim -- rect ) rect boa ; inline -SYNTAX: RECT: scan-object scan-object parsed ; +SYNTAX: RECT: scan-object scan-object suffix! ; : ( -- rect ) rect new ; inline @@ -64,4 +64,4 @@ M: rect contains-point? USING: vocabs vocabs.loader ; -"prettyprint" vocab [ "math.rectangles.prettyprint" require ] when \ No newline at end of file +"prettyprint" vocab [ "math.rectangles.prettyprint" require ] when diff --git a/basis/multiline/multiline.factor b/basis/multiline/multiline.factor index e28537066b..5182c33e59 100644 --- a/basis/multiline/multiline.factor +++ b/basis/multiline/multiline.factor @@ -81,10 +81,10 @@ SYNTAX: HEREDOC: lexer get skip-blank rest-of-line lexer get next-line - parse-til-line-begins parsed ; + parse-til-line-begins suffix! ; SYNTAX: DELIMITED: lexer get skip-blank rest-of-line lexer get next-line - 0 (parse-multiline-string) parsed ; + 0 (parse-multiline-string) suffix! ; diff --git a/basis/opengl/debug/debug.factor b/basis/opengl/debug/debug.factor index 7cbdf62346..cd0985b1b0 100644 --- a/basis/opengl/debug/debug.factor +++ b/basis/opengl/debug/debug.factor @@ -19,5 +19,5 @@ SYMBOL: G-world << \ gl-break t "break?" set-word-prop >> SYNTAX: GB - \ gl-break parsed ; + \ gl-break suffix! ; diff --git a/basis/peg/ebnf/ebnf.factor b/basis/peg/ebnf/ebnf.factor index 136007e7ce..a7fd07a5ec 100644 --- a/basis/peg/ebnf/ebnf.factor +++ b/basis/peg/ebnf/ebnf.factor @@ -547,12 +547,12 @@ PRIVATE> SYNTAX: " reset-tokenizer parse-multiline-string parse-ebnf main swap at - parsed reset-tokenizer ; + suffix! reset-tokenizer ; SYNTAX: [EBNF "EBNF]" reset-tokenizer parse-multiline-string ebnf>quot nip - parsed \ call parsed reset-tokenizer ; + suffix! \ call suffix! reset-tokenizer ; SYNTAX: EBNF: reset-tokenizer CREATE-WORD dup ";EBNF" parse-multiline-string diff --git a/basis/persistent/hashtables/config/config.factor b/basis/persistent/hashtables/config/config.factor index cb2abd8015..190db9e9ab 100644 --- a/basis/persistent/hashtables/config/config.factor +++ b/basis/persistent/hashtables/config/config.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: layouts kernel parser math ; +USING: layouts kernel parser math sequences ; IN: persistent.hashtables.config -: radix-bits ( -- n ) << cell 4 = 4 5 ? parsed >> ; foldable +: radix-bits ( -- n ) << cell 4 = 4 5 ? suffix! >> ; foldable : radix-mask ( -- n ) radix-bits 2^ 1 - ; foldable : full-bitmap-mask ( -- n ) radix-bits 2^ 2^ 1 - ; inline diff --git a/basis/prettyprint/prettyprint-docs.factor b/basis/prettyprint/prettyprint-docs.factor index e17e14f323..bd2c4bd924 100644 --- a/basis/prettyprint/prettyprint-docs.factor +++ b/basis/prettyprint/prettyprint-docs.factor @@ -121,7 +121,7 @@ ARTICLE: "prettyprint-literal" "Literal prettyprinting protocol" " scan-word \\ * assert=" " scan-word" " scan-word \\ ] assert=" - " parsed ;" + " suffix! ;" } "An example literal might be:" { $code "RECT[ 100 * 200 ]" } diff --git a/basis/regexp/regexp.factor b/basis/regexp/regexp.factor index ba4aa47e7b..e9a86516ca 100644 --- a/basis/regexp/regexp.factor +++ b/basis/regexp/regexp.factor @@ -200,7 +200,7 @@ PRIVATE> : parsing-regexp ( accum end -- accum ) lexer get [ take-until ] [ parse-noblank-token ] bi - compile-next-match parsed ; + compile-next-match suffix! ; PRIVATE> diff --git a/basis/roman/roman.factor b/basis/roman/roman.factor index 817b6637d6..bc86db31c6 100644 --- a/basis/roman/roman.factor +++ b/basis/roman/roman.factor @@ -69,4 +69,4 @@ ROMAN-OP: * ROMAN-OP: /i ROMAN-OP: /mod -SYNTAX: ROMAN: scan roman> parsed ; +SYNTAX: ROMAN: scan roman> suffix! ; diff --git a/basis/serialize/serialize-tests.factor b/basis/serialize/serialize-tests.factor index cebf69595f..6dbc76386d 100644 --- a/basis/serialize/serialize-tests.factor +++ b/basis/serialize/serialize-tests.factor @@ -50,7 +50,7 @@ CONSTANT: objects B{ 50 13 55 64 1 } ?{ t f t f f t f } double-array{ 1.0 3.0 4.0 1.0 2.35 0.33 } - << 1 [ 2 ] curry parsed >> + << 1 [ 2 ] curry suffix! >> { { "a" "bc" } { "de" "fg" } } H{ { "a" "bc" } { "de" "fg" } } } diff --git a/basis/shuffle/shuffle.factor b/basis/shuffle/shuffle.factor index d6a4ba8bbb..079e81d082 100644 --- a/basis/shuffle/shuffle.factor +++ b/basis/shuffle/shuffle.factor @@ -20,7 +20,7 @@ MACRO: shuffle-effect ( effect -- ) ] [ ] make ; SYNTAX: shuffle( - ")" parse-effect parsed \ shuffle-effect parsed ; + ")" parse-effect suffix! \ shuffle-effect suffix! ; : 2swap ( x y z t -- z t x y ) 2 2 mnswap ; inline diff --git a/basis/specialized-arrays/specialized-arrays.factor b/basis/specialized-arrays/specialized-arrays.factor index 7a15e5067d..711354d803 100755 --- a/basis/specialized-arrays/specialized-arrays.factor +++ b/basis/specialized-arrays/specialized-arrays.factor @@ -105,7 +105,7 @@ M: A pprint-delims drop \ A{ \ } ; M: A >pprint-sequence ; SYNTAX: A{ \ } [ >A ] parse-literal ; -SYNTAX: A@ scan-object scan-object parsed ; +SYNTAX: A@ scan-object scan-object suffix! ; INSTANCE: A specialized-array diff --git a/basis/tools/test/test.factor b/basis/tools/test/test.factor index 097460837b..009789a739 100644 --- a/basis/tools/test/test.factor +++ b/basis/tools/test/test.factor @@ -96,9 +96,9 @@ MACRO: ( word -- ) ] [ drop ] if ; inline : parse-test ( accum word -- accum ) - literalize parsed - lexer get line>> parsed - \ experiment parsed ; inline + literalize suffix! + lexer get line>> suffix! + \ experiment suffix! ; inline << diff --git a/basis/tools/walker/walker.factor b/basis/tools/walker/walker.factor index 19924d67e4..35a9ce7787 100644 --- a/basis/tools/walker/walker.factor +++ b/basis/tools/walker/walker.factor @@ -167,4 +167,4 @@ SYMBOL: +stopped+ ! For convenience IN: syntax -SYNTAX: B \ break parsed ; +SYNTAX: B \ break suffix! ; diff --git a/basis/urls/urls.factor b/basis/urls/urls.factor index a72fac567a..bf4a9bb76c 100644 --- a/basis/urls/urls.factor +++ b/basis/urls/urls.factor @@ -181,7 +181,7 @@ PRIVATE> clone dup protocol>> '[ _ protocol-port or ] change-port ; ! Literal syntax -SYNTAX: URL" lexer get skip-blank parse-string >url parsed ; +SYNTAX: URL" lexer get skip-blank parse-string >url suffix! ; USING: vocabs vocabs.loader ; diff --git a/basis/values/values.factor b/basis/values/values.factor index b15dcebe49..4329affe82 100644 --- a/basis/values/values.factor +++ b/basis/values/values.factor @@ -44,8 +44,8 @@ M: value-word definition drop f ; def>> first (>>obj) ; SYNTAX: to: - scan-word literalize parsed - \ set-value parsed ; + scan-word literalize suffix! + \ set-value suffix! ; : get-value ( word -- value ) def>> first obj>> ; diff --git a/basis/windows/com/syntax/syntax.factor b/basis/windows/com/syntax/syntax.factor index bbade332cc..fc7d986cbc 100755 --- a/basis/windows/com/syntax/syntax.factor +++ b/basis/windows/com/syntax/syntax.factor @@ -101,7 +101,7 @@ SYNTAX: COM-INTERFACE: dup save-com-interface-definition define-words-for-com-interface ; -SYNTAX: GUID: scan string>guid parsed ; +SYNTAX: GUID: scan string>guid suffix! ; USING: vocabs vocabs.loader ; diff --git a/basis/xml/syntax/syntax.factor b/basis/xml/syntax/syntax.factor index 5b2a0bcfb4..4b9900d3b0 100644 --- a/basis/xml/syntax/syntax.factor +++ b/basis/xml/syntax/syntax.factor @@ -156,16 +156,16 @@ MACRO: interpolate-xml ( xml -- quot ) : collect ( accum variables -- accum ? ) { { [ dup empty? ] [ drop f ] } ! Just a literal - { [ dup [ ] all? ] [ >search-hash parsed t ] } ! locals - { [ dup [ not ] all? ] [ length parsed \ nenum parsed t ] } ! fry + { [ dup [ ] all? ] [ >search-hash suffix! t ] } ! locals + { [ dup [ not ] all? ] [ length suffix! \ nenum suffix! t ] } ! fry [ drop "XML interpolation contains both fry and locals" throw ] ! mixed } cond ; : parse-def ( accum delimiter quot -- accum ) [ parse-multiline-string [ blank? ] trim ] dip call [ extract-variables collect ] keep swap - [ number<-> parsed ] dip - [ \ interpolate-xml parsed ] when ; inline + [ number<-> suffix! ] dip + [ \ interpolate-xml suffix! ] when ; inline PRIVATE> diff --git a/core/parser/parser-docs.factor b/core/parser/parser-docs.factor index 888f9f3b4c..844581c6d9 100644 --- a/core/parser/parser-docs.factor +++ b/core/parser/parser-docs.factor @@ -66,7 +66,7 @@ $nl $nl "Parsing words can read input, add word definitions to the dictionary, and do anything an ordinary word can." $nl -"Because of the stack restriction, parsing words cannot pass data to other words by leaving values on the stack; instead, use " { $link parsed } " to add the data to the parse tree so that it can be evaluated later." +"Because of the stack restriction, parsing words cannot pass data to other words by leaving values on the stack; instead, use " { $link suffix! } " to add the data to the parse tree so that it can be evaluated later." $nl "Parsing words cannot be called from the same source file where they are defined, because new definitions are only compiled at the end of the source file. An attempt to use a parsing word in its own source file raises an error:" { $subsections staging-violation } @@ -172,11 +172,6 @@ $parsing-note ; { parse-tokens (parse-until) parse-until } related-words -HELP: parsed -{ $values { "accum" vector } { "obj" object } } -{ $description "Convenience word for parsing words. It behaves exactly the same as " { $link push } ", except the accumulator remains on the stack." } -$parsing-note ; - HELP: (parse-lines) { $values { "lexer" lexer } { "quot" "a new " { $link quotation } } } { $description "Parses Factor source code using a custom lexer. The vocabulary search path is taken from the current scope." } diff --git a/core/parser/parser.factor b/core/parser/parser.factor index 3152afc093..d920e1fc73 100644 --- a/core/parser/parser.factor +++ b/core/parser/parser.factor @@ -79,8 +79,6 @@ HOOK: parse-quotation quotation-parser ( -- quot ) M: f parse-quotation \ ] parse-until >quotation ; -: parsed ( accum obj -- accum ) over push ; - : (parse-lines) ( lexer -- quot ) [ f parse-until >quotation ] with-lexer ; @@ -88,7 +86,7 @@ M: f parse-quotation \ ] parse-until >quotation ; lexer-factory get call( lines -- lexer ) (parse-lines) ; : parse-literal ( accum end quot -- accum ) - [ parse-until ] dip call parsed ; inline + [ parse-until ] dip call suffix! ; inline : parse-definition ( -- quot ) \ ; parse-until >quotation ; @@ -104,7 +102,7 @@ ERROR: bad-number ; scan swap base> [ bad-number ] unless* ; : parse-base ( parsed base -- parsed ) - scan-base parsed ; + scan-base suffix! ; SYMBOL: bootstrap-syntax diff --git a/core/sequences/sequences.factor b/core/sequences/sequences.factor index c74a7c3ad0..6a40e2236b 100755 --- a/core/sequences/sequences.factor +++ b/core/sequences/sequences.factor @@ -650,6 +650,10 @@ PRIVATE> [ 0 swap copy ] keep ] new-like ; +: suffix! ( seq elt -- seq ) over push ; + +: append! ( seq1 seq2 -- seq1 ) over push-all ; + : last ( seq -- elt ) [ length 1 - ] [ nth ] bi ; : set-last ( elt seq -- ) [ length 1 - ] keep set-nth ; diff --git a/core/syntax/syntax.factor b/core/syntax/syntax.factor index 80c7a42f30..dfb3e0bc10 100644 --- a/core/syntax/syntax.factor +++ b/core/syntax/syntax.factor @@ -73,9 +73,9 @@ IN: bootstrap.syntax "OCT:" [ 8 parse-base ] define-core-syntax "BIN:" [ 2 parse-base ] define-core-syntax - "NAN:" [ 16 scan-base parsed ] define-core-syntax + "NAN:" [ 16 scan-base suffix! ] define-core-syntax - "f" [ f parsed ] define-core-syntax + "f" [ f suffix! ] define-core-syntax "t" "syntax" lookup define-singleton-class "CHAR:" [ @@ -83,31 +83,31 @@ IN: bootstrap.syntax { [ dup length 1 = ] [ first ] } { [ "\\" ?head ] [ next-escape >string "" assert= ] } [ name>char-hook get call( name -- char ) ] - } cond parsed + } cond suffix! ] define-core-syntax - "\"" [ parse-multiline-string parsed ] define-core-syntax + "\"" [ parse-multiline-string suffix! ] define-core-syntax "SBUF\"" [ - lexer get skip-blank parse-string >sbuf parsed + lexer get skip-blank parse-string >sbuf suffix! ] define-core-syntax "P\"" [ - lexer get skip-blank parse-string parsed + lexer get skip-blank parse-string suffix! ] define-core-syntax - "[" [ parse-quotation parsed ] define-core-syntax + "[" [ parse-quotation suffix! ] define-core-syntax "{" [ \ } [ >array ] parse-literal ] define-core-syntax "V{" [ \ } [ >vector ] parse-literal ] define-core-syntax "B{" [ \ } [ >byte-array ] parse-literal ] define-core-syntax "BV{" [ \ } [ >byte-vector ] parse-literal ] define-core-syntax "H{" [ \ } [ >hashtable ] parse-literal ] define-core-syntax - "T{" [ parse-tuple-literal parsed ] define-core-syntax + "T{" [ parse-tuple-literal suffix! ] define-core-syntax "W{" [ \ } [ first ] parse-literal ] define-core-syntax - "POSTPONE:" [ scan-word parsed ] define-core-syntax - "\\" [ scan-word parsed ] define-core-syntax - "M\\" [ scan-word scan-word method parsed ] define-core-syntax + "POSTPONE:" [ scan-word suffix! ] define-core-syntax + "\\" [ scan-word suffix! ] define-core-syntax + "M\\" [ scan-word scan-word method suffix! ] define-core-syntax "inline" [ word make-inline ] define-core-syntax "recursive" [ word make-recursive ] define-core-syntax "foldable" [ word make-foldable ] define-core-syntax @@ -227,7 +227,7 @@ IN: bootstrap.syntax ] define-core-syntax "((" [ - "))" parse-effect parsed + "))" parse-effect suffix! ] define-core-syntax "MAIN:" [ scan-word current-vocab (>>main) ] define-core-syntax @@ -240,8 +240,8 @@ IN: bootstrap.syntax "call-next-method" [ current-method get [ - literalize parsed - \ (call-next-method) parsed + literalize suffix! + \ (call-next-method) suffix! ] [ not-in-a-method-error ] if* diff --git a/extra/alien/data/map/map.factor b/extra/alien/data/map/map.factor index 62bd45938b..6c93e8f4b6 100644 --- a/extra/alien/data/map/map.factor +++ b/extra/alien/data/map/map.factor @@ -118,14 +118,14 @@ MACRO: data-map! ( ins outs -- ) : parse-data-map-effect ( accum -- accum ) ")" parse-effect - [ in>> [ (parse-c-type) ] map parsed ] - [ out>> [ (parse-c-type) ] map parsed ] bi ; + [ in>> [ (parse-c-type) ] map suffix! ] + [ out>> [ (parse-c-type) ] map suffix! ] bi ; PRIVATE> SYNTAX: data-map( - parse-data-map-effect \ data-map parsed ; + parse-data-map-effect \ data-map suffix! ; SYNTAX: data-map!( - parse-data-map-effect \ data-map! parsed ; + parse-data-map-effect \ data-map! suffix! ; diff --git a/extra/annotations/annotations.factor b/extra/annotations/annotations.factor index 387c73abe4..e463206e4f 100644 --- a/extra/annotations/annotations.factor +++ b/extra/annotations/annotations.factor @@ -7,7 +7,7 @@ IN: annotations << : (parse-annotation) ( accum -- accum ) - lexer get [ line-text>> parsed ] [ next-line ] bi ; + lexer get [ line-text>> suffix! ] [ next-line ] bi ; : (non-annotation-usage) ( word -- usages ) smart-usage @@ -24,7 +24,7 @@ NAMEs. DEFINES ${NAME}s. WHERE : (NAME) ( str -- ) drop ; inline -SYNTAX: !NAME (parse-annotation) \ (NAME) parsed ; +SYNTAX: !NAME (parse-annotation) \ (NAME) suffix! ; : NAMEs ( -- usages ) \ (NAME) (non-annotation-usage) ; diff --git a/extra/db/info/info.factor b/extra/db/info/info.factor index 66409f2834..4d17b6bf10 100644 --- a/extra/db/info/info.factor +++ b/extra/db/info/info.factor @@ -10,6 +10,6 @@ SYNTAX: get-psql-info get-info 5 firstn [ >>username ] [ [ f ] [ ] if-empty >>password ] [ >>database ] - } spread parsed ; + } spread suffix! ; -SYNTAX: get-sqlite-info get-info first parsed ; \ No newline at end of file +SYNTAX: get-sqlite-info get-info first suffix! ; diff --git a/extra/decimals/decimals.factor b/extra/decimals/decimals.factor index ae1fb2f9a3..8ca9ea91c5 100644 --- a/extra/decimals/decimals.factor +++ b/extra/decimals/decimals.factor @@ -20,7 +20,7 @@ TUPLE: decimal { mantissa read-only } { exponent read-only } ; : parse-decimal ( -- decimal ) scan string>decimal ; -SYNTAX: D: parse-decimal parsed ; +SYNTAX: D: parse-decimal suffix! ; : decimal>ratio ( decimal -- ratio ) >decimal< 10^ * ; : decimal>float ( decimal -- ratio ) decimal>ratio >float ; diff --git a/extra/infix/infix.factor b/extra/infix/infix.factor index ce19780058..4530d6c5c4 100644 --- a/extra/infix/infix.factor +++ b/extra/infix/infix.factor @@ -82,7 +82,7 @@ M: ast-function infix-codegen PRIVATE> SYNTAX: [infix - "infix]" [infix-parse parsed \ call parsed ; + "infix]" [infix-parse suffix! \ call suffix! ; : morse> ( morse -- plain ) replace-underscores morse>sentence ; -SYNTAX: [MORSE "MORSE]" parse-multiline-string morse> parsed ; +SYNTAX: [MORSE "MORSE]" parse-multiline-string morse> suffix! ; dup pop scan-object 2array parsed ; +SYNTAX: => dup pop scan-object 2array suffix! ; diff --git a/extra/persistency/persistency.factor b/extra/persistency/persistency.factor index f459eca7e4..db999f4c98 100644 --- a/extra/persistency/persistency.factor +++ b/extra/persistency/persistency.factor @@ -26,5 +26,5 @@ SYNTAX: STORED-TUPLE: parse-tuple-definition [ drop persistent ] dip [ remove-ty : remove-tuples ( tuple -- ) [ delete-tuples ] w/db ; TUPLE: pattern value ; C: pattern -SYNTAX: %" parse-string parsed ; +SYNTAX: %" parse-string suffix! ; M: pattern where value>> over column-name>> 0% " LIKE " 0% bind# ; diff --git a/extra/qw/qw.factor b/extra/qw/qw.factor index ce96587c92..e0ad6e0a74 100644 --- a/extra/qw/qw.factor +++ b/extra/qw/qw.factor @@ -1,5 +1,5 @@ ! (c)2009 Joe Groff bsd license -USING: lexer parser ; +USING: lexer sequences parser ; IN: qw -SYNTAX: qw{ "}" parse-tokens parsed ; +SYNTAX: qw{ "}" parse-tokens suffix! ; diff --git a/extra/slides/slides.factor b/extra/slides/slides.factor index af37580ff2..19b0dead48 100755 --- a/extra/slides/slides.factor +++ b/extra/slides/slides.factor @@ -99,7 +99,7 @@ TUPLE: slides < book ; ] with map ; SYNTAX: STRIP-TEASE: - parse-definition strip-tease [ parsed ] each ; + parse-definition strip-tease [ suffix! ] each ; \ slides H{ { T{ button-down } [ request-focus ] } diff --git a/unmaintained/advice/advice.factor b/unmaintained/advice/advice.factor index 44280456c1..8e22609714 100644 --- a/unmaintained/advice/advice.factor +++ b/unmaintained/advice/advice.factor @@ -66,4 +66,4 @@ SYNTAX: ADVISE: ! word adname location => word adname quot loc scan-word scan scan-word parse-definition swap [ spin ] dip advise ; SYNTAX: UNADVISE: - scan-word parsed \ unadvise parsed ; + scan-word suffix! \ unadvise suffix! ;