@cella-lang/cpp 0.1.202611080524 → 0.1.202611082213
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 +37 -0
- package/cpp.arrays.cell +0 -0
- package/cpp.cell +0 -0
- package/cpp.classes.cell +0 -0
- package/cpp.classrules.cell +0 -0
- package/cpp.construction.cell +0 -0
- package/cpp.constructs.cell +0 -0
- package/cpp.copies.cell +0 -0
- package/cpp.exceptions.cell +0 -0
- package/cpp.inheritance.cell +0 -0
- package/cpp.lambdas.cell +0 -0
- package/cpp.layouts.cell +0 -0
- package/cpp.library.algorithms.cell +0 -0
- package/cpp.library.bitsets.cell +0 -0
- package/cpp.library.cell +0 -0
- package/cpp.library.comparisons.cell +0 -0
- package/cpp.library.deques.cell +0 -0
- package/cpp.library.iterators.cell +0 -0
- package/cpp.library.limits.cell +0 -0
- package/cpp.library.lists.cell +0 -0
- package/cpp.library.maps.cell +0 -0
- package/cpp.library.numerics.cell +0 -0
- package/cpp.library.pairs.cell +0 -0
- package/cpp.library.queues.cell +0 -0
- package/cpp.library.sets.cell +0 -0
- package/cpp.library.stacks.cell +0 -0
- package/cpp.library.streamiterators.cell +0 -0
- package/cpp.library.strings.cell +0 -0
- package/cpp.library.trees.cell +0 -0
- package/cpp.library.tuples.cell +0 -0
- package/cpp.library.unorderedmaps.cell +0 -0
- package/cpp.library.vectors.cell +0 -0
- package/cpp.memberpointers.cell +0 -0
- package/cpp.names.cell +0 -0
- package/cpp.objects.cell +0 -0
- package/cpp.operators.cell +0 -0
- package/cpp.overloading.cell +0 -0
- package/cpp.polymorphism.cell +0 -0
- package/cpp.primitives.cell +0 -0
- package/cpp.ranges.cell +0 -0
- package/cpp.references.cell +0 -0
- package/cpp.runtimetypes.cell +0 -0
- package/cpp.standardexceptions.cell +0 -0
- package/cpp.standardfunctions.cell +0 -0
- package/cpp.staticmembers.cell +0 -0
- package/cpp.streams.cell +0 -0
- package/cpp.templates.cell +0 -0
- package/cpp.userconversions.cell +0 -0
- package/index.json +618 -586
- package/package.json +6 -6
package/CHANGES.md
CHANGED
|
@@ -5,6 +5,43 @@
|
|
|
5
5
|
|
|
6
6
|
## 未發佈
|
|
7
7
|
|
|
8
|
+
- **之前判 reject、現在判 accept**:經類別名取靜態成員、名字由 Cella 解析的寫法(`eName "C::n"`):`cout << C::n`、`C::n = 7`、
|
|
9
|
+
`&C::n`、`Logger::current->log("hi")`、`Logger::current->prefix`、`Logger::twice` 當值、`Outer::Inner::k`、`ns::D::m`、
|
|
10
|
+
`Derived::shared`(基底的);之前判「use of undeclared identifier 'C::n'」(見 `@cella-lang/cfamily` 的名字解析)。巢狀類別與
|
|
11
|
+
命名空間裡的類別的靜態成員函式(`Outer::Inner::half`、`ns::D::tag`)當值與呼叫也判 accept 了(之前轉換工具用短名,判 undeclared)。
|
|
12
|
+
- **類別沒有的成員**:經類別名寫、類別(連基底)沒有的成員(`int v = C::m;`)判 reject「no member named 'm' in 'C'」(clang 的字;
|
|
13
|
+
之前是「use of undeclared identifier 'C::m'」)。新的 API:`StaticMembers.missing`。
|
|
14
|
+
- 還不支援類別樣板實例的靜態資料成員(`C<int>::n`)。
|
|
15
|
+
|
|
16
|
+
- **新增 enum class/enum struct**([dcl.enum];語意樹的新形狀 `iEnumClass`,見 `@cella-lang/cfamily`,和 semorphe 談定)。之前轉換
|
|
17
|
+
工具把它當一般的列舉:`int x = Color::Red;`、`Color::Red == 1`、裸寫的 `Red`、`cout << Color::Red` 判 accept(錯的 accept),寫了
|
|
18
|
+
`: long long` 的值判 reject(base 被丟掉)。現在常數只以 `Color::Red` 寫(裸寫判 undeclared);不隱式轉成整數或浮點數
|
|
19
|
+
(`static_cast` 可以);只和同一個列舉比較;`switch` 的 case 寫 `Color::Red`;沒寫 base 時 sizeof 是 int 的,寫了時大小與值的範圍
|
|
20
|
+
照 base(超出判 reject);`cout << Color::Red` 判 reject。拒絕的字照 clang(例如「cannot initialize a variable of type 'int' with an
|
|
21
|
+
rvalue of type 'Color'」「invalid operands to binary expression ('Color' and 'int')」)。
|
|
22
|
+
- **之前判 unknown 或 reject、現在判 accept**:`using namespace std` 之後不帶 `std::` 的標準型別名(`void show(ostream &out, int v)`、
|
|
23
|
+
`catch (const length_error &e) { e.what(); }`、`catch (const exception &e)`)。之前它們是 `tClass "ostream"`、`tClass
|
|
24
|
+
"length_error"`,模型找不到那個類別(`show(cout, 5)` 判 unknown、`e.what()` 判 reject「no member named 'what' in 'length_error'」);
|
|
25
|
+
現在照標準名字表(`cpp.standardnames`)寫成模型的 `tOstream`、`tStdExc`。新的 API:`Names.qualifiedStandardTypes`、
|
|
26
|
+
`Names.standardType`(模型造的 std 類別:標準例外、std::ostream、std::istream)、`Names.standardTypeName`、`Names.enumeratorName`。
|
|
27
|
+
- 經 `istream &`(或 `ostream &`)的物件用運算子(`in >> x`)判 unknown(`Operators.unmodeledStream`):模型的這兩個類別是空的,
|
|
28
|
+
讀寫只在串流的敘述裡。之前寫 `std::istream &` 時判 reject「invalid operands to a binary operator」(錯的 reject);不帶 `std::`
|
|
29
|
+
的 `istream &` 之前是找不到的類別(unknown),這一輪解析到 std::istream 之後才露出來。
|
|
30
|
+
- `Streams.kindOf` 對 scoped 列舉的拒絕改成結構化的 `operandTypes`(之前是一句「cannot print this type with std::cout」)。
|
|
31
|
+
|
|
32
|
+
- **之前判 unknown(the model's 'std::vector<int>' has no member 'reserve')、現在照 [vector.capacity]**:`v.reserve(n)` 不改大小;
|
|
33
|
+
容量小於 n 時換成剛好 n 個的區塊(libc++ 的做法,`capacity()` 照舊附 vector.growth 的假設),一定重新配置,之前拿到的迭代器、
|
|
34
|
+
指標、參考失效,之後經它們存取判 reject(ubDangling,不附假設);容量夠時什麼都不做。n 大於 `max_size()` 丟
|
|
35
|
+
`std::length_error("vector")`。新增 `max_size()`(libc++ 的值:size_t 的最大值除以元素大小,上限是 ptrdiff_t 的最大值;附
|
|
36
|
+
vector.max_size 的假設)。
|
|
37
|
+
- **之前判 unknown(std::next_permutation is not supported yet)、現在判 accept**:`std::next_permutation`、`std::prev_permutation`
|
|
38
|
+
([alg.permutation.generators]),沒有比較子的照 `*i < *j`,也可以給比較子(函式、函式物件);照 libc++ 的步驟。
|
|
39
|
+
- **之前判 reject(callArguments)、現在判 accept**:前端只送名字(`eName "cout"`,由 Cella 解析)時,`cout` 當運算元
|
|
40
|
+
(`ostream_iterator<int>(cout, " ")`、交給參數是 `std::ostream &` 的函式)是標準輸出的那一個物件。之前 `eName "cout"` 解析成
|
|
41
|
+
`eStdout`,而 `eStdout` 當運算式是 C 的 `FILE *`(stdout),建構子的引數對不上;現在運算元的位置解析成 `eConst "cout"`
|
|
42
|
+
(見 `@cella-lang/cfamily`)。`cin` 當運算元(`eConst "cin"`)在程式有 std::istream 的物件時是它;模型沒有那個物件時,以及 `cerr`
|
|
43
|
+
當運算元(模型的 cerr 只在輸出敘述裡寫),判 unknown(之前 `readOne(cin)` 判 reject「use of undeclared identifier 'cin'」)。
|
|
44
|
+
|
|
8
45
|
- **之前判 reject(this construct is not part of C++)、現在判 accept**:`std::swap<T>(a, b)`(寫明樣板引數)。T 寫明時兩個引數
|
|
9
46
|
要是 T 的左值,或兩個同長度的 T 陣列(陣列的多載,`swap<int>(p, q)`);交換和 `std::swap(a, b)` 相同。`swap<long>(int, int)`、
|
|
10
47
|
`swap<const int>` 判 reject(no matching std::swap);參考或兩個以上的樣板引數判 unknown。semorphe 照舊送 `eCallT`。
|
package/cpp.arrays.cell
CHANGED
|
Binary file
|
package/cpp.cell
CHANGED
|
Binary file
|
package/cpp.classes.cell
CHANGED
|
Binary file
|
package/cpp.classrules.cell
CHANGED
|
Binary file
|
package/cpp.construction.cell
CHANGED
|
Binary file
|
package/cpp.constructs.cell
CHANGED
|
Binary file
|
package/cpp.copies.cell
CHANGED
|
Binary file
|
package/cpp.exceptions.cell
CHANGED
|
Binary file
|
package/cpp.inheritance.cell
CHANGED
|
Binary file
|
package/cpp.lambdas.cell
CHANGED
|
Binary file
|
package/cpp.layouts.cell
CHANGED
|
Binary file
|
|
Binary file
|
package/cpp.library.bitsets.cell
CHANGED
|
Binary file
|
package/cpp.library.cell
CHANGED
|
Binary file
|
|
Binary file
|
package/cpp.library.deques.cell
CHANGED
|
Binary file
|
|
Binary file
|
package/cpp.library.limits.cell
CHANGED
|
Binary file
|
package/cpp.library.lists.cell
CHANGED
|
Binary file
|
package/cpp.library.maps.cell
CHANGED
|
Binary file
|
|
Binary file
|
package/cpp.library.pairs.cell
CHANGED
|
Binary file
|
package/cpp.library.queues.cell
CHANGED
|
Binary file
|
package/cpp.library.sets.cell
CHANGED
|
Binary file
|
package/cpp.library.stacks.cell
CHANGED
|
Binary file
|
|
Binary file
|
package/cpp.library.strings.cell
CHANGED
|
Binary file
|
package/cpp.library.trees.cell
CHANGED
|
Binary file
|
package/cpp.library.tuples.cell
CHANGED
|
Binary file
|
|
Binary file
|
package/cpp.library.vectors.cell
CHANGED
|
Binary file
|
package/cpp.memberpointers.cell
CHANGED
|
Binary file
|
package/cpp.names.cell
CHANGED
|
Binary file
|
package/cpp.objects.cell
CHANGED
|
Binary file
|
package/cpp.operators.cell
CHANGED
|
Binary file
|
package/cpp.overloading.cell
CHANGED
|
Binary file
|
package/cpp.polymorphism.cell
CHANGED
|
Binary file
|
package/cpp.primitives.cell
CHANGED
|
Binary file
|
package/cpp.ranges.cell
CHANGED
|
Binary file
|
package/cpp.references.cell
CHANGED
|
Binary file
|
package/cpp.runtimetypes.cell
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/cpp.staticmembers.cell
CHANGED
|
Binary file
|
package/cpp.streams.cell
CHANGED
|
Binary file
|
package/cpp.templates.cell
CHANGED
|
Binary file
|
package/cpp.userconversions.cell
CHANGED
|
Binary file
|