caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Paul Snively <psnively@mac.com>
To: virgile.prevosto@m4x.org
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Question re: camlp4 parser
Date: Wed, 27 Jul 2005 18:27:11 -0700	[thread overview]
Message-ID: <5A709F2F-1728-4904-BAC2-C2E9CC5A3AA9@mac.com> (raw)
In-Reply-To: <2787337705072700045a275ce6@mail.gmail.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Jul 27, 2005, at 12:04 AM, Virgile Prevosto wrote:

> As any other pattern, stream patterns can be refined with a 'when'  
> condition:
>
> let printable s =
>  let buf = Buffer.create 100 in
>  let rec aux = parser
>    | [< '' '..'~' as c when c <> '=' && c <> '[';
>         x = (Buffer.add_char buf c; aux) >] -> x
>    | [< >] -> Buffer.contents buf
>  in aux s ;;
>
> should do the trick. It might not be that convenient for a more
> complex set of excluded characters, but it is possible to write a char
> -> bool test outside of the stream parser.
>
Of course: it's all becoming quite clear now. Thanks for the  
excellent suggestion and your patience with my naïvete. :-)

> -- 
> E tutto per oggi, a la prossima volta
> Virgile
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

Best regards,
Paul Snively



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iEYEARECAAYFAkLoNH8ACgkQO3fYpochAqI94gCfXosjSfFZAbtanYQstgCjYLfY
HqUAoIWd4QpsWhynHyj8A6WJDqWOP61B
=BKDa
-----END PGP SIGNATURE-----


      reply	other threads:[~2005-07-28  1:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-26  0:11 Paul Snively
2005-07-26  1:17 ` [Caml-list] " Stephane Glondu
2005-07-26 16:43   ` Paul Snively
2005-07-26 17:05     ` Stephane Glondu
2005-07-27  7:04     ` Virgile Prevosto
2005-07-28  1:27       ` Paul Snively [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5A709F2F-1728-4904-BAC2-C2E9CC5A3AA9@mac.com \
    --to=psnively@mac.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=virgile.prevosto@m4x.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).