Files
Viper_VSCode/packages/vipeye/package.json
T
TermiNexus baec16e540 feat(vipeye-internal): Viper 1.1.426 语法/语义/补全增强
把 TransPyC 现行语法与 Viper 的类型组合语义补齐到 LSP 侧(编译器 TPC/TPV 不改动):

- 类型描述符:`const` / `volatile` 可前缀任意类型注解并成为硬关键字(仅注解前缀
  合法,`const = 1` / `a: const` 报语法错误),解析层脱糖为等价的 `CConst | T` /
  `CVolatile | T`,与手写 TypeSet 完全同形;`const T*` 得 `CConst | CPtr[T]`;
  `T*` / `&x` 不再要求 import t(回退 builtins 的 rawptr);描述符按「前缀限定符」
  渲染(`const int` / `const volatile int` / `const rawptr[int]`)而不泄漏为联合成员
- 新增 `inline while` / `inline for`;`const` / `volatile` / `inline` 高亮为修饰符
- 新增内建类型名 uint / uchar,并把 rawptr / sizet / int8..uint64 / uintfast* /
  uintleast* 等内建到 builtins.vpi,任意 Viper 工程无需配置 includes
- 新增 `virtual` / `novirtual` 声明修饰符(等价 @t.CVTable / @t.NoVTable),
  含放置位置校验,并并入补全与高亮
- `(T**)x` 两级指针强转修复:指针类型后缀统一按类型表达式求值,不再被当成解引用
- 裸内置内联汇编 / LLVM IR:`__asm__` / `asminp` / `asmout` / `__llvmir__` /
  `irinp` / `irout` / `ASM_DESCR`,与 c.* / t.ASM_DESCR 写法等价
- `X | t.CPtr` 在 X 本身是指针时再包一层(HANDLE | t.CPtr = void**),
  修复 CreatePipe 一类 LPHANDLE 的「跨级指针隐式转换不允许」误报
- 补全并入 Viper 专有关键字(define / const / volatile / typedef / inline / export /
  extern / virtual / novirtual / enum / rnum / union / struct / fn / fun / func / function)
- `T*(x)`:裸模块名 + 模块内同名类归一为 CPtr[bootinfo];并按 TPC `_AtPtrSuffixCall`
  的判据把「类型原子 + 紧贴星串 + 紧贴 (」解析为调用,使
  `uint32*(info.vendor_id)[0] = res.ebx` 成为合法赋值目标
- 新增「重复声明」检查:模块级已有同名运行期变量时,函数内再用类型注解声明同名
  变量无条件报 TypeError(与 TPV AssignGenMixin 同口径);排除 CDefine 宏、CTypedef
  别名、同名函数/类与类体成员。合法写法只剩 `global x` + 无注解赋值,或换名
- 支持 `__attribute__`:装饰器 `@__attribute__(...)` 脱糖为
  `@c.Attribute(t.attr.X, ...)`;注解修饰器 `a: __attribute__(...) const int`
  脱糖为 `t.attr.X | (CConst | int)`;注解联合中的 `t.attr.*` 标记求值为 t.CAttr
  修饰符(运算/下标/赋值/展示均按被修饰的基础类型处理);值位置
  `volatile f()` / `volatile 结构体()` 前缀;`__a` 补全、括号内属性名补全与悬停、
  TextMate 高亮
- 注解位置小写 `callable[[A, B], R]` 等价 t.Callable:parser 仅在类型注解位置把裸名
  `callable` 脱糖为 `Callable`,builtins.vpi 内建 `Callable` 别名(无需 import t);
  值位置 `callable(x)` 仍是内置函数
- 版本号提升至 1.1.426 并更新 CHANGELOG;新增 6 个回归测试文件、更新 4 个,
  全量 64 套件 / 794 用例全绿(另有 1 套件 8 用例为既有 skip)
2026-09-27 12:50:02 +08:00

69 lines
1.9 KiB
JSON

{
"name": "vipeye",
"displayName": "Vipeye",
"description": "Type checker for the Viper language",
"version": "1.1.426",
"license": "MIT",
"author": {
"name": "TermiNexus"
},
"publisher": "terminexus",
"engines": {
"node": ">=14.0.0"
},
"repository": {
"type": "git",
"url": "https://github.com/TermiNexus/Viper_VSCode",
"directory": "packages/vipeye"
},
"scripts": {
"build": "rspack build -c rspack.config.js --mode production",
"clean": "shx rm -rf ./dist ./out README.md LICENSE.txt",
"prepack": "npm run clean && shx cp ../../README.md . && shx cp ../../LICENSE.txt . && npm run build",
"webpack": "rspack build -c rspack.config.js --mode development"
},
"optionalDependencies": {
"fsevents": "~2.3.3"
},
"devDependencies": {
"@rspack/cli": "^2.0.5",
"@rspack/core": "^2.0.5",
"@types/node": "^25.9.2",
"copy-webpack-plugin": "^14.0.0",
"esbuild-loader": "^4.5.0",
"shx": "^0.4.0",
"ts-loader": "^9.5.4",
"typescript": "~6.0.3",
"webpack": "^5.104.1"
},
"files": [
"/dist",
"LICENSE.txt"
],
"main": "index.js",
"bin": {
"vipeye": "index.js",
"vipeye-langserver": "langserver.index.js"
},
"contributes": {
"configuration": {
"title": "Vipeye",
"properties": {
"viper.analysis.dialect": {
"type": "string",
"enum": [
"python",
"viper"
],
"default": "viper",
"description": "Language dialect for analysis. 'viper' enables Viper-specific semantic short-circuits.",
"scope": "resource"
}
}
}
},
"overrides": {
"tar": "7.5.11"
}
}