parent
1813fdabcd
commit
8d555b661b
|
@ -9,7 +9,8 @@ class ArgumentGrammar(Grammar): rules = [PatternRule(r'data', r'[^}]+')]
|
||||||
class StringGrammar1(Grammar): rules = [PatternRule(r'data', r"[^']+")]
|
class StringGrammar1(Grammar): rules = [PatternRule(r'data', r"[^']+")]
|
||||||
class StringGrammar2(Grammar): rules = [PatternRule(r'data', r"(?:[^']|'(?!'))+")]
|
class StringGrammar2(Grammar): rules = [PatternRule(r'data', r"(?:[^']|'(?!'))+")]
|
||||||
|
|
||||||
class FalseGrammar(Grammar): rules = [
|
class FalseGrammar(Grammar):
|
||||||
|
rules = [
|
||||||
PatternRule('data', r'[^\\]+'),
|
PatternRule('data', r'[^\\]+'),
|
||||||
RegionRule('comment', r'\\if', None, r'\\fi'),
|
RegionRule('comment', r'\\if', None, r'\\fi'),
|
||||||
]
|
]
|
||||||
|
@ -17,7 +18,7 @@ class FalseGrammar(Grammar): rules = [
|
||||||
class LatexGrammar(Grammar):
|
class LatexGrammar(Grammar):
|
||||||
rules = [
|
rules = [
|
||||||
PatternRule(r'comment', r'\%.*$'),
|
PatternRule(r'comment', r'\%.*$'),
|
||||||
RegionRule('comment', r'\\iffalse', Grammar, r'\\fi'),
|
RegionRule('comment', r'\\iffalse', FalseGrammar, r'\\fi'),
|
||||||
PatternRule(r'latex_wrapper', r'\\(?:begin|end)'),
|
PatternRule(r'latex_wrapper', r'\\(?:begin|end)'),
|
||||||
PatternRule(r'latex_control', r'\\[a-zA-Z]+'),
|
PatternRule(r'latex_control', r'\\[a-zA-Z]+'),
|
||||||
RegionRule(r'latex_argument', r'{', ArgumentGrammar, r'}'),
|
RegionRule(r'latex_argument', r'{', ArgumentGrammar, r'}'),
|
||||||
|
|
Loading…
Reference in New Issue