1
###############################################################################
3
# Purpose: Define TeX/LateX syntax for highlighting and other features #
4
# Author: Cody Precord <cprecord@editra.org> #
5
# Copyright: (c) 2007 Cody Precord <staff@editra.org> #
6
# License: wxWindows License #
7
###############################################################################
12
@summary: Lexer configuration module for Tex/LaTex.
13
@todo: Fairly poor needs lots of work.
17
__author__ = "Cody Precord <cprecord@editra.org>"
18
__svnid__ = "$Id: _latex.py 68798 2011-08-20 17:17:05Z CJP $"
19
__revision__ = "$Revision: 68798 $"
21
#-----------------------------------------------------------------------------#
29
#-----------------------------------------------------------------------------#
31
#---- Keyword Specifications ----#
34
TEX_KW = (0, "Downarrow backslash lceil rceil Uparrow downarrow lfloor rfloor "
35
"Updownarrow langle rangle Vert")
50
# There are no keyword settings available for LaTeX
52
#---- Syntax Style Specs ----#
54
SYNTAX_ITEMS1 = [(stc.STC_TEX_DEFAULT, 'default_style'),
55
(stc.STC_TEX_COMMAND, 'keyword_style'),
56
(stc.STC_TEX_GROUP, 'scalar_style'),
57
(stc.STC_TEX_SPECIAL, 'operator_style'),
58
(stc.STC_TEX_SYMBOL, 'number_style'),
59
(stc.STC_TEX_TEXT, 'default_style') ]
62
SYNTAX_ITEMS2 = [(stc.STC_L_DEFAULT, 'default_style'),
63
(stc.STC_L_COMMAND, 'pre_style'),
64
(stc.STC_L_COMMENT, 'comment_style'),
65
(stc.STC_L_MATH, 'operator_style'),
66
(stc.STC_L_TAG, 'keyword_style')]
68
#-----------------------------------------------------------------------------#
70
class SyntaxData(syndata.SyntaxDataBase):
71
"""SyntaxData object for LaTeX/TeX"""
72
def __init__(self, langid):
73
super(SyntaxData, self).__init__(langid)
76
# TODO: change to LEX_TEX for TeX?
77
if self.LangId == synglob.ID_LANG_LATEX:
78
self.SetLexer(stc.STC_LEX_LATEX)
80
self.SetLexer(stc.STC_LEX_TEX)
82
def GetKeywords(self):
83
"""Returns Specified Keywords List """
86
def GetSyntaxSpec(self):
87
"""Syntax Specifications """
88
if self.LangId == synglob.ID_LANG_TEX:
93
def GetCommentPattern(self):
94
"""Returns a list of characters used to comment a block of code """