From ab5d13b3636739d60f9101b4934ff9f7522a3722 Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Tue, 16 Mar 2010 01:02:40 -0400 Subject: [PATCH] nocase option --HG-- branch : pmacs2 --- lex.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lex.py b/lex.py index 23dbc22..bd41af8 100755 --- a/lex.py +++ b/lex.py @@ -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):