comparison src/urweb.grm @ 842:d1b6acaec265

&& and ||
author Adam Chlipala <adamc@hcoop.net>
date Sun, 07 Jun 2009 12:01:55 -0400
parents 5154a047c6bc
children 9f0ea203a1ca
comparison
equal deleted inserted replaced
841:44c2c089ca15 842:d1b6acaec265
200 | FN | PLUSPLUS | MINUSMINUS | MINUSMINUSMINUS | DOLLAR | TWIDDLE | CARET 200 | FN | PLUSPLUS | MINUSMINUS | MINUSMINUSMINUS | DOLLAR | TWIDDLE | CARET
201 | LET | IN 201 | LET | IN
202 | STRUCTURE | SIGNATURE | STRUCT | SIG | END | FUNCTOR | WHERE | EXTERN | SQL 202 | STRUCTURE | SIGNATURE | STRUCT | SIG | END | FUNCTOR | WHERE | EXTERN | SQL
203 | INCLUDE | OPEN | CONSTRAINT | CONSTRAINTS | EXPORT | TABLE | SEQUENCE | VIEW 203 | INCLUDE | OPEN | CONSTRAINT | CONSTRAINTS | EXPORT | TABLE | SEQUENCE | VIEW
204 | COOKIE | STYLE 204 | COOKIE | STYLE
205 | CASE | IF | THEN | ELSE 205 | CASE | IF | THEN | ELSE | ANDALSO | ORELSE
206 206
207 | XML_BEGIN of string | XML_END | XML_BEGIN_END of string 207 | XML_BEGIN of string | XML_END | XML_BEGIN_END of string
208 | NOTAGS of string 208 | NOTAGS of string
209 | BEGIN_TAG of string | END_TAG of string 209 | BEGIN_TAG of string | END_TAG of string
210 210
363 %right KARROW 363 %right KARROW
364 %nonassoc DKARROW 364 %nonassoc DKARROW
365 %right SEMI 365 %right SEMI
366 %nonassoc LARROW 366 %nonassoc LARROW
367 %nonassoc IF THEN ELSE 367 %nonassoc IF THEN ELSE
368 %left ANDALSO
369 %left ORELSE
368 %nonassoc DARROW 370 %nonassoc DARROW
369 %nonassoc COLON 371 %nonassoc COLON
370 %nonassoc DCOLON TCOLON 372 %nonassoc DCOLON TCOLON
371 %left UNION INTERSECT EXCEPT 373 %left UNION INTERSECT EXCEPT
372 %right COMMA 374 %right COMMA
941 943
942 | eexp LT eexp (native_op ("lt", eexp1, eexp2, s (eexp1left, eexp2right))) 944 | eexp LT eexp (native_op ("lt", eexp1, eexp2, s (eexp1left, eexp2right)))
943 | eexp LE eexp (native_op ("le", eexp1, eexp2, s (eexp1left, eexp2right))) 945 | eexp LE eexp (native_op ("le", eexp1, eexp2, s (eexp1left, eexp2right)))
944 | eexp GT eexp (native_op ("gt", eexp1, eexp2, s (eexp1left, eexp2right))) 946 | eexp GT eexp (native_op ("gt", eexp1, eexp2, s (eexp1left, eexp2right)))
945 | eexp GE eexp (native_op ("ge", eexp1, eexp2, s (eexp1left, eexp2right))) 947 | eexp GE eexp (native_op ("ge", eexp1, eexp2, s (eexp1left, eexp2right)))
948
949 | eexp ANDALSO eexp (let
950 val loc = s (eexp1left, eexp2right)
951 in
952 (ECase (eexp1, [((PCon (["Basis"], "True", NONE), loc),
953 eexp2),
954 ((PCon (["Basis"], "False", NONE), loc),
955 (EVar (["Basis"], "False", Infer), loc))]), loc)
956 end)
957 | eexp ORELSE eexp (let
958 val loc = s (eexp1left, eexp2right)
959 in
960 (ECase (eexp1, [((PCon (["Basis"], "True", NONE), loc),
961 (EVar (["Basis"], "True", Infer), loc)),
962 ((PCon (["Basis"], "False", NONE), loc),
963 eexp2)]), loc)
964 end)
946 965
947 | eexp PLUSPLUS eexp (EConcat (eexp1, eexp2), s (eexp1left, eexp2right)) 966 | eexp PLUSPLUS eexp (EConcat (eexp1, eexp2), s (eexp1left, eexp2right))
948 967
949 | eexp CARET eexp (native_op ("strcat", eexp1, eexp2, s (eexp1left, eexp2right))) 968 | eexp CARET eexp (native_op ("strcat", eexp1, eexp2, s (eexp1left, eexp2right)))
950 969