From 97b24f1460be2d8092ac6ebff87da683d688642c Mon Sep 17 00:00:00 2001 From: Mars Liu Date: Thu, 21 Oct 2021 14:26:31 +0800 Subject: [PATCH] uniform structure --- .../config.json" | 10 +- .../config.json" | 159 +-- .../config.json" | 136 +-- .../config.json" | 185 ++-- .../config.json" | 6 +- .../1.\345\217\230\351\207\217/config.json" | 4 +- .../2.\345\270\270\351\207\217/config.json" | 5 +- .../config.json" | 95 +- .../config.json" | 98 +- .../config.json" | 156 +-- .../config.json" | 137 +-- .../config.json" | 86 +- .../config.json" | 4 +- .../config.json" | 21 +- .../config.json" | 4 +- .../config.json" | 4 +- .../config.json" | 54 +- .../config.json" | 4 +- .../config.json" | 114 ++- .../config.json" | 146 +-- .../config.json" | 7 +- .../config.json" | 18 +- .../config.json" | 4 +- .../config.json" | 6 +- .../config.json" | 16 +- .../config.json" | 4 +- .../config.json" | 16 +- .../config.json" | 16 +- .../vla.json" | 2 +- .../2.\346\225\260\347\273\204/config.json" | 7 +- .../config.json" | 16 +- .../config.json" | 16 +- .../config.json" | 16 +- .../config.json" | 16 +- .../config.json" | 16 +- .../3.\346\214\207\351\222\210/config.json" | 6 +- .../config.json" | 11 + .../config.json" | 5 +- .../config.json" | 7 +- .../config.json" | 7 +- .../config.json" | 8 +- .../config.json" | 9 +- .../5.\346\226\207\344\273\266/config.json" | 7 +- .../config.json" | 7 +- .../config.json" | 8 +- data/tree.json | 964 ++++++++++++------ src/common/__init__.py | 0 src/common/command_line.py | 81 ++ src/common/logger.py | 77 ++ src/config/__init__.py | 0 src/config/config.py | 57 ++ src/lib/__init__.py | 0 src/lib/apollo.py | 392 +++++++ src/main.py | 45 + src/options.py | 203 ++++ src/tree.py | 26 +- 56 files changed, 2514 insertions(+), 1010 deletions(-) create mode 100644 src/common/__init__.py create mode 100644 src/common/command_line.py create mode 100644 src/common/logger.py create mode 100644 src/config/__init__.py create mode 100644 src/config/config.py create mode 100644 src/lib/__init__.py create mode 100644 src/lib/apollo.py create mode 100644 src/main.py create mode 100644 src/options.py diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/1.C\350\257\255\350\250\200\346\246\202\350\277\260/1.C\350\257\255\350\250\200\345\217\221\345\261\225\345\217\262/config.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/1.C\350\257\255\350\250\200\346\246\202\350\277\260/1.C\350\257\255\350\250\200\345\217\221\345\261\225\345\217\262/config.json" index 03626a2..6459043 100644 --- "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/1.C\350\257\255\350\250\200\346\246\202\350\277\260/1.C\350\257\255\350\250\200\345\217\221\345\261\225\345\217\262/config.json" +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/1.C\350\257\255\350\250\200\346\246\202\350\277\260/1.C\350\257\255\350\250\200\345\217\221\345\261\225\345\217\262/config.json" @@ -13,7 +13,8 @@ "起源", "C语言" ], - "children": [] + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" } }, { @@ -25,9 +26,12 @@ "应用", "C语言" ], - "children": [] + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" } } ], - "export": [ "helloworld.json"] + "export": [ + "helloworld.json" + ] } \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/1.C\350\257\255\350\250\200\346\246\202\350\277\260/2.C\350\257\255\350\250\200\347\211\271\347\202\271/config.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/1.C\350\257\255\350\250\200\346\246\202\350\277\260/2.C\350\257\255\350\250\200\347\211\271\347\202\271/config.json" index 1ad9cf4..37e339c 100644 --- "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/1.C\350\257\255\350\250\200\346\246\202\350\277\260/2.C\350\257\255\350\250\200\347\211\271\347\202\271/config.json" +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/1.C\350\257\255\350\250\200\346\246\202\350\277\260/2.C\350\257\255\350\250\200\347\211\271\347\202\271/config.json" @@ -1,77 +1,86 @@ { - "keywords": [ - "C语言特点", - "C语言特征", - "特点", - "特征", - "C语言" - ], - "children": [ - { - "语言简洁,使用方便灵活": { - "keywords": [ - "语言简洁", - "方便灵活" - ], - "children": [] - } - }, - { - "可移植性好": { - "keywords": [ - "可移植性好", - "移植性" - ], - "children": [] - } - }, - { - "表达能力强": { - "keywords": [ - "表达能力强", - "表达能力" - ], - "children": [] - } - }, - { - "表达方式灵活": { - "keywords": [ - "表达方式灵活", - "表达方式" - ], - "children": [] - } - }, - { - "可进行结构化程序设计": { - "keywords": [ - "结构化程序设计", - "结构化", - "程序设计" - ], - "children": [] - } - }, - { - "可以直接操作计算机硬件": { - "keywords": [ - "操作计算机硬件", - "计算机硬件" - ], - "children": [] - } - }, - { - "生成的目标代码质量高": { - "keywords": [ - "目标代码质量高", - "目标代码" - ], - "children": [] - } - } - ], - "export": ["features.json"], - "node_id": "a34425324c78443a8cb362ab4393ff72" + "keywords": [ + "C语言特点", + "C语言特征", + "特点", + "特征", + "C语言" + ], + "children": [ + { + "语言简洁,使用方便灵活": { + "keywords": [ + "语言简洁", + "方便灵活" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "可移植性好": { + "keywords": [ + "可移植性好", + "移植性" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "表达能力强": { + "keywords": [ + "表达能力强", + "表达能力" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "表达方式灵活": { + "keywords": [ + "表达方式灵活", + "表达方式" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "可进行结构化程序设计": { + "keywords": [ + "结构化程序设计", + "结构化", + "程序设计" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "可以直接操作计算机硬件": { + "keywords": [ + "操作计算机硬件", + "计算机硬件" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "生成的目标代码质量高": { + "keywords": [ + "目标代码质量高", + "目标代码" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + } + ], + "export": [ + "features.json" + ], + "node_id": "a34425324c78443a8cb362ab4393ff72" } \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/1.C\350\257\255\350\250\200\346\246\202\350\277\260/3.C\350\257\255\350\250\200\346\240\207\345\207\206/config.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/1.C\350\257\255\350\250\200\346\246\202\350\277\260/3.C\350\257\255\350\250\200\346\240\207\345\207\206/config.json" index 2fed478..7da22e0 100644 --- "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/1.C\350\257\255\350\250\200\346\246\202\350\277\260/3.C\350\257\255\350\250\200\346\240\207\345\207\206/config.json" +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/1.C\350\257\255\350\250\200\346\246\202\350\277\260/3.C\350\257\255\350\250\200\346\240\207\345\207\206/config.json" @@ -1,66 +1,74 @@ { - "keywords": [ - "C语言标准", - "语言标准", - "C语言" - ], - "children": [ - { - "Traditional C": { - "keywords": [ - "TraditionalC" - ], - "children": [] - } - }, - { - "C89": { - "keywords": [ - "C89" - ], - "children": [] - } - }, - { - "C95": { - "keywords": [ - "C95" - ], - "children": [] - } - }, - { - "C99": { - "keywords": [ - "C99" - ], - "children": [] - } - }, - { - "C11": { - "keywords": [ - "C11" - ], - "children": [] - } - }, - { - "C17": { - "keywords": [ - "C17" - ], - "children": [] - } - }, - { - "C2x": { - "keywords": [ - "C2x" - ], - "children": [] - } - } - ], - "export": [] + "keywords": [ + "C语言标准", + "语言标准", + "C语言" + ], + "children": [ + { + "Traditional C": { + "keywords": [ + "TraditionalC" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "C89": { + "keywords": [ + "C89" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "C95": { + "keywords": [ + "C95" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "C99": { + "keywords": [ + "C99" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "C11": { + "keywords": [ + "C11" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "C17": { + "keywords": [ + "C17" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "C2x": { + "keywords": [ + "C2x" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + } + ], + "export": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" } \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/1.C\350\257\255\350\250\200\346\246\202\350\277\260/4.\347\274\226\347\250\213\346\234\272\345\210\266/config.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/1.C\350\257\255\350\250\200\346\246\202\350\277\260/4.\347\274\226\347\250\213\346\234\272\345\210\266/config.json" index 8f564a8..334e476 100644 --- "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/1.C\350\257\255\350\250\200\346\246\202\350\277\260/4.\347\274\226\347\250\213\346\234\272\345\210\266/config.json" +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/1.C\350\257\255\350\250\200\346\246\202\350\277\260/4.\347\274\226\347\250\213\346\234\272\345\210\266/config.json" @@ -1,90 +1,99 @@ { - "keywords": [ - "编程机制", - "C语言" - ], - "children": [ - { - "目标代码文件、可执行文件和库": { - "keywords": [ - "目标代码文件", - "可执行文件", - "C语言库", - "C语言" - ], - "children": [] - } - }, - { - "UNIX系统": { - "keywords": [ - "UNIX系统", - "UNIX", - "C语言" - ], - "children": [] - } - }, - { - "Linux": { - "keywords": [ - "Linux", - "C语言" - ], - "children": [] - } - }, - { - "Windows": { - "keywords": [ - "Windows", - "Linux", - "C语言" - ], - "children": [] - } - }, - { - "Macintosh": { - "keywords": [ - "Macintosh", - "C语言" - ], - "children": [] - } - }, - { - "GNU编译器集合和LLVM项目": { - "keywords": [ - "GNU编译器", - "GNU", - "LLVM项目", - "LLVM", - "C语言" - ], - "children": [] - } - }, - { - "命令行编译器": { - "keywords": [ - "命令行编译器", - "命令行", - "C语言" - ], - "children": [] - } - }, - { - "集成开发环境": { - "keywords": [ - "集成开发环境", - "IDE", - "C语言" - ], - "children": [] - } - } - ], - "export": [] + "keywords": [ + "编程机制", + "C语言" + ], + "children": [ + { + "目标代码文件、可执行文件和库": { + "keywords": [ + "目标代码文件", + "可执行文件", + "C语言库", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "UNIX系统": { + "keywords": [ + "UNIX系统", + "UNIX", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "Linux": { + "keywords": [ + "Linux", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "Windows": { + "keywords": [ + "Windows", + "Linux", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "Macintosh": { + "keywords": [ + "Macintosh", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "GNU编译器集合和LLVM项目": { + "keywords": [ + "GNU编译器", + "GNU", + "LLVM项目", + "LLVM", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "命令行编译器": { + "keywords": [ + "命令行编译器", + "命令行", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "集成开发环境": { + "keywords": [ + "集成开发环境", + "IDE", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + } + ], + "export": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" } \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/1.C\350\257\255\350\250\200\346\246\202\350\277\260/config.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/1.C\350\257\255\350\250\200\346\246\202\350\277\260/config.json" index 0fc4a6c..3407cf9 100644 --- "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/1.C\350\257\255\350\250\200\346\246\202\350\277\260/config.json" +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/1.C\350\257\255\350\250\200\346\246\202\350\277\260/config.json" @@ -1,8 +1,4 @@ { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "C语言概述", - "概述", - "C语言" - ] + "keywords": [] } \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/1.\345\217\230\351\207\217/config.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/1.\345\217\230\351\207\217/config.json" index 1f5de8e..86c1dd4 100644 --- "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/1.\345\217\230\351\207\217/config.json" +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/1.\345\217\230\351\207\217/config.json" @@ -5,5 +5,7 @@ "C语言" ], "children": [], - "export": ["variables.json"] + "export": [ + "variables.json" + ] } \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/2.\345\270\270\351\207\217/config.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/2.\345\270\270\351\207\217/config.json" index 562ce98..179e2d7 100644 --- "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/2.\345\270\270\351\207\217/config.json" +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/2.\345\270\270\351\207\217/config.json" @@ -4,5 +4,8 @@ "C语言" ], "children": [], - "export": ["constants.json"] + "export": [ + "constants.json" + ], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" } \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/3.\345\237\272\346\234\254\346\225\260\346\215\256\347\261\273\345\236\213/config.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/3.\345\237\272\346\234\254\346\225\260\346\215\256\347\261\273\345\236\213/config.json" index 8173d69..dbf2839 100644 --- "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/3.\345\237\272\346\234\254\346\225\260\346\215\256\347\261\273\345\236\213/config.json" +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/3.\345\237\272\346\234\254\346\225\260\346\215\256\347\261\273\345\236\213/config.json" @@ -1,46 +1,53 @@ { - "keywords": [ - "基本数据类型", - "数据类型" - ], - "children": [ - { - "整数类型": { - "keywords": [ - "整数类型", - "int" - ], - "children": [] - } - }, - { - "浮点类型": { - "keywords": [ - "浮点类型", - "float", - "double" - ], - "children": [] - } - }, - { - "字符类型": { - "keywords": [ - "字符类型", - "char" - ], - "children": [] - } - }, - { - "布尔类型": { - "keywords": [ - "布尔类型", - "boll" - ], - "children": [] - } - } - ], - "export": ["basic_data_types.json"] + "keywords": [ + "基本数据类型", + "数据类型" + ], + "children": [ + { + "整数类型": { + "keywords": [ + "整数类型", + "int" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "浮点类型": { + "keywords": [ + "浮点类型", + "float", + "double" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "字符类型": { + "keywords": [ + "字符类型", + "char" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "布尔类型": { + "keywords": [ + "布尔类型", + "boll" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + } + ], + "export": [ + "basic_data_types.json" + ], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" } \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/config.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/config.json" index 2cf6e89..334e476 100644 --- "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/config.json" +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/2.\346\225\260\346\215\256\347\261\273\345\236\213/config.json" @@ -1,7 +1,99 @@ { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "数据类型", + "编程机制", "C语言" - ] + ], + "children": [ + { + "目标代码文件、可执行文件和库": { + "keywords": [ + "目标代码文件", + "可执行文件", + "C语言库", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "UNIX系统": { + "keywords": [ + "UNIX系统", + "UNIX", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "Linux": { + "keywords": [ + "Linux", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "Windows": { + "keywords": [ + "Windows", + "Linux", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "Macintosh": { + "keywords": [ + "Macintosh", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "GNU编译器集合和LLVM项目": { + "keywords": [ + "GNU编译器", + "GNU", + "LLVM项目", + "LLVM", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "命令行编译器": { + "keywords": [ + "命令行编译器", + "命令行", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "集成开发环境": { + "keywords": [ + "集成开发环境", + "IDE", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + } + ], + "export": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" } \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/2.\347\256\227\346\234\257\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/config.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/2.\347\256\227\346\234\257\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/config.json" index ea3ae9d..a9820d2 100644 --- "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/2.\347\256\227\346\234\257\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/config.json" +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/2.\347\256\227\346\234\257\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/config.json" @@ -1,74 +1,84 @@ { - "keywords": [ - "算术", - "算术运算符", - "运算符", - "C语言" - ], - "children": [ - { - "加法运算符": { - "keywords": [ - "加法运算符", - "加法" - ], - "children": [] - } - }, - { - "减法运算符": { - "keywords": [ - "减法运算符", - "减法" - ], - "children": [] - } - }, - { - "乘法运算符": { - "keywords": [ - "乘法运算符", - "乘法" - ], - "children": [] - } - }, - { - "除法运算符": { - "keywords": [ - "除法运算符", - "除法" - ], - "children": [] - } - }, - { - "求模运算符": { - "keywords": [ - "求模运算符", - "求模" - ], - "children": [] - } - }, - { - "递增运算符": { - "keywords": [ - "递增运算符", - "递增" - ], - "children": [] - } - }, - { - "递减运算符": { - "keywords": [ - "递减运算符", - "递减" - ], - "children": [] - } - } - ], - "export": ["arithmetic_op.json"] - } \ No newline at end of file + "keywords": [ + "算术", + "算术运算符", + "运算符", + "C语言" + ], + "children": [ + { + "加法运算符": { + "keywords": [ + "加法运算符", + "加法" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "减法运算符": { + "keywords": [ + "减法运算符", + "减法" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "乘法运算符": { + "keywords": [ + "乘法运算符", + "乘法" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "除法运算符": { + "keywords": [ + "除法运算符", + "除法" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "求模运算符": { + "keywords": [ + "求模运算符", + "求模" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "递增运算符": { + "keywords": [ + "递增运算符", + "递增" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "递减运算符": { + "keywords": [ + "递减运算符", + "递减" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + } + ], + "export": [ + "arithmetic_op.json" + ], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" +} \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/3.\345\205\263\347\263\273\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/config.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/3.\345\205\263\347\263\273\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/config.json" index cb5cd15..204c867 100644 --- "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/3.\345\205\263\347\263\273\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/config.json" +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/3.\345\205\263\347\263\273\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/config.json" @@ -1,65 +1,74 @@ { - "keywords": [ - "关系", - "关系运算符", - "运算符", - "C语言" - ], - "children": [ - { - "大于运算符": { - "keywords": [ - "大于", - "大于运算符" - ], - "children": [] - } - }, - { - "小于运算符": { - "keywords": [ - "小于", - "小于运算符" - ], - "children": [] - } - }, - { - "等于运算符": { - "keywords": [ - "等于", - "等于运算符" - ], - "children": [] - } - }, - { - "大于等于运算符": { - "keywords": [ - "大于等于", - "大于等于运算符" - ], - "children": [] - } - }, - { - "小于等于运算符": { - "keywords": [ - "小于等于", - "小于等于运算符" - ], - "children": [] - } - }, - { - "不等于运算符": { - "keywords": [ - "不等于", - "不等于运算符" - ], - "children": [] - } - } - ], - "export": ["relational_op.json"] - } \ No newline at end of file + "keywords": [ + "关系", + "关系运算符", + "运算符", + "C语言" + ], + "children": [ + { + "大于运算符": { + "keywords": [ + "大于", + "大于运算符" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "小于运算符": { + "keywords": [ + "小于", + "小于运算符" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "等于运算符": { + "keywords": [ + "等于", + "等于运算符" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "大于等于运算符": { + "keywords": [ + "大于等于", + "大于等于运算符" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "小于等于运算符": { + "keywords": [ + "小于等于", + "小于等于运算符" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "不等于运算符": { + "keywords": [ + "不等于", + "不等于运算符" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + } + ], + "export": [ + "relational_op.json" + ], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" +} \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/4.\351\200\273\350\276\221\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/config.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/4.\351\200\273\350\276\221\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/config.json" index c2464be..7583c75 100644 --- "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/4.\351\200\273\350\276\221\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/config.json" +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/4.\351\200\273\350\276\221\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/config.json" @@ -1,41 +1,47 @@ { - "keywords": [ - "逻辑", - "逻辑运算符", - "运算符", - "C语言" - ], - "children": [ - { - "逻辑与运算符": { - "keywords": [ - "逻辑与", - "逻辑与运算符", - "与运算符" - ], - "children": [] - } - }, - { - "逻辑或运算符": { - "keywords": [ - "逻辑或", - "逻辑或运算符", - "或运算符" - ], - "children": [] - } - }, - { - "逻辑非运算符": { - "keywords": [ - "逻辑非", - "逻辑非运算符", - "非运算符" - ], - "children": [] - } - } - ], - "export": ["logical_op.json"] - } \ No newline at end of file + "keywords": [ + "逻辑", + "逻辑运算符", + "运算符", + "C语言" + ], + "children": [ + { + "逻辑与运算符": { + "keywords": [ + "逻辑与", + "逻辑与运算符", + "与运算符" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "逻辑或运算符": { + "keywords": [ + "逻辑或", + "逻辑或运算符", + "或运算符" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "逻辑非运算符": { + "keywords": [ + "逻辑非", + "逻辑非运算符", + "非运算符" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + } + ], + "export": [ + "logical_op.json" + ], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" +} \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/5.\351\200\227\345\217\267\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/config.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/5.\351\200\227\345\217\267\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/config.json" index 3e3cd41..1769e96 100644 --- "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/5.\351\200\227\345\217\267\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/config.json" +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/5.\351\200\227\345\217\267\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/config.json" @@ -5,5 +5,7 @@ "C语言" ], "children": [], - "export": ["comma_op.json"] + "export": [ + "comma_op.json" + ] } \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/6.\346\235\241\344\273\266\350\277\220\347\256\227\347\254\246/config.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/6.\346\235\241\344\273\266\350\277\220\347\256\227\347\254\246/config.json" index 640596e..0daa1dd 100644 --- "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/6.\346\235\241\344\273\266\350\277\220\347\256\227\347\254\246/config.json" +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/6.\346\235\241\344\273\266\350\277\220\347\256\227\347\254\246/config.json" @@ -1,10 +1,13 @@ { - "keywords": [ - "条件", - "条件运算符", - "运算符", - "C语言" - ], - "children": [], - "export": ["conditional_op.json"] - } \ No newline at end of file + "keywords": [ + "条件", + "条件运算符", + "运算符", + "C语言" + ], + "children": [], + "export": [ + "conditional_op.json" + ], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" +} \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/7.sizeof\350\277\220\347\256\227\347\254\246/config.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/7.sizeof\350\277\220\347\256\227\347\254\246/config.json" index c68ce80..87e6ebd 100644 --- "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/7.sizeof\350\277\220\347\256\227\347\254\246/config.json" +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/7.sizeof\350\277\220\347\256\227\347\254\246/config.json" @@ -5,5 +5,7 @@ "C语言" ], "children": [], - "export": ["sizeof_op.json"] + "export": [ + "sizeof_op.json" + ] } \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/8.\350\277\220\347\256\227\347\254\246\344\274\230\345\205\210\347\272\247\344\270\216\346\261\202\345\200\274\351\241\272\345\272\217/config.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/8.\350\277\220\347\256\227\347\254\246\344\274\230\345\205\210\347\272\247\344\270\216\346\261\202\345\200\274\351\241\272\345\272\217/config.json" index 2fe5a62..b149c93 100644 --- "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/8.\350\277\220\347\256\227\347\254\246\344\274\230\345\205\210\347\272\247\344\270\216\346\261\202\345\200\274\351\241\272\345\272\217/config.json" +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/8.\350\277\220\347\256\227\347\254\246\344\274\230\345\205\210\347\272\247\344\270\216\346\261\202\345\200\274\351\241\272\345\272\217/config.json" @@ -5,5 +5,7 @@ "C语言" ], "children": [], - "export": ["precedence.json"] + "export": [ + "precedence.json" + ] } \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/config.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/config.json" index 0e0676b..dbf2839 100644 --- "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/config.json" +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/3.\350\277\220\347\256\227\347\254\246\344\270\216\350\241\250\350\276\276\345\274\217/config.json" @@ -1,7 +1,53 @@ { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "运算符", - "C语言" - ] + "基本数据类型", + "数据类型" + ], + "children": [ + { + "整数类型": { + "keywords": [ + "整数类型", + "int" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "浮点类型": { + "keywords": [ + "浮点类型", + "float", + "double" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "字符类型": { + "keywords": [ + "字符类型", + "char" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "布尔类型": { + "keywords": [ + "布尔类型", + "boll" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + } + ], + "export": [ + "basic_data_types.json" + ], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" } \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/4.\350\257\255\345\217\245\344\270\216\346\216\247\345\210\266\346\265\201/1.\350\257\255\345\217\245\344\270\216\347\250\213\345\272\217\345\235\227/config.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/4.\350\257\255\345\217\245\344\270\216\346\216\247\345\210\266\346\265\201/1.\350\257\255\345\217\245\344\270\216\347\250\213\345\272\217\345\235\227/config.json" index 58733b9..157eb86 100644 --- "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/4.\350\257\255\345\217\245\344\270\216\346\216\247\345\210\266\346\265\201/1.\350\257\255\345\217\245\344\270\216\347\250\213\345\272\217\345\235\227/config.json" +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/4.\350\257\255\345\217\245\344\270\216\346\216\247\345\210\266\346\265\201/1.\350\257\255\345\217\245\344\270\216\347\250\213\345\272\217\345\235\227/config.json" @@ -6,5 +6,7 @@ "C语言" ], "children": [], - "export": ["statements_n_blocks.json"] + "export": [ + "statements_n_blocks.json" + ] } \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/4.\350\257\255\345\217\245\344\270\216\346\216\247\345\210\266\346\265\201/2.\345\210\244\346\226\255\350\257\255\345\217\245/config.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/4.\350\257\255\345\217\245\344\270\216\346\216\247\345\210\266\346\265\201/2.\345\210\244\346\226\255\350\257\255\345\217\245/config.json" index 7ef38af..e427f60 100644 --- "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/4.\350\257\255\345\217\245\344\270\216\346\216\247\345\210\266\346\265\201/2.\345\210\244\346\226\255\350\257\255\345\217\245/config.json" +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/4.\350\257\255\345\217\245\344\270\216\346\216\247\345\210\266\346\265\201/2.\345\210\244\346\226\255\350\257\255\345\217\245/config.json" @@ -1,55 +1,63 @@ { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "语句", - "控制流", - "C语言" - ], - "children": [ - { - "if语句": { - "keywords": [ - "if语句", - "if" - ], - "children": [] - } - }, - { - "if-else语句": { - "keywords": [ - "if-else语句", - "if", - "else", - "if-else", - "ifelse", - "if else" - ], - "children": [] - } - }, - { - "else-if语句": { - "keywords": [ - "else-if语句", - "if", - "else", - "else-if", - "else-if", - "else if" - ], - "children": [] - } - }, - { - "switch语句": { - "keywords": [ - "switch语句", - "switch" - ], - "children": [] - } - } - ], - "export": ["if.json", "elseif.json", "switch.json"] + "node_id": "569d5e11c4fc5de7844053d9a733c5e8", + "keywords": [ + "语句", + "控制流", + "C语言" + ], + "children": [ + { + "if语句": { + "keywords": [ + "if语句", + "if" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "if-else语句": { + "keywords": [ + "if-else语句", + "if", + "else", + "if-else", + "ifelse", + "if else" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "else-if语句": { + "keywords": [ + "else-if语句", + "if", + "else", + "else-if", + "else-if", + "else if" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "switch语句": { + "keywords": [ + "switch语句", + "switch" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + } + ], + "export": [ + "if.json", + "elseif.json", + "switch.json" + ] } \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/4.\350\257\255\345\217\245\344\270\216\346\216\247\345\210\266\346\265\201/3.\345\276\252\347\216\257\350\257\255\345\217\245/config.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/4.\350\257\255\345\217\245\344\270\216\346\216\247\345\210\266\346\265\201/3.\345\276\252\347\216\257\350\257\255\345\217\245/config.json" index 26a7890..c45c6da 100644 --- "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/4.\350\257\255\345\217\245\344\270\216\346\216\247\345\210\266\346\265\201/3.\345\276\252\347\216\257\350\257\255\345\217\245/config.json" +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/4.\350\257\255\345\217\245\344\270\216\346\216\247\345\210\266\346\265\201/3.\345\276\252\347\216\257\350\257\255\345\217\245/config.json" @@ -1,70 +1,80 @@ { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "语句", - "控制流", - "C语言" - ], - "children": [ - { - "for循环": { - "keywords": [ - "for循环", - "循环", - "for" - ], - "children": [] - } - }, - { - "while循环": { - "keywords": [ - "while循环", - "循环", - "while" - ], - "children": [] - } - }, - { - "do-while循环": { - "keywords": [ - "do-while循环", - "do-while", - "while", - "dowhile", - "do while" - ], - "children": [] - } - }, - { - "break语句": { - "keywords": [ - "break语句", - "break" - ], - "children": [] - } - }, - { - "continue语句": { - "keywords": [ - "continue语句", - "continue" - ], - "children": [] - } - }, - { - "goto语句": { - "keywords": [ - "goto语句", - "goto" - ], - "children": [] - } - } - ], - "export": ["for.json", "goto.json", "while.json"] + "node_id": "569d5e11c4fc5de7844053d9a733c5e8", + "keywords": [ + "语句", + "控制流", + "C语言" + ], + "children": [ + { + "for循环": { + "keywords": [ + "for循环", + "循环", + "for" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "while循环": { + "keywords": [ + "while循环", + "循环", + "while" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "do-while循环": { + "keywords": [ + "do-while循环", + "do-while", + "while", + "dowhile", + "do while" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "break语句": { + "keywords": [ + "break语句", + "break" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "continue语句": { + "keywords": [ + "continue语句", + "continue" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "goto语句": { + "keywords": [ + "goto语句", + "goto" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + } + ], + "export": [ + "for.json", + "goto.json", + "while.json" + ] } \ No newline at end of file diff --git "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/4.\350\257\255\345\217\245\344\270\216\346\216\247\345\210\266\346\265\201/config.json" "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/4.\350\257\255\345\217\245\344\270\216\346\216\247\345\210\266\346\265\201/config.json" index 5f3e056..b149c93 100644 --- "a/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/4.\350\257\255\345\217\245\344\270\216\346\216\247\345\210\266\346\265\201/config.json" +++ "b/data/1.C\350\257\255\350\250\200\345\210\235\351\230\266/4.\350\257\255\345\217\245\344\270\216\346\216\247\345\210\266\346\265\201/config.json" @@ -1,8 +1,11 @@ { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "语句", - "控制流", + "运算符", "C语言" + ], + "children": [], + "export": [ + "precedence.json" ] } \ No newline at end of file diff --git "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/1.\345\207\275\346\225\260\344\270\216\347\250\213\345\272\217\347\273\223\346\236\204/2.\345\207\275\346\225\260\347\232\204\345\217\202\346\225\260/config.json" "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/1.\345\207\275\346\225\260\344\270\216\347\250\213\345\272\217\347\273\223\346\236\204/2.\345\207\275\346\225\260\347\232\204\345\217\202\346\225\260/config.json" index 70cddcc..2565bdd 100644 --- "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/1.\345\207\275\346\225\260\344\270\216\347\250\213\345\272\217\347\273\223\346\236\204/2.\345\207\275\346\225\260\347\232\204\345\217\202\346\225\260/config.json" +++ "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/1.\345\207\275\346\225\260\344\270\216\347\250\213\345\272\217\347\273\223\346\236\204/2.\345\207\275\346\225\260\347\232\204\345\217\202\346\225\260/config.json" @@ -1,10 +1,12 @@ { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "函数", - "程序结构", - "C语言" - ], - "children": [], - "export": ["parameter_n_argument.json"] + "node_id": "569d5e11c4fc5de7844053d9a733c5e8", + "keywords": [ + "函数", + "程序结构", + "C语言" + ], + "children": [], + "export": [ + "parameter_n_argument.json" + ] } \ No newline at end of file diff --git "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/1.\345\207\275\346\225\260\344\270\216\347\250\213\345\272\217\347\273\223\346\236\204/5.\345\207\275\346\225\260\347\232\204\351\200\222\345\275\222/config.json" "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/1.\345\207\275\346\225\260\344\270\216\347\250\213\345\272\217\347\273\223\346\236\204/5.\345\207\275\346\225\260\347\232\204\351\200\222\345\275\222/config.json" index 183ebb5..d45ba0e 100644 --- "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/1.\345\207\275\346\225\260\344\270\216\347\250\213\345\272\217\347\273\223\346\236\204/5.\345\207\275\346\225\260\347\232\204\351\200\222\345\275\222/config.json" +++ "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/1.\345\207\275\346\225\260\344\270\216\347\250\213\345\272\217\347\273\223\346\236\204/5.\345\207\275\346\225\260\347\232\204\351\200\222\345\275\222/config.json" @@ -6,5 +6,7 @@ "C语言" ], "children": [], - "export": ["recurison.json"] + "export": [ + "recursion.json" + ] } \ No newline at end of file diff --git "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/1.\345\207\275\346\225\260\344\270\216\347\250\213\345\272\217\347\273\223\346\236\204/config.json" "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/1.\345\207\275\346\225\260\344\270\216\347\250\213\345\272\217\347\273\223\346\236\204/config.json" index ae36d85..3407cf9 100644 --- "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/1.\345\207\275\346\225\260\344\270\216\347\250\213\345\272\217\347\273\223\346\236\204/config.json" +++ "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/1.\345\207\275\346\225\260\344\270\216\347\250\213\345\272\217\347\273\223\346\236\204/config.json" @@ -1,8 +1,4 @@ { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "函数", - "程序结构", - "C语言" - ] + "keywords": [] } \ No newline at end of file diff --git "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/1.\346\225\260\347\273\204\347\256\200\344\273\213/config.json" "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/1.\346\225\260\347\273\204\347\256\200\344\273\213/config.json" index 48f87cd..e360341 100644 --- "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/1.\346\225\260\347\273\204\347\256\200\344\273\213/config.json" +++ "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/1.\346\225\260\347\273\204\347\256\200\344\273\213/config.json" @@ -1,9 +1,11 @@ { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "数组", - "C语言" - ], - "children": [], - "export": ["array_def.json"] + "node_id": "569d5e11c4fc5de7844053d9a733c5e8", + "keywords": [ + "数组", + "C语言" + ], + "children": [], + "export": [ + "array_def.json" + ] } \ No newline at end of file diff --git "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/2.\344\270\200\347\273\264\346\225\260\347\273\204/config.json" "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/2.\344\270\200\347\273\264\346\225\260\347\273\204/config.json" index 22a44f4..bbf45ca 100644 --- "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/2.\344\270\200\347\273\264\346\225\260\347\273\204/config.json" +++ "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/2.\344\270\200\347\273\264\346\225\260\347\273\204/config.json" @@ -5,5 +5,7 @@ "C语言" ], "children": [], - "export": ["bubble_sort.json"] + "export": [ + "bubble_sort.json" + ] } \ No newline at end of file diff --git "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/3.\344\272\214\347\273\264\346\225\260\347\273\204/config.json" "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/3.\344\272\214\347\273\264\346\225\260\347\273\204/config.json" index 1da0264..ee6e191 100644 --- "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/3.\344\272\214\347\273\264\346\225\260\347\273\204/config.json" +++ "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/3.\344\272\214\347\273\264\346\225\260\347\273\204/config.json" @@ -1,9 +1,11 @@ { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "数组", - "C语言" - ], - "children": [], - "export": ["matrix.json"] + "node_id": "569d5e11c4fc5de7844053d9a733c5e8", + "keywords": [ + "数组", + "C语言" + ], + "children": [], + "export": [ + "matrix.json" + ] } \ No newline at end of file diff --git "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/4.\345\217\230\351\225\277\346\225\260\347\273\204/config.json" "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/4.\345\217\230\351\225\277\346\225\260\347\273\204/config.json" index 67a6b50..644fbac 100644 --- "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/4.\345\217\230\351\225\277\346\225\260\347\273\204/config.json" +++ "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/4.\345\217\230\351\225\277\346\225\260\347\273\204/config.json" @@ -1,9 +1,11 @@ { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "数组", - "C语言" - ], - "children": [], - "export": ["via.json"] + "node_id": "569d5e11c4fc5de7844053d9a733c5e8", + "keywords": [ + "数组", + "C语言" + ], + "children": [], + "export": [ + "vla.json" + ] } \ No newline at end of file diff --git "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/4.\345\217\230\351\225\277\346\225\260\347\273\204/vla.json" "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/4.\345\217\230\351\225\277\346\225\260\347\273\204/vla.json" index d064948..92d57df 100644 --- "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/4.\345\217\230\351\225\277\346\225\260\347\273\204/vla.json" +++ "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/4.\345\217\230\351\225\277\346\225\260\347\273\204/vla.json" @@ -1,6 +1,6 @@ { "type": "code_options", "author": "卢昕", - "source": "via.md", + "source": "vla.md", "exercise_id":"8c6d605410c6416389625741e10fd961" } \ No newline at end of file diff --git "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/config.json" "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/config.json" index 89a00b2..c459827 100644 --- "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/config.json" +++ "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/2.\346\225\260\347\273\204/config.json" @@ -1,7 +1,10 @@ { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "数组", + "函数", + "程序结构", "C语言" - ] + ], + "children": [], + "export": [] } \ No newline at end of file diff --git "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/1.\346\214\207\351\222\210\344\270\216\345\234\260\345\235\200/config.json" "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/1.\346\214\207\351\222\210\344\270\216\345\234\260\345\235\200/config.json" index 6a80217..550c165 100644 --- "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/1.\346\214\207\351\222\210\344\270\216\345\234\260\345\235\200/config.json" +++ "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/1.\346\214\207\351\222\210\344\270\216\345\234\260\345\235\200/config.json" @@ -1,9 +1,11 @@ { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "指针", - "C语言" - ], - "children": [], - "export": ["pointers.json"] + "node_id": "569d5e11c4fc5de7844053d9a733c5e8", + "keywords": [ + "指针", + "C语言" + ], + "children": [], + "export": [ + "pointers.json" + ] } \ No newline at end of file diff --git "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/2.\346\214\207\351\222\210\344\270\216\345\207\275\346\225\260\345\217\202\346\225\260/config.json" "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/2.\346\214\207\351\222\210\344\270\216\345\207\275\346\225\260\345\217\202\346\225\260/config.json" index 558d6c5..9961de1 100644 --- "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/2.\346\214\207\351\222\210\344\270\216\345\207\275\346\225\260\345\217\202\346\225\260/config.json" +++ "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/2.\346\214\207\351\222\210\344\270\216\345\207\275\346\225\260\345\217\202\346\225\260/config.json" @@ -1,9 +1,11 @@ { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "指针", - "C语言" - ], - "children": [], - "export": ["pointers_n_func.json"] + "node_id": "569d5e11c4fc5de7844053d9a733c5e8", + "keywords": [ + "指针", + "C语言" + ], + "children": [], + "export": [ + "pointers_n_func.json" + ] } \ No newline at end of file diff --git "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/3.\346\214\207\351\222\210\344\270\216\346\225\260\347\273\204/config.json" "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/3.\346\214\207\351\222\210\344\270\216\346\225\260\347\273\204/config.json" index 2d1f712..930d2d1 100644 --- "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/3.\346\214\207\351\222\210\344\270\216\346\225\260\347\273\204/config.json" +++ "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/3.\346\214\207\351\222\210\344\270\216\346\225\260\347\273\204/config.json" @@ -1,9 +1,11 @@ { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "指针", - "C语言" - ], - "children": [], - "export": ["pointers_n_array.json"] + "node_id": "569d5e11c4fc5de7844053d9a733c5e8", + "keywords": [ + "指针", + "C语言" + ], + "children": [], + "export": [ + "pointers_n_array.json" + ] } \ No newline at end of file diff --git "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/4.\345\234\260\345\235\200\347\256\227\346\234\257\350\277\220\347\256\227/config.json" "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/4.\345\234\260\345\235\200\347\256\227\346\234\257\350\277\220\347\256\227/config.json" index ccefaa5..ac236cf 100644 --- "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/4.\345\234\260\345\235\200\347\256\227\346\234\257\350\277\220\347\256\227/config.json" +++ "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/4.\345\234\260\345\235\200\347\256\227\346\234\257\350\277\220\347\256\227/config.json" @@ -1,9 +1,11 @@ { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "指针", - "C语言" - ], - "children": [], - "export": ["pointers_arithmetic_op.json"] + "node_id": "569d5e11c4fc5de7844053d9a733c5e8", + "keywords": [ + "指针", + "C语言" + ], + "children": [], + "export": [ + "pointers_arithmetic_op.json" + ] } \ No newline at end of file diff --git "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/7.\346\214\207\345\220\221\345\207\275\346\225\260\347\232\204\346\214\207\351\222\210/config.json" "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/7.\346\214\207\345\220\221\345\207\275\346\225\260\347\232\204\346\214\207\351\222\210/config.json" index 129dbe7..713cdec 100644 --- "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/7.\346\214\207\345\220\221\345\207\275\346\225\260\347\232\204\346\214\207\351\222\210/config.json" +++ "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/7.\346\214\207\345\220\221\345\207\275\346\225\260\347\232\204\346\214\207\351\222\210/config.json" @@ -1,9 +1,11 @@ { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "指针", - "C语言" - ], - "children": [], - "export": ["pointers_2_func.json"] + "node_id": "569d5e11c4fc5de7844053d9a733c5e8", + "keywords": [ + "指针", + "C语言" + ], + "children": [], + "export": [ + "pointers_2_func.json" + ] } \ No newline at end of file diff --git "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/config.json" "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/config.json" index 05dd39a..644fbac 100644 --- "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/config.json" +++ "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/3.\346\214\207\351\222\210/config.json" @@ -1,7 +1,11 @@ { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "指针", + "数组", "C语言" + ], + "children": [], + "export": [ + "vla.json" ] } \ No newline at end of file diff --git "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/4.\345\255\227\347\254\246\344\270\262/config.json" "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/4.\345\255\227\347\254\246\344\270\262/config.json" index e69de29..713cdec 100644 --- "a/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/4.\345\255\227\347\254\246\344\270\262/config.json" +++ "b/data/2.C\350\257\255\350\250\200\344\270\255\351\230\266/4.\345\255\227\347\254\246\344\270\262/config.json" @@ -0,0 +1,11 @@ +{ + "node_id": "569d5e11c4fc5de7844053d9a733c5e8", + "keywords": [ + "指针", + "C语言" + ], + "children": [], + "export": [ + "pointers_2_func.json" + ] +} \ No newline at end of file diff --git "a/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/1.\347\273\223\346\236\204\344\275\223/config.json" "b/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/1.\347\273\223\346\236\204\344\275\223/config.json" index 6a5d8b2..3407cf9 100644 --- "a/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/1.\347\273\223\346\236\204\344\275\223/config.json" +++ "b/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/1.\347\273\223\346\236\204\344\275\223/config.json" @@ -1,7 +1,4 @@ { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "结构体", - "C语言" - ] + "keywords": [] } \ No newline at end of file diff --git "a/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/2.\350\201\224\345\220\210\344\275\223/config.json" "b/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/2.\350\201\224\345\220\210\344\275\223/config.json" index 4c5db12..304857b 100644 --- "a/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/2.\350\201\224\345\220\210\344\275\223/config.json" +++ "b/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/2.\350\201\224\345\220\210\344\275\223/config.json" @@ -1,8 +1,9 @@ { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "共用体", - "联合体", + "结构体", "C语言" - ] + ], + "children": [], + "export": [] } \ No newline at end of file diff --git "a/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/3.\344\275\215\350\277\220\347\256\227/config.json" "b/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/3.\344\275\215\350\277\220\347\256\227/config.json" index ceb358d..304857b 100644 --- "a/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/3.\344\275\215\350\277\220\347\256\227/config.json" +++ "b/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/3.\344\275\215\350\277\220\347\256\227/config.json" @@ -1,8 +1,9 @@ { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "位运算", - "位操作", + "结构体", "C语言" - ] + ], + "children": [], + "export": [] } \ No newline at end of file diff --git "a/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/4.\351\242\204\345\244\204\347\220\206\345\231\250/config.json" "b/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/4.\351\242\204\345\244\204\347\220\206\345\231\250/config.json" index ed227bb..4ef5ef7 100644 --- "a/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/4.\351\242\204\345\244\204\347\220\206\345\231\250/config.json" +++ "b/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/4.\351\242\204\345\244\204\347\220\206\345\231\250/config.json" @@ -1,8 +1,10 @@ { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "预处理器", - "预编译器", + "位运算", + "位操作", "C语言" - ] + ], + "children": [], + "export": [] } \ No newline at end of file diff --git "a/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/5.\346\226\207\344\273\266/1.\346\226\207\344\273\266\347\232\204\345\237\272\346\234\254\346\223\215\344\275\234/config.json" "b/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/5.\346\226\207\344\273\266/1.\346\226\207\344\273\266\347\232\204\345\237\272\346\234\254\346\223\215\344\275\234/config.json" index 8354347..066df97 100644 --- "a/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/5.\346\226\207\344\273\266/1.\346\226\207\344\273\266\347\232\204\345\237\272\346\234\254\346\223\215\344\275\234/config.json" +++ "b/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/5.\346\226\207\344\273\266/1.\346\226\207\344\273\266\347\232\204\345\237\272\346\234\254\346\223\215\344\275\234/config.json" @@ -11,7 +11,8 @@ "文件指针", "文件" ], - "children": [] + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" } }, { @@ -21,7 +22,8 @@ "文件", "文件打开" ], - "children": [] + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" } }, { @@ -31,7 +33,8 @@ "文件", "文件关闭" ], - "children": [] + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" } } ], diff --git "a/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/5.\346\226\207\344\273\266/config.json" "b/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/5.\346\226\207\344\273\266/config.json" index 58f00c4..1def284 100644 --- "a/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/5.\346\226\207\344\273\266/config.json" +++ "b/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/5.\346\226\207\344\273\266/config.json" @@ -1,7 +1,10 @@ { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "文件", + "预处理器", + "预编译器", "C语言" - ] + ], + "children": [], + "export": [] } \ No newline at end of file diff --git "a/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/6.\345\255\230\345\202\250\347\256\241\347\220\206/config.json" "b/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/6.\345\255\230\345\202\250\347\256\241\347\220\206/config.json" index f50d2e1..51bb9ca 100644 --- "a/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/6.\345\255\230\345\202\250\347\256\241\347\220\206/config.json" +++ "b/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/6.\345\255\230\345\202\250\347\256\241\347\220\206/config.json" @@ -1,8 +1,9 @@ { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "存储管理", - "内存管理", + "文件", "C语言" - ] + ], + "children": [], + "export": [] } \ No newline at end of file diff --git "a/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/7.\346\240\207\345\207\206\345\207\275\346\225\260\345\272\223/config.json" "b/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/7.\346\240\207\345\207\206\345\207\275\346\225\260\345\272\223/config.json" index f3f1505..cd9c828 100644 --- "a/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/7.\346\240\207\345\207\206\345\207\275\346\225\260\345\272\223/config.json" +++ "b/data/3.C\350\257\255\350\250\200\351\253\230\351\230\266/7.\346\240\207\345\207\206\345\207\275\346\225\260\345\272\223/config.json" @@ -1,8 +1,10 @@ { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "标准函数库", - "标准库", + "存储管理", + "内存管理", "C语言" - ] + ], + "children": [], + "export": [] } \ No newline at end of file diff --git a/data/tree.json b/data/tree.json index 853f65b..fa2b8b8 100644 --- a/data/tree.json +++ b/data/tree.json @@ -11,11 +11,7 @@ { "C语言概述": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "C语言概述", - "概述", - "C语言" - ], + "keywords": [], "children": [ { "C语言发展史": { @@ -33,7 +29,8 @@ "起源", "C语言" ], - "children": [] + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" } }, { @@ -45,375 +42,636 @@ "应用", "C语言" ], - "children": [] + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" } } ] } - } - ] - } - }, - { - "数据类型": { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "数据类型", - "C语言" - ], - "children": [ - { - "变量与常量": { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "数据类型", - "C语言" - ], - "children": [] - } - }, - { - "整数类型": { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "数据类型", - "C语言" - ], - "children": [] - } }, { - "浮点类型": { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", + "C语言特点": { + "node_id": "a34425324c78443a8cb362ab4393ff72", "keywords": [ - "数据类型", + "C语言特点", + "C语言特征", + "特点", + "特征", "C语言" ], - "children": [] + "children": [ + { + "语言简洁,使用方便灵活": { + "keywords": [ + "语言简洁", + "方便灵活" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "可移植性好": { + "keywords": [ + "可移植性好", + "移植性" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "表达能力强": { + "keywords": [ + "表达能力强", + "表达能力" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "表达方式灵活": { + "keywords": [ + "表达方式灵活", + "表达方式" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "可进行结构化程序设计": { + "keywords": [ + "结构化程序设计", + "结构化", + "程序设计" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "可以直接操作计算机硬件": { + "keywords": [ + "操作计算机硬件", + "计算机硬件" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "生成的目标代码质量高": { + "keywords": [ + "目标代码质量高", + "目标代码" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + } + ] } }, { - "字符类型": { + "C语言标准": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "数据类型", + "C语言标准", + "语言标准", "C语言" ], - "children": [] + "children": [ + { + "Traditional C": { + "keywords": [ + "TraditionalC" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "C89": { + "keywords": [ + "C89" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "C95": { + "keywords": [ + "C95" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "C99": { + "keywords": [ + "C99" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "C11": { + "keywords": [ + "C11" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "C17": { + "keywords": [ + "C17" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "C2x": { + "keywords": [ + "C2x" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + } + ] } }, { - "布尔类型": { + "编程机制": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "数据类型", + "编程机制", "C语言" ], - "children": [] + "children": [ + { + "目标代码文件、可执行文件和库": { + "keywords": [ + "目标代码文件", + "可执行文件", + "C语言库", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "UNIX系统": { + "keywords": [ + "UNIX系统", + "UNIX", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "Linux": { + "keywords": [ + "Linux", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "Windows": { + "keywords": [ + "Windows", + "Linux", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "Macintosh": { + "keywords": [ + "Macintosh", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "GNU编译器集合和LLVM项目": { + "keywords": [ + "GNU编译器", + "GNU", + "LLVM项目", + "LLVM", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "命令行编译器": { + "keywords": [ + "命令行编译器", + "命令行", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "集成开发环境": { + "keywords": [ + "集成开发环境", + "IDE", + "C语言" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + } + ] } } ] } }, { - "运算符": { + "数据类型": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "运算符", + "编程机制", "C语言" ], "children": [ { - "赋值运算符": { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "运算符", - "C语言" - ], - "children": [] - } - }, - { - "逗号运算符": { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "运算符", - "C语言" - ], - "children": [] - } - }, - { - "位逻辑运算符": { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "运算符", - "C语言" - ], - "children": [] - } - }, - { - "sizeof运算符和size_t类型": { + "变量": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "运算符", + "变量", "C语言" ], "children": [] } }, { - "运算符优先级": { + "常量": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "运算符", + "常量", "C语言" ], "children": [] } }, { - "求值顺序": { + "基本数据类型": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "运算符", - "C语言" - ], - "children": [] - } - }, - { - "加法运算符": { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "运算符", - "C语言" - ], - "children": [] - } - }, - { - "减法运算符": { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "运算符", - "C语言" - ], - "children": [] - } - }, - { - "符号运算符": { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "运算符", - "C语言" - ], - "children": [] - } - }, - { - "乘法运算符": { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "运算符", - "C语言" - ], - "children": [] - } - }, - { - "除法运算符": { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "运算符", - "C语言" + "基本数据类型", + "数据类型" ], - "children": [] - } - }, - { - "求模运算符": { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "运算符", - "C语言" - ], - "children": [] - } - }, - { - "递增运算符": { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "运算符", - "C语言" - ], - "children": [] - } - }, - { - "递减运算符": { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "运算符", - "C语言" - ], - "children": [] + "children": [ + { + "整数类型": { + "keywords": [ + "整数类型", + "int" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "浮点类型": { + "keywords": [ + "浮点类型", + "float", + "double" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "字符类型": { + "keywords": [ + "字符类型", + "char" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "布尔类型": { + "keywords": [ + "布尔类型", + "boll" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + } + ] } } ] } }, { - "表达式": { + "运算符与表达式": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "表达式", - "C语言" - ], - "children": [ - { - "赋值表达式": { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "表达式", - "C语言" - ], - "children": [] - } - }, - { - "算术表达式": { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "表达式", - "C语言" - ], - "children": [] - } - }, - { - "关系表达式": { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "表达式", - "C语言" - ], - "children": [] - } - }, + "keywords": [ + "基本数据类型", + "数据类型" + ], + "children": [ { - "逻辑表达式": { + "赋值运算符与表达式": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "表达式", + "赋值", + "运算符", + "赋值运算符", "C语言" ], "children": [] } }, { - "位逻辑表达式": { + "算术运算符与表达式": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "表达式", + "算术", + "算术运算符", + "运算符", "C语言" ], - "children": [] + "children": [ + { + "加法运算符": { + "keywords": [ + "加法运算符", + "加法" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "减法运算符": { + "keywords": [ + "减法运算符", + "减法" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "乘法运算符": { + "keywords": [ + "乘法运算符", + "乘法" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "除法运算符": { + "keywords": [ + "除法运算符", + "除法" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "求模运算符": { + "keywords": [ + "求模运算符", + "求模" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "递增运算符": { + "keywords": [ + "递增运算符", + "递增" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "递减运算符": { + "keywords": [ + "递减运算符", + "递减" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + } + ] } }, { - "逗号表达式": { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "表达式", - "C语言" - ], - "children": [] - } - } - ] - } - }, - { - "语句与控制流": { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "语句", - "控制流", - "C语言" - ], - "children": [ - { - "程序块": { + "关系运算符与表达式": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "语句", - "控制流", + "关系", + "关系运算符", + "运算符", "C语言" ], - "children": [] + "children": [ + { + "大于运算符": { + "keywords": [ + "大于", + "大于运算符" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "小于运算符": { + "keywords": [ + "小于", + "小于运算符" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "等于运算符": { + "keywords": [ + "等于", + "等于运算符" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "大于等于运算符": { + "keywords": [ + "大于等于", + "大于等于运算符" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "小于等于运算符": { + "keywords": [ + "小于等于", + "小于等于运算符" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "不等于运算符": { + "keywords": [ + "不等于", + "不等于运算符" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + } + ] } }, { - "if语句": { + "逻辑运算符与表达式": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "语句", - "控制流", + "逻辑", + "逻辑运算符", + "运算符", "C语言" ], - "children": [] + "children": [ + { + "逻辑与运算符": { + "keywords": [ + "逻辑与", + "逻辑与运算符", + "与运算符" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "逻辑或运算符": { + "keywords": [ + "逻辑或", + "逻辑或运算符", + "或运算符" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "逻辑非运算符": { + "keywords": [ + "逻辑非", + "逻辑非运算符", + "非运算符" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + } + ] } }, { - "if-else语句": { + "逗号运算符与表达式": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "语句", - "控制流", + "运算符", "C语言" ], "children": [] } }, { - "else-if语句": { + "条件运算符": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "语句", - "控制流", + "条件", + "条件运算符", + "运算符", "C语言" ], "children": [] } }, { - "switch语句": { + "sizeof运算符": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "语句", - "控制流", + "运算符", "C语言" ], "children": [] } }, { - "while循环与for循环": { + "运算符优先级与求值顺序": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "语句", - "控制流", + "运算符", "C语言" ], "children": [] } - }, + } + ] + } + }, + { + "语句与控制流": { + "node_id": "569d5e11c4fc5de7844053d9a733c5e8", + "keywords": [ + "运算符", + "C语言" + ], + "children": [ { - "do-while循环": { + "语句与程序块": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ "语句", @@ -424,25 +682,140 @@ } }, { - "break语句与continue语句": { + "判断语句": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ "语句", "控制流", "C语言" ], - "children": [] + "children": [ + { + "if语句": { + "keywords": [ + "if语句", + "if" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "if-else语句": { + "keywords": [ + "if-else语句", + "if", + "else", + "if-else", + "ifelse", + "if else" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "else-if语句": { + "keywords": [ + "else-if语句", + "if", + "else", + "else-if", + "else-if", + "else if" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "switch语句": { + "keywords": [ + "switch语句", + "switch" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + } + ] } }, { - "goto语句": { + "循环语句": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ "语句", "控制流", "C语言" ], - "children": [] + "children": [ + { + "for循环": { + "keywords": [ + "for循环", + "循环", + "for" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "while循环": { + "keywords": [ + "while循环", + "循环", + "while" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "do-while循环": { + "keywords": [ + "do-while循环", + "do-while", + "while", + "dowhile", + "do while" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "break语句": { + "keywords": [ + "break语句", + "break" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "continue语句": { + "keywords": [ + "continue语句", + "continue" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + }, + { + "goto语句": { + "keywords": [ + "goto语句", + "goto" + ], + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" + } + } + ] } } ] @@ -459,11 +832,7 @@ { "函数与程序结构": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "函数", - "程序结构", - "C语言" - ], + "keywords": [], "children": [ { "函数的参数": { @@ -623,10 +992,11 @@ } }, { - "数组和指针": { + "数组": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "数组", + "函数", + "程序结构", "C语言" ], "children": [ @@ -660,16 +1030,6 @@ "children": [] } }, - { - "多维数组": { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "数组", - "C语言" - ], - "children": [] - } - }, { "变长数组": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", @@ -687,7 +1047,7 @@ "指针": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "指针", + "数组", "C语言" ], "children": [ @@ -751,16 +1111,6 @@ "children": [] } }, - { - "指针与多维数组": { - "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "指针", - "C语言" - ], - "children": [] - } - }, { "指向函数的指针": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", @@ -773,6 +1123,16 @@ } ] } + }, + { + "字符串": { + "node_id": "569d5e11c4fc5de7844053d9a733c5e8", + "keywords": [ + "指针", + "C语言" + ], + "children": [] + } } ] } @@ -785,10 +1145,7 @@ { "结构体": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", - "keywords": [ - "结构体", - "C语言" - ], + "keywords": [], "children": [ { "结构体简介": { @@ -847,8 +1204,7 @@ "联合体": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "共用体", - "联合体", + "结构体", "C语言" ], "children": [] @@ -858,8 +1214,7 @@ "位运算": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "位运算", - "位操作", + "结构体", "C语言" ], "children": [ @@ -947,8 +1302,8 @@ "预处理器": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "预处理器", - "预编译器", + "位运算", + "位操作", "C语言" ], "children": [ @@ -1014,7 +1369,8 @@ "文件": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "文件", + "预处理器", + "预编译器", "C语言" ], "children": [ @@ -1032,7 +1388,8 @@ "文件指针", "文件" ], - "children": [] + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" } }, { @@ -1042,7 +1399,8 @@ "文件", "文件打开" ], - "children": [] + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" } }, { @@ -1052,7 +1410,8 @@ "文件", "文件关闭" ], - "children": [] + "children": [], + "node_id": "569d5e11c4fc5de7844053d9a733c5e8" } } ] @@ -1075,8 +1434,7 @@ "存储管理": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "存储管理", - "内存管理", + "文件", "C语言" ], "children": [ @@ -1109,8 +1467,8 @@ "标准函数库": { "node_id": "569d5e11c4fc5de7844053d9a733c5e8", "keywords": [ - "标准函数库", - "标准库", + "存储管理", + "内存管理", "C语言" ], "children": [ diff --git a/src/common/__init__.py b/src/common/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/common/command_line.py b/src/common/command_line.py new file mode 100644 index 0000000..b30fe94 --- /dev/null +++ b/src/common/command_line.py @@ -0,0 +1,81 @@ +# -*- coding: UTF-8 -*- + +import importlib + + +def dispatch(config, options, actions, targets): + ''' 分发命令行 action ''' + action_len = len(actions) + if action_len < 2: + return + + index = 1 + next = targets + action = actions[index] + print(f"[命令路由中..]: {actions[0]}") + + while action_len >= index: + if type(next) == type({}): + if index == action_len: + if next.get('run') != None: + print(f"[命令路由执行]:", '->'.join(actions)) + next['run']() + break + + action = actions[index] + if next.get(action) != None: + print(f"[命令路由中..]: {action}") + next = next[action] + index += 1 + else: + print("[命令路由错误]: 未找到支持的命令行路由:", '->'.join(actions)) + index += 1 + else: + print(f"[命令路由执行]:", '->'.join(actions)) + + next() + index += 1 + break + + +def dispatch_runner(config, options, actions, targets): + ''' 分发命令行 action ''' + action_len = len(actions) + if action_len < 2: + return + + def load_and_run(target): + modules = target.split('.') + class_pos = len(modules)-2 + path_pos = len(modules)-1 + + if class_pos >= 0 and modules[class_pos][0].isupper(): + constructor = modules[class_pos] + runner = modules[path_pos] + module_path = '.'.join(modules[:class_pos]) + importlib.import_module(module_path).__getattribute__( + constructor)(config, options).__getattribute__(runner)() + else: + runner = modules[path_pos] + + module_path = '.'.join(modules[:path_pos]) + importlib.import_module(module_path).__getattribute__( + runner)(config, options) + + index = 1 + next = targets + while action_len >= index: + if type(next) == type({}): + if index == action_len: + if next.get('run') != None: + load_and_run(next['run']) + break + + action = actions[index] + if next.get(action) != None: + next = next[action] + index += 1 + else: + load_and_run(next) + index += 1 + break diff --git a/src/common/logger.py b/src/common/logger.py new file mode 100644 index 0000000..b873aa2 --- /dev/null +++ b/src/common/logger.py @@ -0,0 +1,77 @@ +# -*- coding: UTF-8 -*- +import os +import logging +import platform + +from logging.handlers import RotatingFileHandler + + +def is_osx(): + p = platform.platform() + return p.find('macOS') >= 0 or p.find('Darwin') >= 0 + + +def get_root_log_dir(config, options): + action = 'default' + if options.action: + action = options.action + if is_osx(): + return '/tmp/csdn/ai/{}'.format(action) + else: + is_dev = (options.cluster is None) or (options.cluster == 'dev') + if is_dev: + return '../log/csdn/ai/{}'.format(action) + else: + return '/var/csdn/csdn/ai/{}'.format(action) + + +class TruncatedFileHandler(RotatingFileHandler): + ''' + 日志文件按固定大小自动分割 + ''' + + def __init__(self, filename, mode='a', maxBytes=0, encoding=None, delay=0): + super(TruncatedFileHandler, self).__init__( + filename, mode, maxBytes, 0, encoding, delay) + + def doRollover(self): + """Truncate the file""" + if self.stream: + self.stream.close() + dfn = self.baseFilename + ".1" + if os.path.exists(dfn): + os.remove(dfn) + os.rename(self.baseFilename, dfn) + os.remove(dfn) + self.mode = 'w' + self.stream = self._open() + + +def init_log(config, options): + # 创建日志目录 + root_log_dir = get_root_log_dir(config, options) + os.makedirs(root_log_dir, exist_ok=True) + print('root_log_dir:', root_log_dir) + + # 文件日志控制器 + log_filename = root_log_dir+'/app.log' + file_handler = TruncatedFileHandler(log_filename, "w", 10*1024) + + # 控制台日志控制器 + console_handler = logging.StreamHandler() + + # 日志配置 + logging.basicConfig( + # 日志格式 + format="[%(levelname)s][%(asctime)s][%(filename)s:%(lineno)d at %(funcName)s]: %(message)s", + # 日期格式 + datefmt='%Y-%m-%d %H:%M:%S', + # 日志级别 + level=logging.INFO, + # 输出目标,日志文件+控制台 + handlers=[ + file_handler, + console_handler + ] + ) + diff --git a/src/config/__init__.py b/src/config/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/config/config.py b/src/config/config.py new file mode 100644 index 0000000..4ec9edd --- /dev/null +++ b/src/config/config.py @@ -0,0 +1,57 @@ +# -*- coding: UTF-8 -*- +import os +import json +from lib.apollo import ApolloClient + + +def load_apollo_config(options): + ''' + 阿波罗配置加载 + === + * 如果是 `pro` 环境,则使用线上配置 + * 否则,使用内网配置 + ''' + config_url = None + if options.cluster == 'pro': + config_url = 'http://pro.config.csdn.net:8080' + elif options.cluster == 'fat': + config_url = 'http://fat.config.csdn.net:8080' + elif options.cluster == 'uat': + config_url = 'http://uat.config.csdn.net:8080' + else: + config_url = 'http://dev.config.csdn.net:8080' + + client = ApolloClient( + app_id="949", + cluster="default", + config_url=config_url, + start_hot_update=False + ) + config = client.get_value("csdn-ai", namespace="application") + return json.loads(config) + + +def load_config(options, args): + ''' + 配置加载 + === + * 如果本地 config/config 目录下存在配置,则使用本地配置文件 + * 如果本地 config/config 目录下不存在配置, + * 默认使用 阿波罗配置中心 cluster=dev 配置 + * 如果指定 --cluster,则使用指定 cluster 的阿波罗配置中心的配置 + ''' + profile_path = "config/config/{}.json".format(options.profile) + config = None + if options.cluster: + config = load_apollo_config(options) + else: + if os.path.exists(profile_path): + with open(profile_path, "r") as f: + config = json.loads(f.read()) + else: + # try: + # options.cluster = 'dev' + # config = load_apollo_config(options) + # except: + config = {} + return config diff --git a/src/lib/__init__.py b/src/lib/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/apollo.py b/src/lib/apollo.py new file mode 100644 index 0000000..5737e15 --- /dev/null +++ b/src/lib/apollo.py @@ -0,0 +1,392 @@ +# -*- coding: UTF-8 -*- +import hashlib +import sys +import socket +import logging +import os +import json +import os +import threading +import inspect +import ctypes +import time +import urllib.request +from urllib.error import HTTPError +from urllib import parse +import yaml + +# 定义常量 +CONFIGURATIONS = "configurations" +NOTIFICATION_ID = "notificationId" +NAMESPACE_NAME = "namespaceName" + + +# 对时间戳,uri,秘钥进行加签 +def signature(timestamp, uri, secret): + import hmac + import base64 + string_to_sign = '' + timestamp + '\n' + uri + hmac_code = hmac.new( + secret.encode(), string_to_sign.encode(), hashlib.sha1).digest() + return base64.b64encode(hmac_code).decode() + + +def url_encode_wrapper(params): + return url_encode(params) + + +def no_key_cache_key(namespace, key): + return "{}{}{}".format(namespace, len(namespace), key) + + +# 返回是否获取到的值,不存在则返回None +def get_value_from_dict(namespace_cache, key): + if namespace_cache: + # print(namespace_cache) + kv_data = namespace_cache.get(CONFIGURATIONS) + if kv_data is None: + return None + if key in kv_data: + return kv_data[key] + return None + + +def init_ip(): + try: + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + s.connect(('8.8.8.8', 53)) + ip = s.getsockname()[0] + return ip + finally: + s.close() + return "" + + +def http_request(url, timeout, headers={}): + try: + request = urllib.request.Request(url, headers=headers) + res = urllib.request.urlopen(request, timeout=timeout) + body = res.read().decode("utf-8") + return res.code, body + except HTTPError as e: + if e.code == 304: + logging.getLogger(__name__).warning( + "http_request error,code is 304, maybe you should check secret") + return 304, None + logging.getLogger(__name__).warning( + "http_request error,code is %d, msg is %s", e.code, e.msg) + raise e + + +def url_encode(params): + return parse.urlencode(params) + + +def makedirs_wrapper(path): + os.makedirs(path, exist_ok=True) + + +class ApolloClient(object): + + def __init__(self, config_url, app_id, cluster='default', secret='', start_hot_update=True, + change_listener=None, config_format='json', refresh=False): + + # 核心路由参数 + self.config_url = config_url + self.cluster = cluster + self.app_id = app_id + + # 非核心参数 + self.ip = init_ip() + self.secret = secret + self.config_format = config_format + + # 检查参数变量 + + # 私有控制变量 + self._cycle_time = 2 + self._stopping = False + self._cache = {} + self._no_key = {} + self._hash = {} + self._pull_timeout = 75 + self._cache_file_path = os.path.expanduser('~') + '/data/apollo/cache/' + self._long_poll_thread = None + self._change_listener = change_listener # "add" "delete" "update" + self.refresh = refresh + + if self.refresh: + try: + os.remove(self._cache_file_path) + except: + pass + + # 私有启动方法 + self._path_checker() + # if start_hot_update: + # self._start_hot_update() + + # 启动心跳线程 + # heartbeat = threading.Thread(target=self._heartBeat) + # heartbeat.setDaemon(True) + # heartbeat.start() + + def get_json_from_net(self, namespace='application'): + url = '{}/configs/{}/{}/{}?releaseKey={}&ip={}'.format( + self.config_url, + self.app_id, + self.cluster, + namespace, + "", + self.ip) + try: + print(url) + code, body = http_request( + url, timeout=3, headers=self._signHeaders(url)) + # print(code, body) + if code == 200: + data = json.loads(body) + + if self.config_format == 'yaml': + data = yaml.load(data["configurations"] + ['content'], Loader=yaml.FullLoader) + else: + data = data["configurations"] + # print(data) + return_data = {CONFIGURATIONS: data} + # print('return_data:', return_data) + return return_data + else: + print('http_request error code', code) + return None + except Exception as e: + logging.getLogger(__name__).error(str(e)) + return None + + def get_value(self, key, default_val=None, namespace='application'): + try: + # 读取内存配置 + # print('读取内存配置') + namespace_cache = self._cache.get(namespace) + + val = get_value_from_dict(namespace_cache, key) + if val is not None: + # print('get value from cache') + return val + + no_key = no_key_cache_key(namespace, key) + if no_key in self._no_key: + # print('get value from no_key_cache_key') + return default_val + + # 读取网络配置 + # print('读取网络配置') + namespace_data = self.get_json_from_net(namespace) + val = get_value_from_dict(namespace_data, key) + if val is not None: + # print('get_json_from_net:', namespace_cache) + self._update_cache_and_file(namespace_data, namespace) + return val + + # 读取文件配置 + # print('读取文件配置') + namespace_cache = self._get_local_cache(namespace) + val = get_value_from_dict(namespace_cache, key) + if val is not None: + # print('get_value_from_dict:', namespace_cache) + self._update_cache_and_file(namespace_cache, namespace) + return val + + # 如果全部没有获取,则把默认值返回,设置本地缓存为None + # print('如果全部没有获取,则把默认值返回,设置本地缓存为None') + self._set_local_cache_none(namespace, key) + return default_val + except Exception as e: + logging.getLogger(__name__).error("get_value has error, [key is %s], [namespace is %s], [error is %s], ", + key, namespace, e) + return default_val + + # 设置某个namespace的key为none,这里不设置default_val,是为了保证函数调用实时的正确性。 + # 假设用户2次default_val不一样,然而这里却用default_val填充,则可能会有问题。 + def _set_local_cache_none(self, namespace, key): + no_key = no_key_cache_key(namespace, key) + self._no_key[no_key] = key + + def _start_hot_update(self): + self._long_poll_thread = threading.Thread(target=self._listener) + # 启动异步线程为守护线程,主线程推出的时候,守护线程会自动退出。 + self._long_poll_thread.setDaemon(True) + self._long_poll_thread.start() + + def stop(self): + self._stopping = True + logging.getLogger(__name__).info("Stopping listener...") + + # 调用设置的回调函数,如果异常,直接try掉 + def _call_listener(self, namespace, old_kv, new_kv): + if self._change_listener is None: + return + if old_kv is None: + old_kv = {} + if new_kv is None: + new_kv = {} + try: + for key in old_kv: + new_value = new_kv.get(key) + old_value = old_kv.get(key) + if new_value is None: + # 如果newValue 是空,则表示key,value被删除了。 + self._change_listener("delete", namespace, key, old_value) + continue + if new_value != old_value: + self._change_listener("update", namespace, key, new_value) + continue + for key in new_kv: + new_value = new_kv.get(key) + old_value = old_kv.get(key) + if old_value is None: + self._change_listener("add", namespace, key, new_value) + except BaseException as e: + logging.getLogger(__name__).warning(str(e)) + + def _path_checker(self): + if not os.path.isdir(self._cache_file_path): + makedirs_wrapper(self._cache_file_path) + + # 更新本地缓存和文件缓存 + + def _update_cache_and_file(self, namespace_data, namespace='application'): + # 不使用本地缓存 + if self.refresh: + return + + # 更新本地缓存 + self._cache[namespace] = namespace_data + # 更新文件缓存 + new_string = json.dumps(namespace_data) + new_hash = hashlib.md5(new_string.encode('utf-8')).hexdigest() + if self._hash.get(namespace) == new_hash: + pass + else: + with open(os.path.join(self._cache_file_path, '%s_configuration_%s.txt' % (self.app_id, namespace)), + 'w') as f: + f.write(new_string) + self._hash[namespace] = new_hash + + # 从本地文件获取配置 + def _get_local_cache(self, namespace='application'): + cache_file_path = os.path.join( + self._cache_file_path, '%s_configuration_%s.txt' % (self.app_id, namespace)) + if os.path.isfile(cache_file_path): + with open(cache_file_path, 'r') as f: + result = json.loads(f.readline()) + return result + return {} + + def _long_poll(self): + notifications = [] + for key in self._cache: + namespace_data = self._cache[key] + notification_id = -1 + if NOTIFICATION_ID in namespace_data: + notification_id = self._cache[key][NOTIFICATION_ID] + notifications.append({ + NAMESPACE_NAME: key, + NOTIFICATION_ID: notification_id + }) + try: + # 如果长度为0直接返回 + if len(notifications) == 0: + return + url = '{}/notifications/v2'.format(self.config_url) + params = { + 'appId': self.app_id, + 'cluster': self.cluster, + 'notifications': json.dumps(notifications, ensure_ascii=False) + } + param_str = url_encode_wrapper(params) + url = url + '?' + param_str + code, body = http_request( + url, self._pull_timeout, headers=self._signHeaders(url)) + http_code = code + if http_code == 304: + logging.getLogger(__name__).debug('No change, loop...') + return + if http_code == 200: + data = json.loads(body) + for entry in data: + namespace = entry[NAMESPACE_NAME] + n_id = entry[NOTIFICATION_ID] + logging.getLogger(__name__).info( + "%s has changes: notificationId=%d", namespace, n_id) + self._get_net_and_set_local( + namespace, n_id, call_change=True) + return + else: + logging.getLogger(__name__).warning('Sleep...') + except Exception as e: + logging.getLogger(__name__).warning(str(e)) + + def _get_net_and_set_local(self, namespace, n_id, call_change=False): + namespace_data = self.get_json_from_net(namespace) + namespace_data[NOTIFICATION_ID] = n_id + old_namespace = self._cache.get(namespace) + self._update_cache_and_file(namespace_data, namespace) + if self._change_listener is not None and call_change: + old_kv = old_namespace.get(CONFIGURATIONS) + new_kv = namespace_data.get(CONFIGURATIONS) + self._call_listener(namespace, old_kv, new_kv) + + def _listener(self): + logging.getLogger(__name__).info('start long_poll') + while not self._stopping: + self._long_poll() + time.sleep(self._cycle_time) + logging.getLogger(__name__).info("stopped, long_poll") + + # 给header增加加签需求 + def _signHeaders(self, url): + headers = {} + if self.secret == '': + return headers + uri = url[len(self.config_url):len(url)] + time_unix_now = str(int(round(time.time() * 1000))) + headers['Authorization'] = 'Apollo ' + self.app_id + \ + ':' + signature(time_unix_now, uri, self.secret) + headers['Timestamp'] = time_unix_now + return headers + + def _heartBeat(self): + while not self._stopping: + time.sleep(60 * 10) # 10分钟 + for namespace in self._notification_map: + self._do_heartBeat(namespace) + + def _do_heartBeat(self, namespace): + release_key = self._release_key_map.get(namespace) + url = '{}/configs/{}/{}/{}?releaseKey={}&ip={}'.format(self.config_url, self.app_id, self.cluster, namespace, + release_key, self.ip) + try: + code, body = http_request( + url, timeout=3, headers=self._signHeaders(url)) + if code == 200: + data = json.loads(body) + self._release_key_map[namespace] = data["releaseKey"] + data = data["configurations"] + self._update_cache_and_file(data, namespace) + else: + return None + except Exception as e: + logging.getLogger(__name__).error(str(e)) + return None + + +if __name__ == "__main__": + client = ApolloClient( + app_id="949", + cluster="default", + config_url='http://dev.config.csdn.net:8080', + refresh=True + ) + val = client.get_value("csdn-ai", namespace="application") + # print(val) diff --git a/src/main.py b/src/main.py new file mode 100644 index 0000000..f4d5880 --- /dev/null +++ b/src/main.py @@ -0,0 +1,45 @@ +# -*- coding: UTF-8 -*- +from common.logger import init_log + +from config.config import load_config +from options import parse_options, show_help +from tree import gen_tree + +def test(config, options, actions): + import test as test + test.dispatch(config, options, actions) + +def tree(config, options, actions): + import test as test + gen_tree("../data") + +def run(options): + # 操作入口 + if options.action is not None: + actions = options.action.split('.') + if len(actions) == 0: + return + + print('@init config...') + config = load_config(options, args) + print('') + + print('@init log...') + init_log(config, options) + print('') + + print('@dispatch action:{}...'.format(options.action)) + root_action = actions[0] + next = actions[1:] + dispatch = { + 'test': lambda: test(config, options, next), + 'tree': lambda: tree(config, options, next) + } + dispatch[root_action]() + else: + show_help() + + +if __name__ == "__main__": + [options, args] = parse_options() + run(options) diff --git a/src/options.py b/src/options.py new file mode 100644 index 0000000..26dd98e --- /dev/null +++ b/src/options.py @@ -0,0 +1,203 @@ +from optparse import OptionParser + + +def parse_common_options(parser): + ''' + ## 公共选项 + * -t 或者 --tag_id : 某个操作限制到指定tag_id的数据范围 + * --reset: 重置选项 + * --tag_name: 标签名字 + * --model: 模型名字 + * --log: 日志级别 + * --train: 训练 + * --port: 端口 + * --show_config: 显示配置 + * --count: 指定数量 + * --query: 自定义查询 + ''' + parser.add_option( + "-t", "--tag_id", + dest="tag_id", + help="tag_id", + metavar="TAG_ID" + ) + + parser.add_option( + "--reset", + dest="reset", + help="reset", + action="store_true", + metavar="RESET" + ) + + parser.add_option( + "--tag_name", + dest="tag_name", + help="tag_name", + metavar="TAG_NAME" + ) + + parser.add_option( + "--model", + dest="model", + help="model", + metavar="MODEL" + ) + + parser.add_option( + "--log", + dest="log", + help="log", + metavar="LOG" + ) + + parser.add_option( + "--train", + dest="train", + help="train", + action="store_true", + metavar="TRAIN" + ) + + parser.add_option( + "--port", + dest="port", + help="port", + metavar="PORT" + ) + + parser.add_option( + "--server", + dest="server", + help="server", + metavar="SERVER" + ) + + parser.add_option( + "--show_config", + dest="show_config", + help="show_config", + metavar="SHOW_CONFIG" + ) + + parser.add_option( + "--count", + dest="count", + help="count", + metavar="COUNT" + ) + + parser.add_option( + "--query", + dest="query", + help="query", + metavar="QUERY" + ) + + +def parse_profile_options(parser): + ''' + ## 环境配置选项 + * -p 或 --profile 指定配置环境,可选的有 `dev`, `fat`, `pre`, `pro` + * 如果本地 config/config 目录下存在配置,则使用本地配置文件 + * 如果本地 config/config 目录下不存在配置, + * 默认使用 阿波罗配置中心 cluster=dev 配置 + * 如果指定 --cluster,则使用指定 cluster 的阿波罗配置中心的配置 + ''' + + parser.add_option( + "-p", "--profile", + dest="profile", + help="profile", + default='pro', + metavar="PROFILE" + ) + + parser.add_option( + "--cluster", + dest="cluster", + help="cluster", + metavar="REMOTE" + ) + + +def parse_action_options(parser): + ''' + ## 操作选项 + * -a 或 --action 指定了操作目标,多级目标用点号分割,例如: + * -a dataset.build.tag.all + * -a server.ask + * -a test.code + * 参考[README](./README.md) + ''' + parser.add_option( + "-a", "--action", + dest="action", + help="action", + metavar="ACTION" + ) + + +def parse_test_options(parser): + ''' + ## 测试选项 + 执行 -a test.xx 测试时默认执行冒烟测试,下面的选项改变行为 + * --label 指定执行测试并生成待标注数据 + * --count 指定标注上限 + ''' + parser.add_option( + "--label", + dest="label", + help="label", + action="store_true", + metavar="LABEL" + ) + + +def parse_db_options(parser): + ''' + ## 数据库 migrate 选项 + * --message 传入一个消息变量,db.migrate action 接收此参数 + * --revision 传入版本参数,db.upgrade, db.downgrade, db.stamp, db.show, db.edit 接受此参数 + ''' + parser.add_option( + "--message", + dest="message", + help="message", + metavar="MESSAGE" + ) + parser.add_option( + "--revision", + dest="revision", + help="revision", + metavar="REVISION" + ) + + +def parse_options(): + parser = OptionParser() + + parse_common_options(parser) + parse_profile_options(parser) + parse_action_options(parser) + parse_test_options(parser) + parse_db_options(parser) + + (options, args) = parser.parse_args() + return [options, args] + + +def show_help(): + ''' + 命令行选项说明: + == + ''' + + help = '\n'.join([ + show_help.__doc__, + parse_common_options.__doc__, + parse_profile_options.__doc__, + parse_action_options.__doc__ + ]) + + print(help) diff --git a/src/tree.py b/src/tree.py index 3eba573..f606e39 100644 --- a/src/tree.py +++ b/src/tree.py @@ -51,10 +51,17 @@ def gen_tree(data_path): if os.path.isdir(no_dir): yield no_dir, no_name - def ensure_node_id(cfg_path, cfg): - if cfg.get('node_id') is None: - cfg['node_id'] = gen_node_id() - dump_json(cfg_path, cfg, exist_ok=True, override=True) + def ensure_id_helper(node): + if node.get('node_id') is None: + node['node_id'] = gen_node_id() + + if 'children' in node: + for c in node["children"]: + ensure_id_helper(list(c.values())[0]) + + def ensure_node_id(cfg_path, cfg): + ensure_id_helper(cfg) + dump_json(cfg_path, cfg, exist_ok=True, override=True) def make_node(name, node_id, keywords, children=None): node = {} @@ -89,6 +96,8 @@ def gen_tree(data_path): level_name, cfg['node_id'], cfg['keywords']) tree_node['children'].append(level_node) + + # 章节点 for chapter_no_dir, chapter_no_name in list_dir(level_no_dir): no, chapter_name = parse_no_name(chapter_no_name) @@ -104,8 +113,8 @@ def gen_tree(data_path): for section_no_dir, section_no_name in list_dir(chapter_no_dir): no, section_name = parse_no_name(section_no_name) cfg_path = os.path.join(section_no_dir, 'config.json') - ensure_node_id(cfg_path, cfg) cfg = load_json(cfg_path) + ensure_node_id(cfg_path, cfg) section_node, section_node_children = make_node( section_name, cfg['node_id'], cfg['keywords'], cfg['children']) @@ -113,8 +122,11 @@ def gen_tree(data_path): # 确保习题分配了习题ID for export in cfg['export']: - if export.get('exercise_id') is None: - export['exercise_id'] = gen_node_id() + ecfg_path = os.path.join(section_no_dir, export) + ecfg = load_json(ecfg_path) + if ecfg.get('exercise_id') is None: + ecfg['exercise_id'] = gen_node_id() + dump_json(ecfg_path, ecfg, exist_ok=True, override=True) dump_json(cfg_path, cfg, exist_ok=True, override=True) # 保存技能树骨架 -- GitLab