improved type grammar slightly, and add 'to' keyword

--HG--
branch : pmacs2
This commit is contained in:
Erik Osheim 2010-10-06 17:17:41 -04:00
parent fe680f26dc
commit 111bd2546c
2 changed files with 4 additions and 3 deletions

View File

@ -24,8 +24,8 @@ class RSTGrammar(Grammar):
RegionRule(r'strong_emphasis', r'\*\*', RSTString1, r'\*\*'), RegionRule(r'strong_emphasis', r'\*\*', RSTString1, r'\*\*'),
RegionRule(r'emphasis', r'\*', RSTString1, r'\*'), RegionRule(r'emphasis', r'\*', RSTString1, r'\*'),
RegionRule(r'inline_literal', r'``', RSTString2, r'``'), #RegionRule(r'inline_literal', r'``', RSTString2, r'``'),
RegionRule(r'interpreted', r'`', RSTString2, r'`_?'), #RegionRule(r'interpreted', r'`', RSTString2, r'`_?'),
PatternRule(r'anonymous', r'[a-zA-Z]+__'), PatternRule(r'anonymous', r'[a-zA-Z]+__'),
PatternRule(r'reference', r'[a-zA-Z]+_(?![a-zA-Z0-9_])'), PatternRule(r'reference', r'[a-zA-Z]+_(?![a-zA-Z0-9_])'),

View File

@ -50,6 +50,7 @@ class ScalaGrammar(Grammar):
'scala.reserved', 'spaces', 'scala.type'), 'scala.reserved', 'spaces', 'scala.type'),
#PatternRule('delimiter', r'(?:;|{|}|\[|\]|\(|\)|,|\.|<(?![a-zA-Z_])|>|:|/|\+|-|\*|=)'), #PatternRule('delimiter', r'(?:;|{|}|\[|\]|\(|\)|,|\.|<(?![a-zA-Z_])|>|:|/|\+|-|\*|=)'),
RegionRule('sub', r'(?<=:)\(', SubTypeGrammar, r'\)'),
PatternRule('delimiter', r'(?:;|{|}|\(|\)|,|\.|<(?![a-zA-Z_])|>|:|/|\+|-|\*|=)'), PatternRule('delimiter', r'(?:;|{|}|\(|\)|,|\.|<(?![a-zA-Z_])|>|:|/|\+|-|\*|=)'),
RegionRule('sub', r'\[', SubTypeGrammar, r'\]'), RegionRule('sub', r'\[', SubTypeGrammar, r'\]'),
@ -65,7 +66,7 @@ class ScalaGrammar(Grammar):
PatternRule('scala.pseudo', '(?:true|null|false)'), 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', '-?(?:0|[1-9])[0-9]*[Ll]?'),
PatternRule('scala.integer', '-?0x[0-9A-Fa-f]+[Ll]?'), PatternRule('scala.integer', '-?0x[0-9A-Fa-f]+[Ll]?'),