From 692fc517063cb026458183249bbd2ea923b4504e Mon Sep 17 00:00:00 2001 From: moculus Date: Sun, 22 Feb 2009 22:10:08 +0000 Subject: [PATCH] --HG-- branch : pmacs2 --- code_examples/Reporting2.pm | 3 ++- mode/sql.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code_examples/Reporting2.pm b/code_examples/Reporting2.pm index f521e8c..9e7aa43 100644 --- a/code_examples/Reporting2.pm +++ b/code_examples/Reporting2.pm @@ -9,7 +9,8 @@ sub foo { #@@:heredoc:sql my $s = <bar bar'; +--@@:string:xml +select 'blah blah blah'; drop table foog; insert into mytable (col1, col2, "col3") values (99, 33, 1234); select cast(plunk as timestamp) from blarg join plarg using(id_what) where x = 3; diff --git a/mode/sql.py b/mode/sql.py index af2e046..062f4e3 100644 --- a/mode/sql.py +++ b/mode/sql.py @@ -1,5 +1,5 @@ import mode, tab -from lex import Grammar, PatternRule, NocasePatternRule, RegionRule, NocaseRegionRule +from lex import Grammar, PatternRule, NocasePatternRule, RegionRule, NocaseRegionRule, OverridePatternRule from mode.python import StringGrammar1, StringGrammar2 class BitStringGrammar(Grammar): @@ -10,6 +10,7 @@ class HexStringGrammar(Grammar): base_rules = [ PatternRule(r'spaces', r' +'), + OverridePatternRule(r'comment', r'--@@:(?P[.a-zA-Z0-9_]+):(?P[.a-zA-Z0-9_]+) *$'), PatternRule(r'comment', r'--.*\n$'), RegionRule(r'comment', '/\*', Grammar, '\*/'), PatternRule(r'delimiter', r':=|[():;,\.\$\[\]~]'),