Tue, 02 Jun 2015 10:07:20 +0200
renamed GET to SELECT in davql syntax
--- a/libidav/davqlexec.c Sat May 30 21:43:36 2015 +0200 +++ b/libidav/davqlexec.c Tue Jun 02 10:07:20 2015 +0200 @@ -56,7 +56,7 @@ davqlerror_t error; sstr_t path = dav_format_string(sn->mp->allocator, st->path, ap, &error); - if(st->type == DAVQL_GET) { + if(st->type == DAVQL_SELECT) { dav_exec_get(sn, st, path.ptr, ap); } else { // TODO
--- a/libidav/davqlparser.c Sat May 30 21:43:36 2015 +0200 +++ b/libidav/davqlparser.c Tue Jun 02 10:07:20 2015 +0200 @@ -41,7 +41,7 @@ static const char* _map_querytype(davqltype_t type) { switch(type) { case DAVQL_ERROR: return "ERROR"; - case DAVQL_GET: return "GET"; + case DAVQL_SELECT: return "SELECT"; case DAVQL_SET: return "SET"; default: return "unknown"; } @@ -434,7 +434,7 @@ static const char *special_token_symbols = ",()+-*/&|^~=!<>"; static _Bool iskeyword(DavQLToken *token) { - sstr_t keywords[] = {ST("get"), ST("set"), ST("from"), ST("at"), ST("as"), + sstr_t keywords[] ={ST("select"), ST("set"), ST("from"), ST("at"), ST("as"), ST("where"), ST("with"), ST("order"), ST("by"), ST("asc"), ST("desc") }; for (int i = 0 ; i < sizeof(keywords)/sizeof(sstr_t) ; i++) { @@ -1413,12 +1413,12 @@ } /** - * Parser of a get statement. + * Parser of a select statement. * @param stmt the statement object that shall contain the syntax tree * @param tokens the token list */ -static void dav_parse_get_statement(DavQLStatement *stmt, UcxList *tokens) { - stmt->type = DAVQL_GET; +static void dav_parse_select_statement(DavQLStatement *stmt, UcxList *tokens) { + stmt->type = DAVQL_SELECT; // Consume field list tokens = ucx_list_get(tokens, dav_parse_fieldlist(stmt, tokens)); @@ -1546,8 +1546,8 @@ if (tokens) { // use first token to determine query type - if (tokenvalue_is(tokens, "get")) { - dav_parse_get_statement(stmt, tokens->next); + if (tokenvalue_is(tokens, "select")) { + dav_parse_select_statement(stmt, tokens->next); } else if (tokenvalue_is(tokens, "set")) { dav_parse_set_statement(stmt, tokens->next); } else {
--- a/libidav/davqlparser.h Sat May 30 21:43:36 2015 +0200 +++ b/libidav/davqlparser.h Tue Jun 02 10:07:20 2015 +0200 @@ -40,7 +40,7 @@ /** * Enumeration of possible statement types. */ -typedef enum {DAVQL_ERROR, DAVQL_GET, DAVQL_SET} davqltype_t; +typedef enum {DAVQL_ERROR, DAVQL_SELECT, DAVQL_SET} davqltype_t; /** * Enumeration of possible token classes. @@ -135,7 +135,7 @@ /** * The field name. * <ul> - * <li>GET: the identifier or an alias name</li> + * <li>SELECT: the identifier or an alias name</li> * <li>SET: the identifier</li> * </ul> */ @@ -143,7 +143,7 @@ /** * The field expression. * <ul> - * <li>GET: the queried property (identifier) or an expression</li> + * <li>SELECT: the queried property (identifier) or an expression</li> * <li>SET: the expression for the value to be set</li> * </ul> */ @@ -215,9 +215,9 @@ * arbitrary amount of optional spaces between two symbols if they are not part * of an literal or identifier. * - * <b>GET:</b> + * <b>SELECT:</b> * <pre> - * GetStatement = "get ", FieldExpressions, + * SelectStatement = "select ", FieldExpressions, * " from ", Path, * [" with ", WithClause], * [" where ", LogicalExpression],