parent
bd202de7bc
commit
a3fd30cfc6
12
mode/diff.py
12
mode/diff.py
|
@ -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):
|
||||||
|
|
Loading…
Reference in New Issue