parent
f6c0e57e11
commit
692fc51706
|
@ -9,7 +9,8 @@ sub foo {
|
||||||
|
|
||||||
#@@:heredoc:sql
|
#@@:heredoc:sql
|
||||||
my $s = <<EOT;
|
my $s = <<EOT;
|
||||||
select '<foo attr="3">bar bar</foo>';
|
--@@:string:xml
|
||||||
|
select '<foo attr="3">blah blah blah</foo>';
|
||||||
drop table foog;
|
drop table foog;
|
||||||
insert into mytable (col1, col2, "col3") values (99, 33, 1234);
|
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;
|
select cast(plunk as timestamp) from blarg join plarg using(id_what) where x = 3;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import mode, tab
|
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
|
from mode.python import StringGrammar1, StringGrammar2
|
||||||
|
|
||||||
class BitStringGrammar(Grammar):
|
class BitStringGrammar(Grammar):
|
||||||
|
@ -10,6 +10,7 @@ class HexStringGrammar(Grammar):
|
||||||
|
|
||||||
base_rules = [
|
base_rules = [
|
||||||
PatternRule(r'spaces', r' +'),
|
PatternRule(r'spaces', r' +'),
|
||||||
|
OverridePatternRule(r'comment', r'--@@:(?P<token>[.a-zA-Z0-9_]+):(?P<mode>[.a-zA-Z0-9_]+) *$'),
|
||||||
PatternRule(r'comment', r'--.*\n$'),
|
PatternRule(r'comment', r'--.*\n$'),
|
||||||
RegionRule(r'comment', '/\*', Grammar, '\*/'),
|
RegionRule(r'comment', '/\*', Grammar, '\*/'),
|
||||||
PatternRule(r'delimiter', r':=|[():;,\.\$\[\]~]'),
|
PatternRule(r'delimiter', r':=|[():;,\.\$\[\]~]'),
|
||||||
|
|
Loading…
Reference in New Issue