Skip to content

Commit

Permalink
Fill missing doc strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernest1338 committed Jan 27, 2025
1 parent 74ef5cc commit d479d5e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub struct Compiler {
}

impl Compiler {
/// TODO
/// Creates a new instance of the `Compiler` struct, initializing its fields to default values
pub fn new() -> Self {
Self {
ast: Vec::new(),
Expand All @@ -68,7 +68,7 @@ impl Compiler {
}
}

/// TODO
/// Loads the provided abstract syntax tree (AST) into the compiler, replacing any existing AST
pub fn load_ast(&mut self, ast: Ast) {
self.ast = ast;
}
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use std::{
};

// TODO:
// - line numbers in parser errors
// - more test cases for error returns
// - if, else expr
// - fn expr
Expand Down
4 changes: 2 additions & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ pub fn escape_string(s: &str) -> String {
}

impl From<String> for ErrorType {
/// TODO
/// Converts a String message into an ErrorType::Generic variant
fn from(message: String) -> Self {
ErrorType::Generic(message)
}
Expand All @@ -220,7 +220,7 @@ pub fn dbg_file_if_env(data: &str, file: &str, var: &str) {
}
}

/// TODO
/// Finds the line number where a syntax error occurs in the given source code
pub fn find_error_line_number(source: &str) -> Option<usize> {
let mut current_line = 1;
let mut context = String::new();
Expand Down

0 comments on commit d479d5e

Please sign in to comment.