comparison src/monoize.sml @ 1840:146ec8e90063

Add some name-mangling rules to allow XML attribute 'name' and attributes with dashes
author Adam Chlipala <adam@chlipala.net>
date Thu, 27 Dec 2012 15:34:11 -0500
parents 276fa06428ba
children 184d00f7be74
comparison
equal deleted inserted replaced
1839:d8c260bcc1f9 1840:146ec8e90063
3362 | _ => attrifyExp 3362 | _ => attrifyExp
3363 3363
3364 val x = 3364 val x =
3365 case x of 3365 case x of
3366 "Typ" => "Type" 3366 "Typ" => "Type"
3367 | "Nam" => "Name"
3367 | "Link" => "Href" 3368 | "Link" => "Href"
3368 | _ => x 3369 | _ => x
3370
3371 val x = String.translate (fn #"_" => "-"
3372 | ch => String.str ch) x
3373
3369 val xp = " " ^ lowercaseFirst x ^ "=\"" 3374 val xp = " " ^ lowercaseFirst x ^ "=\""
3370 3375
3371 val (e, fm) = fooify env fm (e, t) 3376 val (e, fm) = fooify env fm (e, t)
3372 val e = case (tag, x) of 3377 val e = case (tag, x) of
3373 ("coption", "Value") => (L'.EStrcat ((L'.EPrim (Prim.String "x"), loc), e), loc) 3378 ("coption", "Value") => (L'.EStrcat ((L'.EPrim (Prim.String "x"), loc), e), loc)