Re: [tap] ANNOUNCE: TAP::Spec::Parser - a TAP parser based on the draft grammar

Michael G Schwern <> Wed, 30 June 2010 09:07 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id CBD403A6971 for <>; Wed, 30 Jun 2010 02:07:39 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: 0.001
X-Spam-Status: No, score=0.001 tagged_above=-999 required=5 tests=[BAYES_50=0.001]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id j-KPPlS35V79 for <>; Wed, 30 Jun 2010 02:07:38 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id 691333A68B2 for <>; Wed, 30 Jun 2010 02:07:38 -0700 (PDT)
Received: by pwj2 with SMTP id 2so237097pwj.31 for <>; Wed, 30 Jun 2010 02:07:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=4cc8YJJ4DFYhUxOIXa0f5zTDA/YMx1KZW6ygiopLrEM=; b=stWOwJqVEICr5AiWeweYxAaIPDw7ymjBsSVkdrNB1v67PC5sAOxhLyx8UhCDs7HN9u w4dSxeNrTZFVCl6pJx/DkFdzvY5Xpn+f9WCmfjK+mvhg3KG0ugNI5N73m5MwkmG3HPHx maReXnP5SVAfwc3bxHrsZjkmRMenNuAeqpMfQ=
DomainKey-Signature: a=rsa-sha1; c=nofws;; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=EK/80cbRpV0BfoxC2230bIs2RGI+7IN3Mj1rnDYSpLLUhASTUmKXwiRysjuC4fypRP UrixLnODz05rhj6Q3jGAPrkRimVUZCm52YbnaGDl2vI6Q4o23ThsuWwdhVkQJ13y5wuu pAgrxgY2MBujnZhrnNN19x/wQppi6f9TDpo7c=
Received: by with SMTP id y19mr9698572wfi.259.1277888865504; Wed, 30 Jun 2010 02:07:45 -0700 (PDT)
Received: from windhund.local ( []) by with ESMTPS id w8sm3782296wfd.7.2010. (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 30 Jun 2010 02:07:44 -0700 (PDT)
Sender: Michael G Schwern <>
Message-ID: <>
Date: Wed, 30 Jun 2010 02:07:40 -0700
From: Michael G Schwern <>
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv: Gecko/20100512 Thunderbird/3.0.5
MIME-Version: 1.0
References: <>
In-Reply-To: <>
X-Enigmail-Version: 1.0.1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Subject: Re: [tap] ANNOUNCE: TAP::Spec::Parser - a TAP parser based on the draft grammar
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Test Anything Protocol WG discussions <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Wed, 30 Jun 2010 09:46:02 -0000

On 2010.6.28 1:07 AM, Andrew Rodland wrote:
> Per Schwern's request at YAPC, I've written a parser based on the grammar in 
> the IETF draft standard 
> <> to help 
> make sure that it's correct and well-exercised. The code is at 
> and it's currently in a working 
> alpha state. It uses a Regexp::Grammars grammar, with the relevant portions of 
> the spec grammar interleaved in comments.

Awesome!  I've done some work on it by adding minimal specification tests so
you can write tests as TAP and how its to be interpreted.

There were a pile of these written in Oslo and I always forget where they
wound up.  Anyone remember?

> Current TODOs for TAP::Spec::Parser:
> * Implement skipping "junk" lines.
> * (Optionally?) remove the '' key (which stores the entire matched text) from 
>   result hashes.

I'd keep it in.  Its handy for debugging.  Make it a less cryptic name.
"raw_text" maybe.

> Draft grammar issues identified so far:
> * The Description rule doesn't make any mention of the optional "-" SP at the
>   beginning of the description (discussed with Schwern).
> * Plan-Todo looks like it should have SP before "todo".

Please edit the draft as you find issues with the grammar.

94. Crucifixes do not ward off officers, and I should not test that.
    -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army