parent
4ebce6cc42
commit
ac9f413b46
|
@ -1,37 +1,20 @@
|
||||||
import color, mode
|
import color, mode
|
||||||
#from lex import Grammar, PatternRule, RegionRule
|
from lex import Grammar, PatternRule, RegionRule
|
||||||
#from mode.python import StringGrammar, PythonGrammar
|
from mode.perl import StringGrammar, PerlGrammar
|
||||||
|
|
||||||
#class ReprGrammar(Grammar):
|
class IperlGrammar(Grammar):
|
||||||
# rules = [
|
rules = [
|
||||||
# RegionRule(r'string', r'"', StringGrammar, r'"'),
|
RegionRule(r'string', r'"', StringGrammar, r'"'),
|
||||||
# RegionRule(r'string', r"'", StringGrammar, r"'"),
|
RegionRule(r'string', r"'", StringGrammar, r"'"),
|
||||||
# ]
|
RegionRule(r'iperl_input', r'^(?:>>>|\.\.>)', PerlGrammar, '\n$'),
|
||||||
#class ConsoleGrammar(Grammar):
|
PatternRule(r'iperl_reserved', r'undef'),
|
||||||
# rules = [
|
]
|
||||||
# PatternRule(r'console_mesg', r'^[A-Za-z].*$'),
|
class Iperl(mode.Fundamental):
|
||||||
# PatternRule(r'console_input', r'^>>>.*$'),
|
|
||||||
# PatternRule(r'console_input', r'^-->.*$'),
|
|
||||||
# RegionRule(r'string', r'"', StringGrammar, r'"'),
|
|
||||||
# RegionRule(r'string', r"'", StringGrammar, r"'"),
|
|
||||||
# #RegionRule(r'console_repr', r"<", ReprGrammar, r">"),
|
|
||||||
# PatternRule(r'console_reserved', r'True|False|None'),
|
|
||||||
# PatternRule(r'console_bareword', r'[a-zA-Z_][a-zA-Z0-9_]*'),
|
|
||||||
# ]
|
|
||||||
class Console(mode.Fundamental):
|
|
||||||
modename = 'IPerl'
|
modename = 'IPerl'
|
||||||
# grammar = ConsoleGrammar()
|
grammar = IperlGrammar()
|
||||||
# colors = {
|
colors = {
|
||||||
# 'console_mesg': ('magenta', 'default', 'bold'),
|
'iperl_input.start': ('red', 'default', 'bold'),
|
||||||
# 'console_input': ('cyan', 'default', 'bold'),
|
'iperl_reserved': ('magenta', 'default', 'bold'),
|
||||||
# 'console_reserved': ('magenta', 'default', 'bold'),
|
}
|
||||||
# 'console_bareword': ('default', 'default', 'bold'),
|
|
||||||
# 'console_repr.start': ('default', 'default', 'bold'),
|
|
||||||
# 'console_repr.null': ('blue', 'default', 'bold'),
|
|
||||||
# 'console_repr.string.start': ('cyan', 'default', 'bold'),
|
|
||||||
# 'console_repr.string.null': ('cyan', 'default', 'bold'),
|
|
||||||
# 'console_repr.string.end': ('cyan', 'default', 'bold'),
|
|
||||||
# 'console_repr.end': ('default', 'default', 'bold'),
|
|
||||||
# }
|
|
||||||
|
|
||||||
install = Console.install
|
install = Iperl.install
|
||||||
|
|
Loading…
Reference in New Issue