@@ -114,7 +114,8 @@ class BooleanAlgebra(object):
114114 """
115115
116116 def __init__ (self , TRUE_class = None , FALSE_class = None , Symbol_class = None ,
117- NOT_class = None , AND_class = None , OR_class = None ):
117+ NOT_class = None , AND_class = None , OR_class = None ,
118+ allowed_in_token = ('.' , ':' , '_' )):
118119 """
119120 The types for TRUE, FALSE, NOT, AND, OR and Symbol define the boolean
120121 algebra elements, operations and Symbol variable. They default to the
@@ -158,6 +159,9 @@ def __init__(self, TRUE_class=None, FALSE_class=None, Symbol_class=None,
158159 for name , value in tf_nao .items ():
159160 setattr (obj , name , value )
160161
162+ # Set the set of characters allowed in tokens
163+ self .allowed_in_token = allowed_in_token
164+
161165 def definition (self ):
162166 """
163167 Return a tuple of this algebra defined elements and types as:
@@ -461,7 +465,7 @@ def tokenize(self, expr):
461465 position += 1
462466 while position < length :
463467 char = expr [position ]
464- if char .isalnum () or char in ( '.' , ':' , '_' ) :
468+ if char .isalnum () or char in self . allowed_in_token :
465469 position += 1
466470 tok += char
467471 else :
0 commit comments