@@ -114,7 +114,8 @@ class BooleanAlgebra(object):
114
114
"""
115
115
116
116
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 = ('.' , ':' , '_' )):
118
119
"""
119
120
The types for TRUE, FALSE, NOT, AND, OR and Symbol define the boolean
120
121
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,
158
159
for name , value in tf_nao .items ():
159
160
setattr (obj , name , value )
160
161
162
+ # Set the set of characters allowed in tokens
163
+ self .allowed_in_token = allowed_in_token
164
+
161
165
def definition (self ):
162
166
"""
163
167
Return a tuple of this algebra defined elements and types as:
@@ -461,7 +465,7 @@ def tokenize(self, expr):
461
465
position += 1
462
466
while position < length :
463
467
char = expr [position ]
464
- if char .isalnum () or char in ( '.' , ':' , '_' ) :
468
+ if char .isalnum () or char in self . allowed_in_token :
465
469
position += 1
466
470
tok += char
467
471
else :
0 commit comments