comparison src/urweb.grm @ 724:12ec14a6be0b

<link>
author Adam Chlipala <adamc@hcoop.net>
date Thu, 16 Apr 2009 12:00:44 -0400
parents 9864b64b1700
children 2c7244c066f1
comparison
equal deleted inserted replaced
723:311ca1ae715d 724:12ec14a6be0b
1306 end) 1306 end)
1307 1307
1308 attr : SYMBOL EQ attrv (if SYMBOL = "class" then 1308 attr : SYMBOL EQ attrv (if SYMBOL = "class" then
1309 Class attrv 1309 Class attrv
1310 else 1310 else
1311 Normal ((CName (capitalize SYMBOL), s (SYMBOLleft, SYMBOLright)), 1311 let
1312 if (SYMBOL = "href" orelse SYMBOL = "src") 1312 val sym =
1313 andalso (case #1 attrv of 1313 case SYMBOL of
1314 EPrim _ => true 1314 "type" => "Typ"
1315 | _ => false) then 1315 | x => capitalize x
1316 let 1316 in
1317 val loc = s (attrvleft, attrvright) 1317 Normal ((CName sym, s (SYMBOLleft, SYMBOLright)),
1318 in 1318 if (sym = "Href" orelse sym = "Src")
1319 (EApp ((EVar (["Basis"], "bless", Infer), loc), 1319 andalso (case #1 attrv of
1320 attrv), loc) 1320 EPrim _ => true
1321 end 1321 | _ => false) then
1322 else 1322 let
1323 attrv)) 1323 val loc = s (attrvleft, attrvright)
1324 in
1325 (EApp ((EVar (["Basis"], "bless", Infer), loc),
1326 attrv), loc)
1327 end
1328 else
1329 attrv)
1330 end)
1324 1331
1325 attrv : INT (EPrim (Prim.Int INT), s (INTleft, INTright)) 1332 attrv : INT (EPrim (Prim.Int INT), s (INTleft, INTright))
1326 | FLOAT (EPrim (Prim.Float FLOAT), s (FLOATleft, FLOATright)) 1333 | FLOAT (EPrim (Prim.Float FLOAT), s (FLOATleft, FLOATright))
1327 | STRING (EPrim (Prim.String STRING), s (STRINGleft, STRINGright)) 1334 | STRING (EPrim (Prim.String STRING), s (STRINGleft, STRINGright))
1328 | LBRACE eexp RBRACE (eexp) 1335 | LBRACE eexp RBRACE (eexp)