~ubuntu-branches/ubuntu/raring/wxwidgets2.8/raring

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Stéphane Graber
  • Date: 2012-01-07 13:59:25 UTC
  • mfrom: (1.1.9) (5.1.10 sid)
  • Revision ID: package-import@ubuntu.com-20120107135925-2601miy9ullcon9j
Tags: 2.8.12.1-6ubuntu1
* Resync from Debian, changes that were kept:
  - debian/rules: re-enable mediactrl. This allows libwx_gtk2u_media-2.8 to be
    built, as this is required by some applications (LP: #632984)
  - debian/control: Build-dep on libxt-dev for mediactrl.
  - Patches
    + fix-bashism-in-example
* Add conflict on python-wxgtk2.8 (<< 2.8.12.1-6ubuntu1~) to python-wxversion
  to guarantee upgrade ordering when moving from pycentral to dh_python2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
"""
16
16
 
17
17
__author__ = "Cody Precord <cprecord@editra.org>"
18
 
__svnid__ = "$Id: _pascal.py 63834 2010-04-03 06:04:33Z CJP $"
19
 
__revision__ = "$Revision: 63834 $"
 
18
__svnid__ = "$Id: _pascal.py 66108 2010-11-10 21:04:54Z CJP $"
 
19
__revision__ = "$Revision: 66108 $"
20
20
 
21
21
#-----------------------------------------------------------------------------#
22
22
# Imports
 
23
import wx
23
24
import wx.stc as stc
24
25
 
25
26
# Local Imports
53
54
             "Ord Round Trunc")
54
55
 
55
56
#---- Syntax Style Specs ----#
56
 
# Pascal Lexer Uses C values, but need to adjust styles accordingly
57
 
SYNTAX_ITEMS = [ (stc.STC_C_DEFAULT, 'default_style'),
58
 
                 (stc.STC_C_COMMENT, 'comment_style'),
59
 
                 (stc.STC_C_COMMENTDOC, 'comment_style'),
60
 
                 (stc.STC_C_COMMENTDOCKEYWORD, 'dockey_style'),
61
 
                 (stc.STC_C_COMMENTDOCKEYWORDERROR, 'error_style'),
62
 
                 (stc.STC_C_COMMENTLINE, 'comment_style'),
63
 
                 (stc.STC_C_COMMENTLINEDOC, 'comment_style'),
64
 
                 (stc.STC_C_CHARACTER, 'char_style'),
65
 
                 (stc.STC_C_GLOBALCLASS, 'global_style'),
66
 
                 (stc.STC_C_IDENTIFIER, 'default_style'),
67
 
                 (stc.STC_C_NUMBER, 'number_style'),
68
 
                 (stc.STC_C_OPERATOR, 'operator_style'),
69
 
                 (stc.STC_C_PREPROCESSOR, 'pre_style'),
70
 
                 (stc.STC_C_REGEX, 'pre_style'),
71
 
                 (stc.STC_C_STRING, 'string_style'),
72
 
                 (stc.STC_C_STRINGEOL, 'stringeol_style'),
73
 
                 (stc.STC_C_UUID, 'pre_style'),
74
 
                 (stc.STC_C_VERBATIM, 'number2_style'),
75
 
                 (stc.STC_C_WORD, 'keyword_style'),
76
 
                 (stc.STC_C_WORD2, 'keyword2_style') ]
 
57
if wx.VERSION >= (2, 9, 0, 0, ''):
 
58
    SYNTAX_ITEMS = [ (stc.STC_PAS_ASM, 'default_style'), #TODO
 
59
                     (stc.STC_PAS_CHARACTER, 'char_style'),
 
60
                     (stc.STC_PAS_COMMENT, 'comment_style'),
 
61
                     (stc.STC_PAS_COMMENT2, 'comment_style'),
 
62
                     (stc.STC_PAS_COMMENTLINE, 'comment_style'),
 
63
                     (stc.STC_PAS_DEFAULT, 'default_style'),
 
64
                     (stc.STC_PAS_HEXNUMBER, 'number_style'), #TODO?
 
65
                     (stc.STC_PAS_IDENTIFIER, 'default_style'),
 
66
                     (stc.STC_PAS_NUMBER, 'number_style'),
 
67
                     (stc.STC_PAS_OPERATOR, 'operator_style'),
 
68
                     (stc.STC_PAS_PREPROCESSOR, 'pre_style'),
 
69
                     (stc.STC_PAS_PREPROCESSOR2, 'default_style'), #TODO
 
70
                     (stc.STC_PAS_STRING, 'string_style'),
 
71
                     (stc.STC_PAS_STRINGEOL, 'stringeol_style'),
 
72
                     (stc.STC_PAS_WORD, 'keyword_style'), ]
 
73
else:
 
74
    # Pascal Lexer Uses C values, but need to adjust styles accordingly
 
75
    SYNTAX_ITEMS = [ (stc.STC_C_DEFAULT, 'default_style'),
 
76
                     (stc.STC_C_COMMENT, 'comment_style'),
 
77
                     (stc.STC_C_COMMENTDOC, 'comment_style'),
 
78
                     (stc.STC_C_COMMENTDOCKEYWORD, 'dockey_style'),
 
79
                     (stc.STC_C_COMMENTDOCKEYWORDERROR, 'error_style'),
 
80
                     (stc.STC_C_COMMENTLINE, 'comment_style'),
 
81
                     (stc.STC_C_COMMENTLINEDOC, 'comment_style'),
 
82
                     (stc.STC_C_CHARACTER, 'char_style'),
 
83
                     (stc.STC_C_GLOBALCLASS, 'global_style'),
 
84
                     (stc.STC_C_IDENTIFIER, 'default_style'),
 
85
                     (stc.STC_C_NUMBER, 'number_style'),
 
86
                     (stc.STC_C_OPERATOR, 'operator_style'),
 
87
                     (stc.STC_C_PREPROCESSOR, 'pre_style'),
 
88
                     (stc.STC_C_REGEX, 'pre_style'),
 
89
                     (stc.STC_C_STRING, 'string_style'),
 
90
                     (stc.STC_C_STRINGEOL, 'stringeol_style'),
 
91
                     (stc.STC_C_UUID, 'pre_style'),
 
92
                     (stc.STC_C_VERBATIM, 'number2_style'),
 
93
                     (stc.STC_C_WORD, 'keyword_style'),
 
94
                     (stc.STC_C_WORD2, 'keyword2_style') ]
77
95
 
78
96
#---- Extra Properties ----#
79
97
FOLD = ("fold", "1")
84
102
class SyntaxData(syndata.SyntaxDataBase):
85
103
    """SyntaxData object for Pascal""" 
86
104
    def __init__(self, langid):
87
 
        syndata.SyntaxDataBase.__init__(self, langid)
 
105
        super(SyntaxData, self).__init__(langid)
88
106
 
89
107
        # Setup
90
108
        self.SetLexer(stc.STC_LEX_PASCAL)