~brian-sidebotham/wxwidgets-cmake/wxpython-2.9.4

« back to all changes in this revision

Viewing changes to wxPython/wx/tools/Editra/src/syntax/_ooc.py

  • Committer: Brian Sidebotham
  • Date: 2013-08-03 14:30:08 UTC
  • Revision ID: brian.sidebotham@gmail.com-20130803143008-c7806tkych1tp6fc
Initial import into Bazaar

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
###############################################################################
 
2
# Name: ooc.py                                                                #
 
3
# Purpose: Define OOC Syntax Highlighting Support and other features          #
 
4
# Author: Cody Precord <cprecord@editra.org>                                  #
 
5
# Copyright: (c) 2010 Cody Precord <staff@editra.org>                         #
 
6
# License: wxWindows License                                                  #
 
7
###############################################################################
 
8
 
 
9
"""
 
10
FILE: ooc.py                                                                
 
11
@author: Cody Precord                                                       
 
12
@summary: Lexer configuration file for OOC (Out of Class)
 
13
                                                                         
 
14
"""
 
15
 
 
16
__author__ = "Cody Precord <cprecord@editra.org>"
 
17
__svnid__ = "$Id:  $"
 
18
__revision__ = "$Revision:  $"
 
19
 
 
20
#-----------------------------------------------------------------------------#
 
21
# Imports
 
22
import wx.stc as stc
 
23
 
 
24
# Local imports
 
25
import synglob
 
26
import syndata
 
27
import _cpp
 
28
 
 
29
#-----------------------------------------------------------------------------#
 
30
 
 
31
#---- Keyword Specifications ----#
 
32
 
 
33
KEYWORDS = (0, "class cover interface implement func abstract extends from "
 
34
               "this super new const final static include import use extern "
 
35
               "inline proto break continue fallthrough operator if else for "
 
36
               "while do switch case as in version return true false null "
 
37
               "default")
 
38
 
 
39
TYPES = (1, "Int Int8 Int16 Int32 Int64 Int80 Int128 UInt UInt8 UInt16 UInt32 "
 
40
            "UInt64 UInt80 UInt128 Octet Short UShort Long ULong LLong ULLong "
 
41
            "Float Double LDouble Float32 Float64 Float128 Char UChar WChar "
 
42
            "String Void Pointer Bool SizeT This")
 
43
 
 
44
#------------------------------------------------------------------------------#
 
45
 
 
46
class SyntaxData(syndata.SyntaxDataBase):
 
47
    """SyntaxData object for many OOC""" 
 
48
    def __init__(self, langid):
 
49
        super(SyntaxData, self).__init__(langid)
 
50
 
 
51
        # Setup
 
52
        self.SetLexer(stc.STC_LEX_CPP)
 
53
 
 
54
    def GetKeywords(self):
 
55
        """Returns Specified Keywords List"""
 
56
        return [KEYWORDS, TYPES, _cpp.DOC_KEYWORDS]
 
57
 
 
58
    def GetSyntaxSpec(self):
 
59
        """Syntax Specifications """
 
60
        return _cpp.SYNTAX_ITEMS
 
61
 
 
62
    def GetProperties(self):
 
63
        """Returns a list of Extra Properties to set"""
 
64
        return [_cpp.FOLD, _cpp.FOLD_COM]
 
65
 
 
66
    def GetCommentPattern(self):
 
67
        """Return comment pattern for OOC"""
 
68
        return [u'//']