|
27 | 27 | [struct StructLitExpr](#structlitexpr)\ |
28 | 28 | [struct AllocStructLitExpr](#allocstructlitexpr)\ |
29 | 29 | [struct CastingExpr](#castingexpr)\ |
| 30 | +[struct TypeAssertionExpr](#typeassertionexpr)\ |
30 | 31 | [struct FuncCallExpr](#funccallexpr)\ |
31 | 32 | [struct SliceExpr](#sliceexpr)\ |
32 | 33 | [struct IndexingExpr](#indexingexpr)\ |
|
81 | 82 | [struct TypeEnum](#typeenum)\ |
82 | 83 | [fn Str\(self\): str](#str-3)\ |
83 | 84 | [fn Equal\(&self, other: &Type\): bool](#equal-3)\ |
84 | | - [fn FindItem\(mut self, ident: str\): &TypeEnumItem](#finditem-1)\ |
85 | 85 | [struct Impl](#impl)\ |
86 | 86 | [fn IsTraitImpl\(self\): bool](#istraitimpl)\ |
87 | 87 | [fn IsStructImpl\(self\): bool](#isstructimpl)\ |
|
156 | 156 | [fn IsInitialized\(self\): bool](#isinitialized)\ |
157 | 157 | [fn IsTypeInferred\(self\): bool](#istypeinferred)\ |
158 | 158 | [struct FuncPattern](#funcpattern)\ |
| 159 | + [static fn Main\(f: &Func\): bool](#main)\ |
| 160 | + [static fn Init\(f: &Func\): bool](#init)\ |
159 | 161 | [static fn Str\(f: &Func\): bool](#str-6)\ |
160 | 162 | [struct Value](#value)\ |
161 | 163 | [fn IsNil\(self\): bool](#isnil)\ |
@@ -568,7 +570,17 @@ struct CastingExpr { |
568 | 570 | Type: &Type |
569 | 571 | } |
570 | 572 | ``` |
571 | | -Casting expression model\. For example: \(int\)\(my\_float\) |
| 573 | +Casting expression model\. For example: \(int\)\(myFloat\) |
| 574 | + |
| 575 | +## TypeAssertionExpr |
| 576 | +```jule |
| 577 | +struct TypeAssertionExpr { |
| 578 | + Token: &token::Token |
| 579 | + Expr: &Value |
| 580 | + Type: &Type |
| 581 | +} |
| 582 | +``` |
| 583 | +Type assertion expression model\. For example: myExpr\.\(destType\) |
572 | 584 |
|
573 | 585 | ## FuncCallExpr |
574 | 586 | ```jule |
@@ -1030,7 +1042,6 @@ Returns item by identifier\. Returns nil if not exist any item in this identifie |
1030 | 1042 | ```jule |
1031 | 1043 | struct TypeEnumItem { |
1032 | 1044 | Token: &token::Token |
1033 | | - Ident: str |
1034 | 1045 | TypeSym: &TypeSym |
1035 | 1046 | } |
1036 | 1047 | ``` |
@@ -1063,12 +1074,6 @@ fn Equal(&self, other: &Type): bool |
1063 | 1074 | ``` |
1064 | 1075 | Reports whether types are same\. |
1065 | 1076 |
|
1066 | | -### FindItem |
1067 | | -```jule |
1068 | | -fn FindItem(mut self, ident: str): &TypeEnumItem |
1069 | | -``` |
1070 | | -Returns item by identifier\. Returns nil if not exist any item in this identifier\. |
1071 | | - |
1072 | 1077 | ## Impl |
1073 | 1078 | ```jule |
1074 | 1079 | struct Impl { |
@@ -1755,6 +1760,18 @@ struct FuncPattern{} |
1755 | 1760 | ``` |
1756 | 1761 | Pattern checker for functions and methods\. |
1757 | 1762 |
|
| 1763 | +### Main |
| 1764 | +```jule |
| 1765 | +static fn Main(f: &Func): bool |
| 1766 | +``` |
| 1767 | +Reports whether function is the reserved main function\. |
| 1768 | + |
| 1769 | +### Init |
| 1770 | +```jule |
| 1771 | +static fn Init(f: &Func): bool |
| 1772 | +``` |
| 1773 | +Reports whether function is the reserved init function\. |
| 1774 | + |
1758 | 1775 | ### Str |
1759 | 1776 | ```jule |
1760 | 1777 | static fn Str(f: &Func): bool |
@@ -2380,6 +2397,7 @@ enum Expr: type { |
2380 | 2397 | &ChanRecv, |
2381 | 2398 | &ChanSend, |
2382 | 2399 | &BuiltinCloseCallExpr, |
| 2400 | + &TypeAssertionExpr, |
2383 | 2401 | } |
2384 | 2402 | ``` |
2385 | 2403 | Expression model\. |
|
0 commit comments