WG15 Defect Report Ref: 9945-2-45
Topic: pmatch rules


This is an approved interpretation of 9945-2:1993.

.

Last update: 1997-05-20


								9945-2-45

 _____________________________________________________________________________


	Topic:			pmatch rules
	Relevant Sections:	B.5.2
	Classification:	defect


Defect Report:
-----------------------
(from Andrew Hume Doug McIlroy)


Issue F

	    ________________________________________

 [17] In B5.2, the meaning of lines 356-361 is unclear.

Proposed Solution:

     Replace the five rules with:

(1)  The nesting of substrings denoted by  nonnegative	off-
     sets  in	 pmatch	 shall be the same as the nesting of
     subexpressions in	pattern.

(2)  A substring denoted by nonnegative	offsets	in pmatch[i]
     shall be the last of all matches to subexpression	i.

(3)  The offsets in pmatch[i] shall be nonnegative if possi-
     ble  according to rules (1) and (2), otherwise the	off-
     sets in pmatch[i] shall be	-1.

Rationale:

     One of us	understood,  ``the  match  ...	reported  in
pmatch[i]  shall be ...	within the substring ... rather	than
the whole string,'' to mean that the  offsets  in  pmatch[i]
were  to  be  measured	relative  to  an origin	specified by
pmatch[j].  We now believe that	the rule  merely  says	that
reported  matches  must	 nest the same way as the subexpres-
sions.	The proposed solution captures this idea succinctly.
Rule  (5)  could  be  kept, but	nobody needs it, given lines
289-90.


WG15 response for 9945-2:1993 
-----------------------------------

The standard states the required behavior and
conforming implementations shall conform to this.

Concerns about the wording of this part of the standard have
been forwarded to the sponsor.  

Rationale for Interpretation:
-----------------------------
Interpretations cannot make substantive changes to the standard.
This may be considered for a future revision. 
 _____________________________________________________________________________