lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [02/22] lucy-clownfish git commit: Build up the ParseTuple format string.
Date Tue, 01 Mar 2016 03:03:10 GMT
Build up the ParseTuple format string.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/4cdfb56b
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/4cdfb56b
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/4cdfb56b

Branch: refs/heads/master
Commit: 4cdfb56b6ed149cfef354720e7514d1d23bd8769
Parents: ba87d53
Author: Marvin Humphrey <marvin@rectangular.com>
Authored: Tue Feb 2 13:45:03 2016 -0800
Committer: Marvin Humphrey <marvin@rectangular.com>
Committed: Wed Feb 24 15:24:52 2016 -0800

----------------------------------------------------------------------
 compiler/src/CFCPyMethod.c | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/4cdfb56b/compiler/src/CFCPyMethod.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCPyMethod.c b/compiler/src/CFCPyMethod.c
index c0363a5..8d6adfb 100644
--- a/compiler/src/CFCPyMethod.c
+++ b/compiler/src/CFCPyMethod.c
@@ -201,6 +201,10 @@ S_gen_arg_parsing(CFCParamList *param_list, int first_tick, char **error)
{
         CFCVariable *var  = vars[i];
         const char  *val  = vals[i];
 
+        const char *var_name = CFCVariable_get_name(var);
+        keywords = CFCUtil_cat(keywords, "\"", var_name, "\", ", NULL);
+
+        // Build up ParseTuple format string.
         if (val == NULL) {
             if (optional_started) { // problem!
                 *error = "Required after optional param";
@@ -210,8 +214,10 @@ S_gen_arg_parsing(CFCParamList *param_list, int first_tick, char **error)
{
         else {
             if (!optional_started) {
                 optional_started = 1;
+                format_str = CFCUtil_cat(format_str, "|", NULL);
             }
         }
+        format_str = CFCUtil_cat(format_str, "O&", NULL);
 
         char *declaration = S_gen_declaration(var, val);
         declarations = CFCUtil_cat(declarations, declaration, NULL);


Mime
View raw message