parent
b708191ef0
commit
daa843abba
2
BUGS
2
BUGS
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
2008/05/16:
|
2008/05/16:
|
||||||
paired delimiters in perl regexes either never worked or are broken.
|
paired delimiters in perl regexes either never worked or are broken.
|
||||||
dammit.
|
dammit. (FIXED 2008/07/29)
|
||||||
|
|
||||||
2007/07/15:
|
2007/07/15:
|
||||||
sometimes you don't get search-as-you-type (and have to hit C-s again
|
sometimes you don't get search-as-you-type (and have to hit C-s again
|
||||||
|
|
16
mode/perl.py
16
mode/perl.py
|
@ -15,9 +15,9 @@ class PodGrammar(Grammar):
|
||||||
|
|
||||||
def _make_string_rules(forbidden=None):
|
def _make_string_rules(forbidden=None):
|
||||||
if forbidden:
|
if forbidden:
|
||||||
rule = PatternRule(r'scalar', r"\$[^A-Za-z0-9 \\%s](?![A-Za-z0-9_])" % forbidden)
|
rule = PatternRule(r'scalar', r"\$[^\[\]\(\){}<>A-Za-z0-9 \\%s](?![A-Za-z0-9_])" % forbidden)
|
||||||
else:
|
else:
|
||||||
rule = ContextPatternRule(r'scalar', r"\$[^A-Za-z0-9 %(delim)s](?![A-Za-z0-9_])", r"\$[^A-Za-z0-9 ](?![A-Za-z0-9_])")
|
rule = ContextPatternRule(r'scalar', r"\$[^\[\]\(\){}<>A-Za-z0-9 %(delim)s](?![A-Za-z0-9_])", r"\$[^A-Za-z0-9 ](?![A-Za-z0-9_])")
|
||||||
|
|
||||||
rules = [
|
rules = [
|
||||||
PatternRule(r'octal', r'\\[0-7]{3}'),
|
PatternRule(r'octal', r'\\[0-7]{3}'),
|
||||||
|
@ -81,11 +81,23 @@ class PerlGrammar(Grammar):
|
||||||
PatternRule(r'perl_hash', r"%\$*[A-Za-z_](?:[A-Za-z0-9_]|::)*"),
|
PatternRule(r'perl_hash', r"%\$*[A-Za-z_](?:[A-Za-z0-9_]|::)*"),
|
||||||
PatternRule(r'deref', r"[@%\$&\*](?={)"),
|
PatternRule(r'deref', r"[@%\$&\*](?={)"),
|
||||||
|
|
||||||
|
# match regexes; paired delimiters
|
||||||
|
RegionRule(r'match', r'm *(?P<delim>\()', StringGrammar, r'\)[a-z]*'),
|
||||||
|
RegionRule(r'match', r'm *(?P<delim>\[)', StringGrammar, r'\][a-z]*'),
|
||||||
|
RegionRule(r'match', r'm *(?P<delim>\{)', StringGrammar, r'\}[a-z]*'),
|
||||||
|
RegionRule(r'match', r'm *(?P<delim>\<)', StringGrammar, r'\>[a-z]*'),
|
||||||
|
|
||||||
# match regexes
|
# match regexes
|
||||||
RegionRule(r'match', r'(?:(?<==~)|(?<=!~)|(?<=\()|(?<=split)|(?<=if)|(?<=unless)|(?<=while)|(?<=until)) *(?P<delim>/)', StringGrammar, r'/[a-z]*'),
|
RegionRule(r'match', r'(?:(?<==~)|(?<=!~)|(?<=\()|(?<=split)|(?<=if)|(?<=unless)|(?<=while)|(?<=until)) *(?P<delim>/)', StringGrammar, r'/[a-z]*'),
|
||||||
RegionRule(r'match', r'm *(?P<delim>[^ #a-zA-Z0-9_])', StringGrammar, r'%(delim)s[a-z]*'),
|
RegionRule(r'match', r'm *(?P<delim>[^ #a-zA-Z0-9_])', StringGrammar, r'%(delim)s[a-z]*'),
|
||||||
RegionRule(r'match', r'm(?P<delim>#)', StringGrammar, r'#[a-z]*'),
|
RegionRule(r'match', r'm(?P<delim>#)', StringGrammar, r'#[a-z]*'),
|
||||||
|
|
||||||
|
# match regexes; paired delimiters
|
||||||
|
RegionRule(r'replace', r's *(?P<delim>\()', StringGrammar, r'\)\(', StringGrammar, r'\)[a-z]*'),
|
||||||
|
RegionRule(r'replace', r's *(?P<delim>\[)', StringGrammar, r'\]\[', StringGrammar, r'\][a-z]*'),
|
||||||
|
RegionRule(r'replace', r's *(?P<delim>\{)', StringGrammar, r'\}\{', StringGrammar, r'\}[a-z]*'),
|
||||||
|
RegionRule(r'replace', r's *(?P<delim>\<)', StringGrammar, r'\>\<', StringGrammar, r'\>[a-z]*'),
|
||||||
|
|
||||||
# replace regexes
|
# replace regexes
|
||||||
RegionRule(r'replace', r's *(?P<delim>[^ a-zA-Z0-9_])', StringGrammar, r'%(delim)s', StringGrammar, r'%(delim)s[a-z]*'),
|
RegionRule(r'replace', r's *(?P<delim>[^ a-zA-Z0-9_])', StringGrammar, r'%(delim)s', StringGrammar, r'%(delim)s[a-z]*'),
|
||||||
RegionRule(r'replace', r's(?P<delim>#)', StringGrammar, r'#', StringGrammar, r'#[a-z]*'),
|
RegionRule(r'replace', r's(?P<delim>#)', StringGrammar, r'#', StringGrammar, r'#[a-z]*'),
|
||||||
|
|
Loading…
Reference in New Issue