[llvm-commits] [hlvm] r38240 - /hlvm/trunk/build/filterbuilders.py
Reid Spencer
reid at x10sys.com
Sat Jul 7 17:01:30 PDT 2007
Author: reid
Date: Sat Jul 7 19:01:30 2007
New Revision: 38240
URL: http://llvm.org/viewvc/llvm-project?rev=38240&view=rev
Log:
Improve pattern for SchemaTokenizer to allow spaces around =
Modified:
hlvm/trunk/build/filterbuilders.py
Modified: hlvm/trunk/build/filterbuilders.py
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/build/filterbuilders.py?rev=38240&r1=38239&r2=38240&view=diff
==============================================================================
--- hlvm/trunk/build/filterbuilders.py (original)
+++ hlvm/trunk/build/filterbuilders.py Sat Jul 7 19:01:30 2007
@@ -43,14 +43,18 @@
return b
def getSchemaTokens(fname):
- elemPat = re.compile('<element[^>]*name="([^"]*)"')
- attrPat = re.compile('<attribute[^>]*name="([^"]*)"')
+ elemPat = re.compile('<element[^>]*name[ ]*=[ ]*"([^"]*)"')
+ attrPat = re.compile('<attribute[^>]*name[ ]*=[ ]*"([^"]*)"')
valuPat = re.compile('<value>\s*([^<\s]*)')
tokens = []
for line in fileinput.input(fname):
- tokens += elemPat.findall(line)
- tokens += attrPat.findall(line)
- tokens += valuPat.findall(line)
+ print line;
+ new_tokens = []
+ new_tokens += elemPat.findall(line)
+ new_tokens += attrPat.findall(line)
+ new_tokens += valuPat.findall(line)
+ print " ",new_tokens
+ tokens += new_tokens
dict = {}
for tok in tokens:
dict[tok] = 1
More information about the llvm-commits
mailing list