Skip to content

Commit 023fc4b

Browse files
authored
Merge pull request #64 from behemehal/dev
v0.6.0
2 parents b200212 + da91a9c commit 023fc4b

43 files changed

Lines changed: 1255 additions & 206 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,10 @@
1313
- [TECHNICAL] Save function's parameter name and type cursor positions separately [5ab7849dd09407baea6a39a47803a3c6e953314b](https://github.com/behemehal/Ellie-Language/commit/5ab7849dd09407baea6a39a47803a3c6e953314b)
1414
- Fix the situation that ret cant be void. [97e877e5d08ca800e1c3c0394e09a158276a2d50](https://github.com/behemehal/Ellie-Language/commit/97e877e5d08ca800e1c3c0394e09a158276a2d50)
1515
- [Major] Fix cursor issues with cli. [3ea4d25726beae6fcecb00c477358cc6989055a3](https://github.com/behemehal/Ellie-Language/commit/3ea4d25726beae6fcecb00c477358cc6989055a3)
16+
17+
# v0.6.0
18+
19+
- Parser v0.4.0
20+
21+
- Implement conditions [0253d6898ed0a1447392652b422cec2759358413](https://github.com/behemehal/Ellie-Language/commit/0253d6898ed0a1447392652b422cec2759358413)
22+
- Implement for loop [bfdb7d90e5a5cec14d42164634c546b78a804493](https://github.com/behemehal/Ellie-Language/commit/bfdb7d90e5a5cec14d42164634c546b78a804493)

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "ellie_engine"
33
version_code = "BeautifulTropicalFish"
4-
version = "0.5.5"
4+
version = "0.6.0"
55
authors = ["Ahmetcan Aksu <ahmetcanaksu@behemehal.net>", "Behemehal <info@behemehal.net>"]
66
edition = "2021"
77
license-file = "LICENSE"

bytecode/src/assembler.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,14 +377,15 @@ impl Assembler {
377377
ellie_core::definite::items::Collecting::Generic(_) => {
378378
std::println!("[Assembler,Ignore,Element] Generic")
379379
}
380-
ellie_core::definite::items::Collecting::NativeClass => todo!(),
381380
ellie_core::definite::items::Collecting::GetterCall(_) => todo!(),
382381
ellie_core::definite::items::Collecting::SetterCall(_) => todo!(),
383382
ellie_core::definite::items::Collecting::Enum(_) => todo!(),
384383
ellie_core::definite::items::Collecting::NativeFunction(_) => {
385384
std::println!("[Assembler,Ignore,Element] NativeFunction")
386385
}
387386
ellie_core::definite::items::Collecting::None => todo!(),
387+
ellie_core::definite::items::Collecting::Brk(_) => todo!(),
388+
ellie_core::definite::items::Collecting::Go(_) => todo!(),
388389
}
389390
}
390391
for dependency in &processed_page.dependencies {

core/src/definite/definers.rs

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,40 @@ impl DefinerCollecting {
160160
false
161161
}
162162
}
163-
DefinerCollecting::Cloak(_) => todo!(),
164-
DefinerCollecting::Collective(_) => todo!(),
165-
DefinerCollecting::Nullable(_) => todo!(),
166-
DefinerCollecting::Dynamic => todo!(),
163+
DefinerCollecting::Cloak(cloak) => {
164+
if let DefinerCollecting::Cloak(other_cloak) = other {
165+
cloak.rtype.len() == other_cloak.rtype.len()
166+
&& cloak
167+
.rtype
168+
.iter()
169+
.zip(other_cloak.rtype.iter())
170+
.all(|(a, b)| a.same_as(b.clone()))
171+
} else {
172+
false
173+
}
174+
}
175+
DefinerCollecting::Collective(e) => {
176+
//Check if the key and value are the same
177+
if let DefinerCollecting::Collective(other_e) = other {
178+
e.key.same_as(*other_e.key.clone()) && e.value.same_as(*other_e.value.clone())
179+
} else {
180+
false
181+
}
182+
}
183+
DefinerCollecting::Nullable(e) => {
184+
if let DefinerCollecting::Nullable(other_e) = other {
185+
e.value.same_as(*other_e.value.clone())
186+
} else {
187+
false
188+
}
189+
}
190+
DefinerCollecting::Dynamic => {
191+
if let DefinerCollecting::Dynamic = other {
192+
true
193+
} else {
194+
false
195+
}
196+
}
167197
}
168198
}
169199
}

core/src/definite/items/brk.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
use crate::defs;
2+
use serde::{Deserialize, Serialize};
3+
4+
#[derive(PartialEq, Debug, Clone, Serialize, Deserialize)]
5+
pub struct Brk {
6+
pub pos: defs::Cursor,
7+
}

core/src/definite/items/condition.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::alloc::boxed::Box;
1+
use crate::{alloc::boxed::Box, definite::definers::DefinerCollecting};
22
use crate::alloc::vec::Vec;
33
use crate::definite::types;
44
use crate::defs;
@@ -22,5 +22,6 @@ pub struct ConditionChain {
2222
#[derive(PartialEq, Debug, Clone, Serialize, Deserialize)]
2323
pub struct Condition {
2424
pub chains: Vec<ConditionChain>,
25+
pub returns: Option<DefinerCollecting>,
2526
pub pos: defs::Cursor,
2627
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
use super::Collecting;
21
use crate::definite::types;
32
use crate::defs;
4-
use alloc::vec::Vec;
53
use serde::{Deserialize, Serialize};
64

75
#[derive(PartialEq, Debug, Clone, Serialize, Deserialize)]
86
pub struct ForLoop {
97
pub variable: types::Types,
108
pub iterator: types::Types,
119
pub parameter: defs::Cursor,
10+
pub variable_pos: defs::Cursor,
11+
pub iterator_pos: defs::Cursor,
1212
pub body_pos: defs::Cursor,
13-
pub body: Vec<Collecting>,
13+
pub inner_page_id: u64,
1414
pub pos: defs::Cursor,
1515
}

core/src/definite/items/go.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
use crate::defs;
2+
use serde::{Deserialize, Serialize};
3+
4+
#[derive(PartialEq, Debug, Clone, Serialize, Deserialize)]
5+
pub struct Go {
6+
pub pos: defs::Cursor,
7+
}

core/src/definite/items/mod.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ pub mod variable;
1919
pub mod native_function;
2020
pub mod ret;
2121

22+
pub mod brk;
23+
pub mod go;
24+
2225
#[derive(PartialEq, Debug, Clone, Serialize, Deserialize)]
2326
pub enum Collecting {
2427
Variable(variable::Variable),
@@ -27,13 +30,14 @@ pub enum Collecting {
2730
Condition(condition::Condition),
2831
Class(class::Class),
2932
Ret(ret::Ret),
33+
Brk(brk::Brk),
34+
Go(go::Go),
3035
Constructor(constructor::Constructor),
3136
Import(import::Import),
3237
FileKey(file_key::FileKey),
3338
Getter(getter::Getter),
3439
Setter(setter::Setter),
3540
Generic(generic::Generic),
36-
NativeClass,
3741
GetterCall(getter_call::GetterCall),
3842
SetterCall(setter_call::SetterCall),
3943
Enum(enum_type::EnumType),
@@ -69,8 +73,9 @@ impl Collecting {
6973
},
7074
Collecting::Enum(e) => e.pos,
7175
Collecting::NativeFunction(e) => e.pos,
72-
Collecting::None => todo!(),
73-
Collecting::NativeClass => todo!(),
76+
Collecting::None => unreachable!(),
77+
Collecting::Brk(e) => e.pos,
78+
Collecting::Go(e) => e.pos,
7479
}
7580
}
7681

@@ -87,13 +92,14 @@ impl Collecting {
8792
Collecting::FileKey(_) => false,
8893
Collecting::Getter(e) => e.public,
8994
Collecting::Setter(e) => e.public,
90-
Collecting::NativeClass => true,
9195
Collecting::GetterCall(_) => false,
9296
Collecting::SetterCall(_) => false,
9397
Collecting::Enum(e) => e.public,
9498
Collecting::NativeFunction(e) => e.public,
9599
Collecting::None => false,
96100
Collecting::Generic(_) => false,
101+
Collecting::Brk(_) => false,
102+
Collecting::Go(_) => false,
97103
}
98104
}
99105
}

core/src/error/error_list.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ lazy_static! {
7979
pub static ref ERROR_S13: error::Error = error::Error {
8080
code: 0x12,
8181
title: "SyntaxError".to_owned(),
82-
message: "Expected operator found '$token'".to_owned(),
82+
message: "'$token' and '$token1' has incompatible type returns".to_owned(),
8383
..Default::default()
8484
};
8585
pub static ref ERROR_S14: error::Error = error::Error {
@@ -164,7 +164,7 @@ lazy_static! {
164164
pub static ref ERROR_S27: error::Error = error::Error {
165165
code: 0x26,
166166
title: "TypeError".to_owned(),
167-
message: "Cannot apply data to generic type".to_owned(),
167+
message: "Un-Assignable type".to_owned(),
168168
..Default::default()
169169
};
170170
pub static ref ERROR_S28: error::Error = error::Error {

0 commit comments

Comments
 (0)