Page MenuHomePhabricator

PATCH.output_hash

Authored By
bzimport
Nov 21 2014, 10:25 PM
Size
2 KB
Referenced Files
None
Subscribers
None

PATCH.output_hash

Index: texvc.ml
===================================================================
--- texvc.ml (revision 64567)
+++ texvc.ml (working copy)
@@ -1,4 +1,13 @@
exception LexerException of string
+
+(* Updates the output_hash with any version requirements *)
+let output_hash md5 =
+ let version = !Texutil.version_needed in
+ if version > "" then
+ Digest.to_hex (Digest.string md5 ^ version )
+ else
+ md5
+
let lexer_token_safe lexbuf =
try Lexer.token lexbuf
with Failure s -> raise (LexerException s)
@@ -19,7 +28,7 @@
| Some h,Html.LIBERAL,Some m -> "L" ^ md5 ^ h ^ "\000" ^ m
| None,_,Some m -> "X" ^ md5 ^ m
);
- Render.render tmppath finalpath outtex md5 backcolor
+ Render.render tmppath finalpath outtex (output_hash md5) backcolor
end
let _ =
Texutil.set_encoding (try Sys.argv.(4) with _ -> "UTF-8");
Index: texutil.ml
===================================================================
--- texutil.ml (revision 64567)
+++ texutil.ml (working copy)
@@ -34,6 +34,9 @@
| TEX_MATRIX (t,rows) -> "{\\begin{"^t^"}"^(mapjoine "\\\\" (mapjoine "&" (mapjoin render_tex)) rows)^"\\end{"^t^"}}"
| TEX_LR (l,r,tl) -> "\\left "^(tex_part l)^(mapjoin render_tex tl)^"\\right "^(tex_part r)
+let version_needed = ref ""
+let changed_on version = ( if !version_needed < version then version_needed := version else () )
+let get_version_needed = !version_needed
(* Dynamic loading*)
type encoding_t = LATIN1 | LATIN2 | UTF8
@@ -128,7 +131,7 @@
"\\mathrm{T}", "&Tau;")))
| "\\upsilon" -> LITERAL (HTMLABLEC (FONT_UF, "\\upsilon ", "&upsilon;"))
| "\\Upsilon" -> LITERAL (HTMLABLEC (FONT_UF, "\\Upsilon ", "&Upsilon;"))
- | "\\phi" -> LITERAL (HTMLABLEC (FONT_UF, "\\phi ", "&phi;"))
+ | "\\phi" -> (changed_on("2010-04-03"); LITERAL (TEX_ONLY "\\phi "))
| "\\Phi" -> LITERAL (HTMLABLEC (FONT_UF, "\\Phi ", "&Phi;"))
| "\\varphi" -> LITERAL (TEX_ONLY "\\varphi ")
| "\\chi" -> LITERAL (HTMLABLEC (FONT_UF, "\\chi ", "&chi;"))
Index: texutil.mli
===================================================================
--- texutil.mli (revision 64567)
+++ texutil.mli (working copy)
@@ -6,6 +6,7 @@
val get_preface : unit -> string
val get_footer : unit -> string
+val version_needed : string ref
exception Illegal_tex_function of string
val find: string -> Parser.token

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4879
Default Alt Text
PATCH.output_hash (2 KB)

Event Timeline