Skip to content

Commit

Permalink
rename validate_literal to check_literal_value
Browse files Browse the repository at this point in the history
  • Loading branch information
jimblandy committed Oct 19, 2023
1 parent 4ba0d19 commit 22adbe1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/proc/constant_evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@ impl<'a> ConstantEvaluator<'a> {
// expression at a time, `Compose` expressions can only refer to other
// expressions, and `ZeroValue` expressions are always okay.
if let Expression::Literal(literal) = expr {
crate::valid::validate_literal(literal)?;
crate::valid::check_literal_value(literal)?;
}

if let Some(FunctionLocalData {
Expand Down
6 changes: 3 additions & 3 deletions src/valid/expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ impl super::Validator {

match gctx.const_expressions[handle] {
E::Literal(literal) => {
validate_literal(literal)?;
check_literal_value(literal)?;
}
E::Constant(_) | E::ZeroValue(_) => {}
E::Compose { ref components, ty } => {
Expand Down Expand Up @@ -343,7 +343,7 @@ impl super::Validator {
ShaderStages::all()
}
E::Literal(literal) => {
validate_literal(literal)?;
check_literal_value(literal)?;
ShaderStages::all()
}
E::Constant(_) | E::ZeroValue(_) => ShaderStages::all(),
Expand Down Expand Up @@ -1565,7 +1565,7 @@ impl super::Validator {
}
}

pub fn validate_literal(literal: crate::Literal) -> Result<(), LiteralError> {
pub fn check_literal_value(literal: crate::Literal) -> Result<(), LiteralError> {
let is_nan = match literal {
crate::Literal::F64(v) => v.is_nan(),
crate::Literal::F32(v) => v.is_nan(),
Expand Down
2 changes: 1 addition & 1 deletion src/valid/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use std::ops;
use crate::span::{AddSpan as _, WithSpan};
pub use analyzer::{ExpressionInfo, FunctionInfo, GlobalUse, Uniformity, UniformityRequirements};
pub use compose::ComposeError;
pub use expression::{validate_literal, LiteralError};
pub use expression::{check_literal_value, LiteralError};
pub use expression::{ConstExpressionError, ExpressionError};
pub use function::{CallError, FunctionError, LocalVariableError};
pub use interface::{EntryPointError, GlobalVariableError, VaryingError};
Expand Down

0 comments on commit 22adbe1

Please sign in to comment.