fixed diff mode bug

--HG--
branch : pmacs2
This commit is contained in:
moculus 2007-09-28 20:55:57 +00:00
parent bd202de7bc
commit a3fd30cfc6
1 changed files with 6 additions and 6 deletions

View File

@ -3,12 +3,12 @@ from lex3 import Grammar, PatternRule, RegionRule
class DiffGrammar(Grammar): class DiffGrammar(Grammar):
rules = [ rules = [
PatternRule(name=r'left', pattern=r"^\-.*$"), PatternRule(name=r'left', pattern=r"^\-.*\n$"),
PatternRule(name=r'right', pattern=r"^\+.*$"), PatternRule(name=r'right', pattern=r"^\+.*\n$"),
PatternRule(name=r'metadata', pattern=r'^[A-Za-z].*$'), PatternRule(name=r'metadata', pattern=r'^[A-Za-z].*\n$'),
PatternRule(name=r'seperator', pattern=r'^={67}$'), PatternRule(name=r'seperator', pattern=r'^={67}\n$'),
PatternRule(name=r'location', pattern=r"(?:^|(?<=\n))@@ [-+0-9a-z, ]* @@(?:$|\n)"), PatternRule(name=r'location', pattern=r"^@@ [-+0-9a-z, ]* @@\n$"),
PatternRule(name=r'common', pattern=r"(?:^|(?<=\n)).*(?:$|\n)"), PatternRule(name=r'common', pattern=r"^.*\n$"),
] ]
class Diff(mode2.Fundamental): class Diff(mode2.Fundamental):