comparison src/urweb.grm @ 563:44958d74c43f

Initial conversion to arbitrary-kind classes
author Adam Chlipala <adamc@hcoop.net>
date Fri, 19 Dec 2008 10:03:31 -0500
parents 5d494183ca89
children 8998114760c1
comparison
equal deleted inserted replaced
562:6daa59a55c43 563:44958d74c43f
408 | m :: ms => [(DOpenConstraints (m, ms), s (OPENleft, mpathright))]) 408 | m :: ms => [(DOpenConstraints (m, ms), s (OPENleft, mpathright))])
409 | CONSTRAINT cterm TWIDDLE cterm ([(DConstraint (cterm1, cterm2), s (CONSTRAINTleft, ctermright))]) 409 | CONSTRAINT cterm TWIDDLE cterm ([(DConstraint (cterm1, cterm2), s (CONSTRAINTleft, ctermright))])
410 | EXPORT spath ([(DExport spath, s (EXPORTleft, spathright))]) 410 | EXPORT spath ([(DExport spath, s (EXPORTleft, spathright))])
411 | TABLE SYMBOL COLON cexp ([(DTable (SYMBOL, entable cexp), s (TABLEleft, cexpright))]) 411 | TABLE SYMBOL COLON cexp ([(DTable (SYMBOL, entable cexp), s (TABLEleft, cexpright))])
412 | SEQUENCE SYMBOL ([(DSequence SYMBOL, s (SEQUENCEleft, SYMBOLright))]) 412 | SEQUENCE SYMBOL ([(DSequence SYMBOL, s (SEQUENCEleft, SYMBOLright))])
413 | CLASS SYMBOL EQ cexp ([(DClass (SYMBOL, cexp), s (CLASSleft, cexpright))]) 413 | CLASS SYMBOL EQ cexp (let
414 val loc = s (CLASSleft, cexpright)
415 in
416 [(DClass (SYMBOL, (KWild, loc), cexp), loc)]
417 end)
418 | CLASS SYMBOL DCOLON kind EQ cexp ([(DClass (SYMBOL, kind, cexp), s (CLASSleft, cexpright))])
414 | CLASS SYMBOL SYMBOL EQ cexp (let 419 | CLASS SYMBOL SYMBOL EQ cexp (let
415 val loc = s (CLASSleft, cexpright) 420 val loc = s (CLASSleft, cexpright)
416 val k = (KType, loc) 421 val k = (KWild, loc)
417 val c = (CAbs (SYMBOL2, SOME k, cexp), loc) 422 val c = (CAbs (SYMBOL2, SOME k, cexp), loc)
418 in 423 in
419 [(DClass (SYMBOL1, c), s (CLASSleft, cexpright))] 424 [(DClass (SYMBOL1, k, c), s (CLASSleft, cexpright))]
425 end)
426 | CLASS SYMBOL LPAREN SYMBOL DCOLON kind RPAREN EQ cexp (let
427 val loc = s (CLASSleft, cexpright)
428 val c = (CAbs (SYMBOL2, SOME kind, cexp), loc)
429 in
430 [(DClass (SYMBOL1, kind, c), s (CLASSleft, cexpright))]
420 end) 431 end)
421 | COOKIE SYMBOL COLON cexp ([(DCookie (SYMBOL, cexp), s (COOKIEleft, cexpright))]) 432 | COOKIE SYMBOL COLON cexp ([(DCookie (SYMBOL, cexp), s (COOKIEleft, cexpright))])
422 433
423 kopt : (NONE) 434 kopt : (NONE)
424 | DCOLON kind (SOME kind) 435 | DCOLON kind (SOME kind)
499 val loc = s (SEQUENCEleft, SYMBOLright) 510 val loc = s (SEQUENCEleft, SYMBOLright)
500 val t = (CVar (["Basis"], "sql_sequence"), loc) 511 val t = (CVar (["Basis"], "sql_sequence"), loc)
501 in 512 in
502 (SgiVal (SYMBOL, t), loc) 513 (SgiVal (SYMBOL, t), loc)
503 end) 514 end)
504 | CLASS SYMBOL (SgiClassAbs SYMBOL, s (CLASSleft, SYMBOLright)) 515 | CLASS SYMBOL (let
505 | CLASS SYMBOL EQ cexp (SgiClass (SYMBOL, cexp), s (CLASSleft, cexpright)) 516 val loc = s (CLASSleft, SYMBOLright)
517 in
518 (SgiClassAbs (SYMBOL, (KWild, loc)), loc)
519 end)
520 | CLASS SYMBOL DCOLON kind (let
521 val loc = s (CLASSleft, kindright)
522 in
523 (SgiClassAbs (SYMBOL, kind), loc)
524 end)
525 | CLASS SYMBOL EQ cexp (let
526 val loc = s (CLASSleft, cexpright)
527 in
528 (SgiClass (SYMBOL, (KWild, loc), cexp), loc)
529 end)
530 | CLASS SYMBOL DCOLON kind EQ cexp (let
531 val loc = s (CLASSleft, cexpright)
532 in
533 (SgiClass (SYMBOL, kind, cexp), loc)
534 end)
506 | CLASS SYMBOL SYMBOL EQ cexp (let 535 | CLASS SYMBOL SYMBOL EQ cexp (let
507 val loc = s (CLASSleft, cexpright) 536 val loc = s (CLASSleft, cexpright)
508 val k = (KType, loc) 537 val k = (KWild, loc)
509 val c = (CAbs (SYMBOL2, SOME k, cexp), loc) 538 val c = (CAbs (SYMBOL2, SOME k, cexp), loc)
510 in 539 in
511 (SgiClass (SYMBOL1, c), s (CLASSleft, cexpright)) 540 (SgiClass (SYMBOL1, k, c), s (CLASSleft, cexpright))
541 end)
542 | CLASS SYMBOL LPAREN SYMBOL DCOLON kind RPAREN EQ cexp (let
543 val loc = s (CLASSleft, cexpright)
544 val c = (CAbs (SYMBOL2, SOME kind, cexp), loc)
545 in
546 (SgiClass (SYMBOL1, kind, c), s (CLASSleft, cexpright))
512 end) 547 end)
513 | COOKIE SYMBOL COLON cexp (let 548 | COOKIE SYMBOL COLON cexp (let
514 val loc = s (COOKIEleft, cexpright) 549 val loc = s (COOKIEleft, cexpright)
515 val t = (CApp ((CVar (["Basis"], "http_cookie"), loc), 550 val t = (CApp ((CVar (["Basis"], "http_cookie"), loc),
516 entable cexp), loc) 551 entable cexp), loc)