Skip to content

Commit

Permalink
remove func pkg and show self_ty
Browse files Browse the repository at this point in the history
  • Loading branch information
He1pa committed Sep 8, 2023
1 parent e6514b3 commit b878ac4
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 151 deletions.
2 changes: 0 additions & 2 deletions kclvm/sema/src/builtin/decorator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ macro_rules! register_decorator {

register_decorator! {
deprecated => Type::function(
Some("Decorator".to_string()),
None,
Rc::new(Type::ANY),
&[
Expand Down Expand Up @@ -54,7 +53,6 @@ register_decorator! {
None,
)
info => Type::function(
Some("Decorator".to_string()),
None,
Rc::new(Type::ANY),
&[],
Expand Down
27 changes: 0 additions & 27 deletions kclvm/sema/src/builtin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ macro_rules! register_builtin {

register_builtin! {
option => Type::function(
Some("Builtin".to_string()),
None,
Rc::new(Type::ANY),
&[
Expand Down Expand Up @@ -79,7 +78,6 @@ register_builtin! {
Some(1),
)
print => Type::function(
Some("Builtin".to_string()),
None,
Rc::new(Type::ANY),
&[],
Expand All @@ -92,7 +90,6 @@ register_builtin! {
Some(0),
)
multiplyof => Type::function(
Some("Builtin".to_string()),
None,
Rc::new(Type::BOOL),
&[
Expand All @@ -112,7 +109,6 @@ register_builtin! {
Some(0),
)
isunique => Type::function(
Some("Builtin".to_string()),
None,
Rc::new(Type::BOOL),
&[
Expand All @@ -127,7 +123,6 @@ register_builtin! {
None,
)
len => Type::function(
Some("Builtin".to_string()),
None,
Rc::new(Type::INT),
&[
Expand All @@ -142,7 +137,6 @@ register_builtin! {
None,
)
abs => Type::function(
Some("Builtin".to_string()),
None,
Rc::new(Type::ANY),
&[
Expand All @@ -157,7 +151,6 @@ register_builtin! {
None,
)
all_true => Type::function(
Some("Builtin".to_string()),
None,
Rc::new(Type::BOOL),
&[
Expand All @@ -174,7 +167,6 @@ register_builtin! {
None,
)
any_true => Type::function(
Some("Builtin".to_string()),
None,
Rc::new(Type::BOOL),
&[
Expand All @@ -191,7 +183,6 @@ register_builtin! {
None,
)
hex => Type::function(
Some("Builtin".to_string()),
None,
Rc::new(Type::STR),
&[
Expand All @@ -206,7 +197,6 @@ register_builtin! {
None,
)
bin => Type::function(
Some("Builtin".to_string()),
None,
Rc::new(Type::STR),
&[
Expand All @@ -221,7 +211,6 @@ register_builtin! {
None,
)
oct => Type::function(
Some("Builtin".to_string()),
None,
Rc::new(Type::STR),
&[
Expand All @@ -236,7 +225,6 @@ register_builtin! {
None,
)
ord => Type::function(
Some("Builtin".to_string()),
None,
Rc::new(Type::INT),
&[
Expand All @@ -251,7 +239,6 @@ register_builtin! {
None,
)
sorted => Type::function(
Some("Builtin".to_string()),
None,
Type::list_ref(Rc::new(Type::ANY)),
&[
Expand All @@ -274,7 +261,6 @@ register_builtin! {
Some(1),
)
range => Type::function(
Some("Builtin".to_string()),
None,
Type::list_ref(Rc::new(Type::INT)),
&[
Expand All @@ -299,7 +285,6 @@ register_builtin! {
None,
)
max => Type::function(
Some("Builtin".to_string()),
None,
Rc::new(Type::ANY),
&[],
Expand All @@ -311,7 +296,6 @@ register_builtin! {
None,
)
min => Type::function(
Some("Builtin".to_string()),
None,
Rc::new(Type::ANY),
&[],
Expand All @@ -323,7 +307,6 @@ register_builtin! {
None,
)
sum => Type::function(
Some("Builtin".to_string()),
None,
Rc::new(Type::ANY),
&[
Expand All @@ -345,7 +328,6 @@ register_builtin! {
None,
)
pow => Type::function(
Some("Builtin".to_string()),
None,
Type::number(),
&[
Expand Down Expand Up @@ -373,7 +355,6 @@ register_builtin! {
None,
)
round => Type::function(
Some("Builtin".to_string()),
None,
Type::number(),
&[
Expand All @@ -397,7 +378,6 @@ register_builtin! {
None,
)
zip => Type::function(
Some("Builtin".to_string()),
None,
Type::list_ref(Rc::new(Type::ANY)),
&[],
Expand All @@ -408,7 +388,6 @@ register_builtin! {
None,
)
int => Type::function(
Some("Builtin".to_string()),
None,
Rc::new(Type::INT),
&[
Expand All @@ -429,7 +408,6 @@ register_builtin! {
None,
)
float => Type::function(
Some("Builtin".to_string()),
None,
Rc::new(Type::FLOAT),
&[
Expand All @@ -444,7 +422,6 @@ register_builtin! {
None,
)
bool => Type::function(
Some("Builtin".to_string()),
None,
Rc::new(Type::BOOL),
&[
Expand All @@ -461,7 +438,6 @@ register_builtin! {
None,
)
str => Type::function(
Some("Builtin".to_string()),
None,
Rc::new(Type::STR),
&[
Expand All @@ -479,7 +455,6 @@ register_builtin! {
None,
)
list => Type::function(
Some("Builtin".to_string()),
None,
Type::list_ref(Rc::new(Type::ANY)),
&[
Expand All @@ -497,7 +472,6 @@ register_builtin! {
None,
)
dict => Type::function(
Some("Builtin".to_string()),
None,
Type::dict_ref(Rc::new(Type::ANY), Rc::new(Type::ANY)),
&[
Expand All @@ -512,7 +486,6 @@ register_builtin! {
None,
)
typeof => Type::function(
Some("Builtin".to_string()),
None,
Rc::new(Type::STR),
&[
Expand Down
Loading

0 comments on commit b878ac4

Please sign in to comment.