parent
050f68bc69
commit
b0b050d092
|
@ -50,8 +50,6 @@ class ELisp(mode.Fundamental):
|
|||
'close-paren': (')',),
|
||||
'close-brace': ('}',),
|
||||
'close-bracket': (']',),
|
||||
'lisp-comment-region': ('C-c #',),
|
||||
'lisp-uncomment-region': ('C-u C-C #',),
|
||||
}
|
||||
|
||||
install = ELisp.install
|
||||
|
|
23
mode/sql.py
23
mode/sql.py
|
@ -21,9 +21,7 @@ end_rules = [
|
|||
PatternRule(r'eol', r'\n'),
|
||||
]
|
||||
|
||||
class PlPgSqlGrammar(Grammar):
|
||||
#rules = base_rules + sql_rules + end_rules
|
||||
pass
|
||||
class PlPgSqlGrammar(Grammar): pass
|
||||
|
||||
sql_type_rule = NocasePatternRule(r'sql_type', r'(?:void|row|serial|varchar|float|integer|int|text|timestamptz|timestamp|datetz|date|timetz|time|boolean|bool)(?![A-Za-z0-9_])')
|
||||
|
||||
|
@ -51,16 +49,23 @@ sql_rules = [
|
|||
PatternRule(r'number', r'[0-9]+(?:e[+-]?[0-9]+)?'),
|
||||
PatternRule(r'number', r'[0-9]+\.(?:[0-9]+)?(?:e[+-]?[0-9]+)?'),
|
||||
PatternRule(r'number', r'\.[0-9]+(?:e[+-]?[0-9]+)'),
|
||||
RegionRule(r'string', "B'", BitStringGrammar, "'"),
|
||||
RegionRule(r'string', "X'", HexStringGrammar, "'"),
|
||||
RegionRule(r'string', "'", StringGrammar1, "'"),
|
||||
RegionRule(r'sql_quoted', '"', StringGrammar2, '"'),
|
||||
]
|
||||
|
||||
PlPgSqlGrammar.rules = base_rules + sql_rules + end_rules
|
||||
string_rules = [
|
||||
RegionRule(r'string', "B'", BitStringGrammar, "'"),
|
||||
RegionRule(r'string', "X'", HexStringGrammar, "'"),
|
||||
RegionRule(r'string', "'", StringGrammar1, "'"),
|
||||
]
|
||||
|
||||
PlPgSqlGrammar.rules = base_rules + sql_rules + [
|
||||
RegionRule(r'string', "B''", BitStringGrammar, "''"),
|
||||
RegionRule(r'string', "X''", HexStringGrammar, "''"),
|
||||
RegionRule(r'string', "''", StringGrammar1, "''"),
|
||||
] + end_rules
|
||||
|
||||
class SqlGrammar(Grammar):
|
||||
rules = base_rules + function_rules + sql_rules + end_rules
|
||||
rules = base_rules + function_rules + sql_rules + string_rules + end_rules
|
||||
|
||||
class SqlTabber(tab.StackTabber):
|
||||
wst = ('null', 'eol',)
|
||||
|
@ -146,8 +151,6 @@ class Sql(mode.Fundamental):
|
|||
'close-paren': (')',),
|
||||
'close-brace': ('}',),
|
||||
'close-bracket': (']',),
|
||||
'sql-comment-region': ('C-c #',),
|
||||
'sql-uncomment-region': ('C-u C-c #',),
|
||||
}
|
||||
|
||||
install = Sql.install
|
||||
|
|
Loading…
Reference in New Issue