diff --git a/mode/tal.py b/mode/tal.py index 3a93034..213ec68 100644 --- a/mode/tal.py +++ b/mode/tal.py @@ -6,7 +6,7 @@ import re class TalGrammar(Grammar): rules = [ PatternRule('spaces', '[ \t]+'), - RegionRule('comment', r'\(', Grammar, '\)'), + RegionRule('comment', r'\((?:[ \t]|$)', Grammar, '(?:^|[ \t])\)'), PatternRule('delimiter', r'[\[\]{}]'), PatternRule('tal.inst', r'(BRK|LIT|INC|POP|DUP|NIP|SWP|OVR|ROT|EQU|NEQ|GTH|LTH|JMP|JCN|JSR|STH|LDZ|STZ|LDR|STR|LDA|STA|DEI|DEO|ADD|SUB|MUL|DIV|AND|ORA|EOR|SFT)2?k?r?'), # instructions PatternRule('tal.defmacro', r'%[^ \t\n]+'), # macro-define