parent
34b16ad19e
commit
a01a44b165
|
@ -1,8 +1,7 @@
|
|||
import re, sets, string, sys
|
||||
import color, commands, default, lex2, method, mode2, regex, tab2
|
||||
from point2 import Point
|
||||
from lex2 import Grammar, ConstantRule, PatternRule, ContextPatternRule, \
|
||||
RegionRule, DualRegionRule
|
||||
from lex2 import Grammar, ConstantRule, PatternRule, ContextPatternRule, RegionRule, DualRegionRule
|
||||
|
||||
class PodGrammar(Grammar):
|
||||
rules = [
|
||||
|
@ -16,13 +15,12 @@ class PodGrammar(Grammar):
|
|||
class StringGrammar(Grammar):
|
||||
rules = [
|
||||
PatternRule(name=r'escaped', pattern=r'\\.'),
|
||||
PatternRule(name=r'deref', pattern=r"\$\$*[A-Za-z0-9_](?:[A-Za-z0-9_]|::)*(?:->{\$?(?:[a-zA-Z_][a-zA-Z_0-9]*|'(?:\\.|[^'\\])*'|\"(\\.|[^\\\"])*\")}|->\[\$?[0-9a-zA-Z_]+\])+"),
|
||||
PatternRule(name=r'deref', pattern=r"\$+[A-Za-z0-9_](?:[A-Za-z0-9_]|::)*(?:->{\$?(?:[a-zA-Z_][a-zA-Z_0-9]*|'(?:\\.|[^'\\])*'|\"(\\.|[^\\\"])*\")}|->\[\$?[0-9a-zA-Z_]+\])+"),
|
||||
PatternRule(name=r'length', pattern=r"\$#[A-Za-z0-9_](?:[A-Za-z0-9_]|::)*"),
|
||||
ContextPatternRule(name=r'scalar', pattern=r"\$[^A-Za-z0-9 %(delim)s](?![A-Za-z0-9_])", fallback=r"\$[^A-Za-z0-9 ](?![A-Za-z0-9_])"),
|
||||
PatternRule(name=r'scalar', pattern=r"\$\$*[A-Za-z0-9_](?:[A-Za-z0-9_]|::)*"),
|
||||
PatternRule(name=r'cast', pattern=r"[\$\@\%\&]{.*?}"),
|
||||
PatternRule(name=r'array', pattern=r"@\$*[A-Za-z_](?:[A-Za-z0-9_]|::)*"),
|
||||
#PatternRule(name=r'hash', pattern=r"%\$*[A-Za-z_](?:[A-Za-z0-9_]|::)*"),
|
||||
]
|
||||
|
||||
g = Grammar()
|
||||
|
|
Loading…
Reference in New Issue