aboutsummaryrefslogtreecommitdiffstats
path: root/libpathod/language/base.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2015-05-17 10:43:30 +1200
committerAldo Cortesi <aldo@nullcube.com>2015-05-17 10:43:30 +1200
commite4feba54330e1afcfb8d48bce8c474659aba281c (patch)
treee3b7369a66f309e8228aac26a4fe8f5e932debcf /libpathod/language/base.py
parent2ee60783b694b6a8555a6afbef21dc1f2ca1f8b9 (diff)
downloadmitmproxy-e4feba54330e1afcfb8d48bce8c474659aba281c.tar.gz
mitmproxy-e4feba54330e1afcfb8d48bce8c474659aba281c.tar.bz2
mitmproxy-e4feba54330e1afcfb8d48bce8c474659aba281c.zip
Introduce and enfoce uniqueness constraints for language components
Diffstat (limited to 'libpathod/language/base.py')
-rw-r--r--libpathod/language/base.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/libpathod/language/base.py b/libpathod/language/base.py
index 3773fde1..2a9e4ed3 100644
--- a/libpathod/language/base.py
+++ b/libpathod/language/base.py
@@ -77,6 +77,15 @@ class Token(object):
"""
return None
+ @property
+ def unique_name(self):
+ """
+ Controls uniqueness constraints for tokens. No two tokens with the
+ same name will be allowed. If no uniquness should be applied, this
+ should be None.
+ """
+ return self.__class__.__name__
+
def resolve(self, settings, msg):
"""
Resolves this token to ready it for transmission. This means that