nocase option

--HG--
branch : pmacs2
This commit is contained in:
Erik Osheim 2010-03-16 01:02:40 -04:00
parent 766b923fbb
commit ab5d13b363
1 changed files with 5 additions and 2 deletions

7
lex.py
View File

@ -36,8 +36,11 @@ class Token(object):
return self.fqname() in names
def fqmatch(self, name, string):
return self.fqname() == name and self.string == string
def fqmatchs(self, name, strings):
return self.fqname() == name and self.string in strings
def fqmatchs(self, name, strings, nocase=False):
if nocase:
return self.fqname() == name and self.string.lower() in strings
else:
return self.fqname() == name and self.string in strings
def fqmatchp(self, pairs):
for (name, string) in pairs:
if self.fqmatch(name, string):