“4bc1dc269e4d30f83b3284573c17f24a40605d10”上不存在“paddle/git@gitcode.net:RobotFutures/Paddle.git”
提交 83428604 编写于 作者: M Mars Liu

fxied bug in tree.py

上级 2318de26
{ {
"type": "code_options", "type": "code_options",
"author": "幻灰龙", "author": "幻灰龙",
"source": "standard.md" "source": "standard.md",
"exercise_id": "8150ef23aad248f78110f33e34754311"
} }
\ No newline at end of file
{ {
"type": "code_options", "type": "code_options",
"author": "幻灰龙", "author": "幻灰龙",
"source": "compiler.md" "source": "compiler.md",
"exercise_id": "b812499b338541d2955575e56c116da9"
} }
\ No newline at end of file
...@@ -5,7 +5,5 @@ ...@@ -5,7 +5,5 @@
"C语言" "C语言"
], ],
"children": [], "children": [],
"export": [ "export": []
"vla.json"
]
} }
\ No newline at end of file
...@@ -5,7 +5,5 @@ ...@@ -5,7 +5,5 @@
"C语言" "C语言"
], ],
"children": [], "children": [],
"export": [ "export": []
"pointers_2_func.json"
]
} }
\ No newline at end of file
...@@ -7,7 +7,5 @@ ...@@ -7,7 +7,5 @@
"C语言" "C语言"
], ],
"children": [], "children": [],
"export": [ "export": []
"linked_list.json"
]
} }
\ No newline at end of file
{ {
"type": "code_options", "type": "code_options",
"author": "幻灰龙", "author": "幻灰龙",
"source": "bin_to_hex.md" "source": "bin_to_hex.md",
"exercise_id": "bfae271b73284a6fa5f48bcde4a7f3e0"
} }
\ No newline at end of file
{ {
"type": "code_options", "type": "code_options",
"author": "幻灰龙", "author": "幻灰龙",
"source": "bit_op.md" "source": "bit_op.md",
"exercise_id": "0952044cc5e54770b7418ed868d201a2"
} }
\ No newline at end of file
{ {
"type": "code_options", "type": "code_options",
"author": "幻灰龙", "author": "幻灰龙",
"source": "pack01.md" "source": "pack01.md",
"exercise_id": "4aa8ae84487d433e943a5a9ef6293dbd"
} }
\ No newline at end of file
{ {
"type": "code_options", "type": "code_options",
"author": "幻灰龙", "author": "幻灰龙",
"source": "pack02.md" "source": "pack02.md",
"exercise_id": "03f964d865b54fe9947e728585a27486"
} }
\ No newline at end of file
...@@ -6,7 +6,5 @@ ...@@ -6,7 +6,5 @@
"C语言" "C语言"
], ],
"children": [], "children": [],
"export": [ "export": []
"enum.json"
]
} }
\ No newline at end of file
...@@ -5,7 +5,5 @@ ...@@ -5,7 +5,5 @@
"C语言" "C语言"
], ],
"children": [], "children": [],
"export": [ "export": []
"inline01.json"
]
} }
\ No newline at end of file
...@@ -6,7 +6,5 @@ ...@@ -6,7 +6,5 @@
"C语言" "C语言"
], ],
"children": [], "children": [],
"export": [ "export": []
"file_hash.json"
]
} }
\ No newline at end of file
...@@ -5,20 +5,24 @@ ...@@ -5,20 +5,24 @@
"children": [ "children": [
{ {
"C语言初阶": { "C语言初阶": {
"node_id": "8699564e59bd4972a2aae85e7e198c4d", "node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [], "keywords": [],
"children": [ "children": [
{ {
"C语言概述": { "C语言概述": {
"node_id": "ff93d18873424490849cdcf2ca01a48b", "node_id": "ff93d18873424490849cdcf2ca01a48b",
"keywords": [], "keywords": [
"概述",
"C语言概述",
"C语言"
],
"children": [ "children": [
{ {
"C语言发展史": { "C语言发展史": {
"node_id": "8c3cdf9ae7b547adbd99c360246bf2b2", "node_id": "8c3cdf9ae7b547adbd99c360246bf2b2",
"keywords": [ "keywords": [
"C语言概述", "C语言发展史",
"概述", "发展史",
"C语言" "C语言"
], ],
"children": [ "children": [
...@@ -226,7 +230,7 @@ ...@@ -226,7 +230,7 @@
"C语言" "C语言"
], ],
"children": [], "children": [],
"node_id": "d8484b58a8724720bc603c7f4502c663" "node_id": "557cbf68f22a4747b8992615ad643fa8"
} }
}, },
{ {
...@@ -237,7 +241,7 @@ ...@@ -237,7 +241,7 @@
"C语言" "C语言"
], ],
"children": [], "children": [],
"node_id": "5df2b51772a347d0af0e58a58fe2dddb" "node_id": "33b51bd99ba743c090b8050e3e784470"
} }
}, },
{ {
...@@ -247,7 +251,7 @@ ...@@ -247,7 +251,7 @@
"C语言" "C语言"
], ],
"children": [], "children": [],
"node_id": "820683ecd76749c4bdd1cf67c1a638d2" "node_id": "d78d438e88454d1fa7dd12676b100e0c"
} }
}, },
{ {
...@@ -258,7 +262,7 @@ ...@@ -258,7 +262,7 @@
"C语言" "C语言"
], ],
"children": [], "children": [],
"node_id": "c3dba269f7234c259fd5a86cb32fe14e" "node_id": "be25cc23301b4373940b6eff8291bb05"
} }
}, },
{ {
...@@ -268,7 +272,7 @@ ...@@ -268,7 +272,7 @@
"C语言" "C语言"
], ],
"children": [], "children": [],
"node_id": "a2e960e51c174ada94e889beb01b89c1" "node_id": "a9c21fb270414f5d8599b1eea5e6a59f"
} }
}, },
{ {
...@@ -281,7 +285,7 @@ ...@@ -281,7 +285,7 @@
"C语言" "C语言"
], ],
"children": [], "children": [],
"node_id": "bb2a19fec37745c4bad917d57da0a9cd" "node_id": "4b692f5904ff4c70a44a648f47c024d4"
} }
}, },
{ {
...@@ -292,7 +296,7 @@ ...@@ -292,7 +296,7 @@
"C语言" "C语言"
], ],
"children": [], "children": [],
"node_id": "9bd2fc9f48be469bb057b46f99f0b9e3" "node_id": "68819aeb078d4ce4a6538b8a548c0eea"
} }
}, },
{ {
...@@ -303,7 +307,7 @@ ...@@ -303,7 +307,7 @@
"C语言" "C语言"
], ],
"children": [], "children": [],
"node_id": "ac1afe2e796b45e4b191db769245c33a" "node_id": "908f40d645f4410680fbab6feddab8b2"
} }
} }
] ]
...@@ -316,7 +320,7 @@ ...@@ -316,7 +320,7 @@
"数据类型": { "数据类型": {
"node_id": "c7ef387bd4bf4bd0a87d1886e66160c5", "node_id": "c7ef387bd4bf4bd0a87d1886e66160c5",
"keywords": [ "keywords": [
"编程机制", "数据类型",
"C语言" "C语言"
], ],
"children": [ "children": [
...@@ -355,7 +359,7 @@ ...@@ -355,7 +359,7 @@
"int" "int"
], ],
"children": [], "children": [],
"node_id": "714e6165568248aeb284356eeb0821c0" "node_id": "4b8c956c12dd4d59a3ebdab97bac590d"
} }
}, },
{ {
...@@ -366,7 +370,7 @@ ...@@ -366,7 +370,7 @@
"double" "double"
], ],
"children": [], "children": [],
"node_id": "bc91e7bffb97458bb9d5143c52b8b84c" "node_id": "50a4fd5c83bf4f558d7cc9cc27c39c90"
} }
}, },
{ {
...@@ -376,7 +380,7 @@ ...@@ -376,7 +380,7 @@
"char" "char"
], ],
"children": [], "children": [],
"node_id": "3caf78e68a2a4cb38db14f8d2aeb8864" "node_id": "8cff086ba20b4cc88f07dbb3dc8e7c38"
} }
}, },
{ {
...@@ -386,7 +390,7 @@ ...@@ -386,7 +390,7 @@
"boll" "boll"
], ],
"children": [], "children": [],
"node_id": "6d00d6533afd4f8eb0b7974315888381" "node_id": "1702c0269b714bf3a5b00e366a71a829"
} }
} }
] ]
...@@ -399,8 +403,9 @@ ...@@ -399,8 +403,9 @@
"运算符与表达式": { "运算符与表达式": {
"node_id": "5002624ecc8d4be1a3d8eab4579ac7b8", "node_id": "5002624ecc8d4be1a3d8eab4579ac7b8",
"keywords": [ "keywords": [
"基本数据类型", "运算符",
"数据类型" "表达式",
"运算符与表达式"
], ],
"children": [ "children": [
{ {
...@@ -409,7 +414,9 @@ ...@@ -409,7 +414,9 @@
"keywords": [ "keywords": [
"赋值", "赋值",
"运算符", "运算符",
"表达式",
"赋值运算符", "赋值运算符",
"赋值表达式",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -421,7 +428,9 @@ ...@@ -421,7 +428,9 @@
"keywords": [ "keywords": [
"算术", "算术",
"算术运算符", "算术运算符",
"算术表达式",
"运算符", "运算符",
"表达式",
"C语言" "C语言"
], ],
"children": [ "children": [
...@@ -504,7 +513,9 @@ ...@@ -504,7 +513,9 @@
"keywords": [ "keywords": [
"关系", "关系",
"关系运算符", "关系运算符",
"关系表达式",
"运算符", "运算符",
"表达式",
"C语言" "C语言"
], ],
"children": [ "children": [
...@@ -577,6 +588,8 @@ ...@@ -577,6 +588,8 @@
"keywords": [ "keywords": [
"逻辑", "逻辑",
"逻辑运算符", "逻辑运算符",
"逻辑表达式",
"表达式",
"运算符", "运算符",
"C语言" "C语言"
], ],
...@@ -621,7 +634,11 @@ ...@@ -621,7 +634,11 @@
"逗号运算符与表达式": { "逗号运算符与表达式": {
"node_id": "d8047c9c975b457cbc30445ff78787d6", "node_id": "d8047c9c975b457cbc30445ff78787d6",
"keywords": [ "keywords": [
"逗号",
"运算符", "运算符",
"表达式",
"逗号运算符",
"逗号表达式",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -633,6 +650,8 @@ ...@@ -633,6 +650,8 @@
"keywords": [ "keywords": [
"条件", "条件",
"条件运算符", "条件运算符",
"条件表达式",
"表达式",
"运算符", "运算符",
"C语言" "C语言"
], ],
...@@ -643,6 +662,8 @@ ...@@ -643,6 +662,8 @@
"sizeof运算符": { "sizeof运算符": {
"node_id": "a78c62afc42f45178a799ff67c9fd330", "node_id": "a78c62afc42f45178a799ff67c9fd330",
"keywords": [ "keywords": [
"sizeof运算符",
"sizeof",
"运算符", "运算符",
"C语言" "C语言"
], ],
...@@ -654,6 +675,10 @@ ...@@ -654,6 +675,10 @@
"node_id": "eb5b902755f24674bce31bde2ce4f439", "node_id": "eb5b902755f24674bce31bde2ce4f439",
"keywords": [ "keywords": [
"运算符", "运算符",
"优先级",
"求值顺序",
"运算符优先级",
"运算符求值顺序",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -666,7 +691,9 @@ ...@@ -666,7 +691,9 @@
"语句与控制流": { "语句与控制流": {
"node_id": "18bef4edbf9a498fa3838246cd733986", "node_id": "18bef4edbf9a498fa3838246cd733986",
"keywords": [ "keywords": [
"运算符", "语句与控制流",
"语句",
"控制流",
"C语言" "C语言"
], ],
"children": [ "children": [
...@@ -675,7 +702,8 @@ ...@@ -675,7 +702,8 @@
"node_id": "a88a08b3d3a24780b94e2809336202b5", "node_id": "a88a08b3d3a24780b94e2809336202b5",
"keywords": [ "keywords": [
"语句", "语句",
"控制流", "程序块",
"语句与程序块",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -685,8 +713,9 @@ ...@@ -685,8 +713,9 @@
"判断语句": { "判断语句": {
"node_id": "0c86f68dfe7c4a4ca6c8b7c12135fd43", "node_id": "0c86f68dfe7c4a4ca6c8b7c12135fd43",
"keywords": [ "keywords": [
"判断语句",
"判断",
"语句", "语句",
"控制流",
"C语言" "C语言"
], ],
"children": [ "children": [
...@@ -746,7 +775,8 @@ ...@@ -746,7 +775,8 @@
"node_id": "bc001e483b8c41a8a7ccc369393d636a", "node_id": "bc001e483b8c41a8a7ccc369393d636a",
"keywords": [ "keywords": [
"语句", "语句",
"控制流", "循环",
"循环语句",
"C语言" "C语言"
], ],
"children": [ "children": [
...@@ -826,20 +856,27 @@ ...@@ -826,20 +856,27 @@
}, },
{ {
"C语言中阶": { "C语言中阶": {
"node_id": "a311b31b4bda403f99963cffd92e6306", "node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [], "keywords": [],
"children": [ "children": [
{ {
"函数与程序结构": { "函数与程序结构": {
"node_id": "c1d5e45aeba9407a9aba96de5af95e4e", "node_id": "c1d5e45aeba9407a9aba96de5af95e4e",
"keywords": [], "keywords": [
"函数",
"程序结构",
"C语言"
],
"children": [ "children": [
{ {
"函数的声明与定义": { "函数的声明与定义": {
"node_id": "e2785c48975d4b32917e89a5c260ae27", "node_id": "e2785c48975d4b32917e89a5c260ae27",
"keywords": [ "keywords": [
"函数", "函数",
"程序结构", "声明",
"定义",
"函数声明",
"函数定义",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -850,7 +887,8 @@ ...@@ -850,7 +887,8 @@
"node_id": "30a5dee1088c403b81ae2d61f717f214", "node_id": "30a5dee1088c403b81ae2d61f717f214",
"keywords": [ "keywords": [
"函数", "函数",
"程序结构", "参数",
"函数参数",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -861,7 +899,9 @@ ...@@ -861,7 +899,9 @@
"node_id": "bfff88a1a24e4eb98577ac663c44da09", "node_id": "bfff88a1a24e4eb98577ac663c44da09",
"keywords": [ "keywords": [
"函数", "函数",
"程序结构", "返回",
"返回值",
"函数返回",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -872,7 +912,8 @@ ...@@ -872,7 +912,8 @@
"node_id": "67a79ded33aa459e81f953aea62b5b65", "node_id": "67a79ded33aa459e81f953aea62b5b65",
"keywords": [ "keywords": [
"函数", "函数",
"程序结构", "调用",
"函数调用",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -883,7 +924,8 @@ ...@@ -883,7 +924,8 @@
"node_id": "978a26e7ad464c5481ce0c56480ed60d", "node_id": "978a26e7ad464c5481ce0c56480ed60d",
"keywords": [ "keywords": [
"函数", "函数",
"程序结构", "递归",
"函数递归",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -893,8 +935,8 @@ ...@@ -893,8 +935,8 @@
"局部变量和全局变量": { "局部变量和全局变量": {
"node_id": "293ce0005b924bd7b76216d395e021f2", "node_id": "293ce0005b924bd7b76216d395e021f2",
"keywords": [ "keywords": [
"C语言概述", "局部变量",
"概述", "全局变量",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -904,8 +946,7 @@ ...@@ -904,8 +946,7 @@
"头文件": { "头文件": {
"node_id": "9b668f9078814a86b5d45265f2d87186", "node_id": "9b668f9078814a86b5d45265f2d87186",
"keywords": [ "keywords": [
"函数", "头文件",
"程序结构",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -915,8 +956,8 @@ ...@@ -915,8 +956,8 @@
"内部函数和外部函数": { "内部函数和外部函数": {
"node_id": "c4862064e784410fb4ee6f54e2c74e7a", "node_id": "c4862064e784410fb4ee6f54e2c74e7a",
"keywords": [ "keywords": [
"函数", "内部函数",
"程序结构", "外部函数",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -929,8 +970,7 @@ ...@@ -929,8 +970,7 @@
"数组": { "数组": {
"node_id": "aab5230436134bc0ae4334f20616646b", "node_id": "aab5230436134bc0ae4334f20616646b",
"keywords": [ "keywords": [
"函数", "数组",
"程序结构",
"C语言" "C语言"
], ],
"children": [ "children": [
...@@ -938,6 +978,7 @@ ...@@ -938,6 +978,7 @@
"数组简介": { "数组简介": {
"node_id": "4103c3071b694c778cdee1f78150b3dd", "node_id": "4103c3071b694c778cdee1f78150b3dd",
"keywords": [ "keywords": [
"数组简介",
"数组", "数组",
"C语言" "C语言"
], ],
...@@ -948,6 +989,7 @@ ...@@ -948,6 +989,7 @@
"一维数组": { "一维数组": {
"node_id": "50bb5756ca6f4fab9db632226f95ef13", "node_id": "50bb5756ca6f4fab9db632226f95ef13",
"keywords": [ "keywords": [
"一维数组",
"数组", "数组",
"C语言" "C语言"
], ],
...@@ -959,6 +1001,7 @@ ...@@ -959,6 +1001,7 @@
"node_id": "f9e454c8bac54e17a358aa3537f80f2b", "node_id": "f9e454c8bac54e17a358aa3537f80f2b",
"keywords": [ "keywords": [
"数组", "数组",
"二维数组",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -969,6 +1012,7 @@ ...@@ -969,6 +1012,7 @@
"node_id": "ba9bbb9164584d7285e469c5aa34b8aa", "node_id": "ba9bbb9164584d7285e469c5aa34b8aa",
"keywords": [ "keywords": [
"数组", "数组",
"变长数组",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -981,7 +1025,7 @@ ...@@ -981,7 +1025,7 @@
"指针": { "指针": {
"node_id": "9e7cea0fd7294892be114dbb7fbc9b30", "node_id": "9e7cea0fd7294892be114dbb7fbc9b30",
"keywords": [ "keywords": [
"数组", "指针",
"C语言" "C语言"
], ],
"children": [ "children": [
...@@ -989,6 +1033,7 @@ ...@@ -989,6 +1033,7 @@
"指针与地址": { "指针与地址": {
"node_id": "b56d0beb05d8468a92b5127af497f66b", "node_id": "b56d0beb05d8468a92b5127af497f66b",
"keywords": [ "keywords": [
"地址",
"指针", "指针",
"C语言" "C语言"
], ],
...@@ -999,6 +1044,7 @@ ...@@ -999,6 +1044,7 @@
"指针与函数参数": { "指针与函数参数": {
"node_id": "c125ac53cc324775abe8604efe6ba023", "node_id": "c125ac53cc324775abe8604efe6ba023",
"keywords": [ "keywords": [
"函数参数",
"指针", "指针",
"C语言" "C语言"
], ],
...@@ -1009,6 +1055,7 @@ ...@@ -1009,6 +1055,7 @@
"指针与数组": { "指针与数组": {
"node_id": "826682a938a0422390dcf4d3f7b933b4", "node_id": "826682a938a0422390dcf4d3f7b933b4",
"keywords": [ "keywords": [
"数组",
"指针", "指针",
"C语言" "C语言"
], ],
...@@ -1019,6 +1066,8 @@ ...@@ -1019,6 +1066,8 @@
"地址算术运算": { "地址算术运算": {
"node_id": "2301f0c532c143c28e3261b442743f05", "node_id": "2301f0c532c143c28e3261b442743f05",
"keywords": [ "keywords": [
"地址算术运算",
"算术运算",
"指针", "指针",
"C语言" "C语言"
], ],
...@@ -1029,6 +1078,8 @@ ...@@ -1029,6 +1078,8 @@
"指针数组以及指向指针的指针": { "指针数组以及指向指针的指针": {
"node_id": "86987ec92a6b441abc05a9dc616e3075", "node_id": "86987ec92a6b441abc05a9dc616e3075",
"keywords": [ "keywords": [
"指针数组",
"指针的指针",
"指针", "指针",
"C语言" "C语言"
], ],
...@@ -1040,6 +1091,8 @@ ...@@ -1040,6 +1091,8 @@
"node_id": "fa927c0947f3427aafee3415e11694e7", "node_id": "fa927c0947f3427aafee3415e11694e7",
"keywords": [ "keywords": [
"指针", "指针",
"函数指针",
"指向函数的指针",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -1052,7 +1105,7 @@ ...@@ -1052,7 +1105,7 @@
"字符串": { "字符串": {
"node_id": "60997c5d19b84545abb2adbac24351bc", "node_id": "60997c5d19b84545abb2adbac24351bc",
"keywords": [ "keywords": [
"指针", "字符串",
"C语言" "C语言"
], ],
"children": [ "children": [
...@@ -1060,8 +1113,11 @@ ...@@ -1060,8 +1113,11 @@
"字符串输入与输出": { "字符串输入与输出": {
"node_id": "bbd1310e647846018a1ff37d29c70ff0", "node_id": "bbd1310e647846018a1ff37d29c70ff0",
"keywords": [ "keywords": [
"C语言概述", "字符串输出",
"概述", "字符串输入",
"输出",
"输入",
"字符串",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -1071,8 +1127,8 @@ ...@@ -1071,8 +1127,8 @@
"字符串函数": { "字符串函数": {
"node_id": "2aa6707a4e0244dfab606b030f5c35c9", "node_id": "2aa6707a4e0244dfab606b030f5c35c9",
"keywords": [ "keywords": [
"C语言概述", "字符串函数",
"概述", "字符串",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -1086,18 +1142,22 @@ ...@@ -1086,18 +1142,22 @@
}, },
{ {
"C语言高阶": { "C语言高阶": {
"node_id": "307890a9cb4543b08f52b4b0a7fe9933", "node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [], "keywords": [],
"children": [ "children": [
{ {
"结构体": { "结构体": {
"node_id": "457fbccd00ef4ce3b0f44702f9755b43", "node_id": "457fbccd00ef4ce3b0f44702f9755b43",
"keywords": [], "keywords": [
"结构体",
"C语言"
],
"children": [ "children": [
{ {
"结构体简介": { "结构体简介": {
"node_id": "86b95a1e3e084e7c92fa959b731d81dc", "node_id": "86b95a1e3e084e7c92fa959b731d81dc",
"keywords": [ "keywords": [
"结构体简介",
"结构体", "结构体",
"C语言" "C语言"
], ],
...@@ -1108,6 +1168,7 @@ ...@@ -1108,6 +1168,7 @@
"结构体数组": { "结构体数组": {
"node_id": "e970a52419484d11bcdd097d713b065e", "node_id": "e970a52419484d11bcdd097d713b065e",
"keywords": [ "keywords": [
"结构体数组",
"结构体", "结构体",
"C语言" "C语言"
], ],
...@@ -1118,6 +1179,7 @@ ...@@ -1118,6 +1179,7 @@
"结构体指针": { "结构体指针": {
"node_id": "c41c3c9229594a619abb2295be13a789", "node_id": "c41c3c9229594a619abb2295be13a789",
"keywords": [ "keywords": [
"结构体指针",
"结构体", "结构体",
"C语言" "C语言"
], ],
...@@ -1128,6 +1190,8 @@ ...@@ -1128,6 +1190,8 @@
"结构体与函数": { "结构体与函数": {
"node_id": "11a69657ca7d422d9a08ecef807f1600", "node_id": "11a69657ca7d422d9a08ecef807f1600",
"keywords": [ "keywords": [
"结构体与函数",
"函数",
"结构体", "结构体",
"C语言" "C语言"
], ],
...@@ -1138,6 +1202,8 @@ ...@@ -1138,6 +1202,8 @@
"链式结构": { "链式结构": {
"node_id": "a6978054585b44acb482eea3d9e4aefc", "node_id": "a6978054585b44acb482eea3d9e4aefc",
"keywords": [ "keywords": [
"链式结构",
"链表",
"结构体", "结构体",
"C语言" "C语言"
], ],
...@@ -1151,7 +1217,9 @@ ...@@ -1151,7 +1217,9 @@
"联合体与枚举类型": { "联合体与枚举类型": {
"node_id": "6a54244141664f8a9fe626d564bb150f", "node_id": "6a54244141664f8a9fe626d564bb150f",
"keywords": [ "keywords": [
"结构体", "枚举类型",
"联合体",
"共用体",
"C语言" "C语言"
], ],
"children": [ "children": [
...@@ -1160,7 +1228,8 @@ ...@@ -1160,7 +1228,8 @@
"node_id": "65fbcb8587ab432895bbfb7d873d17de", "node_id": "65fbcb8587ab432895bbfb7d873d17de",
"keywords": [ "keywords": [
"联合体", "联合体",
"共用体" "共用体",
"C语言"
], ],
"children": [] "children": []
} }
...@@ -1170,7 +1239,8 @@ ...@@ -1170,7 +1239,8 @@
"node_id": "a18e6c6aef644580a7e9743087cb8fd8", "node_id": "a18e6c6aef644580a7e9743087cb8fd8",
"keywords": [ "keywords": [
"枚举", "枚举",
"枚举类型" "枚举类型",
"C语言"
], ],
"children": [] "children": []
} }
...@@ -1182,27 +1252,28 @@ ...@@ -1182,27 +1252,28 @@
"位运算": { "位运算": {
"node_id": "f0296e72f7c441f0b0eee5a854580022", "node_id": "f0296e72f7c441f0b0eee5a854580022",
"keywords": [ "keywords": [
"枚举", "位运算",
"枚举类型" "位操作",
"C语言"
], ],
"children": [ "children": [
{ {
"位和字节": { "位和字节": {
"node_id": "cfe3277172e24a0587fc7b9dca6b8633", "node_id": "cfe3277172e24a0587fc7b9dca6b8633",
"keywords": [ "keywords": [
"位运算", "位和字节",
"位操作", "字节",
"C语言" "C语言"
], ],
"children": [] "children": []
} }
}, },
{ {
"二进制": { "二进制": {
"node_id": "18a259dd149a4ad4b51ca76cece73575", "node_id": "18a259dd149a4ad4b51ca76cece73575",
"keywords": [ "keywords": [
"位运算", "二进制",
"位操作", "2进制",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -1212,8 +1283,8 @@ ...@@ -1212,8 +1283,8 @@
"八进制": { "八进制": {
"node_id": "d09ce6bde4bd4d43b5bda77b98328367", "node_id": "d09ce6bde4bd4d43b5bda77b98328367",
"keywords": [ "keywords": [
"位运算", "八进制",
"位操作", "8进制",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -1223,8 +1294,8 @@ ...@@ -1223,8 +1294,8 @@
"十六进制": { "十六进制": {
"node_id": "2caff3956d7e43c08c46cdcf8f8b6f29", "node_id": "2caff3956d7e43c08c46cdcf8f8b6f29",
"keywords": [ "keywords": [
"位运算", "十六进制",
"位操作", "16进制",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -1235,29 +1306,28 @@ ...@@ -1235,29 +1306,28 @@
"node_id": "d199fcbcb452465696fadddafbfb26e1", "node_id": "d199fcbcb452465696fadddafbfb26e1",
"keywords": [ "keywords": [
"位运算", "位运算",
"位操作", "位逻辑运算",
"C语言" "C语言"
], ],
"children": [] "children": []
} }
}, },
{ {
"位字段": { "对齐特性": {
"node_id": "044247ccf6324f749dd6fcecb6fd7c1f", "node_id": "501dc3e5d4da44fe8ba5614875d9cbdf",
"keywords": [ "keywords": [
"对齐特性",
"位运算", "位运算",
"位操作",
"C语言" "C语言"
], ],
"children": [] "children": []
} }
}, },
{ {
"对齐特性": { "位字段": {
"node_id": "501dc3e5d4da44fe8ba5614875d9cbdf", "node_id": "044247ccf6324f749dd6fcecb6fd7c1f",
"keywords": [ "keywords": [
"位运算", "位字段",
"位操作",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -1270,8 +1340,8 @@ ...@@ -1270,8 +1340,8 @@
"预处理器": { "预处理器": {
"node_id": "4c711f0dc45c49e39f2dbdb5f89008a9", "node_id": "4c711f0dc45c49e39f2dbdb5f89008a9",
"keywords": [ "keywords": [
"位运算", "预处理器",
"位操作", "预编译器",
"C语言" "C语言"
], ],
"children": [ "children": [
...@@ -1279,8 +1349,7 @@ ...@@ -1279,8 +1349,7 @@
"宏定义": { "宏定义": {
"node_id": "81ca2e0059a547db93cb10c8352a3687", "node_id": "81ca2e0059a547db93cb10c8352a3687",
"keywords": [ "keywords": [
"预处理器", "宏定义",
"预编译器",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -1290,8 +1359,8 @@ ...@@ -1290,8 +1359,8 @@
"#include指令": { "#include指令": {
"node_id": "a9536f1fcd9242fc96a358be560ff7b1", "node_id": "a9536f1fcd9242fc96a358be560ff7b1",
"keywords": [ "keywords": [
"预处理器", "include",
"预编译器", "#include",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -1301,8 +1370,8 @@ ...@@ -1301,8 +1370,8 @@
"#undef指令": { "#undef指令": {
"node_id": "9177a200808c4d879116a4a69e89df41", "node_id": "9177a200808c4d879116a4a69e89df41",
"keywords": [ "keywords": [
"预处理器", "undef",
"预编译器", "#undef",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -1312,7 +1381,7 @@ ...@@ -1312,7 +1381,7 @@
"条件编译": { "条件编译": {
"node_id": "d962e7c6c96d431ea38e6e6aed7728b6", "node_id": "d962e7c6c96d431ea38e6e6aed7728b6",
"keywords": [ "keywords": [
"预处理器", "条件编译",
"预编译器", "预编译器",
"C语言" "C语言"
], ],
...@@ -1323,8 +1392,7 @@ ...@@ -1323,8 +1392,7 @@
"内联函数": { "内联函数": {
"node_id": "d21d6de040954559abee2dbad03ac4d1", "node_id": "d21d6de040954559abee2dbad03ac4d1",
"keywords": [ "keywords": [
"预处理器", "内联函数",
"预编译器",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -1337,8 +1405,7 @@ ...@@ -1337,8 +1405,7 @@
"文件": { "文件": {
"node_id": "4877d759ed524ba086a8dd6bc00c2e86", "node_id": "4877d759ed524ba086a8dd6bc00c2e86",
"keywords": [ "keywords": [
"预处理器", "文件",
"预编译器",
"C语言" "C语言"
], ],
"children": [ "children": [
...@@ -1347,6 +1414,7 @@ ...@@ -1347,6 +1414,7 @@
"node_id": "6ac7da2c6a894cc2ad4a2facb2aec07a", "node_id": "6ac7da2c6a894cc2ad4a2facb2aec07a",
"keywords": [ "keywords": [
"文件", "文件",
"文件基本操作",
"C语言" "C语言"
], ],
"children": [ "children": [
...@@ -1390,6 +1458,7 @@ ...@@ -1390,6 +1458,7 @@
"node_id": "c9f455f9665042b5bdfd19918e34cc94", "node_id": "c9f455f9665042b5bdfd19918e34cc94",
"keywords": [ "keywords": [
"文件", "文件",
"文件读写",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -1402,7 +1471,8 @@ ...@@ -1402,7 +1471,8 @@
"存储管理": { "存储管理": {
"node_id": "d127f044a075402788e20b3cb690a328", "node_id": "d127f044a075402788e20b3cb690a328",
"keywords": [ "keywords": [
"文件", "存储管理",
"内存管理",
"C语言" "C语言"
], ],
"children": [ "children": [
...@@ -1410,19 +1480,38 @@ ...@@ -1410,19 +1480,38 @@
"存储类别": { "存储类别": {
"node_id": "055d9ba0f2864f78a5fea826aded5aaa", "node_id": "055d9ba0f2864f78a5fea826aded5aaa",
"keywords": [ "keywords": [
"存储管理", "存储类别",
"内存管理",
"C语言" "C语言"
], ],
"children": [] "children": []
} }
}, },
{ {
"分配内存:malloc()和free()": { "内存动态管理": {
"node_id": "e75bdc3470954cb38bdfcf4f0ed3680b", "node_id": "e75bdc3470954cb38bdfcf4f0ed3680b",
"keywords": [ "keywords": [
"存储管理", "存储管理",
"内存管理", "内存管理",
"内存动态管理",
"C语言"
],
"children": [
{
"内存分配:malloc()": {
"keywords": [
"内存分配",
"malloc",
"C语言"
],
"children": [],
"node_id": "db508a67e5fa4092ae5f130e59e15941"
}
},
{
"内存释放:free()": {
"keywords": [
"内存释放",
"free",
"C语言" "C语言"
], ],
"children": [] "children": []
...@@ -1430,13 +1519,16 @@ ...@@ -1430,13 +1519,16 @@
} }
] ]
} }
}
]
}
}, },
{ {
"标准函数库": { "标准函数库": {
"node_id": "a95ae0dfca614dab8b02ef4b96d7398d", "node_id": "a95ae0dfca614dab8b02ef4b96d7398d",
"keywords": [ "keywords": [
"存储管理", "标准函数库",
"内存管理", "标准库",
"C语言" "C语言"
], ],
"children": [ "children": [
...@@ -1444,7 +1536,8 @@ ...@@ -1444,7 +1536,8 @@
"数学库": { "数学库": {
"node_id": "77363abd916c4981b595f44138f53e0a", "node_id": "77363abd916c4981b595f44138f53e0a",
"keywords": [ "keywords": [
"标准函数库", "数学库",
"math.h",
"标准库", "标准库",
"C语言" "C语言"
], ],
...@@ -1455,7 +1548,8 @@ ...@@ -1455,7 +1548,8 @@
"通用工具库": { "通用工具库": {
"node_id": "dab1add961df46479031b66bc52a00b0", "node_id": "dab1add961df46479031b66bc52a00b0",
"keywords": [ "keywords": [
"标准函数库", "stdlib.h",
"通用工具库",
"标准库", "标准库",
"C语言" "C语言"
], ],
...@@ -1463,10 +1557,11 @@ ...@@ -1463,10 +1557,11 @@
} }
}, },
{ {
"断言库 ": { "断言库": {
"node_id": "2ce0d5349c454d099692a07c2a32a56d", "node_id": "2ce0d5349c454d099692a07c2a32a56d",
"keywords": [ "keywords": [
"标准函数库", "assert.h",
"断言库",
"标准库", "标准库",
"C语言" "C语言"
], ],
......
...@@ -37,6 +37,19 @@ def parse_no_name(d): ...@@ -37,6 +37,19 @@ def parse_no_name(d):
return no, dir_name return no, dir_name
def check_export(base, cfg):
flag = False
exports = []
for export in cfg.get('export', []):
ecfg_path = os.path.join(base, export)
if os.path.exists(ecfg_path):
exports.append(export)
else:
flag = True
if flag:
cfg["export"] = exports
return flag
def gen_tree(data_path): def gen_tree(data_path):
root = {} root = {}
...@@ -54,18 +67,21 @@ def gen_tree(data_path): ...@@ -54,18 +67,21 @@ def gen_tree(data_path):
yield no_dir, no_name yield no_dir, no_name
def ensure_id_helper(node): def ensure_id_helper(node):
flag = False
if (node.get('node_id') is None) or node.get('node_id') in id_set: if (node.get('node_id') is None) or node.get('node_id') in id_set:
node['node_id'] = gen_node_id() node['node_id'] = gen_node_id()
flag = True
id_set.add(node['node_id']) id_set.add(node['node_id'])
if 'children' in node: if 'children' in node:
for c in node["children"]: for c in node["children"]:
ensure_id_helper(list(c.values())[0]) flag = flag or ensure_id_helper(list(c.values())[0])
def ensure_node_id(cfg_path, cfg): return flag
ensure_id_helper(cfg)
dump_json(cfg_path, cfg, exist_ok=True, override=True) def ensure_node_id(cfg):
return ensure_id_helper(cfg)
def make_node(name, node_id, keywords, children=None): def make_node(name, node_id, keywords, children=None):
node = {} node = {}
...@@ -80,7 +96,8 @@ def gen_tree(data_path): ...@@ -80,7 +96,8 @@ def gen_tree(data_path):
# 根节点 # 根节点
cfg_path = os.path.join(data_path, 'config.json') cfg_path = os.path.join(data_path, 'config.json')
cfg = load_json(cfg_path) cfg = load_json(cfg_path)
ensure_node_id(cfg_path, cfg) if ensure_node_id(cfg):
dump_json(cfg_path, cfg)
tree_node = { tree_node = {
"node_id": cfg['node_id'], "node_id": cfg['node_id'],
"keywords": cfg['keywords'], "keywords": cfg['keywords'],
...@@ -92,47 +109,51 @@ def gen_tree(data_path): ...@@ -92,47 +109,51 @@ def gen_tree(data_path):
for level_no_dir, level_no_name in list_dir(data_path): for level_no_dir, level_no_name in list_dir(data_path):
print(level_no_dir) print(level_no_dir)
no, level_name = parse_no_name(level_no_name) no, level_name = parse_no_name(level_no_name)
cfg_path = os.path.join(level_no_dir, 'config.json') level_path = os.path.join(level_no_dir, 'config.json')
cfg = load_json(cfg_path) level_cfg = load_json(level_path)
ensure_node_id(cfg_path, cfg) if ensure_node_id(level_cfg) or check_export(level_no_dir, level_cfg):
dump_json(level_path, level_cfg, exist_ok=True, override=True)
level_node, level_node_children = make_node( level_node, level_node_children = make_node(
level_name, cfg['node_id'], cfg['keywords']) level_name, cfg['node_id'], cfg['keywords'])
tree_node['children'].append(level_node) tree_node['children'].append(level_node)
# 章节点 # 章节点
for chapter_no_dir, chapter_no_name in list_dir(level_no_dir): for chapter_no_dir, chapter_no_name in list_dir(level_no_dir):
no, chapter_name = parse_no_name(chapter_no_name) no, chapter_name = parse_no_name(chapter_no_name)
cfg_path = os.path.join(chapter_no_dir, 'config.json') chapter_path = os.path.join(chapter_no_dir, 'config.json')
ensure_node_id(cfg_path, cfg) chapter_cfg = load_json(chapter_path)
cfg = load_json(cfg_path) if ensure_node_id(chapter_cfg) or check_export(chapter_no_dir, chapter_cfg):
dump_json(chapter_path, chapter_cfg, exist_ok=True, override=True)
chapter_node, chapter_node_children = make_node( chapter_node, chapter_node_children = make_node(
chapter_name, cfg['node_id'], cfg['keywords']) chapter_name, chapter_cfg['node_id'], chapter_cfg['keywords'])
level_node_children.append(chapter_node) level_node_children.append(chapter_node)
# 知识点 # 知识点
for section_no_dir, section_no_name in list_dir(chapter_no_dir): for section_no_dir, section_no_name in list_dir(chapter_no_dir):
no, section_name = parse_no_name(section_no_name) no, section_name = parse_no_name(section_no_name)
cfg_path = os.path.join(section_no_dir, 'config.json') sec_path = os.path.join(section_no_dir, 'config.json')
cfg = load_json(cfg_path) sec_cfg = load_json(sec_path)
ensure_node_id(cfg_path, cfg) flag = ensure_node_id(sec_cfg) or check_export(section_no_dir, sec_cfg)
section_node, section_node_children = make_node( section_node, section_node_children = make_node(
section_name, cfg['node_id'], cfg['keywords'], cfg['children']) section_name, sec_cfg['node_id'], sec_cfg['keywords'], sec_cfg['children'])
chapter_node_children.append(section_node) chapter_node_children.append(section_node)
# 确保习题分配了习题ID # 确保习题分配了习题ID
for export in cfg['export']:
for export in sec_cfg["export"]:
ecfg_path = os.path.join(section_no_dir, export) ecfg_path = os.path.join(section_no_dir, export)
ecfg = load_json(ecfg_path) ecfg = load_json(ecfg_path)
if (ecfg.get('exercise_id') is None) or (ecfg.get('exercise_id') in id_set): if (ecfg.get('exercise_id') is None) or (ecfg.get('exercise_id') in id_set):
ecfg['exercise_id'] = uuid.uuid4().hex ecfg['exercise_id'] = uuid.uuid4().hex
dump_json(ecfg_path, ecfg, exist_ok=True, override=True) dump_json(ecfg_path, ecfg, exist_ok=True, override=True)
id_set.add(ecfg['exercise_id']) id_set.add(ecfg['exercise_id'])
if flag:
dump_json(cfg_path, cfg, exist_ok=True, override=True) dump_json(cfg_path, cfg, exist_ok=True, override=True)
# 保存技能树骨架 # 保存技能树骨架
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册