Skip to content

Commit

Permalink
nitpick: add a type alias for assembly string
Browse files Browse the repository at this point in the history
  • Loading branch information
veera-sivarajan committed Dec 19, 2023
1 parent adbebcc commit af64de1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions compiler/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ impl Expr {
}
}

// this is disgusting. refactor this asap
impl From<&Expr> for Token {
fn from(value: &Expr) -> Token {
match value {
Expand Down
4 changes: 3 additions & 1 deletion compiler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ mod typecheck;
use crate::error::BobaError;
use crate::parser::Parser;

fn compile_helper(source: &str, print_ast: bool) -> Result<String, BobaError> {
type Assembly = String;

fn compile_helper(source: &str, print_ast: bool) -> Result<Assembly, BobaError> {
let mut lexer = lexer::Lexer::new(source);
let tokens = lexer.scan()?;
if !tokens.is_empty() {
Expand Down

0 comments on commit af64de1

Please sign in to comment.