r87117 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87116‎ | r87117 | r87118 >
Date:06:08, 29 April 2011
Author:thenub314
Status:resolved (Comments)
Tags:brion, math 
Comment:
This update removes unneeded code from texutil.ml and corrects the way
functions are handled in lexer.mll. In particular lexer.mll failed to
insert a space that, in some cases rendering errors. This bug has now
been corrected.
Modified paths:
  • /trunk/extensions/Math/math/lexer.mll (modified) (history)
  • /trunk/extensions/Math/math/texutil.ml (modified) (history)

Diff [purge]

Index: trunk/extensions/Math/math/lexer.mll
@@ -63,7 +63,7 @@
6464 | "\\" (latex_function_names as name) space * "(" { LITERAL (HTMLABLEC(FONT_UFH,"\\" ^ name ^ "(", name ^ "(")) }
6565 | "\\" (latex_function_names as name) space * "[" { LITERAL (HTMLABLEC(FONT_UFH,"\\" ^ name ^ "[", name ^ "[")) }
6666 | "\\" (latex_function_names as name) space * "\\{" { LITERAL (HTMLABLEC(FONT_UFH,"\\" ^ name ^ "\\{", name ^ "{")) }
67 - | "\\" (latex_function_names as name) space * { LITERAL (HTMLABLEC(FONT_UFH,"\\" ^ name, name ^ " ")) }
 67+ | "\\" (latex_function_names as name) space * { LITERAL (HTMLABLEC(FONT_UFH,"\\" ^ name ^ " ", name ^ " ")) }
6868 | "\\" (mediawiki_function_names as name) space * "(" { (Texutil.tex_use_ams(); LITERAL (HTMLABLEC(FONT_UFH,"\\operatorname{" ^ name ^ "}(", name^ "("))) }
6969 | "\\" (mediawiki_function_names as name) space * "[" { (Texutil.tex_use_ams(); LITERAL (HTMLABLEC(FONT_UFH,"\\operatorname{" ^ name ^ "}[", name^ "["))) }
7070 | "\\" (mediawiki_function_names as name) space * "\\{" { (Texutil.tex_use_ams(); LITERAL (HTMLABLEC(FONT_UFH,"\\operatorname{" ^ name ^ "}\\{", name^ "{"))) }
Index: trunk/extensions/Math/math/texutil.ml
@@ -240,16 +240,6 @@
241241 | "\\triangleleft" -> LITERAL (TEX_ONLY "\\triangleleft ")
242242 | "\\triangleright" -> LITERAL (TEX_ONLY "\\triangleright ")
243243 | "\\textvisiblespace" -> LITERAL (TEX_ONLY "\\textvisiblespace ")
244 - | "\\ker" -> LITERAL (HTMLABLEC(FONT_UFH,"\\ker ","ker"))
245 - | "\\lim" -> LITERAL (TEX_ONLY "\\lim ")
246 - | "\\limsup" -> LITERAL (TEX_ONLY "\\limsup ")
247 - | "\\liminf" -> LITERAL (TEX_ONLY "\\liminf ")
248 - | "\\sup" -> LITERAL (TEX_ONLY "\\sup ")
249 - | "\\Pr" -> LITERAL (TEX_ONLY "\\Pr ")
250 - | "\\hom" -> LITERAL (HTMLABLEC(FONT_UFH,"\\hom ","hom"))
251 - | "\\arg" -> LITERAL (HTMLABLEC(FONT_UFH,"\\arg ","arg"))
252 - | "\\dim" -> LITERAL (HTMLABLEC(FONT_UFH,"\\dim ","dim"))
253 - | "\\inf" -> LITERAL (TEX_ONLY "\\inf ")
254244 | "\\circ" -> LITERAL (TEX_ONLY "\\circ ")
255245 | "\\hbar" -> LITERAL (TEX_ONLY "\\hbar ")
256246 | "\\imath" -> LITERAL (TEX_ONLY "\\imath ")
@@ -270,32 +260,10 @@
271261 | "\\limits" -> LITERAL (TEX_ONLY "\\limits ")
272262 | "\\nolimits" -> LITERAL (TEX_ONLY "\\nolimits ")
273263 | "\\top" -> LITERAL (TEX_ONLY "\\top ")
274 - | "\\sin" -> LITERAL (HTMLABLEC(FONT_UFH,"\\sin ","sin"))
275 - | "\\cos" -> LITERAL (HTMLABLEC(FONT_UFH,"\\cos ","cos"))
276 - | "\\sinh" -> LITERAL (HTMLABLEC(FONT_UFH,"\\sinh ","sinh"))
277 - | "\\cosh" -> LITERAL (HTMLABLEC(FONT_UFH,"\\cosh ","cosh"))
278 - | "\\tan" -> LITERAL (HTMLABLEC(FONT_UFH,"\\tan ","tan"))
279 - | "\\tanh" -> LITERAL (HTMLABLEC(FONT_UFH,"\\tanh ","tanh"))
280 - | "\\sec" -> LITERAL (HTMLABLEC(FONT_UFH,"\\sec ","sec"))
281 - | "\\csc" -> LITERAL (HTMLABLEC(FONT_UFH,"\\csc ","csc"))
282 - | "\\arcsin" -> LITERAL (HTMLABLEC(FONT_UFH,"\\arcsin ","arcsin"))
283 - | "\\arctan" -> LITERAL (HTMLABLEC(FONT_UFH,"\\arctan ","arctan"))
284 - | "\\arccos" -> (tex_use_ams (); LITERAL (HTMLABLEC(FONT_UFH,"\\mathop{\\mathrm{arccos}}","arccos")))
285264 | "\\arccot" -> (tex_use_ams (); LITERAL (HTMLABLEC(FONT_UFH,"\\mathop{\\mathrm{arccot}}","arccot")))
286265 | "\\arcsec" -> (tex_use_ams (); LITERAL (HTMLABLEC(FONT_UFH,"\\mathop{\\mathrm{arcsec}}","arcsec")))
287266 | "\\arccsc" -> (tex_use_ams (); LITERAL (HTMLABLEC(FONT_UFH,"\\mathop{\\mathrm{arccsc}}","arccsc")))
288267 | "\\sgn" -> (tex_use_ams (); LITERAL (HTMLABLEC(FONT_UFH,"\\mathop{\\mathrm{sgn}}","sgn")))
289 - | "\\cot" -> LITERAL (HTMLABLEC(FONT_UFH,"\\cot ","cot"))
290 - | "\\coth" -> LITERAL (HTMLABLEC(FONT_UFH,"\\coth ","coth"))
291 - | "\\log" -> LITERAL (HTMLABLEC(FONT_UFH,"\\log ", "log"))
292 - | "\\lg" -> LITERAL (HTMLABLEC(FONT_UFH,"\\lg ", "lg"))
293 - | "\\ln" -> LITERAL (HTMLABLEC(FONT_UFH,"\\ln ", "ln"))
294 - | "\\exp" -> LITERAL (HTMLABLEC(FONT_UFH,"\\exp ", "exp"))
295 - | "\\min" -> LITERAL (HTMLABLEC(FONT_UFH,"\\min ", "min"))
296 - | "\\max" -> LITERAL (HTMLABLEC(FONT_UFH,"\\max ", "max"))
297 - | "\\gcd" -> LITERAL (HTMLABLEC(FONT_UFH,"\\gcd ", "gcd"))
298 - | "\\deg" -> LITERAL (HTMLABLEC(FONT_UFH,"\\deg ", "deg"))
299 - | "\\det" -> LITERAL (HTMLABLEC(FONT_UFH,"\\det ", "det"))
300268 | "\\bullet" -> LITERAL (HTMLABLE (FONT_UFH, "\\bullet ", "•"))
301269 | "\\bull" -> LITERAL (HTMLABLE (FONT_UFH, "\\bullet ", "•"))
302270 | "\\angle" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UF, "\\angle ", "∠")))

Sign-offs

UserFlagDate
Thelema314inspected14:08, 29 August 2011

Follow-up revisions

RevisionCommit summaryAuthorDate
r96990Revert changes to texvc that provide no test cases or examples of what they'r...brion19:00, 13 September 2011
r96993MFT r96990: provisional revert of texvc changes that don't come with any test...brion19:07, 13 September 2011
r97034* (bug 6722) Spacing fixes for math functions with/without parens...brion00:49, 14 September 2011

Comments

#Comment by Thelema314 (talk | contribs)   14:08, 29 August 2011

Probably better than putting a space after latex function names would be to put "{}". Otherwise, this patch seems good.

#Comment by Brion VIBBER (talk | contribs)   18:47, 13 September 2011

Anything that involves "some cases" should prove it via parser tests...

#Comment by Brion VIBBER (talk | contribs)   19:03, 13 September 2011

Provisionally reverted in r96990 pending test cases.

#Comment by Brion VIBBER (talk | contribs)   00:51, 14 September 2011

Reapplied in r97034 along with test cases & some friends; a couple more revs that hadn't been obviously connected resolve this issue.

Status & tagging log