From: Noah Lavine <noah.b.lavine@gmail.com>
To: Krister Svanlund <krister.svanlund@gmail.com>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: GNU Guile PEG-parser
Date: Tue, 7 Feb 2012 19:47:12 -0500 [thread overview]
Message-ID: <CA+U71=OCNcApUDLYGe6BuqacLnzvic-XtbD40Hp2Mag1GJ=_ug@mail.gmail.com> (raw)
In-Reply-To: <CAO_vGe8tm2=gyhF4vKrYV=mU9gEpbrmGwsr0JnsnF9JqvfaMuA@mail.gmail.com>
Hello,
Thanks for emailing! I suppose I am the one to talk to, since I was
the last one to work on it.
I didn't make the PEG parsing syntax, but I would guess the reason
there isn't a string syntax for ignore is that there's no conventional
way to write it, but there is for the other PEG elements. It would be
easy to add one if it was useful, but we'd want to make sure our
syntax agreed with other PEG libraries, so people wouldn't be confused
later.
For blank-space indented blocks, do you mean you want to group
together lines with the same indentation, like Python syntax? If you
know what the indentation will be at the beginning of each line, you
can do something like this:
(* (and "\t" <match-line> "\n")),
where you replace "\t" with whatever indentation you want.
However, what you probably want to do is look at the indentation in
the first line and then group it with every following line that has
the same indentation. I'm not sure if it's possible, but it would
probably be ugly. If you tell me what you're trying to do, though, I
can help you write your own parser to handle it. You can even write
some of your parser yourself and use PEGs for the rest, if you're
willing to use PEG internals.
Can you tell me more about what you're trying to do? I am happy to
help now, but I will be more helpful if I know more.
I'm going to CC the guile-devel mailing list because of the issue with
the string syntax.
Noah
On Tue, Feb 7, 2012 at 10:03 AM, Krister Svanlund
<krister.svanlund@gmail.com> wrote:
> Hi,
> I'm currently involved in a project that plans on using the PEG module for
> Guile for parsing and I've understod that you are the one to talk to about
> it. I'm mostly just curious how come there isn't an equivalent to ignore in
> string-patterns and if this would be complex to add?
>
> I'm also curious if there is any way to deal with blank-space indented
> blocks in PEG.
>
> Yours
> Krister Svanlund
next parent reply other threads:[~2012-02-08 0:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAO_vGe8tm2=gyhF4vKrYV=mU9gEpbrmGwsr0JnsnF9JqvfaMuA@mail.gmail.com>
2012-02-08 0:47 ` Noah Lavine [this message]
2012-02-08 18:29 ` GNU Guile PEG-parser Krister Svanlund
2012-02-09 15:42 ` Noah Lavine
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
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CA+U71=OCNcApUDLYGe6BuqacLnzvic-XtbD40Hp2Mag1GJ=_ug@mail.gmail.com' \
--to=noah.b.lavine@gmail.com \
--cc=guile-devel@gnu.org \
--cc=krister.svanlund@gmail.com \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).