Mercurial > urweb
diff src/mono_opt.sml @ 2008:93ff76058825
HTML5 data-* attributes
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Fri, 02 May 2014 15:32:10 -0400 |
parents | 3d922a28370b |
children | 4d64af730e35 |
line wrap: on
line diff
--- a/src/mono_opt.sml Wed Apr 30 13:05:54 2014 -0400 +++ b/src/mono_opt.sml Fri May 02 15:32:10 2014 -0400 @@ -118,6 +118,9 @@ end fun checkUrl s = CharVector.all Char.isGraph s andalso Settings.checkUrl s +val checkData = CharVector.all (fn ch => Char.isAlphaNum ch + orelse ch = #"_" + orelse ch = #"-") val checkAtom = CharVector.all (fn ch => Char.isAlphaNum ch orelse ch = #"+" orelse ch = #"-" @@ -442,6 +445,13 @@ | ESignalBind ((ESignalReturn e1, loc), e2) => optExp (EApp (e2, e1), loc) + | EFfiApp ("Basis", "blessData", [((se as EPrim (Prim.String s), loc), _)]) => + (if checkData s then + () + else + ErrorMsg.errorAt loc ("Invalid HTML5 data-* attribute " ^ s); + se) + | EFfiApp ("Basis", "bless", [((se as EPrim (Prim.String s), loc), _)]) => (if checkUrl s then ()