[Python-bugs-list] [Bug #113254] pre/sre difference breaks pyclbr

noreply@sourceforge.net noreply@sourceforge.net
Thu, 31 Aug 2000 20:57:29 -0700


Bug #113254, was updated on 2000-Aug-31 12:13
Here is a current snapshot of the bug.

Project: Python
Category: Core
Status: Open
Resolution: None
Bug Group: None
Priority: 6
Summary: pre/sre difference breaks pyclbr

Details: """ 

pre and sre deal differently with groups that
"do not contribute to the match". Fredrick
points out that sre seems to be right but now
pyclbr is broken (though easy to fix). This
program demonstrates the difference in behavior
and the pyclbr breakage.

call it "pyclbrbug.py" The name matters because
it uses itself as a test case!
"""


import pre
import sre
import pyclbr
import sys

the_re=r"""
    (?P<Method>
	^
	(?P<MethodIndent> [ \t]* )
	def [ \t]+
	(?P<MethodName> [a-zA-Z_] \w* )
	[ \t]* \(
    )

|   (?P<Class>
	^
	(?P<ClassIndent> [ \t]* )
	class [ \t]+
	(?P<ClassName> [a-zA-Z_] \w* )
	[ \t]*
	(?P<ClassSupers> \( [^)\n]* \) )?
	[ \t]* :
    )
"""

eg="class foo: pass"

def test( mod ):
	print "===========", mod.__name__
	re=mod.compile(the_re, 
	              mod.VERBOSE | 
                      mod.DOTALL | 
	              mod.MULTILINE)
	match=re.search( eg )
	print match.start( "Method" )
	print match.group( "MethodIndent" )
	sys.modules["re"]=mod
	reload( pyclbr )
	pyclbr.readmodule_ex("pyclbrbug",["."])

test( pre )
test( sre )



Follow-Ups:

Date: 2000-Aug-31 20:57
By: jhylton

Comment:
Who should fix pyclbr?  If not you /F, please reassign.

-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=113254&group_id=5470