string-parser ( -- parser ) (original) (raw)

Vocabulary
parser-combinators.simple

Inputs
None

Outputs

parser a parser object

Word description
Return a parser that consumes a string enclosed in quotations from the input string. The string value consumed is the result of the parse.

Examples

USING: lists.lazy parser-combinators parser-combinators.simple prettyprint ; "\"foo\"" string-parser parse-1 .
"foo"

See also
$see-also, digit-parser, integer-parser, bold-parser, italic-parser, comma-list

Definition

USING: kernel parser-combinators strings ;

IN: parser-combinators.simple

: string-parser ( -- parser )
[ 34 = ] satisfy [ 34 = not ] satisfy <*> &>
[ 34 = ] satisfy <& [ >string ] <@ ;