myuan 2 年之前
父节点
当前提交
62567b0c03
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/calc.y

+ 2 - 1
src/calc.y

@@ -56,6 +56,7 @@ create_table_stmt: CREATE TABLE IDENTIFIER NEWLINE
 		cJSON* node = cJSON_CreateObject();
 		cJSON_AddStringToObject(node, "type", "create_table");
 		cJSON_AddStringToObject(node, "table_name", $3);
+		cJSON_AddItemToObject(node, "cols", cJSON_CreateArray());
 		cJSON_AddItemToArray(jroot, node);
 	}
 
@@ -86,7 +87,7 @@ create_col_list: create_definition {
     ;
 
 create_definition: IDENTIFIER data_type col_options {
-		printf("得列 %s %s with options %s: %d\n", $1, $2, $3, strlen($3));
+		sprintf(stderr, "得列 %s %s with options %s: %d\n", $1, $2, $3, strlen($3));
 
 		cJSON* node = cJSON_CreateObject();
 		cJSON_AddStringToObject(node, "type", "create_column");