9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] acme + plumber question
Date: Fri,  5 Oct 2012 10:25:33 -0400	[thread overview]
Message-ID: <37362a64c5aa9018d47a5ba6f10fcba5@brasstown.quanstro.net> (raw)
In-Reply-To: <5945870.BeEu8mdyey@coil>

> i've tried in two ways, both failed: data matches='foo
> ' (literal newline) and data matches='foo\n' (C-style escape sequence). first
> trips plumber's parser, the other doesn't match anything -- perhaps \n is
> taken literaly.

it looks like plumber's failure of vision.  regexps don't take escapes like that.
and on the other hand you can't say \ + literal newline, either.  plumber
misparses that.

however, i thought of a really sneaky cheat, that is almost correct.  since
\n is 0a, and we almost never see 09 or 0b (ht and vt), we could build a
sneaky character class to elude the parser:

data	matches	'error[	-\v]'
plumb	start	window

and i've verified this does work on plan 9.  a proper fix would be to
change the string parser in plumber to convert '\' + 'n' to a newline.

(but i do feel dirty.)

- erik



  reply	other threads:[~2012-10-05 14:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-05 10:23 dexen deVries
2012-10-05 11:49 ` erik quanstrom
2012-10-05 12:31   ` dexen deVries
2012-10-05 12:44   ` dexen deVries
2012-10-05 13:04     ` erik quanstrom
2012-10-05 13:08       ` dexen deVries
2012-10-05 14:25         ` erik quanstrom [this message]
2012-10-05 14:34           ` erik quanstrom
2012-10-05 14:48             ` dexen deVries

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=37362a64c5aa9018d47a5ba6f10fcba5@brasstown.quanstro.net \
    --to=quanstro@quanstro.net \
    --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).