Skip to content

Commit

Permalink
v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmtcn123 committed Jan 5, 2022
1 parent 1d661fc commit 73db1a6
Show file tree
Hide file tree
Showing 20 changed files with 1,160 additions and 816 deletions.
88 changes: 1 addition & 87 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,90 +1,4 @@
# Changelog

# v2.0.0
- Parser
* Performance improved
* integer, float type introduced

# v2.1.0
- Parser
* Class introduced
* Ret introduced
* Constants added
* Bug fix & performance improvements
- Engine
* Benchmarks added
- CLI
* Experimental error listing

# v2.2.0
- Parser:
* Bug fixes
* Code execution order
* Class call
* Scope management
* Reserved keywords protection
* Callers are introduced

# v2.6.0
- CLI
* Support eval for language server

# v2.7.0
- Parser
* Comment bug fix
* Collective introduced
* Negative introduced (!!true)
* Nullable types introduced

# v2.8.1
- Parser v1.1.1
* Fix standard library's long load times
* Fix class imports
- CLI
* Fix eval & file code order

# v3.0.2
- Parser v1.3.2
* Apply imported file error trace
* Support constructing classes
- CLI
* Support imported file error show

# v3.4.0
- Parser v1.4.0
* Support native headers
* Apply parsing log
* Expandable function parameter introduced
- CLI
* Create parsing visualizer
* Make experimental error provider stable
* Improve import resolver


# v3.5.0
- Parser v1.6.0
* Getter & setter implemented
* Enum implemented
- CLI
* Fix eval bugs
* Initialize runtime

# v3.5.1
- Parser v1.6.2
* Performance bug resolved
* Array type definition error fixed

# v3.6.2
- Parser v1.7.3
* Future type introduced
* Reference resolver implemented
* Fix dynamic type assignment error in collective
* Fix class constructor parameter type mismatch

# v3.7.3
- Parser v1.7.3
* Fix condition error
- Runtime v0.1.0
* Create type conversion between types and items
- Native-Bridge v0.1.0
* Add int, float, string data types
- Change cli options and behaviour
27 changes: 12 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "ellie_engine"
version_code = "BeautifulTropicalFish"
version = "0.1.0"
version = "0.2.0"
authors = ["Ahmetcan Aksu <ahmetcanaksu@behemehal.net>"]
edition = "2021"
license-file = "LICENSE"
Expand All @@ -11,24 +11,24 @@ default-run = "elliec"
lazy_static = { version = "1.4.0", features = ["spin_no_std"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
path-absolutize = {version = "3.0.10", optional = true }
websocket = {version = "0.26.2", optional = true, default-features = false, features = ["sync"] }
path-absolutize = { version = "3.0.10", optional = true }
websocket = { version = "0.26.2", optional = true, default-features = false, features = ["sync"] }
regex = { version = "1.1.7", optional = true }
bincode = { version = "1.0", optional = true }

ellie_core = {path = "core", version = "0.2.0"}
ellie_tokenizer = {path = "tokenizer", version = "0.2.0", default-features = false}
ellie_parser = {path = "parser", version = "0.2.0", default-features = false}
ellie_assist = {path = "EllieAssist", version = "0.1.0", optional = true}
clap = { version = "3.0.0", optional = true }
clap_complete = { version = "3.0.0", optional = true }
ellie_core = { path = "core", version = "0.2.0" }
ellie_tokenizer = { path = "tokenizer", version = "0.2.0", default-features = false }
ellie_parser = { path = "parser", version = "0.2.0", default-features = false }
ellie_assist = { path = "EllieAssist", version = "0.1.0", optional = true }
ellie_runtime = {path = "runtime", version = "0.1.0" }

[features]
default = ["build-cli", "standard_rules"]
build-cli = ["path-absolutize", "websocket", "regex", "bincode"]
build-cli = ["path-absolutize", "websocket", "regex", "bincode", "clap"]
ellie_asist = ["ellie_assist"]
standard_rules = ["ellie_parser/standard_rules"]


[[bin]]
name = "elliec"
test = false
Expand All @@ -37,6 +37,7 @@ required-features = ["build-cli"]

[build-dependencies]
lazy_static = "1.4.0"
clap_complete = "3.0.0"
ellie_core = { path = "core", version = "0.2.0" }
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
ellie_parser = {path = "parser", version = "0.2.0", default-features = false}
Expand All @@ -46,9 +47,5 @@ regex = { version = "1.1.7" }
ellie_tokenizer = {path = "tokenizer", version = "0.2.0", default-features = false}
bincode = { version = "1.0", optional = true }


#[dev-dependencies]
#criterion = { version = "0.3", features= ["html_reports"]}

[profile.release]
opt-level = 3
opt-level = 3
21 changes: 16 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ use toml::Value;
#[path = "src/cli_utils.rs"]
mod cli_utils;

#[path = "src/engine_constants.rs"]
mod engine_constants;

use std::{
collections::hash_map::DefaultHasher,
fs::{self, File},
Expand Down Expand Up @@ -61,7 +64,10 @@ fn main() {
&version_line_regex.captures(&builded_libraries).unwrap();
let current_lib_version = current_version_number["version"].to_owned();

if current_lib_version != lib_version {
if current_lib_version != lib_version
|| ellie_core::builded_libraries::BUILDED_ELLIE_VERSION
!= engine_constants::ELLIE_VERSION
{
let mut pager = tokenizer::Pager::new(
ellie_lib,
Path::new("./lib/ellie.ei").to_str().unwrap().to_string(),
Expand Down Expand Up @@ -146,7 +152,13 @@ fn main() {
lib_version.clone(),
),
);
let workspace = parser.parse("ellie_std".to_owned());
let workspace = parser.parse(
"ellie_std".to_owned(),
"Ellie Standard Types".to_owned(),
ellie_core::defs::Version::build_from_string(
engine_constants::ELLIE_VERSION.to_owned(),
),
);

if !parser.informations.has_no_warnings() {
cli_utils::print_warnings(
Expand Down Expand Up @@ -206,7 +218,7 @@ fn main() {
let json = serde_json::to_string(&workspace).unwrap();
fs::write(
"./core/src/builded_libraries.rs",
format!("//@version = \"{}\";\npub static ELLIE_STD_VERSION : crate::defs::Version = crate::defs::Version {{minor: {}, major: {}, bug: {} }};\npub static ELLIE_STANDARD_LIBRARY : &str = {:#?};\n", lib_version, lib_version.split(".").nth(0).unwrap(), lib_version.split(".").nth(1).unwrap(),lib_version.split(".").nth(2).unwrap(), json),
format!("//NEVER EDIT THIS FILE WHILE LANGUAGE SERVER IS RUNNING\n//@version = \"{}\";\npub static BUILDED_ELLIE_VERSION: &'static str = \"{}\";\npub static ELLIE_STD_VERSION : crate::defs::Version = crate::defs::Version {{minor: {}, major: {}, bug: {} }};\npub static ELLIE_STANDARD_LIBRARY : &str = {:#?};\n", lib_version, engine_constants::ELLIE_VERSION, lib_version.split(".").nth(0).unwrap(), lib_version.split(".").nth(1).unwrap(),lib_version.split(".").nth(2).unwrap(), json),
)
.unwrap();
}
Expand All @@ -226,9 +238,8 @@ fn main() {
)
}
}

fs::write(
"./src/cli_constants.rs",
"./src/engine_constants.rs",
format!(
"pub static ELLIE_VERSION: &'static str = &{};\npub static ELLIE_VERSION_NAME: &'static str = &{};\npub static ELLIE_TOKENIZER_VERSION: &'static str = &{};\npub static ELLIE_PARSER_VERSION: &'static str = &{};\npub static ELLIE_RUNTIME_VERSION: &'static str = &{};\npub static ELLIE_CORE_VERSION: &'static str = &{};\npub static ELLIE_STD_VERSION: &'static str = &\"{}\";\n",
ellie_version,
Expand Down
8 changes: 5 additions & 3 deletions core/src/builded_libraries.rs

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions core/src/defs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ pub struct Version {
pub bug: u8,
}

impl PartialEq for Version {
fn eq(&self, other: &Self) -> bool {
//Ignore bug
self.minor == other.minor && self.major == other.major
}
}

impl Version {
pub fn build_from_string(input: String) -> Version {
Version {
Expand Down
2 changes: 1 addition & 1 deletion lib/ellie.ei
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Copyright (c) 2020 Behemehal. See license file for details
*/
@version = "0.2.0"; //Changing this triggers build.rs
@version = "0.2.1"; //Changing this triggers build.rs
pub import void;
pub import string;
pub import char;
Expand Down
41 changes: 13 additions & 28 deletions parser/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ impl ProcessedPage {
pub struct Module {
pub hash: u64,
pub name: String,
pub description: String,
pub initial_page: u64,
pub ellie_version: ellie_core::defs::Version,
pub pages: Vec<ProcessedPage>,
pub version: ellie_core::defs::Version,
pub modules: Vec<ellie_tokenizer::tokenizer::Module>,
Expand Down Expand Up @@ -147,12 +149,14 @@ impl Parser {
hash: p.hash,
inner: p.inner,
path: p.path.clone(),
module: true,
dependents: p.dependents.clone(),
dependencies: p.dependencies.clone(),
..Default::default()
})
.collect::<Vec<_>>();
self.find_page(self.initial_page).unwrap().dependencies = module

let imported_dependencies: Vec<Dependency> = module
.pages
.iter()
.map(|x| ellie_tokenizer::tokenizer::Dependency {
Expand All @@ -163,35 +167,13 @@ impl Parser {
public: false,
})
.collect();
self.pages.extend(unprocessed_pages);
}

/*
pub fn import_processed_module(&mut self, processed_pages: Vec<ProcessedPage>) {
let unprocessed_pages = processed_pages
.iter()
.map(|p| ellie_tokenizer::tokenizer::Page {
hash: p.hash,
inner: p.inner,
path: p.path.clone(),
dependents: p.dependents.clone(),
dependencies: p.dependencies.clone(),
..Default::default()
})
.collect::<Vec<_>>();
self.find_page(self.initial_page).unwrap().dependencies = unprocessed_pages
.iter()
.map(|x| ellie_tokenizer::tokenizer::Dependency {
hash: x.hash,
processed: true,
deep_link: if x.hash == 343 { None } else { Some(343) },
public: false,
})
.collect();
self.find_page(self.initial_page)
.unwrap()
.dependencies
.extend(imported_dependencies);
self.pages.extend(unprocessed_pages);
self.processed_pages.extend(processed_pages);
}
*/

pub fn resolve_type_name(&self, rtype: ellie_core::definite::types::Types) -> String {
match rtype {
Expand Down Expand Up @@ -330,6 +312,7 @@ impl Parser {
if !searched.contains(&target_page) {
for dep in self_dependendencies {
searched.push(target_page);

if let Some(module_initial_page) = dep.module {
let unprocessed_page = self
.find_page(dep.hash)
Expand Down Expand Up @@ -828,14 +811,16 @@ impl Parser {
}
}

pub fn parse(&mut self, module_name: String) -> Module {
pub fn parse(&mut self, module_name: String, module_description: String, ellie_version: defs::Version) -> Module {
self.process_page(self.initial_page);
Module {
name: module_name,
description: module_description,
initial_page: self.initial_page,
hash: self.calculate_hash(),
pages: self.processed_pages.clone(),
version: self.version.clone(),
ellie_version,
modules: self
.modules
.iter()
Expand Down
25 changes: 13 additions & 12 deletions parser/src/processors/type_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,20 @@ pub fn process(
Vec::new(),
0,
);


if deep_search_result.found {
match deep_search_result.found_item {
crate::parser::DeepSearchItems::Class(_) => todo!(),
crate::parser::DeepSearchItems::Class(_) => todo!("class type not yet implemented"),
crate::parser::DeepSearchItems::Variable(e) => {
Ok(types::Types::VariableType(types::variable::VariableType {
value: e.name,
reference: e.hash,
pos: from.get_pos(),
}))
}
crate::parser::DeepSearchItems::Function(_) => todo!(),
crate::parser::DeepSearchItems::ImportReference(_) => todo!(),
crate::parser::DeepSearchItems::Function(_) => todo!("function type not yet implemented"),
crate::parser::DeepSearchItems::ImportReference(_) => todo!("import reference type not yet implemented"),
crate::parser::DeepSearchItems::BrokenPageGraph => todo!(),
crate::parser::DeepSearchItems::MixUp(_) => todo!(),
crate::parser::DeepSearchItems::None => todo!(),
Expand Down Expand Up @@ -68,15 +69,15 @@ pub fn process(
Err(errors)
}
}
Processors::Negative(_) => todo!(),
Processors::Array(_) => todo!(),
Processors::Operator(_) => todo!(),
Processors::Reference(_) => todo!(),
Processors::BraceReference(_) => todo!(),
Processors::FunctionCall(_) => todo!(),
Processors::ClassCall(_) => todo!(),
Processors::Cloak(_) => todo!(),
Processors::Collective(_) => todo!(),
Processors::Negative(_) => todo!("negative type not yet implemented"),
Processors::Array(_) => todo!("array type not yet implemented"),
Processors::Operator(_) => todo!("operator type not yet implemented"),
Processors::Reference(_) => todo!("reference type not yet implemented"),
Processors::BraceReference(_) => todo!("brace_reference_type type not yet implemented"),
Processors::FunctionCall(_) => todo!("functionCall type not yet implemented"),
Processors::ClassCall(_) => todo!("classCall type not yet implemented"),
Processors::Cloak(_) => todo!("cloak type not yet implemented"),
Processors::Collective(_) => todo!("collective type not yet implemented"),
Processors::AsKeyword(as_keyword) => {
match process(*as_keyword.data.target, parser, page_id, ignore_hash.clone()) {
Ok(resolved_types) => {
Expand Down
Loading

0 comments on commit 73db1a6

Please sign in to comment.