Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nic-gaffney committed Jul 28, 2023
1 parent ad85abc commit 1744d9d
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 103 deletions.
12 changes: 12 additions & 0 deletions examples/chatbot.sloth
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
fn main() Int {
var run: Bool = true;
while run == true {
println("Hello! How are you?");
print("User> ");
var input: String = readln();
if sequals(input, "bad") {
println("lmao sucks");
}
}
return 0;
}
32 changes: 0 additions & 32 deletions mandelbrot.c

This file was deleted.

40 changes: 0 additions & 40 deletions mandelbrot.java

This file was deleted.

23 changes: 0 additions & 23 deletions mandelbrot.py

This file was deleted.

2 changes: 1 addition & 1 deletion sloth/src/analysis/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ pub(super) fn propagate_types_stmt(node: &mut Stmt) -> Result<(), AnalysisError>
propagate_types(iterator)?;
propagate_types_stmt(body)?;
}
StmtKind::DefineVariable { value, typ, .. } => {
StmtKind::DefineVariable { value, .. } => {
propagate_types(value)?;
}
StmtKind::AssignVariable { value, .. } => {
Expand Down
6 changes: 3 additions & 3 deletions sloth/src/codegen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ impl<'ctx> Codegen<'ctx> {
//
match value.typ {
Some(Type::Boolean) => {
let value = self.codegen_expr(value).unwrap().into_int_value();
let _value = self.codegen_expr(value).unwrap().into_int_value();

match op {
UnaryOp::Not => {
Expand Down Expand Up @@ -923,10 +923,10 @@ impl<'ctx> Codegen<'ctx> {
let inputs = &[array_input.into(), self.context.i32_type().into()];
let func_type = self.context.void_type().fn_type(inputs, false);
self._setup(&format!("vremove{name}"), func_type);
let func = self.current_func.unwrap();
let _func = self.current_func.unwrap();

// Types
let element_type = self.type_as_basic_type(typ);
let _element_type = self.type_as_basic_type(typ);

// FIXME: Array cant shrink as of now
// TODO: vremove
Expand Down
2 changes: 1 addition & 1 deletion sloth/src/parser/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ impl Stmt {
}
StmtKind::ForStmt {
iterator,
identifier,
identifier: _,
body,
} => {
children.push(iterator.as_node());
Expand Down
6 changes: 3 additions & 3 deletions sloth/src/parser/graph.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
us estd::fmt::{Error, Write};
use std::fmt::{Error, Write};

use super::ast::{Expr, ExprKind, Function, FunctionKind, Stmt, StmtKind};

Expand Down Expand Up @@ -74,7 +74,7 @@ impl GraphBuilder {
}
StmtKind::ForStmt {
iterator,
identifier,
identifier: _,
body,
} => {
writeln!(
Expand Down Expand Up @@ -257,7 +257,7 @@ impl GraphBuilder {
}
StmtKind::ForStmt {
iterator,
identifier,
identifier: _,
body,
} => {
writeln!(
Expand Down

0 comments on commit 1744d9d

Please sign in to comment.