A few minor corrections:
On Sep 14, 2006, at 3:47 PM, jerry gay wrote:
grammar TAP;
## Ovid's TAP grammar, translated, corrected, and rendered idiomatic
## NOTE: not yet extended to deal with 'Bail out!' etc.
token tap { <plan> <lines> | <lines> <plan> <comment>* }
token plan { <'1..'> \d+ \n }
That \d+ is bad because it allows '000'. Instead:
token plan { <'1..'> [ <'0'> | <[1..9]> \d* ] \n }
token lines { <line>+ }
token line { <test> | <comment> }
token test {
<status>
[ <' '> (<[1..9]> \d*) ]? ## assumes a single
space, not \h+
\h* <description>? \h* <directive>? \n
}
token status { <'not '>? <'ok'> }
token description { <after \h> <-[#\n]>+ }
The description can't start with a number if there is a test number:
token description { <after \h> <-[#\n\d]> <-[#\n]>* }
token directive { <after \h> <'# '> [:i todo | skip ] \N* }
token comment { <'#'> \N* \n }
Chris
--
Chris Dolan, Software Developer, Clotho Advanced Media Inc.
608-294-7900, fax 294-7025, 1435 E Main St, Madison WI 53703
vCard: http://www.chrisdolan.net/ChrisDolan.vcf
Clotho Advanced Media, Inc. - Creators of MediaLandscape Software
(http://www.media-landscape.com/) and partners in the revolutionary
Croquet project (http://www.opencroquet.org/)