added block commenting and some cleanup

--HG--
branch : pmacs2
This commit is contained in:
Erik Osheim 2010-05-24 22:54:52 -04:00
parent 5cd69146a6
commit fc62fd9c5e
1 changed files with 8 additions and 6 deletions

View File

@ -14,12 +14,14 @@ word = chr1 + chr2 + '*'
class LuaGrammar(Grammar): class LuaGrammar(Grammar):
rules = [ rules = [
PatternRule('comment', r'--.*$'), RegionRule('comment', r'--\[(?P<level>=*)\[', Grammar, r'\]%(level)s\]'),
PatternRule('spaces', r' +'), #RegionRule('comment', r'--\[\[', Grammar, r'\]\]'),
PatternRule('comment', '--.*$'),
PatternRule('spaces', ' +'),
PatternRule('eol', r'\n'), PatternRule('eol', r'\n'),
RegionRule('lua.string', r"'", StringGrammar1, r"'"), RegionRule('lua.string', "'", StringGrammar1, "'"),
RegionRule('lua.string', r'"', StringGrammar2, r'"'), RegionRule('lua.string', '"', StringGrammar2, '"'),
PatternMatchRule('x', '(function)( +)(' + word + ')', PatternMatchRule('x', '(function)( +)(' + word + ')',
'lua.keyword', 'spaces', 'lua.function'), 'lua.keyword', 'spaces', 'lua.function'),