From acfcb09dea2c47d45fe51e12898cada53f8d6921 Mon Sep 17 00:00:00 2001 From: moculus Date: Fri, 13 Jul 2007 08:08:09 +0000 Subject: [PATCH] some improvements --HG-- branch : pmacs2 --- mode_sql.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mode_sql.py b/mode_sql.py index f236673..7bd6000 100644 --- a/mode_sql.py +++ b/mode_sql.py @@ -17,11 +17,11 @@ class SqlGrammar(Grammar): RegionRule(r'quoted', '"', StringGrammar, '"'), PatternRule(r'bareword', r'[A-Za-z0-9_]+'), PatternRule(r'empty', r'^ *\n$'), - PatternRule(r'eol', r'; *\n'), - PatternRule(r'continuation', r'\n'), + PatternRule(r'eol', r'\n'), ] class SqlTabber(tab2.StackTabber): + wst = ('null', 'eol',) def is_base(self, y): if y == 0: return True @@ -32,10 +32,13 @@ class SqlTabber(tab2.StackTabber): return t.name == 'function' def _handle_other_token(self, currlvl, y, i): token = self.get_token(y, i) + if token.name == 'delimiter' and token.string == ';': + self._opt_pop('cont') + if self.is_rightmost_token(y, i): if not self._empty() and token.name == 'continuation': self._opt_append('cont', currlvl + 4) - elif token.name == 'eol': + elif token.name == 'eol' and not self.markers: self._opt_pop("cont") return currlvl