refactor(tvix/eval): rename OpAttrsIsSet -> OpHasAttr
This matches the name of the AST node from which it was compiled. Suggested by sterni in cl/6231 Change-Id: Ia51525158d2f47467c01fce2282005b1a8417a47 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6623 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
parent
337d626f00
commit
da9e885e06
3 changed files with 3 additions and 3 deletions
|
@ -256,7 +256,7 @@ impl Compiler<'_, '_> {
|
||||||
|
|
||||||
// After the last fragment, emit the actual instruction that
|
// After the last fragment, emit the actual instruction that
|
||||||
// leaves a boolean on the stack.
|
// leaves a boolean on the stack.
|
||||||
self.push_op(OpCode::OpAttrsIsSet, &node);
|
self.push_op(OpCode::OpHasAttr, &node);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(super) fn compile_select(&mut self, slot: LocalIdx, node: ast::Select) {
|
pub(super) fn compile_select(&mut self, slot: LocalIdx, node: ast::Select) {
|
||||||
|
|
|
@ -91,7 +91,7 @@ pub enum OpCode {
|
||||||
OpAttrsUpdate,
|
OpAttrsUpdate,
|
||||||
OpAttrsSelect,
|
OpAttrsSelect,
|
||||||
OpAttrsTrySelect,
|
OpAttrsTrySelect,
|
||||||
OpAttrsIsSet,
|
OpHasAttr,
|
||||||
|
|
||||||
// `with`-handling
|
// `with`-handling
|
||||||
OpPushWith(StackIdx),
|
OpPushWith(StackIdx),
|
||||||
|
|
|
@ -317,7 +317,7 @@ impl<'o> VM<'o> {
|
||||||
self.push(value);
|
self.push(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
OpCode::OpAttrsIsSet => {
|
OpCode::OpHasAttr => {
|
||||||
let key = fallible!(self, self.pop().to_str());
|
let key = fallible!(self, self.pop().to_str());
|
||||||
let result = match self.pop() {
|
let result = match self.pop() {
|
||||||
Value::Attrs(attrs) => attrs.contains(key.as_str()),
|
Value::Attrs(attrs) => attrs.contains(key.as_str()),
|
||||||
|
|
Loading…
Reference in a new issue