Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ambrop72/badvpn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmbroz Bizjak <ambrop7@gmail.com>2014-04-05 13:10:21 +0400
committerAmbroz Bizjak <ambrop7@gmail.com>2014-10-28 00:38:51 +0300
commit298e79776fbad01b8cee5ff34e992c413e9a845b (patch)
tree1636fe15a71d7471c3fce8f5c204aa2a5054bf89 /examples
parentd09be2a492a3cfdd5b676329d9c6c03d4de4c504 (diff)
ncd: Add parser support for function invocations and parentheses in value expressions.
Diffstat (limited to 'examples')
-rw-r--r--examples/ncd_parser_test.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/ncd_parser_test.c b/examples/ncd_parser_test.c
index 0385c3f..59af2a4 100644
--- a/examples/ncd_parser_test.c
+++ b/examples/ncd_parser_test.c
@@ -147,6 +147,24 @@ static int generate_val (NCDValue *value, ExpString *out_str)
}
} break;
+ case NCDVALUE_INVOC: {
+ if (!generate_val(NCDValue_InvocFunc(value), out_str)) {
+ goto fail;
+ }
+
+ if (!ExpString_AppendChar(out_str, '(')) {
+ goto fail;
+ }
+
+ if (!generate_val(NCDValue_InvocArg(value), out_str)) {
+ goto fail;
+ }
+
+ if (!ExpString_AppendChar(out_str, ')')) {
+ goto fail;
+ }
+ } break;
+
default: ASSERT(0);
}