mirror of
https://github.com/azur1s/bobbylisp.git
synced 2024-10-16 02:37:40 -05:00
restructure folders
This commit is contained in:
parent
cef5e00f3a
commit
fcac3d254a
21
sketch.hlm
Normal file
21
sketch.hlm
Normal file
|
@ -0,0 +1,21 @@
|
|||
println({
|
||||
println("Hello");
|
||||
return let x: num = 17 * 2 in
|
||||
x + 1;
|
||||
} + 34);
|
||||
|
||||
//----------
|
||||
|
||||
let stack = [];
|
||||
|
||||
push("Hello");
|
||||
console.log(pop());
|
||||
push(17)
|
||||
push(2)
|
||||
push(pop() * pop());
|
||||
push(pop() + 1);
|
||||
// [35]
|
||||
|
||||
push(34)
|
||||
push(pop() + pop()) // [35] + 34
|
||||
console.log(pop());
|
|
@ -1,5 +1,5 @@
|
|||
use std::fmt::{Display, Formatter, Result as FmtResult};
|
||||
use super::ty::Type;
|
||||
use crate::trans::ty::Type;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum UnaryOp {
|
|
@ -1,5 +1,5 @@
|
|||
use std::fmt::{Display, Formatter, Result as FmtResult};
|
||||
use super::ty::Type;
|
||||
use crate::trans::ty::Type;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum JSLiteral { Num(i64), Str(String), Bool(bool) }
|
3
src/asts/mod.rs
Normal file
3
src/asts/mod.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
pub mod past;
|
||||
pub mod ast;
|
||||
pub mod js;
|
|
@ -1,6 +1,6 @@
|
|||
use crate::trans::ty::*;
|
||||
|
||||
use super::parse::Spanned;
|
||||
use crate::read::parse::Spanned;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum PUnaryOp {
|
|
@ -1,4 +1,5 @@
|
|||
#![feature(trait_alias)]
|
||||
pub mod asts;
|
||||
pub mod read;
|
||||
pub mod trans;
|
||||
pub mod args;
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
pub mod parse;
|
||||
pub mod past;
|
||||
pub mod parse;
|
|
@ -3,7 +3,7 @@ use chumsky::{prelude::*, Stream};
|
|||
use std::fmt::{Display, Formatter, Result as FmtResult};
|
||||
use crate::trans::ty::Type;
|
||||
|
||||
use super::past::*;
|
||||
use crate::asts::past::*;
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
|
||||
pub enum Delim { Paren, Brack, Brace }
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use crate::read::past::{PExpr, PLiteral, PBinaryOp, PUnaryOp};
|
||||
use super::{
|
||||
ast::{Expr, Literal, BinaryOp, UnaryOp},
|
||||
js::{JSExpr, JSLiteral},
|
||||
use crate::asts::{
|
||||
past::*,
|
||||
ast::*,
|
||||
js::*,
|
||||
};
|
||||
|
||||
pub fn translate_expr(expr: PExpr) -> Expr {
|
||||
|
|
|
@ -1,4 +1,2 @@
|
|||
pub mod ty;
|
||||
pub mod ast;
|
||||
pub mod js;
|
||||
pub mod low;
|
Loading…
Reference in a new issue