diff --git a/mode/forth.py b/mode/forth.py index f7c6505..9864e73 100644 --- a/mode/forth.py +++ b/mode/forth.py @@ -21,7 +21,7 @@ class StringGrammar3(Grammar): rules = [PatternRule('data', r'[^)]+')] class ForthGrammar(Grammar): rules = [ PatternRule('comment', r"\\(?: .*)?\n$"), - RegionRule('comment', r'\((?= |\n)', DataGrammar, r'\)'), + RegionRule('comment', r'\((?= |\n|$)', DataGrammar, r'\)'), NocaseRegionRule('comment', r'0 \[if\]', DataGrammar, r'\[(?:endif|then)\]'), RegionRule('string', r'[.cs]" ', StringGrammar2, r'"'), RegionRule('string', r'[.s]\\" ', StringGrammar2, r'"'),