make XML parsing slightly more flexible

--HG--
branch : pmacs2
This commit is contained in:
Erik Osheim 2010-09-10 00:18:34 -04:00
parent d95e7d3dda
commit c439163434
1 changed files with 2 additions and 2 deletions

View File

@ -20,9 +20,9 @@ class CommentGrammar(Grammar):
rules = [PatternRule('data', '(?:[^-]|-(?!-)|--(?!>))+')] rules = [PatternRule('data', '(?:[^-]|-(?!-)|--(?!>))+')]
class TagGrammar(Grammar): class TagGrammar(Grammar):
rules = [ rules = [
PatternRule('attrname', '[a-zA-Z_][a-zA-Z0-9_]+(?==)'), PatternRule('attrname', '[a-zA-Z_][-a-zA-Z0-9_]*(?==)'),
PatternRule('namespace', '[a-zA-Z_]+(?=:)'), PatternRule('namespace', '[a-zA-Z_]+(?=:)'),
PatternRule('name', '[a-zA-Z_][a-zA-Z0-9_]*'), PatternRule('name', '[a-zA-Z_][-a-zA-Z0-9_]*'),
PatternRule('delimiter', '[:/=]'), PatternRule('delimiter', '[:/=]'),
RegionRule('string', '"', StringGrammar1, '"'), RegionRule('string', '"', StringGrammar1, '"'),
RegionRule('string', "'", StringGrammar2, "'"), RegionRule('string', "'", StringGrammar2, "'"),