コード例 #1
0
        self._properties = properties
        self._lexer = find_lexer_module_by_id(SCLEX_SQL)
        self._keyword_lists = [
            WordList(Keywords.sql_keywords),
        ]


class SQLHandler(DispatchHandler):
    def __init__(self):
        DispatchHandler.__init__(self, 'SCE_C')


class SQLHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, SQLHandler):
    name = 'sql'
    description = 'SQL'

    def __init__(self):
        SQLHandler.__init__(self)
        HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_C')

    def generate_html(self, file, buffer, lexer=SQLLexer()):
        self._file = file

        lexer.tokenize_by_style(buffer, self.event_handler)


sql_language_info = LanguageInfo.LanguageInfo('sql', ['sql'], [],
                                              [SQLHTMLGenerator])

LanguageInfo.register_language(sql_language_info)
コード例 #2
0
ファイル: PostScript.py プロジェクト: Resike/SublimeCodeIntel
            WordList(Keywords.postscript_level3_keywords),
            WordList(Keywords.postscript_ripspecific_keywords),
            WordList(),
        ]


class PostScriptHandler(DispatchHandler):
    def __init__(self):
        DispatchHandler.__init__(self, "SCE_PS")


class PostScriptHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, PostScriptHandler):
    name = "ps"
    description = "PostScript"

    def __init__(self):
        PostScriptHandler.__init__(self)
        HTMLGenerator.SimpleHTMLGenerator.__init__(self, "SCE_PS")

    def generate_html(self, file, buffer, lexer=PostScriptLexer()):
        self._file = file

        lexer.tokenize_by_style(buffer, self.event_handler)


postscript_language_info = LanguageInfo.LanguageInfo(
    "PostScript", ["ps", "eps", "postscript"], [".*?PS-.*?"], [PostScriptHTMLGenerator]
)

LanguageInfo.register_language(postscript_language_info)
コード例 #3
0
ファイル: Java.py プロジェクト: shani2010/SublimeCodeIntel
            WordList(Keywords.java_keywords),
            WordList(),  # User defined (important functions, constants, etc.)
            WordList(Keywords.javadoc_keywords),
            WordList(),  # "Fold header keywords" - whatever that is
            WordList(),  # Global classes and typedefs
        ]


class JavaHandler(DispatchHandler):
    def __init__(self):
        DispatchHandler.__init__(self, 'SCE_C')


class JavaHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, JavaHandler):
    name = 'java'
    description = 'Java'

    def __init__(self):
        JavaHandler.__init__(self)
        HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_C')

    def generate_html(self, file, buffer, lexer=JavaLexer()):
        self._file = file

        lexer.tokenize_by_style(buffer, self.event_handler)


java_language_info = LanguageInfo.LanguageInfo('Java', ['java'], [],
                                               [JavaHTMLGenerator])

LanguageInfo.register_language(java_language_info)
コード例 #4
0
            WordList(Keywords.vb_keywords),
            WordList(Keywords.python_keywords),
            WordList(Keywords.php_keywords),
            WordList(Keywords.sgml_keywords)
        ]


class XSLTHandler(DispatchHandler):
    def __init__(self):
        DispatchHandler.__init__(self, 'SCE_H')


class XSLTHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, XSLTHandler):
    name = 'xslt'
    description = 'XSLT'

    def __init__(self):
        XSLTHandler.__init__(self)
        HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_H')

    def generate_html(self, file, buffer, lexer=XSLTLexer()):
        self._file = file

        lexer.tokenize_by_style(buffer, self.event_handler)


xslt_language_info = LanguageInfo.LanguageInfo('xslt', ['xsl', 'xslt'], [],
                                               [XSLTHTMLGenerator])

LanguageInfo.register_language(xslt_language_info)
コード例 #5
0
import _SilverCity
from _SilverCity import *


def get_default_stylesheet_location():
    """get_default_stylesheet_location() => file path

    Returns the path of the default cascading style sheet (CSS) file
    that is installed with the rest of the SilverCity package."""

    import os

    css_file = os.path.join(os.path.dirname(__file__), 'default.css')
    if not os.path.exists(css_file):
        raise Exception('Default CSS file could not be found at %s' % css_file)

    return css_file


import LanguageInfo
LanguageInfo.do_registration()
コード例 #6
0
    def __init__(self):
        PythonHandler.__init__(self)
        HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_P')

    def handle_p_string(self, text, **ignored):
        generator = guess_generator(text)
        if generator is not None:
            generator.generate_html(self._file, text)
        else:
            self.handle_other(text=text, **ignored)

    def handle_p_character(self, **kwargs):
        self.handle_p_string(**kwargs)

    def handle_p_triple(self, **kwargs):
        self.handle_p_string(**kwargs)

    def handle_p_tripledouble(self, **kwargs):
        self.handle_p_string(**kwargs)

    def handle_p_stringeol(self, **kwargs):
        self.handle_p_string(**kwargs)


python_language_info = LanguageInfo.LanguageInfo(
    'python', ['py', 'pyw', 'cgi'], ['.*?python.*?'],
    [PythonHTMLGenerator, SmartPythonHTMLGenerator])

LanguageInfo.register_language(python_language_info)
コード例 #7
0
ファイル: Java.py プロジェクト: Ahmad-Dukhan/plugins
            WordList(), # "Fold header keywords" - whatever that is
            WordList(), # Global classes and typedefs
                               ]
            
class JavaHandler(DispatchHandler):
    def __init__(self):
        DispatchHandler.__init__(self, 'SCE_C')

class JavaHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, JavaHandler):
    name = 'java'
    description = 'Java'

    def __init__(self):
        JavaHandler.__init__(self)
        HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_C')
            
    def generate_html(self, file, buffer, lexer = JavaLexer()):
        self._file = file
        
        lexer.tokenize_by_style(buffer, self.event_handler)


java_language_info = LanguageInfo.LanguageInfo(
                'Java',
                 ['java'],
                 [],
                 [JavaHTMLGenerator]
            ) 

LanguageInfo.register_language(java_language_info)
コード例 #8
0
ファイル: XSLT.py プロジェクト: Ahmad-Dukhan/plugins
            WordList(Keywords.python_keywords),
            WordList(Keywords.php_keywords),
            WordList(Keywords.sgml_keywords)
                               ]

class XSLTHandler(DispatchHandler):
    def __init__(self):
        DispatchHandler.__init__(self, 'SCE_H')

class XSLTHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, XSLTHandler):
    name = 'xslt'
    description = 'XSLT'

    def __init__(self):
        XSLTHandler.__init__(self)
        HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_H')
            
    def generate_html(self, file, buffer, lexer = XSLTLexer()):
        self._file = file
        
        lexer.tokenize_by_style(buffer, self.event_handler)

xslt_language_info = LanguageInfo.LanguageInfo(
                'xslt',
                 ['xsl', 'xslt'],
                 [],
                 [XSLTHTMLGenerator]
            ) 

LanguageInfo.register_language(xslt_language_info) 
コード例 #9
0
        self._properties = properties
        self._lexer = find_lexer_module_by_id(SCLEX_NULL)
        self._keyword_lists = []


class NULLHandler(DispatchHandler):
    def __init__(self):
        DispatchHandler.__init__(self, None)


class NULLHTMLGenerator(HTMLGenerator.HTMLGenerator, NULLHandler):
    name = 'null'
    description = 'No styling'

    def __init__(self):
        NULLHandler.__init__(self)

    def generate_html(self, file, buffer, lexer=NULLLexer()):
        self._file = file

        lexer.tokenize_by_style(buffer, self.event_handler)

    def handle_other(self, style, text, **ignored):
        self._file.write(self.markup(text))


null_language_info = LanguageInfo.LanguageInfo('null', ['text', 'txt'], [],
                                               [NULLHTMLGenerator])

LanguageInfo.register_language(null_language_info)
コード例 #10
0
ファイル: Verilog.py プロジェクト: Ahmad-Dukhan/plugins
            WordList(),# "User defined tasks and identifiers"
            WordList(),# "Unused"
            ]
            
class VerilogHandler(DispatchHandler):
    def __init__(self):
        DispatchHandler.__init__(self, 'SCE_V')

class VerilogHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, VerilogHandler):
    name = 'verilog'
    description = 'verilog'

    def __init__(self):
        VerilogHandler.__init__(self)
        HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_V')
            
    def generate_html(self, file, buffer, lexer = VerilogLexer()):
        self._file = file
        
        lexer.tokenize_by_style(buffer, self.event_handler)


verilog_language_info = LanguageInfo.LanguageInfo(
                'Verilog',
                 ['v', 'vh', 'sv', 'svh' ],
                 [],
                 [VerilogHTMLGenerator]
            ) 

LanguageInfo.register_language(verilog_language_info)
コード例 #11
0
            WordList(),
            WordList(),
            WordList(Keywords.sgml_keywords)
        ]


class XMLHandler(DispatchHandler):
    def __init__(self):
        DispatchHandler.__init__(self, 'SCE_H')


class XMLHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, XMLHandler):
    name = 'xml'
    description = 'XML'

    def __init__(self):
        XMLHandler.__init__(self)
        HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_H')

    def generate_html(self, file, buffer, lexer=XMLLexer()):
        self._file = file

        lexer.tokenize_by_style(buffer, self.event_handler)


xml_language_info = LanguageInfo.LanguageInfo('xml', ['xml', 'dtd'],
                                              [r'.*?\<\?xml.*?'],
                                              [XMLHTMLGenerator])

LanguageInfo.register_language(xml_language_info)
コード例 #12
0
ファイル: CSS.py プロジェクト: zqy1/SublimeCodeIntel

class LessLexer(_CSSLexerTemplate):
    def __init__(self, properties=PropertySet()):
        _CSSLexerTemplate.__init__(self, properties)
        properties['lexer.css.less.language'] = '1'


class CSSHandler(DispatchHandler):
    def __init__(self):
        DispatchHandler.__init__(self, 'SCE_CSS')


class CSSHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, CSSHandler):
    name = 'css'
    description = 'Cascading Style Sheets'

    def __init__(self):
        CSSHandler.__init__(self)
        HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_CSS')

    def generate_html(self, file, buffer, lexer=CSSLexer()):
        self._file = file
        lexer.tokenize_by_style(buffer, self.event_handler)


css_language_info = LanguageInfo.LanguageInfo('css', ['css'], ['.*?css.*?'],
                                              [CSSHTMLGenerator])

LanguageInfo.register_language(css_language_info)
コード例 #13
0
            WordList()
        ]


class JavaScriptHandler(DispatchHandler):
    def __init__(self):
        DispatchHandler.__init__(self, 'SCE_C')


class JavaScriptHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, JavaScriptHandler):
    name = 'js'
    description = 'JavaScript'

    def __init__(self):
        JavaScriptHandler.__init__(self)
        HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_C')

    def generate_html(self, file, buffer, lexer=JavaScriptLexer()):
        self._file = file

        lexer.tokenize_by_style(buffer, self.event_handler)

javascript_language_info = LanguageInfo.LanguageInfo(
    'JavaScript',
    ['js', 'javascript'],
    [],
    [JavaScriptHTMLGenerator]
)

LanguageInfo.register_language(javascript_language_info)
コード例 #14
0
ファイル: Perl.py プロジェクト: shani2010/SublimeCodeIntel
        self._lexer = find_lexer_module_by_id(SCLEX_PERL)
        self._keyword_lists = [
            WordList(Keywords.perl_keywords),
        ]


class PerlHandler(DispatchHandler):
    def __init__(self):
        DispatchHandler.__init__(self, 'SCE_PL')


class PerlHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, PerlHandler):
    name = 'perl'
    description = 'Perl'

    def __init__(self):
        PerlHandler.__init__(self)
        HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_PL')

    def generate_html(self, file, buffer, lexer=PerlLexer()):
        self._file = file

        lexer.tokenize_by_style(buffer, self.event_handler)


perl_language_info = LanguageInfo.LanguageInfo('perl', ['pl', 'cgi'],
                                               ['.*?perl.*?'],
                                               [PerlHTMLGenerator])

LanguageInfo.register_language(perl_language_info)
コード例 #15
0
        ]


class HyperTextHandler(DispatchHandler):
    def __init__(self):
        DispatchHandler.__init__(self, 'SCE_H')


class HyperTextHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator,
                             HyperTextHandler):
    name = 'html'
    description = 'HTML and PHP [with embedded: JavaScript, VBScript, Python]'

    def __init__(self):
        HyperTextHandler.__init__(self)
        HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_H')

    def generate_html(self, file, buffer, lexer=HyperTextLexer()):
        self._file = file

        lexer.tokenize_by_style(buffer, self.event_handler)


html_language_info = LanguageInfo.LanguageInfo(
    'html',
    ['html', 'htm', 'xhtml',
     re.compile('^php(\d)?$', re.IGNORECASE), 'inc'], ['.*?\<!DOCTYPE\s+html'],
    [HyperTextHTMLGenerator])

LanguageInfo.register_language(html_language_info)
コード例 #16
0
ファイル: YAML.py プロジェクト: shani2010/SublimeCodeIntel
        self._properties = properties
        self._lexer = find_lexer_module_by_id(SCLEX_YAML)
        self._keyword_lists = [
            WordList(Keywords.yaml_keywords),
        ]


class YAMLHandler(DispatchHandler):
    def __init__(self):
        DispatchHandler.__init__(self, 'SCE_YAML')


class YAMLHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, YAMLHandler):
    name = 'yaml'
    description = 'YAML'

    def __init__(self):
        YAMLHandler.__init__(self)
        HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_YAML')

    def generate_html(self, file, buffer, lexer=YAMLLexer()):
        self._file = file

        lexer.tokenize_by_style(buffer, self.event_handler)


yaml_language_info = LanguageInfo.LanguageInfo('YAML', ['yml', 'yaml'], [],
                                               [YAMLHTMLGenerator])

LanguageInfo.register_language(yaml_language_info)
コード例 #17
0
        ]


class CPPHandler(DispatchHandler):
    def __init__(self):
        DispatchHandler.__init__(self, 'SCE_C')


class CPPHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, CPPHandler):
    name = 'cpp'
    description = 'C and C++'

    def __init__(self):
        CPPHandler.__init__(self)
        HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_C')

    def generate_html(self, file, buffer, lexer=CPPLexer()):
        self._file = file

        lexer.tokenize_by_style(buffer, self.event_handler)


cpp_language_info = LanguageInfo.LanguageInfo(
    'C++',
    ['c', 'c+', 'c++', 'cpp', 'cxx', 'h', 'hpp'],
    [],
    [CPPHTMLGenerator]
)

LanguageInfo.register_language(cpp_language_info)
コード例 #18
0
ファイル: Perl.py プロジェクト: Ahmad-Dukhan/plugins
        self._lexer = find_lexer_module_by_id(SCLEX_PERL)
        self._keyword_lists = [
            WordList(Keywords.perl_keywords),
                               ]
            
class PerlHandler(DispatchHandler):
    def __init__(self):
        DispatchHandler.__init__(self, 'SCE_PL')

class PerlHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, PerlHandler):
    name = 'perl'
    description = 'Perl'
    
    def __init__(self):
        PerlHandler.__init__(self)
        HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_PL')
            
    def generate_html(self, file, buffer, lexer = PerlLexer()):
        self._file = file
        
        lexer.tokenize_by_style(buffer, self.event_handler)

perl_language_info = LanguageInfo.LanguageInfo(
                'perl',
                 ['pl', 'cgi'],
                 ['.*?perl.*?'],
                 [PerlHTMLGenerator]
            ) 

LanguageInfo.register_language(perl_language_info)
コード例 #19
0
            WordList(),  # "System Tasks"
            WordList(),  # "User defined tasks and identifiers"
            WordList(),  # "Unused"
        ]


class VerilogHandler(DispatchHandler):
    def __init__(self):
        DispatchHandler.__init__(self, 'SCE_V')


class VerilogHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, VerilogHandler):
    name = 'verilog'
    description = 'verilog'

    def __init__(self):
        VerilogHandler.__init__(self)
        HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_V')

    def generate_html(self, file, buffer, lexer=VerilogLexer()):
        self._file = file

        lexer.tokenize_by_style(buffer, self.event_handler)


verilog_language_info = LanguageInfo.LanguageInfo('Verilog',
                                                  ['v', 'vh', 'sv', 'svh'], [],
                                                  [VerilogHTMLGenerator])

LanguageInfo.register_language(verilog_language_info)
コード例 #20
0
ファイル: Ruby.py プロジェクト: INDIAN2020/Sublime-text-2
        self._lexer = find_lexer_module_by_id(SCLEX_RUBY)
        self._keyword_lists = [
            WordList(Keywords.ruby_keywords)
                            ]

class RubyHandler(Python.PythonHandler):
    pass

# This is a hack since we now subclass PythonHandler instead of
# RubyHandler
class RubyHTMLGenerator(Python.PythonHTMLGenerator):
    name = 'ruby'
    description = 'Ruby'

    def __init__(self):
        Python.PythonHTMLGenerator.__init__(self)

    def generate_html(self, file, buffer, lexer = RubyLexer()):
        self._file = file
        
        lexer.tokenize_by_style(buffer, self.event_handler)
        
ruby_language_info = LanguageInfo.LanguageInfo(
                'ruby',
                 ['rb', 'cgi'],
                 ['.*?ruby.*?'],
                 [RubyHTMLGenerator]
            )

LanguageInfo.register_language(ruby_language_info)
コード例 #21
0
            WordList(),
            WordList()
        ]


class JavaScriptHandler(DispatchHandler):
    def __init__(self):
        DispatchHandler.__init__(self, 'SCE_C')


class JavaScriptHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator,
                              JavaScriptHandler):
    name = 'js'
    description = 'JavaScript'

    def __init__(self):
        JavaScriptHandler.__init__(self)
        HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_C')

    def generate_html(self, file, buffer, lexer=JavaScriptLexer()):
        self._file = file

        lexer.tokenize_by_style(buffer, self.event_handler)


javascript_language_info = LanguageInfo.LanguageInfo('JavaScript',
                                                     ['js', 'javascript'], [],
                                                     [JavaScriptHTMLGenerator])

LanguageInfo.register_language(javascript_language_info)
コード例 #22
0
ファイル: Ruby.py プロジェクト: Ahmad-Dukhan/plugins
        self._lexer = find_lexer_module_by_id(SCLEX_RUBY)
        self._keyword_lists = [
            WordList(Keywords.ruby_keywords)
                            ]

class RubyHandler(Python.PythonHandler):
    pass

# This is a hack since we now subclass PythonHandler instead of
# RubyHandler
class RubyHTMLGenerator(Python.PythonHTMLGenerator):
    name = 'ruby'
    description = 'Ruby'

    def __init__(self):
        Python.PythonHTMLGenerator.__init__(self)

    def generate_html(self, file, buffer, lexer = RubyLexer()):
        self._file = file
        
        lexer.tokenize_by_style(buffer, self.event_handler)
        
ruby_language_info = LanguageInfo.LanguageInfo(
                'ruby',
                 ['rb', 'cgi'],
                 ['.*?ruby.*?'],
                 [RubyHTMLGenerator]
            )

LanguageInfo.register_language(ruby_language_info)
コード例 #23
0
import _SilverCity
from _SilverCity import *


def get_default_stylesheet_location():
    """get_default_stylesheet_location() => file path

    Returns the path of the default cascading style sheet (CSS) file
    that is installed with the rest of the SilverCity package."""

    import os

    css_file = os.path.join(os.path.dirname(__file__), 'default.css')
    if not os.path.exists(css_file):
        raise Exception('Default CSS file could not be found at %s' % css_file)

    return css_file

import LanguageInfo
LanguageInfo.do_registration()
コード例 #24
0
ファイル: NULL.py プロジェクト: Ahmad-Dukhan/plugins
        self._lexer = find_lexer_module_by_id(SCLEX_NULL)
        self._keyword_lists = []

class NULLHandler(DispatchHandler):
    def __init__(self):
        DispatchHandler.__init__(self, None)

class NULLHTMLGenerator(HTMLGenerator.HTMLGenerator, NULLHandler):
    name = 'null'
    description = 'No styling'
    
    def __init__(self):
        NULLHandler.__init__(self)
            
    def generate_html(self, file, buffer, lexer = NULLLexer()):
        self._file = file
        
        lexer.tokenize_by_style(buffer, self.event_handler)

    def handle_other(self, style, text, **ignored):
        self._file.write(self.markup(text))
        
null_language_info = LanguageInfo.LanguageInfo(
                'null',
                 ['text', 'txt'],
                 [],
                 [NULLHTMLGenerator]
            )

LanguageInfo.register_language(null_language_info) 
コード例 #25
0
    def __init__(self):
        PythonHandler.__init__(self)
        HTMLGenerator.SimpleHTMLGenerator.__init__(self, "SCE_P")

    def handle_p_string(self, text, **ignored):
        generator = guess_generator(text)
        if generator is not None:
            generator.generate_html(self._file, text)
        else:
            self.handle_other(text=text, **ignored)

    def handle_p_character(self, **kwargs):
        self.handle_p_string(**kwargs)

    def handle_p_triple(self, **kwargs):
        self.handle_p_string(**kwargs)

    def handle_p_tripledouble(self, **kwargs):
        self.handle_p_string(**kwargs)

    def handle_p_stringeol(self, **kwargs):
        self.handle_p_string(**kwargs)


python_language_info = LanguageInfo.LanguageInfo(
    "python", ["py", "pyw", "cgi"], [".*?python.*?"], [PythonHTMLGenerator, SmartPythonHTMLGenerator]
)

LanguageInfo.register_language(python_language_info)
コード例 #26
0
ファイル: XML.py プロジェクト: Acidburn0zzz/KomodoEdit
            WordList(),
            WordList(),
            WordList(Keywords.sgml_keywords)
                               ]

class XMLHandler(DispatchHandler):
    def __init__(self):
        DispatchHandler.__init__(self, 'SCE_H')

class XMLHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, XMLHandler):
    name = 'xml'
    description = 'XML'

    def __init__(self):
        XMLHandler.__init__(self)
        HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_H')
            
    def generate_html(self, file, buffer, lexer = XMLLexer()):
        self._file = file
        
        lexer.tokenize_by_style(buffer, self.event_handler)

xml_language_info = LanguageInfo.LanguageInfo(
                'xml',
                 ['xml', 'dtd'],
                 [r'.*?\<\?xml.*?'],
                 [XMLHTMLGenerator]
            ) 

LanguageInfo.register_language(xml_language_info)        
コード例 #27
0
ファイル: PostScript.py プロジェクト: zqy1/SublimeCodeIntel
            WordList(Keywords.postscript_ripspecific_keywords),
            WordList()
        ]


class PostScriptHandler(DispatchHandler):
    def __init__(self):
        DispatchHandler.__init__(self, 'SCE_PS')


class PostScriptHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator,
                              PostScriptHandler):
    name = 'ps'
    description = 'PostScript'

    def __init__(self):
        PostScriptHandler.__init__(self)
        HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_PS')

    def generate_html(self, file, buffer, lexer=PostScriptLexer()):
        self._file = file

        lexer.tokenize_by_style(buffer, self.event_handler)


postscript_language_info = LanguageInfo.LanguageInfo(
    'PostScript', ['ps', 'eps', 'postscript'], ['.*?PS-.*?'],
    [PostScriptHTMLGenerator])

LanguageInfo.register_language(postscript_language_info)