_pike.py
2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
###############################################################################
# Name: pike.py #
# Purpose: Define highlighting/syntax for Pike programming language #
# Author: Cody Precord <cprecord@editra.org> #
# Copyright: (c) 2007 Cody Precord <staff@editra.org> #
# License: wxWindows License #
###############################################################################
"""
FILE: pike.py
@summary: Defines syntax and highlighting settings for the Pike programming
language. Pike is very similar in form to C/CPP so the Cpp lexer is
used to provide the highlighting settings.
"""
__author__ = "Cody Precord <cprecord@editra.org>"
__svnid__ = "$Id: _pike.py 68798 2011-08-20 17:17:05Z CJP $"
__revision__ = "$Revision: 68798 $"
#-----------------------------------------------------------------------------#
# Imports
import wx.stc as stc
# Local Imports
import synglob
import syndata
import _cpp
#-----------------------------------------------------------------------------#
#---- Keyword Definitions ----#
PIKE_KW = (0, "goto break return continue case default if else switch while "
"foreach do gauge destruct lambda inherit import typeof catch "
"for inline nomask")
PIKE_TYPE = (1, "private protected public static "
"int string void float mapping array multiset mixed program "
"object function")
#---- End Keyword Definitions ----#
#-----------------------------------------------------------------------------#
class SyntaxData(_cpp.SyntaxData):
"""SyntaxData object for Pike"""
def __init__(self, langid):
super(SyntaxData, self).__init__(langid)
def GetKeywords(self):
"""Returns Specified Keywords List """
return [PIKE_KW, PIKE_TYPE, _cpp.DOC_KEYWORDS]
def GetCommentPattern(self):
"""Get the comment pattern"""
return [u"//"]