From 111bd2546c9e3017edd72f414bbeed746fbf58a8 Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Wed, 6 Oct 2010 17:17:41 -0400 Subject: [PATCH] improved type grammar slightly, and add 'to' keyword --HG-- branch : pmacs2 --- mode/rst.py | 4 ++-- mode/scala.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mode/rst.py b/mode/rst.py index 70fde25..eb7746c 100644 --- a/mode/rst.py +++ b/mode/rst.py @@ -24,8 +24,8 @@ class RSTGrammar(Grammar): RegionRule(r'strong_emphasis', r'\*\*', RSTString1, r'\*\*'), RegionRule(r'emphasis', r'\*', RSTString1, r'\*'), - RegionRule(r'inline_literal', r'``', RSTString2, r'``'), - RegionRule(r'interpreted', r'`', RSTString2, r'`_?'), + #RegionRule(r'inline_literal', r'``', RSTString2, r'``'), + #RegionRule(r'interpreted', r'`', RSTString2, r'`_?'), PatternRule(r'anonymous', r'[a-zA-Z]+__'), PatternRule(r'reference', r'[a-zA-Z]+_(?![a-zA-Z0-9_])'), diff --git a/mode/scala.py b/mode/scala.py index 7224bf4..6c0e2d0 100644 --- a/mode/scala.py +++ b/mode/scala.py @@ -50,6 +50,7 @@ class ScalaGrammar(Grammar): 'scala.reserved', 'spaces', 'scala.type'), #PatternRule('delimiter', r'(?:;|{|}|\[|\]|\(|\)|,|\.|<(?![a-zA-Z_])|>|:|/|\+|-|\*|=)'), + RegionRule('sub', r'(?<=:)\(', SubTypeGrammar, r'\)'), PatternRule('delimiter', r'(?:;|{|}|\(|\)|,|\.|<(?![a-zA-Z_])|>|:|/|\+|-|\*|=)'), RegionRule('sub', r'\[', SubTypeGrammar, r'\]'), @@ -65,7 +66,7 @@ class ScalaGrammar(Grammar): PatternRule('scala.pseudo', '(?:true|null|false)'), - PatternRule('scala.reserved', '(?:yield|with|while|var|val|until|type|true|try|trait|throw|this|super|sealed|return|protected|private|package|override|object|null|new|match|lazy|import|implicit|if|forSome|for|finally|final|false|extends|else|do|def|class|catch|case|abstract)(?!%s)' % word), + PatternRule('scala.reserved', '(?:yield|with|while|var|val|until|type|true|try|trait|throw|to|this|super|sealed|return|protected|private|package|override|object|null|new|match|lazy|import|implicit|if|forSome|for|finally|final|false|extends|else|do|def|class|catch|case|abstract)(?!%s)' % word), PatternRule('scala.integer', '-?(?:0|[1-9])[0-9]*[Ll]?'), PatternRule('scala.integer', '-?0x[0-9A-Fa-f]+[Ll]?'),