You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2016/02/25 00:56:28 UTC

[27/36] lucy-clownfish git commit: Handle default values for primitive types.

Handle default values for primitive types.

Set conversion args to default values prior to Python argument parsing.


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

Branch: refs/heads/py_exp13
Commit: 73635f233dc3a5b1addf17aacdf5773d8fad1113
Parents: 2e4d3d3
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Fri Feb 5 18:03:01 2016 -0800
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Wed Feb 24 15:36:07 2016 -0800

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


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/73635f23/compiler/src/CFCPyMethod.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCPyMethod.c b/compiler/src/CFCPyMethod.c
index ef8b152..d8128c2 100644
--- a/compiler/src/CFCPyMethod.c
+++ b/compiler/src/CFCPyMethod.c
@@ -124,7 +124,10 @@ S_gen_declaration(CFCVariable *var, const char *val) {
         }
     }
     else if (CFCType_is_primitive(type)) {
-        ;
+        if (val) {
+            char pattern[] = "    %s_ARG = %s;\n";
+            result = CFCUtil_sprintf(pattern, var_name, val);
+        }
     }
     else {
         CFCUtil_die("Unexpected type, can't gen declaration: %s", type_str);