caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Serge Leblanc <serge.leblanc@orange.fr>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] DELETE_RULE arguments?
Date: Wed, 22 Jul 2009 14:54:16 +0200	[thread overview]
Message-ID: <1248267256.4403.13.camel@serge2> (raw)
In-Reply-To: <527cf6bc0907220026t7bd0a18by15ce80a4b2fbd85b@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2181 bytes --]

Unfortunately with ( `_ LIDENT) the statement is also split into "
LIDENT _" in pattern matching:

$ camlp4of -str 'DELETE_RULE Gram bar: "foo"; (`LIDENT _); bar END'
Gram.delete_rule bar
  [ Gram.Skeyword "foo";
    Gram.Stoken (((function | LIDENT _ -> true | _ -> false), "LIDENT
_"));
    Gram.Snterm (Gram.Entry.obj (bar : 'bar Gram.Entry.t)) ]


On Wed, 2009-07-22 at 09:26 +0200, blue storm wrote: 

> That was the correct code, except you shouldn't have tested it in the shell :
> 
> $ camlp4of -str "DELETE_RULE Gram bar: \"foo\"; LIDENT; bar END"
> Gram.delete_rule bar
>   [ Gram.Skeyword "foo";
>     Gram.Stoken (((fun | LIDENT ((_)) -> true | _ -> false), "LIDENT ((_))"));
>     Gram.Snterm (Gram.Entry.obj (bar : 'bar Gram.Entry.t)) ]
> 
> You can have the exact "LIDENT _" output with (`LIDENT _), though i'm
> not sure it changes the end result.
> 
> On Wed, Jul 22, 2009 at 12:35 AM, Serge Leblanc<serge.leblanc@orange.fr> wrote:
> > In the attached exemple, the DELETE_RULE raise an exception Not_found.
> > The statement DELETE_RULE Gram foo: "foo"; LIDENT; END bar is exploded as
> > follows :
> >
> > $ camlp4of -str "DELETE_RULE Gram foo: "foo"; LIDENT; bar END"
> >
> > Gram.delete_rule foo
> >   [ Gram.Snterm (Gram.Entry.obj (foo : 'foo Gram.Entry.t));
> >     Gram.Stoken
> >       (((function | LIDENT ((_)) -> true | _ -> false), "LIDENT ((_))"));
> >     Gram.Snterm (Gram.Entry.obj (bar : 'bar Gram.Entry.t)) ]
> >
> > while the running example is the following :
> >
> > Gram.delete_rule foo
> >       [ Gram.Skeyword "foo";
> >         Gram.Stoken
> >           (((function | LIDENT ((_)) -> true | _ -> false), "LIDENT _"));
> >         Gram.Snterm (Gram.Entry.obj (bar : 'bar Gram.Entry.t)) ]
> >
> > How do I write the rule DELETE_RULE to work in this case?
> > --
> > Serge Leblanc
> > gpg --keyserver  hkp://keyserver.ubuntu.com:11371 --recv-keys 0x33243C1B
> > Fingerprint = 066C 005F 5595 D85C 7673  D969 1DD4 90C4 3324 3C1B


--
Serge Leblanc
gpg --keyserver  hkp://keyserver.ubuntu.com:11371 --recv-keys 0x33243C1B
Fingerprint = 066C 005F 5595 D85C 7673  D969 1DD4 90C4 3324 3C1B


[-- Attachment #1.2: Type: text/html, Size: 3300 bytes --]

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2009-07-22 12:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-19 12:34 Serge Leblanc
2009-07-21 22:35 ` [Caml-list] " Serge Leblanc
2009-07-22  7:26   ` blue storm
2009-07-22 12:54     ` Serge Leblanc [this message]
2009-07-22 10:03 ` blue storm

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=1248267256.4403.13.camel@serge2 \
    --to=serge.leblanc@orange.fr \
    --cc=caml-list@yquem.inria.fr \
    /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).