-
Notifications
You must be signed in to change notification settings - Fork 4
Next #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: nextBase
Are you sure you want to change the base?
Next #7
Changes from 5 commits
bec5345
c8d8140
9c9d896
aa5fb75
9111db2
4d15c73
40e7db5
938076d
e7a1efd
0b97df2
14b3f07
1141052
c02b973
a0c0742
3db45e2
93dbbdd
92a59cf
65dff5d
94cbf58
83b338e
06ea8f8
5a68fc1
0cb3edc
b8b98ca
10593b6
cbda13f
b63328e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| Index: | ||
| Background: Build # 开启后台索引 | ||
|
|
||
| # 如果你的 compile_commands.json 不在根目录,需要在这里显式指定 | ||
| CompileFlags: | ||
| CompilationDatabase: ".vscode" | ||
|
|
||
| Diagnostics: | ||
| UnusedIncludes: None # 关键:这会关闭“未使用头文件”的提示 | ||
| MissingIncludes: None # 可选:关闭“缺失头文件”的提示 | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,8 +1,27 @@ | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| "clangd.enable": false, | ||||||||||||||||||||||
| "C_Cpp.intelliSenseEngine": "default", | ||||||||||||||||||||||
| "C_Cpp.codeAnalysis.clangTidy.enabled": true, | ||||||||||||||||||||||
| "c-cpp-flylint.enable": true, | ||||||||||||||||||||||
| "Lua.codeLens.enable": false, | ||||||||||||||||||||||
| "Lua.hint.enable": false, | ||||||||||||||||||||||
| "Lua.completion.enable": false, | ||||||||||||||||||||||
| "Lua.format.enable": false, | ||||||||||||||||||||||
| "Lua.hover.enable": false, | ||||||||||||||||||||||
| "Lua.diagnostics.enable": false, | ||||||||||||||||||||||
| "Lua.semantic.enable": false, | ||||||||||||||||||||||
| "Lua.addonManager.enable": false, | ||||||||||||||||||||||
| "Lua.signatureHelp.enable": false, | ||||||||||||||||||||||
| "clangd.enable": true, | ||||||||||||||||||||||
| "clangd.arguments": [ | ||||||||||||||||||||||
| ], | ||||||||||||||||||||||
| "C_Cpp.intelliSenseEngine": "disabled", | ||||||||||||||||||||||
| "C_Cpp.errorSquiggles": "disabled", // 关闭微软的波浪线 | ||||||||||||||||||||||
| "C_Cpp.autocomplete": "disabled", // 关闭微软的自动补全 | ||||||||||||||||||||||
| "C_Cpp.default.compileCommands": "${workspaceFolder}/.vscode/compile_commands.json", | ||||||||||||||||||||||
| "C_Cpp.codeAnalysis.clangTidy.enabled": false, | ||||||||||||||||||||||
| "C_Cpp.codeAnalysis.clangTidy.args": [ | ||||||||||||||||||||||
| // "--extra-arg=-ferror-limit=1" | ||||||||||||||||||||||
| // "--extra-arg=-m32", | ||||||||||||||||||||||
| "--extra-arg=--target=arm-none-eabi-gcc" | ||||||||||||||||||||||
| ], | ||||||||||||||||||||||
|
Comment on lines
+23
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 目标三元组格式可能不正确。
🔧 建议修复 "C_Cpp.codeAnalysis.clangTidy.args": [
// "--extra-arg=-ferror-limit=1"
// "--extra-arg=-m32",
- "--extra-arg=--target=arm-none-eabi-gcc"
+ "--extra-arg=--target=arm-none-eabi"
],📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| "c-cpp-flylint.enable": false, | ||||||||||||||||||||||
| "c-cpp-flylint.cppcheck.severityLevels": { | ||||||||||||||||||||||
| "error": "Error", | ||||||||||||||||||||||
| "warning": "Warning", | ||||||||||||||||||||||
|
|
@@ -12,49 +31,13 @@ | |||||||||||||||||||||
| "information": "Information" | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| "c-cpp-flylint.cppcheck.extraArgs": [ | ||||||||||||||||||||||
| // "--suppress=constParameterPointer", | ||||||||||||||||||||||
| // "--suppress=constParameterCallback", | ||||||||||||||||||||||
| "--suppress=constParameterPointer", | ||||||||||||||||||||||
| "--suppress=constParameterCallback", | ||||||||||||||||||||||
| "--check-level=exhaustive", | ||||||||||||||||||||||
| // "--suppress=variableScope", | ||||||||||||||||||||||
| // "--suppress=unreadVariable", | ||||||||||||||||||||||
| // "--suppress=constVariablePointer", | ||||||||||||||||||||||
| // "--suppress=constParameter", | ||||||||||||||||||||||
| ], | ||||||||||||||||||||||
| "files.watcherExclude": { | ||||||||||||||||||||||
| "**/test/fuzzer/corpus/**": true, | ||||||||||||||||||||||
| "./docs": true, | ||||||||||||||||||||||
| "./build": true, | ||||||||||||||||||||||
| "./.xmake": true, | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| "files.exclude": { | ||||||||||||||||||||||
| "**/test/fuzzer/corpus/**": true, | ||||||||||||||||||||||
| "./docs": true, | ||||||||||||||||||||||
| "./build": true, | ||||||||||||||||||||||
| "./.xmake": true, | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| "files.associations": { | ||||||||||||||||||||||
| "*.c": "c", | ||||||||||||||||||||||
| "inttypes.h": "c", | ||||||||||||||||||||||
| "float.h": "c", | ||||||||||||||||||||||
| "stdlib.h": "c", | ||||||||||||||||||||||
| "limits.h": "c", | ||||||||||||||||||||||
| "stdio.h": "c", | ||||||||||||||||||||||
| "stdint.h": "c", | ||||||||||||||||||||||
| "ryanjsontest.h": "c", | ||||||||||||||||||||||
| "dirent.h": "c", | ||||||||||||||||||||||
| "valloc.h": "c", | ||||||||||||||||||||||
| "initializer_list": "c", | ||||||||||||||||||||||
| "array": "c", | ||||||||||||||||||||||
| "string_view": "c", | ||||||||||||||||||||||
| "utility": "c", | ||||||||||||||||||||||
| "math.h": "c", | ||||||||||||||||||||||
| "compare": "c", | ||||||||||||||||||||||
| "type_traits": "c", | ||||||||||||||||||||||
| "cjson.h": "c", | ||||||||||||||||||||||
| "ryanjson.h": "c", | ||||||||||||||||||||||
| "string.h": "c", | ||||||||||||||||||||||
| "stdarg.h": "c", | ||||||||||||||||||||||
| "cstdlib": "c", | ||||||||||||||||||||||
| "ryanjsonconfig.h": "c" | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| "--suppress=variableScope", | ||||||||||||||||||||||
| "--suppress=unreadVariable", | ||||||||||||||||||||||
| "--suppress=constVariablePointer", | ||||||||||||||||||||||
| "--suppress=constParameter", | ||||||||||||||||||||||
| "--suppress=unusedStructMember", | ||||||||||||||||||||||
| ] | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -28,7 +28,7 @@ | |||||||||
|
|
||||||||||
| ### 2、设计 | ||||||||||
|
|
||||||||||
| **RyanJson设计时大量借鉴了 [json](https://api.gitee.com/Lamdonn/json) 和 [cJSON](https://github.com/DaveGamble/cJSON) ! ** | ||||||||||
| **RyanJson设计时借鉴了 [json](https://api.gitee.com/Lamdonn/json) 和 [cJSON](https://github.com/DaveGamble/cJSON) ! ** | ||||||||||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
|
|
||||||||||
| Json语法是**JavaScript**对象语法的子集,可通过下面两个连接学习json语法。 | ||||||||||
|
|
||||||||||
|
|
@@ -46,13 +46,20 @@ struct RyanJsonNode | |||||||||
| { | ||||||||||
| struct RyanJsonNode *next; // 单链表节点指针 | ||||||||||
|
|
||||||||||
| /* | ||||||||||
| * 在 next 后紧跟一个字节的 flag,用于描述节点的核心信息: | ||||||||||
| /** | ||||||||||
| * @brief RyanJson 节点结构体 | ||||||||||
| * 每个节点由链表连接,包含元数据标识 (Flag) 与动态载荷存储区。 | ||||||||||
| * | ||||||||||
| * 位分布如下: | ||||||||||
| * 内存布局: | ||||||||||
| * [ next指针 | flag(1字节) | padding/指针空间 | 动态载荷区 ] | ||||||||||
| * | ||||||||||
| * @brief 节点元数据标识 (Flag) | ||||||||||
| * 紧跟 next 指针后,利用 1 字节位域描述节点类型及存储状态。 | ||||||||||
| * | ||||||||||
| * flag 位分布定义: | ||||||||||
| * bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 | ||||||||||
| * ----------------------------------------------------- | ||||||||||
| * 保留 KeyLen KeyLen HasKey NumExt Type2 Type1 Type0 | ||||||||||
| * strMode KeyLen KeyLen HasKey NumExt Type2 Type1 Type0 | ||||||||||
| * | ||||||||||
| * 各位含义: | ||||||||||
| * - bit0-2 : 节点类型 | ||||||||||
|
|
@@ -61,58 +68,88 @@ struct RyanJsonNode | |||||||||
| * | ||||||||||
| * - bit3 : 扩展位 | ||||||||||
| * Bool 类型:0=false, 1=true | ||||||||||
| * Number 类型:0=int, 1=double | ||||||||||
| * Number 类型:0=int(4字节), 1=double(8字节) | ||||||||||
| * | ||||||||||
| * - bit4 : 是否包含 Key | ||||||||||
| * 0=无 Key(数组元素) | ||||||||||
| * 1=有 Key(对象成员) | ||||||||||
| * | ||||||||||
| * - bit5-6 : Key 长度字段字节数 | ||||||||||
| * 00=1字节 (≤255) | ||||||||||
| * 01=2字节 (≤65535) | ||||||||||
| * 10=3字节 (≤16M) | ||||||||||
| * 00=1字节 (≤UINT8_MAX) | ||||||||||
| * 01=2字节 (≤UINT16_MAX) | ||||||||||
| * 10=3字节 (≤UINT24_MAX) | ||||||||||
| * 11=4字节 (≤UINT32_MAX) | ||||||||||
| * | ||||||||||
| * - bit7 : 保留位(未来可用于压缩标记、特殊类型等) | ||||||||||
| */ | ||||||||||
|
|
||||||||||
| /* | ||||||||||
| * flag 后若节点包含 key / strValue,则跟随一个指针, | ||||||||||
| * 指向存储区:[ keyLen | key | stringValue ] | ||||||||||
| * 其中 keyLen 的大小由 flag 中的长度信息决定(最多 4 字节)。 | ||||||||||
| * | ||||||||||
| * 在指针之后,根据节点类型存储具体数据: | ||||||||||
| * - null / bool : 由 flag 表示 | ||||||||||
| * - string : 由上述指针指向 | ||||||||||
| * - number : 根据 flag 决定存储 int(4字节) 或 double(8字节) | ||||||||||
| * - object : 动态分配空间存储子节点,链表结构如下: | ||||||||||
| * | ||||||||||
| * { | ||||||||||
| * "name": "RyanJson", | ||||||||||
| * next ( | ||||||||||
| * "version": "xxx", | ||||||||||
| * next ( | ||||||||||
| * "repository": "https://github.com/Ryan-CW-Code/RyanJson", | ||||||||||
| * next ( | ||||||||||
| * "keywords": ["json", "streamlined", "parser"], | ||||||||||
| * next ( | ||||||||||
| * "others": { ... } | ||||||||||
| * ))) | ||||||||||
| * } | ||||||||||
| */ | ||||||||||
|
|
||||||||||
| /* | ||||||||||
| * 设计特点: | ||||||||||
| * - 一个 Json 节点最多 malloc 两次(一次节点本身,一次可选的 key/stringValue), | ||||||||||
| * 对嵌入式系统非常友好,减少 malloc 头部开销, 尽可能的减少内存碎片。 | ||||||||||
| * - bit7 : 表示key / strValue 存储模式 | ||||||||||
| * 1:inline 模式, 0=ptr 模式 | ||||||||||
|
||||||||||
| * - bit7 : 表示key / strValue 存储模式 | |
| * 1:inline 模式, 0=ptr 模式 | |
| * - bit7 : 表示key / strValue 存储模式 | |
| * 0:inline 模式, 1=ptr 模式 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: Ryan-CW-Code/RyanJson
Length of output: 409
🏁 Script executed:
Repository: Ryan-CW-Code/RyanJson
Length of output: 108
🏁 Script executed:
Repository: Ryan-CW-Code/RyanJson
Length of output: 273
compile_commands.json 文件缺失。
CompilationDatabase 配置指向 ".vscode" 目录,但 compile_commands.json 在该目录(以及根目录)中都不存在。clangd 无法找到编译数据库,将无法正确索引和分析代码。需要生成 compile_commands.json 文件或将配置路径指向正确位置。
🤖 Prompt for AI Agents