Rename roc_module::operator -> roc_module::called_via

A bit of a nit, but this file is now more general than just keeping
track of operator methods.
This commit is contained in:
ayazhafiz 2021-11-18 00:09:53 -05:00
parent 30955a1eb8
commit 8a60162a1e
15 changed files with 17 additions and 17 deletions

View file

@ -7,7 +7,7 @@ use crate::{
}; };
use roc_can::expr::Recursive; use roc_can::expr::Recursive;
use roc_module::low_level::LowLevel; use roc_module::low_level::LowLevel;
use roc_module::operator::CalledVia; use roc_module::called_via::CalledVia;
use roc_module::symbol::Symbol; use roc_module::symbol::Symbol;
use super::record_field::RecordField; use super::record_field::RecordField;

View file

@ -3,7 +3,7 @@ use bumpalo::Bump;
use libloading::Library; use libloading::Library;
use roc_gen_llvm::{run_jit_function, run_jit_function_dynamic_type}; use roc_gen_llvm::{run_jit_function, run_jit_function_dynamic_type};
use roc_module::ident::TagName; use roc_module::ident::TagName;
use roc_module::operator::CalledVia; use roc_module::called_via::CalledVia;
use roc_module::symbol::{Interns, ModuleId, Symbol}; use roc_module::symbol::{Interns, ModuleId, Symbol};
use roc_mono::ir::ProcLayout; use roc_mono::ir::ProcLayout;
use roc_mono::layout::{union_sorted_tags_help, Builtin, Layout, UnionLayout, UnionVariant}; use roc_mono::layout::{union_sorted_tags_help, Builtin, Layout, UnionLayout, UnionVariant};

View file

@ -5,7 +5,7 @@ use crate::pattern::Pattern;
use roc_collections::all::SendMap; use roc_collections::all::SendMap;
use roc_module::ident::{Lowercase, TagName}; use roc_module::ident::{Lowercase, TagName};
use roc_module::low_level::LowLevel; use roc_module::low_level::LowLevel;
use roc_module::operator::CalledVia; use roc_module::called_via::CalledVia;
use roc_module::symbol::Symbol; use roc_module::symbol::Symbol;
use roc_region::all::{Located, Region}; use roc_region::all::{Located, Region};
use roc_types::subs::{VarStore, Variable}; use roc_types::subs::{VarStore, Variable};

View file

@ -12,7 +12,7 @@ use crate::scope::Scope;
use roc_collections::all::{ImSet, MutMap, MutSet, SendMap}; use roc_collections::all::{ImSet, MutMap, MutSet, SendMap};
use roc_module::ident::{ForeignSymbol, Lowercase, TagName}; use roc_module::ident::{ForeignSymbol, Lowercase, TagName};
use roc_module::low_level::LowLevel; use roc_module::low_level::LowLevel;
use roc_module::operator::{CalledVia, Sugar}; use roc_module::called_via::{CalledVia, Sugar};
use roc_module::symbol::Symbol; use roc_module::symbol::Symbol;
use roc_parse::ast::{self, EscapedChar, StrLiteral}; use roc_parse::ast::{self, EscapedChar, StrLiteral};
use roc_parse::pattern::PatternType::*; use roc_parse::pattern::PatternType::*;

View file

@ -3,8 +3,8 @@
use bumpalo::collections::Vec; use bumpalo::collections::Vec;
use bumpalo::Bump; use bumpalo::Bump;
use roc_module::ident::ModuleName; use roc_module::ident::ModuleName;
use roc_module::operator::BinOp::Pizza; use roc_module::called_via::BinOp::Pizza;
use roc_module::operator::{BinOp, CalledVia}; use roc_module::called_via::{BinOp, CalledVia};
use roc_parse::ast::Expr::{self, *}; use roc_parse::ast::Expr::{self, *};
use roc_parse::ast::{AssignedField, Def, WhenBranch}; use roc_parse::ast::{AssignedField, Def, WhenBranch};
use roc_region::all::{Located, Region}; use roc_region::all::{Located, Region};
@ -277,7 +277,7 @@ pub fn desugar_expr<'a>(arena: &'a Bump, loc_expr: &'a Located<Expr<'a>>) -> &'a
}) })
} }
UnaryOp(loc_arg, loc_op) => { UnaryOp(loc_arg, loc_op) => {
use roc_module::operator::UnaryOp::*; use roc_module::called_via::UnaryOp::*;
let region = loc_op.region; let region = loc_op.region;
let op = loc_op.value; let op = loc_op.value;
@ -475,7 +475,7 @@ fn binop_step<'a>(
op_stack: &mut Vec<Located<BinOp>>, op_stack: &mut Vec<Located<BinOp>>,
next_op: Located<BinOp>, next_op: Located<BinOp>,
) -> Step<'a> { ) -> Step<'a> {
use roc_module::operator::Associativity::*; use roc_module::called_via::Associativity::*;
use std::cmp::Ordering; use std::cmp::Ordering;
match op_stack.pop() { match op_stack.pop() {

View file

@ -3,7 +3,7 @@ use crate::def::fmt_def;
use crate::pattern::fmt_pattern; use crate::pattern::fmt_pattern;
use crate::spaces::{add_spaces, fmt_comments_only, fmt_spaces, newline, NewlineAt, INDENT}; use crate::spaces::{add_spaces, fmt_comments_only, fmt_spaces, newline, NewlineAt, INDENT};
use bumpalo::collections::String; use bumpalo::collections::String;
use roc_module::operator::{self, BinOp}; use roc_module::called_via::{self, BinOp};
use roc_parse::ast::StrSegment; use roc_parse::ast::StrSegment;
use roc_parse::ast::{ use roc_parse::ast::{
AssignedField, Base, Collection, CommentOrNewline, Expr, Pattern, WhenBranch, AssignedField, Base, Collection, CommentOrNewline, Expr, Pattern, WhenBranch,

View file

@ -6,7 +6,7 @@ use roc_can::pattern::Pattern;
use roc_can::scope::Scope; use roc_can::scope::Scope;
use roc_collections::all::{MutSet, SendMap}; use roc_collections::all::{MutSet, SendMap};
use roc_module::ident::TagName; use roc_module::ident::TagName;
use roc_module::operator::CalledVia; use roc_module::called_via::CalledVia;
use roc_module::symbol::Symbol; use roc_module::symbol::Symbol;
use roc_region::all::{Located, Region}; use roc_region::all::{Located, Region};
use roc_types::subs::{VarStore, Variable}; use roc_types::subs::{VarStore, Variable};

View file

@ -2,10 +2,10 @@
// See github.com/rtfeldman/roc/issues/800 for discussion of the large_enum_variant check. // See github.com/rtfeldman/roc/issues/800 for discussion of the large_enum_variant check.
#![allow(clippy::large_enum_variant, clippy::upper_case_acronyms)] #![allow(clippy::large_enum_variant, clippy::upper_case_acronyms)]
pub mod called_via;
pub mod ident; pub mod ident;
pub mod low_level; pub mod low_level;
pub mod module_err; pub mod module_err;
pub mod operator;
pub mod symbol; pub mod symbol;
#[macro_use] #[macro_use]

View file

@ -4,7 +4,7 @@ use crate::header::{AppHeader, ImportsEntry, InterfaceHeader, PlatformHeader, Ty
use crate::ident::Ident; use crate::ident::Ident;
use bumpalo::collections::{String, Vec}; use bumpalo::collections::{String, Vec};
use bumpalo::Bump; use bumpalo::Bump;
use roc_module::operator::{BinOp, CalledVia, UnaryOp}; use roc_module::called_via::{BinOp, CalledVia, UnaryOp};
use roc_region::all::{Loc, Position, Region}; use roc_region::all::{Loc, Position, Region};
#[derive(Clone, Debug, PartialEq)] #[derive(Clone, Debug, PartialEq)]

View file

@ -13,7 +13,7 @@ use crate::pattern::loc_closure_param;
use crate::type_annotation; use crate::type_annotation;
use bumpalo::collections::Vec; use bumpalo::collections::Vec;
use bumpalo::Bump; use bumpalo::Bump;
use roc_module::operator::{BinOp, CalledVia, UnaryOp}; use roc_module::called_via::{BinOp, CalledVia, UnaryOp};
use roc_region::all::{Located, Position, Region}; use roc_region::all::{Located, Position, Region};
use crate::parser::Progress::{self, *}; use crate::parser::Progress::{self, *};

View file

@ -1,6 +1,6 @@
use roc_collections::all::MutSet; use roc_collections::all::MutSet;
use roc_module::ident::{Ident, Lowercase, ModuleName, TagName}; use roc_module::ident::{Ident, Lowercase, ModuleName, TagName};
use roc_module::operator::BinOp; use roc_module::called_via::BinOp;
use roc_module::symbol::{ModuleId, Symbol}; use roc_module::symbol::{ModuleId, Symbol};
use roc_parse::ast::Base; use roc_parse::ast::Base;
use roc_parse::pattern::PatternType; use roc_parse::pattern::PatternType;

View file

@ -5,7 +5,7 @@ use crate::subs::{
use roc_collections::all::{ImMap, ImSet, Index, MutSet, SendMap}; use roc_collections::all::{ImMap, ImSet, Index, MutSet, SendMap};
use roc_module::ident::{ForeignSymbol, Ident, Lowercase, TagName}; use roc_module::ident::{ForeignSymbol, Ident, Lowercase, TagName};
use roc_module::low_level::LowLevel; use roc_module::low_level::LowLevel;
use roc_module::operator::CalledVia; use roc_module::called_via::CalledVia;
use roc_module::symbol::{Interns, ModuleId, Symbol}; use roc_module::symbol::{Interns, ModuleId, Symbol};
use roc_region::all::{Located, Region}; use roc_region::all::{Located, Region};
use std::fmt; use std::fmt;

View file

@ -1,7 +1,7 @@
use roc_can::expected::{Expected, PExpected}; use roc_can::expected::{Expected, PExpected};
use roc_collections::all::{Index, MutSet, SendMap}; use roc_collections::all::{Index, MutSet, SendMap};
use roc_module::ident::{Ident, IdentStr, Lowercase, TagName}; use roc_module::ident::{Ident, IdentStr, Lowercase, TagName};
use roc_module::operator::{BinOp, CalledVia, Sugar}; use roc_module::called_via::{BinOp, CalledVia, Sugar};
use roc_module::symbol::Symbol; use roc_module::symbol::Symbol;
use roc_region::all::{Located, Region}; use roc_region::all::{Located, Region};
use roc_solve::solve; use roc_solve::solve;

View file

@ -353,7 +353,7 @@ impl<'a> RocDocAllocator<'a> {
pub fn binop( pub fn binop(
&'a self, &'a self,
content: roc_module::operator::BinOp, content: roc_module::called_via::BinOp,
) -> DocBuilder<'a, Self, Annotation> { ) -> DocBuilder<'a, Self, Annotation> {
self.text(content.to_string()).annotate(Annotation::BinOp) self.text(content.to_string()).annotate(Annotation::BinOp)
} }