9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Bruce Ellis <bruce.ellis@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Help with plumbing rules
Date: Wed,  6 Nov 2013 17:56:11 +1100	[thread overview]
Message-ID: <CAJQxxwk8_Drex5qRnTdVd48U71xZ=SwFjmM4FN0_nA-9Ki3vmw@mail.gmail.com> (raw)
In-Reply-To: <8533-1383720139-778543@sneakemail.com>

[-- Attachment #1: Type: text/plain, Size: 2472 bytes --]

The diagnostic on the last line should be:

Unexpected End of File at EOF

That's the memorable diagnostic from a CDC compiler.

brucee


On 6 November 2013 17:42, <6o205zd02@sneakemail.com> wrote:

> I'm trying to create a plumbing rule so that I can right-click (in acme)
> on the diagnostic messages produced by Python and get the file opened with
> the appropriate line select.  Unfortunately my attempts so far have failed.
>
> Question 1: Is there an easy way to "debug" plumbing rules (I'm using
> plan9port on linux)?
>
> I started by looking at a couple of existing rules from $PLAN9/plumb/basic:
>
> # existing files tagged by line number:columnumber or
> linenumber.columnumber, twice, go to editor
> type is text
> data matches '([.a-zA-Z¡-￿0-9_/\-]*[a-zA-Z¡-￿0-9_/\-])':$
> twocolonaddr,$twocolonaddr
> arg isfile $1
> data set $file
> attr add addr=$2-#1+#$3,$4-#1+#$5
> plumb to edit
> plumb client $editor
>
> # existing files tagged by line number:columnumber or
> linenumber.columnumber, twice, go to editor
> type is text
> data matches '([.a-zA-Z¡-￿0-9_/\-]*[a-zA-Z¡-￿0-9_/\-])':$
> twocolonaddr
> arg isfile $1
> data set $file
> attr add addr=$2-#1+#$3
> plumb to edit
> plumb client $editor
>
> After reading http://plan9.bell-labs.com/sys/doc/plumb.pdf, I think I
> understand these rules except for the line
> data set $file
>
> Question2: What does that line do?  What is $file?
>
> Since the Python 2.7 diagnostic messages look like
>
> File "/home/pcanning/src/python/test/test_cli.py", line 91, in
> test_interactive_mode
>
> I created the following rule that attempts to match the test from "File"
> to "line 91", and send plumbing message to edit (acme).
>
> # Python (2.7) error messages
> type is text
> data matches File "([.a-zA-Z¡-￿0-9_/\-]*[a-zA-Z¡-￿0-9_/\-])", line
> ([0-9]+)
> arg isfile $1
> data set $1
> attr add addr=$2
> plumb to edit
> plumb client $editor
>
> Question 3: How do I change this rule to make acme open
> /home/pcanning/src/python/test/test_cli.py and select line 91 (in the
> example above)?
>
>     thanks,
>     Peter Canning
>
> PS: Once I get this working I'll tackle the diagnostic messages I get when
> compiling Java code using maven (not my choice).  They look like
> [error] /home/pcanning/src/java/test/PerfTest.java:[66,1] error: reached
> end of file while parsing
>
>
>

[-- Attachment #2: Type: text/html, Size: 3140 bytes --]

  reply	other threads:[~2013-11-06  6:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-06  6:42 6o205zd02
2013-11-06  6:56 ` Bruce Ellis [this message]
2013-11-06 11:08 ` Alexander Sychev
2013-11-06 13:02 ` Mark van Atten
2013-11-06 13:06   ` Rubén Berenguel

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='CAJQxxwk8_Drex5qRnTdVd48U71xZ=SwFjmM4FN0_nA-9Ki3vmw@mail.gmail.com' \
    --to=bruce.ellis@gmail.com \
    --cc=9fans@9fans.net \
    /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).