Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-M-Lucas committed Apr 25, 2024
1 parent 0d61600 commit 0b31b1a
Show file tree
Hide file tree
Showing 22 changed files with 129 additions and 1,766 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "whython-7"
name = "whython-8"
version = "0.1.0"
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion main.why
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fn main() ~ int {
fn main() -> int {
printb(true);
}
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
mod root;
mod root;

fn main() {
root::main();
Expand Down
22 changes: 12 additions & 10 deletions src/root.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::root::name_resolver::resolve::resolve_names;
use crate::root::parser::parse::parse;
// use crate::root::assembler::assemble::generate_assembly;
// use crate::root::name_resolver::processor::process;
use crate::root::utils::AnyError;
use crate::time;
use clap::Parser;
use color_print::cprintln;
Expand All @@ -19,12 +20,12 @@ use std::path::PathBuf;
// use runner::link_gcc_experimental;
// use crate::root::parser::parse::parse;

mod assembler;
mod custom;
mod parser;
mod runner;
mod utils;
mod name_resolver;
pub mod parser;
pub mod runner;
pub mod utils;
pub mod name_resolver;

pub const POINTER_SIZE: usize = 8;

/// Compiler for Whython files (.why)
#[derive(Parser)]
Expand Down Expand Up @@ -54,12 +55,12 @@ pub fn main() {
let _ = main_args(args);
}

pub fn main_args(args: Args) -> Result<(), AnyError> {
pub fn main_args(args: Args) {
if let Some(path) = PathBuf::from(&args.output).parent() {
if let Err(e) = fs::create_dir_all(path) {
if !matches!(e.kind(), ErrorKind::AlreadyExists) {
cprintln!("<r,bold>Failed to create directories for output files</>");
return Err(AnyError::Other);
panic!();
}
}
}
Expand All @@ -69,6 +70,8 @@ pub fn main_args(args: Args) -> Result<(), AnyError> {
let parsed = parse(PathBuf::from(&args.input)).unwrap();
);

resolve_names(parsed);


// print!("Compiling... ");
// time!(generate_assembly(&args.output, functions););
Expand Down Expand Up @@ -113,5 +116,4 @@ pub fn main_args(args: Args) -> Result<(), AnyError> {
// }

cprintln!("<g,bold>Done!</>");
Ok(())
}
25 changes: 0 additions & 25 deletions src/root/assembler/assemble.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/root/assembler/mod.rs

This file was deleted.

2 changes: 0 additions & 2 deletions src/root/custom/functions/mod.rs

This file was deleted.

234 changes: 0 additions & 234 deletions src/root/custom/functions/print.rs

This file was deleted.

Loading

0 comments on commit 0b31b1a

Please sign in to comment.