@cella-lang/cpp 0.1.202611082213 → 0.1.202611090959
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 +18 -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.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 +440 -416
- package/package.json +6 -6
package/CHANGES.md
CHANGED
|
@@ -5,6 +5,24 @@
|
|
|
5
5
|
|
|
6
6
|
## 未發佈
|
|
7
7
|
|
|
8
|
+
- **之前判 unknown、現在判 reject**:標準串流當二元運算子的運算元、而 std::ostream/std::istream 沒有那個運算子(學生把 `<<` 打成
|
|
9
|
+
`<`:`cout < "Hello!";`、`int x; cin < x;`;`cout + x`、`x == cin`、`cerr < 1`),判 reject operandTypes,字照 clang:
|
|
10
|
+
「invalid operands to binary expression ('ostream' (aka 'basic_ostream<char>') and 'const char[7]')」(另一邊的型別照寫的、陣列
|
|
11
|
+
不退化)。之前程式別處沒有寫 `ostream`/沒有讀標準輸入時,模型沒有 cout/cin 的物件,判 unknown「the model's std::cout is not an
|
|
12
|
+
object this program can use as an operand」;有物件時判 reject 但字是「invalid operands to a binary operator」。`<<`、`>>`(標準
|
|
13
|
+
庫有)與 `&&`、`||`(經 explicit operator bool)不在內,照舊。新的 API:`Operators.streamOperand`、`Operators.streamText`、
|
|
14
|
+
`Operators.operandText`、`Operators.streamMismatch`。
|
|
15
|
+
- **`cout < "Hello!" << endl`**(`<<` 比 `<` 先結合,成了 `"Hello!" << endl`):二元運算子的運算元是 std::endl 時判 reject,字照
|
|
16
|
+
clang 的第一個錯誤「reference to overloaded function could not be resolved; did you mean to call it?」,指到 endl。新的 API:
|
|
17
|
+
`Streams.manipulatorOperand`。endl 用在初始化、指定等其他位置的字(clang 是另外的句子)還沒有做。
|
|
18
|
+
- **比較、相等、邏輯與 `!` 的型別改成 bool**([expr.rel]p1、[expr.eq]p1、[expr.log.and]p1、[expr.log.or]p1、[expr.unary.op]p9;
|
|
19
|
+
之前照 C 的規則是 int)。**型別表(`types()` 的 `nodes`)的回報值改變**:`a > 5`、`a == b`、`d < 1.0`、`p != nullptr`、`a && b`、
|
|
20
|
+
`!a` 的節點、`auto x = a > b;` 的 `x` 回報 `bool`(之前 `int`)。跟著改對的判決與輸出(之前和 clang 不同):`sizeof(a > 5)` 是 1
|
|
21
|
+
(之前 4);多載 `f(bool)`/`f(int)` 選 `f(bool)`(之前選 `f(int)`);`auto x = a > b; x = 5;` 的 `x` 是 1(之前 5);樣板從
|
|
22
|
+
`a < b` 推導出 `T = bool`;`cout << boolalpha << (a > b)` 印 `true`(之前印 `1`)。
|
|
23
|
+
- 轉換工具:`cout << boolalpha`(連 `std::` 與否)、`hex`、`fixed`、`flush` 等操縱子轉成 `eManip`(之前轉成名字,判「use of
|
|
24
|
+
undeclared identifier 'boolalpha'」)。
|
|
25
|
+
|
|
8
26
|
- **之前判 reject、現在判 accept**:經類別名取靜態成員、名字由 Cella 解析的寫法(`eName "C::n"`):`cout << C::n`、`C::n = 7`、
|
|
9
27
|
`&C::n`、`Logger::current->log("hi")`、`Logger::current->prefix`、`Logger::twice` 當值、`Outer::Inner::k`、`ns::D::m`、
|
|
10
28
|
`Derived::shared`(基底的);之前判「use of undeclared identifier 'C::n'」(見 `@cella-lang/cfamily` 的名字解析)。巢狀類別與
|
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
|
package/cpp.library.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
|