Handbook
Glossary
take-quoted-string ( sequence-parser escape-char quote-char -- string )
Vocabulary
c
.
lexer
Inputs
sequence-parser
an
object
escape-char
an
object
quote-char
an
object
Outputs
string
an
object
Definition
USING:
accessors
combinators.short-circuit
kernel
sequences.parser
;
IN:
c.lexer
::
take-quoted-string
( sequence-parser escape-char quote-char -- string )
sequence-parser
n>>
:>
start-n sequence-parser
advance
[
{
[
{
[
previous
escape-char
=
]
[
current
quote-char
=
]
}
1&&
]
[
current
quote-char
=
not
]
}
1||
]
take-while
:>
string sequence-parser
current
quote-char
=
[
sequence-parser
advance
drop
string
]
[
start-n sequence-parser
n<<
f
]
if
;