diff --git a/extra/peg/parsers/parsers-docs.factor b/extra/peg/parsers/parsers-docs.factor index d71fdaea3b..7ffd458fce 100755 --- a/extra/peg/parsers/parsers-docs.factor +++ b/extra/peg/parsers/parsers-docs.factor @@ -11,7 +11,7 @@ HELP: 1token } { $description "Calls 1string on a character and returns a parser that matches that character." } { $examples - { $example "USING: peg peg.parsers prettyprint ;" "\"a\" CHAR: a 1token parse parse-result-ast ." "\"a\"" } + { $example "USING: peg peg.parsers prettyprint ;" "\"a\" CHAR: a 1token parse ." "\"a\"" } } { $see-also 'string' } ; HELP: (list-of) @@ -33,8 +33,8 @@ HELP: list-of "Returns a parser that returns a list of items separated by the separator parser. Hides the separators and matches a list of one or more items." } { $notes "Use " { $link list-of-many } " to ensure a list contains two or more items." } { $examples - { $example "USING: peg peg.parsers prettyprint ;" "\"a\" \"a\" token \",\" token list-of parse parse-result-ast ." "V{ \"a\" }" } - { $example "USING: peg peg.parsers prettyprint ;" "\"a,a,a,a\" \"a\" token \",\" token list-of parse parse-result-ast ." "V{ \"a\" \"a\" \"a\" \"a\" }" } + { $example "USING: peg peg.parsers prettyprint ;" "\"a\" \"a\" token \",\" token list-of parse ." "V{ \"a\" }" } + { $example "USING: peg peg.parsers prettyprint ;" "\"a,a,a,a\" \"a\" token \",\" token list-of parse ." "V{ \"a\" \"a\" \"a\" \"a\" }" } } { $see-also list-of-many } ; HELP: list-of-many @@ -46,8 +46,8 @@ HELP: list-of-many "Returns a parser that returns a list of items separated by the separator parser. Hides the separators and matches a list of two or more items." } { $notes "Use " { $link list-of } " to return a list of only one item." } { $examples - { $example "USING: peg peg.parsers prettyprint ;" "\"a\" \"a\" token \",\" token list-of-many parse ." "f" } - { $example "USING: peg peg.parsers prettyprint ;" "\"a,a,a,a\" \"a\" token \",\" token list-of-many parse parse-result-ast ." "V{ \"a\" \"a\" \"a\" \"a\" }" } + { $code "USING: peg peg.parsers prettyprint ;" "\"a\" \"a\" token \",\" token list-of-many parse => exception" } + { $example "USING: peg peg.parsers prettyprint ;" "\"a,a,a,a\" \"a\" token \",\" token list-of-many parse ." "V{ \"a\" \"a\" \"a\" \"a\" }" } } { $see-also list-of } ; HELP: epsilon @@ -72,8 +72,8 @@ HELP: exactly-n } { $description "Returns a parser that matches an exact repetition of the input parser." } { $examples - { $example "USING: peg peg.parsers prettyprint ;" "\"aaa\" \"a\" token 4 exactly-n parse ." "f" } - { $example "USING: peg peg.parsers prettyprint ;" "\"aaaa\" \"a\" token 4 exactly-n parse parse-result-ast ." "V{ \"a\" \"a\" \"a\" \"a\" }" } + { $code "USING: peg peg.parsers prettyprint ;" "\"aaa\" \"a\" token 4 exactly-n parse => exception" } + { $example "USING: peg peg.parsers prettyprint ;" "\"aaaa\" \"a\" token 4 exactly-n parse ." "V{ \"a\" \"a\" \"a\" \"a\" }" } } { $see-also at-least-n at-most-n from-m-to-n } ; HELP: at-least-n @@ -84,9 +84,9 @@ HELP: at-least-n } { $description "Returns a parser that matches n or more repetitions of the input parser." } { $examples - { $example "USING: peg peg.parsers prettyprint ;" "\"aaa\" \"a\" token 4 at-least-n parse ." "f" } - { $example "USING: peg peg.parsers prettyprint ;" "\"aaaa\" \"a\" token 4 at-least-n parse parse-result-ast ." "V{ \"a\" \"a\" \"a\" \"a\" }" } - { $example "USING: peg peg.parsers prettyprint ;" "\"aaaaa\" \"a\" token 4 at-least-n parse parse-result-ast ." "V{ \"a\" \"a\" \"a\" \"a\" \"a\" }" } + { $code "USING: peg peg.parsers prettyprint ;" "\"aaa\" \"a\" token 4 at-least-n parse => exception"} + { $example "USING: peg peg.parsers prettyprint ;" "\"aaaa\" \"a\" token 4 at-least-n parse ." "V{ \"a\" \"a\" \"a\" \"a\" }" } + { $example "USING: peg peg.parsers prettyprint ;" "\"aaaaa\" \"a\" token 4 at-least-n parse ." "V{ \"a\" \"a\" \"a\" \"a\" \"a\" }" } } { $see-also exactly-n at-most-n from-m-to-n } ; HELP: at-most-n @@ -97,8 +97,8 @@ HELP: at-most-n } { $description "Returns a parser that matches n or fewer repetitions of the input parser." } { $examples - { $example "USING: peg peg.parsers prettyprint ;" "\"aaaa\" \"a\" token 4 at-most-n parse parse-result-ast ." "V{ \"a\" \"a\" \"a\" \"a\" }" } - { $example "USING: peg peg.parsers prettyprint ;" "\"aaaaa\" \"a\" token 4 at-most-n parse parse-result-ast ." "V{ \"a\" \"a\" \"a\" \"a\" }" } + { $example "USING: peg peg.parsers prettyprint ;" "\"aaaa\" \"a\" token 4 at-most-n parse ." "V{ \"a\" \"a\" \"a\" \"a\" }" } + { $example "USING: peg peg.parsers prettyprint ;" "\"aaaaa\" \"a\" token 4 at-most-n parse ." "V{ \"a\" \"a\" \"a\" \"a\" }" } } { $see-also exactly-n at-least-n from-m-to-n } ; HELP: from-m-to-n @@ -110,9 +110,9 @@ HELP: from-m-to-n } { $description "Returns a parser that matches between and including m to n repetitions of the input parser." } { $examples - { $example "USING: peg peg.parsers prettyprint ;" "\"aaa\" \"a\" token 3 4 from-m-to-n parse parse-result-ast ." "V{ \"a\" \"a\" \"a\" }" } - { $example "USING: peg peg.parsers prettyprint ;" "\"aaaa\" \"a\" token 3 4 from-m-to-n parse parse-result-ast ." "V{ \"a\" \"a\" \"a\" \"a\" }" } - { $example "USING: peg peg.parsers prettyprint ;" "\"aaaaa\" \"a\" token 3 4 from-m-to-n parse parse-result-ast ." "V{ \"a\" \"a\" \"a\" \"a\" }" } + { $example "USING: peg peg.parsers prettyprint ;" "\"aaa\" \"a\" token 3 4 from-m-to-n parse ." "V{ \"a\" \"a\" \"a\" }" } + { $example "USING: peg peg.parsers prettyprint ;" "\"aaaa\" \"a\" token 3 4 from-m-to-n parse ." "V{ \"a\" \"a\" \"a\" \"a\" }" } + { $example "USING: peg peg.parsers prettyprint ;" "\"aaaaa\" \"a\" token 3 4 from-m-to-n parse ." "V{ \"a\" \"a\" \"a\" \"a\" }" } } { $see-also exactly-n at-most-n at-least-n } ; HELP: pack @@ -124,7 +124,7 @@ HELP: pack } { $description "Returns a parser that parses the begin, body, and end parsers in order. The begin and end parsers are hidden." } { $examples - { $example "USING: peg peg.parsers prettyprint ;" "\"hi123bye\" \"hi\" token 'integer' \"bye\" token pack parse parse-result-ast ." "123" } + { $example "USING: peg peg.parsers prettyprint ;" "\"hi123bye\" \"hi\" token 'integer' \"bye\" token pack parse ." "123" } } { $see-also surrounded-by } ; HELP: surrounded-by @@ -136,7 +136,7 @@ HELP: surrounded-by } { $description "Calls token on begin and end to make them into string parsers. Returns a parser that parses the begin, body, and end parsers in order. The begin and end parsers are hidden." } { $examples - { $example "USING: peg peg.parsers prettyprint ;" "\"hi123bye\" 'integer' \"hi\" \"bye\" surrounded-by parse parse-result-ast ." "123" } + { $example "USING: peg peg.parsers prettyprint ;" "\"hi123bye\" 'integer' \"hi\" \"bye\" surrounded-by parse ." "123" } } { $see-also pack } ; HELP: 'digit' @@ -173,7 +173,7 @@ HELP: range-pattern "of characters separated with a dash (-) represents the " "range of characters from the first to the second, inclusive." { $examples - { $example "USING: peg peg.parsers prettyprint strings ;" "\"a\" \"_a-zA-Z\" range-pattern parse parse-result-ast 1string ." "\"a\"" } - { $example "USING: peg peg.parsers prettyprint ;\n\"0\" \"^0-9\" range-pattern parse ." "f" } + { $example "USING: peg peg.parsers prettyprint strings ;" "\"a\" \"_a-zA-Z\" range-pattern parse 1string ." "\"a\"" } + { $code "USING: peg peg.parsers prettyprint ;\n\"0\" \"^0-9\" range-pattern parse => exception"} } } ; diff --git a/extra/peg/peg-docs.factor b/extra/peg/peg-docs.factor index 10e05a2512..00390c1b1e 100644 --- a/extra/peg/peg-docs.factor +++ b/extra/peg/peg-docs.factor @@ -7,11 +7,11 @@ HELP: parse { $values { "input" "a string" } { "parser" "a parser" } - { "result" "a parse-result or f" } + { "ast" "an object" } } { $description - "Given the input string, parse it using the given parser. The result is a object if " - "the parse was successful, otherwise it is f." } + "Given the input string, parse it using the given parser. The result is the abstract " + "syntax tree returned by the parser." } { $see-also compile } ; HELP: compile @@ -20,7 +20,7 @@ HELP: compile { "word" "a word" } } { $description - "Compile the parser to a word. The word will have stack effect ( -- result )." + "Compile the parser to a word. The word will have stack effect ( -- ast )." } { $see-also parse } ; @@ -104,8 +104,7 @@ HELP: semantic "Returns a parser that succeeds if the 'p1' parser succeeds and the quotation called with " "the AST produced by 'p1' on the stack returns true." } { $examples - { $example "USING: kernel math peg prettyprint ;" "\"A\" [ drop t ] satisfy [ 66 > ] semantic parse ." "f" } - { $example "USING: kernel math peg prettyprint ;" "\"C\" [ drop t ] satisfy [ 66 > ] semantic parse parse-result-ast ." "67" } + { $example "USING: kernel math peg prettyprint ;" "\"C\" [ drop t ] satisfy [ 66 > ] semantic parse ." "67" } } ; HELP: ensure diff --git a/extra/ui/gadgets/frames/frames-docs.factor b/extra/ui/gadgets/frames/frames-docs.factor index bb759cf92e..db3ae856b1 100755 --- a/extra/ui/gadgets/frames/frames-docs.factor +++ b/extra/ui/gadgets/frames/frames-docs.factor @@ -8,7 +8,6 @@ ARTICLE: "ui-frame-layout" "Frame layouts" "Creating empty frames:" { $subsection } "Creating new frames using a combinator:" -{ $subsection make-frame } { $subsection frame, } "A set of mnemonic words for the positions on a frame's 3x3 grid; these words push values which may be passed to " { $link grid-add } " or " { $link frame, } ":" { $subsection @center } @@ -44,15 +43,9 @@ HELP: { $values { "frame" frame } } { $description "Creates a new " { $link frame } " for laying out gadgets in a 3x3 grid." } ; -{ make-frame } related-words - -HELP: make-frame -{ $values { "quot" quotation } { "frame" frame } } -{ $description "Creates a new frame. The quotation can add children by calling the " { $link frame, } " word." } ; - HELP: frame, { $values { "gadget" gadget } { "i" "non-negative integer" } { "j" "non-negative integer" } } -{ $description "Adds a child gadget at the specified location. This word can only be called inside the quotation passed to " { $link make-frame } "." } ; +{ $description "Adds a child gadget at the specified location. This word can only be called inside the quotation passed to make-frame." } ; { grid frame } related-words diff --git a/extra/ui/gadgets/frames/frames.factor b/extra/ui/gadgets/frames/frames.factor index 717323c69a..4e0601d4c3 100644 --- a/extra/ui/gadgets/frames/frames.factor +++ b/extra/ui/gadgets/frames/frames.factor @@ -39,8 +39,5 @@ M: frame layout* [ rot rect-dim fill-center ] 3keep grid-layout ; -: make-frame ( quot -- frame ) - swap make-gadget ; inline - : frame, ( gadget i j -- ) gadget get -rot grid-add ; diff --git a/extra/ui/gadgets/gadgets-docs.factor b/extra/ui/gadgets/gadgets-docs.factor index 3437f1fdb4..ac428799ab 100755 --- a/extra/ui/gadgets/gadgets-docs.factor +++ b/extra/ui/gadgets/gadgets-docs.factor @@ -180,14 +180,6 @@ HELP: focusable-child { $values { "gadget" gadget } { "child" gadget } } { $description "Outputs the child of the gadget which would prefer to receive keyboard focus." } ; -HELP: make-gadget -{ $values { "gadget" gadget } { "quot" quotation } } -{ $description "Calls the quotation in a new scope with the gadget stored in the " { $link gadget } " variable." } ; - -HELP: with-gadget -{ $values { "gadget" gadget } { "quot" quotation } } -{ $description "Calls the quotation in a new scope with the " { $link gadget } " and " { $link make-gadget } " variables set to " { $snippet "gadget" } } ; - { control-value set-control-value gadget-model } related-words HELP: control-value diff --git a/extra/ui/gadgets/gadgets.factor b/extra/ui/gadgets/gadgets.factor index ef0a9e828d..19593d2f22 100755 --- a/extra/ui/gadgets/gadgets.factor +++ b/extra/ui/gadgets/gadgets.factor @@ -357,12 +357,6 @@ M: f request-focus-on 2drop ; : focus-path ( world -- seq ) [ focus>> ] follow ; -: with-gadget ( gadget quot -- ) - gadget swap with-variable ; inline - -: make-gadget ( gadget quot -- gadget ) - [ with-gadget ] [ drop ] 2bi ; inline - ! Deprecated : set-gadget-delegate ( gadget tuple -- ) over [ diff --git a/extra/ui/gadgets/labelled/labelled.factor b/extra/ui/gadgets/labelled/labelled.factor index 8f504aea14..686e940ae6 100755 --- a/extra/ui/gadgets/labelled/labelled.factor +++ b/extra/ui/gadgets/labelled/labelled.factor @@ -38,10 +38,9 @@ M: labelled-gadget focusable-child* labelled-gadget-content ; : ( text -- label )