Mercurial > urweb
diff src/urweb.grm @ 2047:6be31671911b
'aria-*' attributes
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Fri, 01 Aug 2014 11:43:44 -0400 |
parents | d11a7a9c4a73 |
children | 4d64af730e35 |
line wrap: on
line diff
--- a/src/urweb.grm Thu Jul 31 09:56:41 2014 -0400 +++ b/src/urweb.grm Fri Aug 01 11:43:44 2014 -0400 @@ -225,7 +225,7 @@ datatype prop_kind = Delete | Update -datatype attr = Class of exp | DynClass of exp | Style of exp | DynStyle of exp | Normal of con * exp | Data of string * exp +datatype attr = Class of exp | DynClass of exp | Style of exp | DynStyle of exp | Normal of con * exp | Data of string * string * exp fun patType loc (p : pat) = case #1 p of @@ -486,7 +486,7 @@ | rpat of (string * pat) list * bool | ptuple of pat list - | attrs of exp option * exp option * exp option * exp option * (string * exp) list * (con * exp) list + | attrs of exp option * exp option * exp option * exp option * (string * string * exp) list * (con * exp) list | attr of attr | attrv of exp @@ -1652,9 +1652,10 @@ [] => #6 attrs | data :: datas => let - fun doOne (name, value) = + fun doOne (kind, name, value) = let val e = (EVar (["Basis"], "data_attr", Infer), pos) + val e = (EApp (e, (EVar (["Basis"], kind ^ "_kind", Infer), pos)), pos) val e = (EApp (e, (EPrim (Prim.String name), pos)), pos) in (EApp (e, value), pos) @@ -1725,7 +1726,9 @@ | "dynStyle" => DynStyle attrv | _ => if String.isPrefix "data-" SYMBOL then - Data (String.extract (SYMBOL, 5, NONE), attrv) + Data ("data", String.extract (SYMBOL, 5, NONE), attrv) + else if String.isPrefix "aria-" SYMBOL then + Data ("aria", String.extract (SYMBOL, 5, NONE), attrv) else let val sym = makeAttr SYMBOL