diff --git a/mode/latex.py b/mode/latex.py index 3aa756f..bdd44e7 100644 --- a/mode/latex.py +++ b/mode/latex.py @@ -9,15 +9,16 @@ class ArgumentGrammar(Grammar): rules = [PatternRule(r'data', r'[^}]+')] class StringGrammar1(Grammar): rules = [PatternRule(r'data', r"[^']+")] class StringGrammar2(Grammar): rules = [PatternRule(r'data', r"(?:[^']|'(?!'))+")] -class FalseGrammar(Grammar): rules = [ - PatternRule('data', r'[^\\]+'), - RegionRule('comment', r'\\if', None, r'\\fi'), -] +class FalseGrammar(Grammar): + rules = [ + PatternRule('data', r'[^\\]+'), + RegionRule('comment', r'\\if', None, r'\\fi'), + ] class LatexGrammar(Grammar): rules = [ 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_control', r'\\[a-zA-Z]+'), RegionRule(r'latex_argument', r'{', ArgumentGrammar, r'}'),