escalier-lang / escalier

A compile-to-JavaScript language with tight TypeScript integration.
https://escalier-lang.github.io/escalier/
MIT License
21 stars 1 forks source link

Add Checker struct and make existing functions methods on it #670

Closed kevinbarabash closed 1 year ago

kevinbarabash commented 1 year ago

This PR introduces a Checker struct and makes a bunch of functions that were taking arena as a param to be methods on Checker. This simplifies calls to those methods. It also will make recoverable error handling easier in the future because we can store the diagnostics on Checker instead of having to pass them around as params to everything.

codecov[bot] commented 1 year ago

Codecov Report

Merging #670 (25331d1) into main (9f11ff2) will decrease coverage by 0.02%. The diff coverage is 84.64%.

@@            Coverage Diff             @@
##             main     #670      +/-   ##
==========================================
- Coverage   90.74%   90.73%   -0.02%     
==========================================
  Files         104      104              
  Lines       21966    21956      -10     
==========================================
- Hits        19934    19922      -12     
- Misses       2032     2034       +2     
Files Changed Coverage Δ
crates/escalier_ast/src/type_ann.rs 100.00% <ø> (ø)
crates/escalier_hm/src/infer.rs 90.90% <ø> (-0.46%) :arrow_down:
crates/escalier_hm/src/lib.rs 100.00% <ø> (ø)
crates/escalier_hm/src/util.rs 81.00% <79.69%> (-0.37%) :arrow_down:
crates/escalier_hm/src/unify.rs 83.98% <82.76%> (-0.45%) :arrow_down:
crates/escalier_hm/src/types.rs 80.94% <87.89%> (+0.73%) :arrow_up:
crates/escalier_hm/src/infer_pattern.rs 92.72% <98.58%> (+0.03%) :arrow_up:
crates/escalier_hm/src/context.rs 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes