Compare commits

..

No commits in common. "main" and "hg-default" have entirely different histories.

3 changed files with 1 additions and 50 deletions

6
.gitignore vendored
View File

@ -1,6 +0,0 @@
syntax: glob
*.pyc
*.pyo
*~
TAGS
__pycache__

View File

@ -179,7 +179,7 @@ class Application(object):
'awk', 'shell', 'shellmini', 'fstab', 'yacc', 'pipe', 'mbox', 'awk', 'shell', 'shellmini', 'fstab', 'yacc', 'pipe', 'mbox',
'error', 'lua', 'lily', 'forth', 'ebnf', 'colortest', 'go', 'error', 'lua', 'lily', 'forth', 'ebnf', 'colortest', 'go',
'inform6', 'scala', 'markdown', 'roy', 'twine', 'idris', 'rust', 'inform6', 'scala', 'markdown', 'roy', 'twine', 'idris', 'rust',
'bosatsu', 'tal', 'modal', 'bosatsu', 'tal',
) )
for name in names: for name in names:
exec("import mode.%s; mode.%s.install(self)" % (name, name)) exec("import mode.%s; mode.%s.install(self)" % (name, name))

View File

@ -1,43 +0,0 @@
from mode import Fundamental
from lex import Grammar, PatternRule, RegionRule
class DataGrammar(Grammar):
pass
DataGrammar.rules = [
PatternRule('spaces', ' +'),
RegionRule('sequence', r'\(', DataGrammar, r'\)|$'),
PatternRule('register', r'\?[a-z]'),
PatternRule('word', r'[^() \n]+'),
]
class RuleGrammar(Grammar):
rules = [
PatternRule('spaces', ' +'),
RegionRule('group', r'\(', DataGrammar, r'\)|$'),
PatternRule('register', r'\?[a-z]'),
PatternRule('word', r'[^() \n]+'),
]
class ModalGrammar(Grammar):
rules = [
PatternRule('spaces', ' +'),
PatternRule('eol', r'\n'),
RegionRule('modal.rule', '<>', RuleGrammar, '\n|$'),
PatternRule('modal.lit', r'[^\n]+'),
]
class Modal(Fundamental):
name = 'Modal'
extensions = ['.modal']
grammar = ModalGrammar
colors = {
'modal.lit': ('cyan', 'default'),
'modal.rule.start': ('magenta', 'default'),
'register': ('yellow', 'default'),
'modal.rule.group.start': ('blue', 'default'),
'modal.rule.group.end': ('blue', 'default'),
}
def install(*args):
Modal.install(*args)