@cella-lang/cfamily 0.1.202611080415 → 0.1.202611080959

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGES.md CHANGED
@@ -2,6 +2,29 @@
2
2
 
3
3
  ## 未發佈
4
4
 
5
+ - **語意樹新增 `eStaticCall (n : NodeId) (owner : TypeSyntax) (f : String) (args : List Expr)`**(只做加法;**待 semorphe 同意**):
6
+ 經類別呼叫靜態成員函式、類別寫成型別(`std::numeric_limits<int>::max()` 是 owner `tTemplate "std::numeric_limits" [tInt]`)。
7
+ owner 可以是任何指到類別的型別,之後 `tMember`(`vector<int>::size_type` 一類)也共用。產生的走訪(syntaxwalk、syntaxcollect、
8
+ syntaxtypes、syntaxnodes)重產;印出是 `T::f(args)`;效果摘要當成可能呼叫任何函式(C++ 在檢查前把它降成 `C::f` 的呼叫)。
9
+ - **沒有標籤的 struct、union 與匿名成員**(C11 6.7.2.1p13;**新的寫法待 semorphe 同意**,只做加法:舊的樹照舊可讀):
10
+ - 沒有標籤的定義(`struct { … } v;`、成員 `union { … } v;`、`typedef struct { … } Point;`)照舊送一個 iStruct/iUnion,名字由
11
+ 前端合成成 C 寫不出來的 `(unnamed struct at <節點>)`/`(unnamed union at <節點>)`(clang 的叫法),用到的地方用 tStruct/tUnion
12
+ 指它:`{"k": "iUnion", "d": {"k": "sdef", "n": "n12", "name": "(unnamed union at n12)", "fields": [...]}}`,
13
+ `{"k": "fld", "name": "v", "t": {"k": "tUnion", "name": "(unnamed union at n12)"}}`。定義排在用到它的定義之前。
14
+ - 匿名成員是名字為空字串的 fld,型別是那個 union/struct:`{"k": "fld", "name": "", "t": {"k": "tUnion", "name": "(unnamed union at n21)"}}`。
15
+ 名字為空字串、型別不是 struct/union 的照舊是沒有名字的位元欄位。
16
+ - **之前判 reject、現在照標準執行**:`s.i`、`p->i` 往匿名成員裡找(可以多層);初始化時匿名成員是一格(大括號可以省略:
17
+ `struct S s2 = {7, 8};`),指定子可以直接寫匿名成員裡的名字(`{.z = 3, .x = 1}`;進到匿名 union 的指定子照舊 unknown)。
18
+ - 型別的文字(訊息、`params` 的 from/to)照 clang 去掉位置:`union (unnamed union)`、`struct (unnamed struct)`。
19
+ - 除錯器的值:匿名成員只寫它的值(`{tag = 3, {a = 1, b = 2}}`,gdb 的寫法);路徑不寫空的名字(`s.i`)。
20
+ - generate:沒有標籤的定義寫在用到它的地方(`struct { int k; union { int i; double d; } v; } Value;`、
21
+ `union { int i; float f; };`),定義本身不另外印。區塊裡的(`sType`)還沒做,照字面印。
22
+ - 新的 API:`Tag.isUnnamed`、`Tag.shown`、`Field.isAnonymous`、`FieldTy.isAnonymous`、`FieldTy.isUnnamedBitField`、
23
+ `Ty.memberThrough`、`Ty.memberInside`、`Print.unnamedDefinitions`、`TypeSyntax.unnamedPrinted`、`StructDefinition.isUnnamed`。
24
+ - ⚠️ 不相容:`Ty.memberNamed` 拿掉(換成 `Ty.memberThrough`,多回傳路上的匿名成員);`Designator.memberPlace`、`Designator.place`
25
+ 多回傳「指定子要不要接著進到那一格」(`Option (Nat * Bool)`)。
26
+ - 不做:C++ 的類別(`mbField`、`mbUnion`)的匿名 union,轉換工具照舊寫成具名的 `__cella_anon_k`。
27
+
5
28
  - **下標的兩邊可以對調**(C11 6.5.2.1p2、C++17 [expr.sub]p1:`E1[E2]` 就是 `*((E1)+(E2))`):`4[arr]`、`1[p]` 之前判 reject
6
29
  (subscripted value is not an array or pointer),現在和 `arr[4]` 同一個左值;兩邊都不是指標照舊 reject。新增 `CheckDialect.pointerSubscript`。
7
30
  - **效果摘要看函式庫呼叫的引數**:函式庫函式「只經過某些引數寫」時(`LibraryFunction.writesThrough`:sprintf、snprintf 的緩衝,
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file