jmeaster30 / ocean

A C-like programming language (get it like sea-like like an ocean lol)
GNU General Public License v3.0
0 stars 0 forks source link

Add macros for the scoped borrows in the using step #107

Closed jmeaster30 closed 6 months ago

jmeaster30 commented 6 months ago

In order to work with the borrow checker properly I had to do a pattern like:

let full_path = {
      let borrow = context.borrow();
      Path::new(&borrow.project_root).join(Path::new(&file_path))
};

and similar for borrow_mut. I will definitely run into issues with this as I move to the other semantic analysis steps so it would be nice to have easy ways to do this and not have ugly blocks everywhere

jmeaster30 commented 6 months ago

Done and they work well