summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b5c0396)
raw | patch | inline | side by side (parent: b5c0396)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 31 Mar 2014 21:39:38 +0000 (23:39 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 31 Mar 2014 21:39:38 +0000 (23:39 +0200) |
… for host names and name matchers. Identifiers were used as an early
work-around but they are not valid in those places.
work-around but they are not valid in those places.
src/frontend/grammar.y | patch | blob | history | |
t/frontend/parser_test.c | patch | blob | history |
diff --git a/src/frontend/grammar.y b/src/frontend/grammar.y
index c3ee0af37886d3391d37f0d8fd425a586d0257c1..ce313310b918f9c6011410d2e9e9c60e430ab67d 100644 (file)
--- a/src/frontend/grammar.y
+++ b/src/frontend/grammar.y
;
fetch_statement:
- FETCH IDENTIFIER
- {
- $$ = SDB_CONN_NODE(sdb_object_create_dT(/* name = */ NULL,
- conn_fetch_t, conn_fetch_destroy));
- CONN_FETCH($$)->name = strdup($2);
- $$->cmd = CONNECTION_FETCH;
- free($2);
- $2 = NULL;
- }
- |
FETCH STRING
{
$$ = SDB_CONN_NODE(sdb_object_create_dT(/* name = */ NULL,
;
expression:
- IDENTIFIER
+ STRING
{
$$ = SDB_CONN_NODE(sdb_object_create_T(/* name = */ NULL,
conn_node_matcher_t));
index 85265147b1bebdb86ad842ba0a180ef6560faa01..71fc1dbd219b0b382b615897670af5d573d35b9f 100644 (file)
--- a/t/frontend/parser_test.c
+++ b/t/frontend/parser_test.c
{ ";;", -1, 0, 0 },
/* valid commands */
- { "FETCH host", -1, 1, CONNECTION_FETCH },
+ { "FETCH 'host'", -1, 1, CONNECTION_FETCH },
{ "LIST", -1, 1, CONNECTION_LIST },
{ "LIST -- comment", -1, 1, CONNECTION_LIST },
{ "LIST;", -1, 1, CONNECTION_LIST },
/* syntax errors */
{ "INVALID", -1, -1, 0 },
- { "FETCH $%&#", -1, -1, 0 },
+ { "FETCH host", -1, -1, 0 },
{ "LIST; INVALID", 8, -1, 0 },
{ "/* some incomplete", -1, -1, 0 },
};
{ "", -1, -1 },
/* valid expressions */
- { "localhost", -1, 0 },
- { "localhost -- foo", -1, 0 },
- { "localhost <garbage>", 9, 0 },
+ { "'localhost'", -1, 0 },
+ { "'localhost' -- foo", -1, 0 },
+ { "'host' <garbage>", 6, 0 },
/* syntax errors */
{ "LIST", -1, -1 },