QScintilla/Lexers/LexerTeX.py

changeset 6874
5a3a39442711
parent 6645
ad476851d7e0
child 6891
93f82da09f22
equal deleted inserted replaced
6873:47804e8cde27 6874:5a3a39442711
27 """ 27 """
28 QsciLexerTeX.__init__(self, parent) 28 QsciLexerTeX.__init__(self, parent)
29 Lexer.__init__(self) 29 Lexer.__init__(self)
30 30
31 self.commentString = "%" 31 self.commentString = "%"
32
33 self.keywordSetDescriptions = [
34 self.tr("TeX, eTeX, pdfTeX, Omega"),
35 self.tr("ConTeXt Dutch"),
36 self.tr("ConTeXt English"),
37 self.tr("ConTeXt German"),
38 self.tr("ConTeXt Czech"),
39 self.tr("ConTeXt Italian"),
40 self.tr("ConTeXt Romanian"),
41 self.tr("LaTeX"),
42 ]
32 43
33 def initProperties(self): 44 def initProperties(self):
34 """ 45 """
35 Public slot to initialize the properties. 46 Public slot to initialize the properties.
36 """ 47 """
66 Public method to get the default keywords. 77 Public method to get the default keywords.
67 78
68 @param kwSet number of the keyword set (integer) 79 @param kwSet number of the keyword set (integer)
69 @return string giving the keywords (string) or None 80 @return string giving the keywords (string) or None
70 """ 81 """
71 return QsciLexerTeX.keywords(self, kwSet) 82 texKeywords = (
83 "above abovedisplayshortskip abovedisplayskip "
84 "abovewithdelims accent adjdemerits advance afterassignment "
85 "aftergroup atop atopwithdelims badness baselineskip batchmode "
86 "begingroup belowdisplayshortskip belowdisplayskip binoppenalty "
87 "botmark box boxmaxdepth brokenpenalty catcode char chardef "
88 "cleaders closein closeout clubpenalty copy count countdef cr "
89 "crcr csname day deadcycles def defaulthyphenchar defaultskewchar "
90 "delcode delimiter delimiterfactor delimeters delimitershortfall "
91 "delimeters dimen dimendef discretionary displayindent "
92 "displaylimits displaystyle displaywidowpenalty displaywidth "
93 "divide doublehyphendemerits dp dump edef else emergencystretch "
94 "end endcsname endgroup endinput endlinechar eqno errhelp "
95 "errmessage errorcontextlines errorstopmode escapechar everycr "
96 "everydisplay everyhbox everyjob everymath everypar everyvbox "
97 "exhyphenpenalty expandafter fam fi finalhyphendemerits firstmark "
98 "floatingpenalty font fontdimen fontname futurelet gdef global "
99 "group globaldefs halign hangafter hangindent hbadness hbox hfil "
100 "horizontal hfill horizontal hfilneg hfuzz hoffset holdinginserts "
101 "hrule hsize hskip hss horizontal ht hyphenation hyphenchar "
102 "hyphenpenalty hyphen if ifcase ifcat ifdim ifeof iffalse ifhbox "
103 "ifhmode ifinner ifmmode ifnum ifodd iftrue ifvbox ifvmode ifvoid "
104 "ifx ignorespaces immediate indent input inputlineno input insert "
105 "insertpenalties interlinepenalty jobname kern language lastbox "
106 "lastkern lastpenalty lastskip lccode leaders left lefthyphenmin "
107 "leftskip leqno let limits linepenalty line lineskip "
108 "lineskiplimit long looseness lower lowercase mag mark mathaccent "
109 "mathbin mathchar mathchardef mathchoice mathclose mathcode "
110 "mathinner mathop mathopen mathord mathpunct mathrel mathsurround "
111 "maxdeadcycles maxdepth meaning medmuskip message mkern month "
112 "moveleft moveright mskip multiply muskip muskipdef newlinechar "
113 "noalign noboundary noexpand noindent nolimits nonscript "
114 "scriptscript nonstopmode nulldelimiterspace nullfont number "
115 "omit openin openout or outer output outputpenalty over "
116 "overfullrule overline overwithdelims pagedepth pagefilllstretch "
117 "pagefillstretch pagefilstretch pagegoal pageshrink pagestretch "
118 "pagetotal par parfillskip parindent parshape parskip patterns "
119 "pausing penalty postdisplaypenalty predisplaypenalty "
120 "predisplaysize pretolerance prevdepth prevgraf radical raise "
121 "read relax relpenalty right righthyphenmin rightskip "
122 "romannumeral scriptfont scriptscriptfont scriptscriptstyle "
123 "scriptspace scriptstyle scrollmode setbox setlanguage sfcode "
124 "shipout show showbox showboxbreadth showboxdepth showlists "
125 "showthe skewchar skip skipdef spacefactor spaceskip span special "
126 "splitbotmark splitfirstmark splitmaxdepth splittopskip string "
127 "tabskip textfont textstyle the thickmuskip thinmuskip time "
128 "toks toksdef tolerance topmark topskip tracingcommands "
129 "tracinglostchars tracingmacros tracingonline tracingoutput "
130 "tracingpages tracingparagraphs tracingrestores tracingstats "
131 "uccode uchyph underline unhbox unhcopy unkern unpenalty unskip "
132 "unvbox unvcopy uppercase vadjust valign vbadness vbox vcenter "
133 "vfil vfill vfilneg vfuzz voffset vrule vsize vskip vsplit vss "
134 "vtop wd widowpenalty write xdef xleaders xspaceskip year"
135 )
136 etexKeywords = (
137 "beginL beginR botmarks clubpenalties currentgrouplevel "
138 "currentgrouptype currentifbranch currentiflevel currentiftype "
139 "detokenize dimexpr displaywidowpenalties endL endR eTeXrevision "
140 "eTeXversion everyeof firstmarks fontchardp fontcharht fontcharic "
141 "fontcharwd glueexpr glueshrink glueshrinkorder gluestretch "
142 "gluestretchorder gluetomu ifcsname ifdefined iffontchar "
143 "interactionmode interactionmode interlinepenalties lastlinefit "
144 "lastnodetype marks topmarks middle muexpr mutoglue numexpr "
145 "pagediscards parshapedimen parshapeindent parshapelength "
146 "predisplaydirection savinghyphcodes savingvdiscards scantokens "
147 "showgroups showifs showtokens splitdiscards splitfirstmarks "
148 "TeXXeTstate tracingassigns tracinggroups tracingifs "
149 "tracingnesting tracingscantokens unexpanded unless widowpenalties"
150 )
151 pdftexKeywords = (
152 "pdfadjustspacing pdfannot pdfavoidoverfull pdfcatalog "
153 "pdfcompresslevel pdfdecimaldigits pdfdest pdfdestmargin "
154 "pdfendlink pdfendthread pdffontattr pdffontexpand pdffontname "
155 "pdffontobjnum pdffontsize pdfhorigin pdfimageresolution "
156 "pdfincludechars pdfinfo pdflastannot pdflastdemerits pdflastobj "
157 "pdflastvbreakpenalty pdflastxform pdflastximage "
158 "pdflastximagepages pdflastxpos pdflastypos pdflinesnapx "
159 "pdflinesnapy pdflinkmargin pdfliteral pdfmapfile pdfmaxpenalty "
160 "pdfminpenalty pdfmovechars pdfnames pdfobj "
161 "pdfoptionpdfminorversion pdfoutline pdfoutput pdfpageattr "
162 "pdfpageheight pdfpageresources pdfpagesattr pdfpagewidth "
163 "pdfpkresolution pdfprotrudechars pdfrefobj pdfrefxform "
164 "pdfrefximage pdfsavepos pdfsnaprefpoint pdfsnapx pdfsnapy "
165 "pdfstartlink pdfstartthread pdftexrevision pdftexversion "
166 "pdfthread pdfthreadmargin pdfuniqueresname pdfvorigin pdfxform "
167 "pdfximage"
168 )
169 omegaKeywords = (
170 "odelimiter omathaccent omathchar oradical omathchardef omathcode "
171 "odelcode leftghost rightghost charwd charht chardp charit "
172 "localleftbox localrightbox localinterlinepenalty "
173 "localbrokenpenalty pagedir bodydir pardir textdir mathdir boxdir "
174 "nextfakemath pagewidth pageheight pagerightoffset "
175 "pagebottomoffset nullocp nullocplist ocp externalocp ocplist "
176 "pushocplist popocplist clearocplists ocptracelevel "
177 "addbeforeocplist addafterocplist removebeforeocplist "
178 "removeafterocplist OmegaVersion InputTranslation "
179 "OutputTranslation DefaultInputTranslation "
180 "DefaultOutputTranslation noInputTranslation noOutputTranslation "
181 "InputMode OutputMode DefaultInputMode DefaultOutputMode "
182 "noInputMode noOutputMode noDefaultInputMode noDefaultOutputMode"
183 )
184 macros = (
185 "TeX bgroup egroup endgraf space empty null newcount newdimen "
186 "newskip newmuskip newbox newtoks newhelp newread newwrite newfam "
187 "newlanguage newinsert newif maxdimen magstephalf magstep "
188 "frenchspacing nonfrenchspacing normalbaselines obeylines "
189 "obeyspaces raggedright ttraggedright thinspace negthinspace "
190 "enspace enskip quad qquad smallskip medskip bigskip "
191 "removelastskip topglue vglue hglue break nobreak allowbreak "
192 "filbreak goodbreak smallbreak medbreak bigbreak line leftline "
193 "rightline centerline rlap llap underbar strutbox strut cases "
194 "matrix pmatrix bordermatrix eqalign displaylines eqalignno "
195 "leqalignno pageno folio tracingall showhyphens fmtname "
196 "fmtversion hphantom vphantom phantom smash "
197 "eTeX newmarks grouptype interactionmode nodetype iftype "
198 "tracingall loggingall tracingnone"
199 )
200 if kwSet in (1, 2, 3, 4, 5, 6, 7):
201 return (
202 texKeywords + " " + etexKeywords + " " +
203 pdftexKeywords + " " + omegaKeywords + " " + macros
204 )
205
206 if kwSet == 8:
207 return (
208 texKeywords + " " + etexKeywords + " " +
209 pdftexKeywords
210 )

eric ide

mercurial