Skip to content

Commit

Permalink
refact(rivet): rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
StunxFS committed Dec 8, 2023
1 parent d29abce commit 2537a06
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/rivet/src/ast/TypeInfo.ri
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ pub enum TypeInfo < traits.Stringable {
}

#[inline]
pub func is_mut_arr_or_vec(self) -> bool {
pub func is_mut_arr_or_dyn_array(self) -> bool {
return match self is {
.Array(arr) -> arr.is_mut,
.DynArray(vec) -> vec.is_mut,
Expand Down
4 changes: 2 additions & 2 deletions lib/rivet/src/checker/exprs.ri
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ extend Checker {
if value_sym.info is .Array(array_info) {
size = array_info.size;
}
is_mut = value_sym.info.is_mut_arr_or_vec();
is_mut = value_sym.info.is_mut_arr_or_dyn_array();
} else if !self.expected_type.is_void() {
has_expected_type = true;
value_type = self.expected_type;
Expand Down Expand Up @@ -416,7 +416,7 @@ extend Checker {
.Array, .DynArray -> {
elem_type := left_sym.info.elem_type()?;
if index.index is .Range {
is_mut := left_sym.info.is_mut_arr_or_vec();
is_mut := left_sym.info.is_mut_arr_or_dyn_array();
if left_sym.info is .DynArray {
index.left_type
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/rivet/src/checker/mod.ri
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ pub struct Checker {
return;
}
expr_sym := index.left_type.symbol()?;
if !expr_sym.info.is_mut_arr_or_vec() {
if !expr_sym.info.is_mut_arr_or_dyn_array() {
report.error(
"cannot modify elements of an immutable {}".fmt(expr_sym.info),
index.pos
Expand Down
2 changes: 1 addition & 1 deletion lib/rivet/src/checker/stmts.ri
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ extend Checker {
elem_sym := elem_type.symbol()?;
if for_stmt.values.len == 1 {
value0 := for_stmt.values[0];
if value0.is_mut and !iterable_sym.info.is_mut_arr_or_vec() {
if value0.is_mut and !iterable_sym.info.is_mut_arr_or_dyn_array() {
report.error(
"cannot modify immutable {}".fmt(iterable_sym.info),
for_stmt.iterable.position()
Expand Down
2 changes: 1 addition & 1 deletion rivetc/src/codegen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def gen_source_files(self, source_files):
ir.Selector(ir.UINT64_T, testRunner, ir.Name("skip_tests")),
ir.IntLit(ir.UINT64_T, "0")
)
tests_vec = ir.Selector(
tests_dyn_array = ir.Selector(
ir.DYN_ARRAY_T.ptr(True), testRunner, ir.Name("tests")
)
test_t = ir.TEST_T.ptr()
Expand Down

0 comments on commit 2537a06

Please sign in to comment.