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

« back to all changes in this revision

Viewing changes to wxPython/wx/tools/Editra/src/syntax/_squirrel.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: squirrel.py                                                           #
 
3
# Purpose: Syntax Definitions for Squirrel programming language               #
 
4
# Author: Cody Precord <cprecord@editra.org>                                  #
 
5
# Copyright: (c) 2008 Cody Precord <staff@editra.org>                         #
 
6
# License: wxWindows License                                                  #
 
7
###############################################################################
 
8
 
 
9
"""
 
10
@summary: Lexer configuration module for Squirrel Programming Language
 
11
 
 
12
"""
 
13
 
 
14
__author__ = "Cody Precord <cprecord@editra.org>"
 
15
__svnid__ = "$Id: _squirrel.py 68798 2011-08-20 17:17:05Z CJP $"
 
16
__revision__ = "$Revision: 68798 $"
 
17
 
 
18
#-----------------------------------------------------------------------------#
 
19
# Imports
 
20
import wx.stc as stc
 
21
 
 
22
# Local Imports
 
23
import synglob
 
24
import syndata
 
25
import _cpp
 
26
 
 
27
#-----------------------------------------------------------------------------#
 
28
 
 
29
#---- Keyword Definitions ----#
 
30
SQUIRREL_KW = (0, "break case catch class clone continue const default "
 
31
                  "delegate delete do else enum extends for foreach function "
 
32
                  "if in local null resume return switch this throw try typeof "
 
33
                  "while parent yield constructor vargc vargv instanceof true "
 
34
                  "false static")
 
35
 
 
36
SQUIRREL_TYPES = (1, "")
 
37
 
 
38
#---- End Keyword Definitions ----#
 
39
 
 
40
#-----------------------------------------------------------------------------#
 
41
 
 
42
class SyntaxData(syndata.SyntaxDataBase):
 
43
    """SyntaxData object for Squirrel""" 
 
44
    def __init__(self, langid):
 
45
        super(SyntaxData, self).__init__(langid)
 
46
 
 
47
        # Setup
 
48
        self.SetLexer(stc.STC_LEX_CPP)
 
49
        self.RegisterFeature(synglob.FEATURE_AUTOINDENT, _cpp.AutoIndenter)
 
50
 
 
51
    def GetKeywords(self):
 
52
        """Returns Specified Keywords List """
 
53
        return [SQUIRREL_KW, SQUIRREL_TYPES, _cpp.DOC_KEYWORDS]
 
54
 
 
55
    def GetSyntaxSpec(self):
 
56
        """Syntax Specifications """
 
57
        return _cpp.SYNTAX_ITEMS
 
58
 
 
59
    def GetProperties(self):
 
60
        """Returns a list of Extra Properties to set """
 
61
        return [_cpp.FOLD,]
 
62
 
 
63
    def GetCommentPattern(self):
 
64
        """Returns a list of characters used to comment a block of code """
 
65
        return ['//']