Skip to content

Commit 6d23386

Browse files
committed
update std/jule/sema
1 parent 92771aa commit 6d23386

File tree

1 file changed

+27
-9
lines changed

1 file changed

+27
-9
lines changed

src/std/jule-sema.md

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
[struct StructLitExpr](#structlitexpr)\
2828
[struct AllocStructLitExpr](#allocstructlitexpr)\
2929
[struct CastingExpr](#castingexpr)\
30+
[struct TypeAssertionExpr](#typeassertionexpr)\
3031
[struct FuncCallExpr](#funccallexpr)\
3132
[struct SliceExpr](#sliceexpr)\
3233
[struct IndexingExpr](#indexingexpr)\
@@ -81,7 +82,6 @@
8182
[struct TypeEnum](#typeenum)\
8283
    [fn Str\(self\): str](#str-3)\
8384
    [fn Equal\(&self, other: &Type\): bool](#equal-3)\
84-
    [fn FindItem\(mut self, ident: str\): &TypeEnumItem](#finditem-1)\
8585
[struct Impl](#impl)\
8686
    [fn IsTraitImpl\(self\): bool](#istraitimpl)\
8787
    [fn IsStructImpl\(self\): bool](#isstructimpl)\
@@ -156,6 +156,8 @@
156156
    [fn IsInitialized\(self\): bool](#isinitialized)\
157157
    [fn IsTypeInferred\(self\): bool](#istypeinferred)\
158158
[struct FuncPattern](#funcpattern)\
159+
    [static fn Main\(f: &Func\): bool](#main)\
160+
    [static fn Init\(f: &Func\): bool](#init)\
159161
    [static fn Str\(f: &Func\): bool](#str-6)\
160162
[struct Value](#value)\
161163
    [fn IsNil\(self\): bool](#isnil)\
@@ -568,7 +570,17 @@ struct CastingExpr {
568570
Type: &Type
569571
}
570572
```
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\)
572584

573585
## FuncCallExpr
574586
```jule
@@ -1030,7 +1042,6 @@ Returns item by identifier\. Returns nil if not exist any item in this identifie
10301042
```jule
10311043
struct TypeEnumItem {
10321044
Token: &token::Token
1033-
Ident: str
10341045
TypeSym: &TypeSym
10351046
}
10361047
```
@@ -1063,12 +1074,6 @@ fn Equal(&self, other: &Type): bool
10631074
```
10641075
Reports whether types are same\.
10651076

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-
10721077
## Impl
10731078
```jule
10741079
struct Impl {
@@ -1755,6 +1760,18 @@ struct FuncPattern{}
17551760
```
17561761
Pattern checker for functions and methods\.
17571762

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+
17581775
### Str
17591776
```jule
17601777
static fn Str(f: &Func): bool
@@ -2380,6 +2397,7 @@ enum Expr: type {
23802397
&ChanRecv,
23812398
&ChanSend,
23822399
&BuiltinCloseCallExpr,
2400+
&TypeAssertionExpr,
23832401
}
23842402
```
23852403
Expression model\.

0 commit comments

Comments
 (0)