[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-bugs-list
Subject:    [Python-bugs-list] [Bug #113254] pre/sre difference breaks pyclbr
From:       noreply () sourceforge ! net (noreply () sourceforge ! net)
Date:       2000-08-31 19:13:23
Message-ID: 200008311913.MAA13905 () bush ! i ! sourceforge ! net
[Download RAW message or body]

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

Project: Python
Category: None
Status: Open
Resolution: None
Bug Group: None
Priority: 5
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 )



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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic