summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2010-01-04 08:25:18 +0000
committerptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2010-01-04 08:25:18 +0000
commit0fe5dc6a9837ece57b02e65457ca1c626cb7d8a6 (patch)
tree2f0bea569ce865e1982a8b48572f803f8bf94bea
parenta2964a0855e0dd8c6d8b3ef7a24fdf341cbab96c (diff)
downloadpyparsing-0fe5dc6a9837ece57b02e65457ca1c626cb7d8a6.tar.gz
Removed use of __slots__ for Jython/IronPython compatibility.
Removed extra FollowedBy test in operatorPrecedence git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/src@188 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
-rw-r--r--pyparsing.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/pyparsing.py b/pyparsing.py
index e3e1ffb..62608b9 100644
--- a/pyparsing.py
+++ b/pyparsing.py
@@ -59,7 +59,7 @@ The pyparsing module handles some of the problems that are typically vexing when
"""
__version__ = "1.5.3"
-__versionTime__ = "24 September 2009 02:18"
+__versionTime__ = "4 January 2010 02:23"
__author__ = "Paul McGuire <ptmcg@users.sourceforge.net>"
import string
@@ -266,7 +266,7 @@ class ParseResults(object):
- by list index (results[0], results[1], etc.)
- by attribute (results.<resultsName>)
"""
- __slots__ = ( "__toklist", "__tokdict", "__doinit", "__name", "__parent", "__accumNames", "__weakref__" )
+ #~ __slots__ = ( "__toklist", "__tokdict", "__doinit", "__name", "__parent", "__accumNames", "__weakref__" )
def __new__(cls, toklist, name=None, asList=True, modal=True ):
if isinstance(toklist, cls):
return toklist
@@ -276,7 +276,7 @@ class ParseResults(object):
# Performance tuning: we construct a *lot* of these, so keep this
# constructor as small and fast as possible
- def __init__( self, toklist, name=None, asList=True, modal=True ):
+ def __init__( self, toklist, name=None, asList=True, modal=True, isinstance=isinstance ):
if self.__doinit:
self.__doinit = False
self.__name = None
@@ -288,7 +288,7 @@ class ParseResults(object):
self.__toklist = [toklist]
self.__tokdict = dict()
- if name:
+ if name is not None and name:
if not modal:
self.__accumNames[name] = 0
if isinstance(name,int):
@@ -318,7 +318,7 @@ class ParseResults(object):
else:
return ParseResults([ v[0] for v in self.__tokdict[i] ])
- def __setitem__( self, k, v ):
+ def __setitem__( self, k, v, isinstance=isinstance ):
if isinstance(v,_ParseResultsWithOffset):
self.__tokdict[k] = self.__tokdict.get(k,list()) + [v]
sub = v[0]
@@ -398,7 +398,7 @@ class ParseResults(object):
return [ v[-1][0] for v in self.__tokdict.values() ]
def __getattr__( self, name ):
- if name not in self.__slots__:
+ if True: #name not in self.__slots__:
if name in self.__tokdict:
if name not in self.__accumNames:
return self.__tokdict[name][-1][0]
@@ -3640,7 +3640,7 @@ def indentedBlock(blockStatementExpr, indentStack, indent=True):
UNDENT = Empty().setParseAction(checkUnindent)
if indent:
smExpr = Group( Optional(NL) +
- FollowedBy(blockStatementExpr) +
+ #~ FollowedBy(blockStatementExpr) +
INDENT + (OneOrMore( PEER + Group(blockStatementExpr) + Optional(NL) )) + UNDENT)
else:
smExpr = Group( Optional(NL) +