diff options
author | 2008-08-28 11:59:46 -0400 | |
---|---|---|
committer | 2008-08-28 11:59:46 -0400 | |
commit | fe8bd11ade81a5835d72c498a763c13c17fddd25 (patch) | |
tree | 5ed3eba6ef836ed2e6a42d9561bafc183ec9f7a3 /src | |
parent | 595c8e8d87d9f91e454654c3d7ad9dd49a1bfd93 (diff) |
COUNT
Diffstat (limited to 'src')
-rw-r--r-- | src/lacweb.grm | 8 | ||||
-rw-r--r-- | src/lacweb.lex | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/lacweb.grm b/src/lacweb.grm index c6d89bf6..e230d91e 100644 --- a/src/lacweb.grm +++ b/src/lacweb.grm @@ -169,6 +169,7 @@ fun sql_relop (oper, sqlexp1, sqlexp2, loc) = | UNION | INTERSECT | EXCEPT | LIMIT | OFFSET | ALL | TRUE | FALSE | CAND | OR | NOT + | COUNT | NE | LT | LE | GT | GE %nonterm @@ -824,6 +825,13 @@ sqlexp : TRUE (sql_inject (EVar (["Basis"], "True"), s (LBRACEleft, RBRACEright))) | LPAREN sqlexp RPAREN (sqlexp) + | COUNT LPAREN STAR RPAREN (let + val loc = s (COUNTleft, RPARENright) + in + (EApp ((EVar (["Basis"], "sql_count"), loc), + (ERecord [], loc)), loc) + end) + wopt : (sql_inject (EVar (["Basis"], "True"), EVar (["Basis"], "sql_bool"), dummy)) diff --git a/src/lacweb.lex b/src/lacweb.lex index f67eada7..08e39c81 100644 --- a/src/lacweb.lex +++ b/src/lacweb.lex @@ -323,6 +323,8 @@ notags = [^<{\n]+; <INITIAL> "OR" => (Tokens.OR (pos yypos, pos yypos + size yytext)); <INITIAL> "NOT" => (Tokens.NOT (pos yypos, pos yypos + size yytext)); +<INITIAL> "COUNT" => (Tokens.COUNT (pos yypos, pos yypos + size yytext)); + <INITIAL> {id} => (Tokens.SYMBOL (yytext, pos yypos, pos yypos + size yytext)); <INITIAL> {cid} => (Tokens.CSYMBOL (yytext, pos yypos, pos yypos + size yytext)); |