mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-28 17:19:11 +01:00
[naga wgsl-in] Remove unnecessary dependencies.
Avoid adding entries to `ExpressionContext::unresolved` for identifiers that `ExpressionContext::ident_expr` has already processed. At the moment, there is no way these could cause a bug: they only occur after we've recognized a call/construction expression, and those can never refer to function-local definitions, so the string in question is certain to have already been added to `unresolved` by `ExpressionContext::ident_expr`. But they're redundant, and if Naga ever supported nested functions or local type aliases, these could end up adding extraneous dependencies.
This commit is contained in:
1 parent
ada7681067
commit
0c77a1f6ca
1 file changed
-9
@@ -489,10 +489,6 @@ impl Parser {
|
||||
|
||||
if let Token::Paren('(') = lexer.peek().0 {
|
||||
let arguments = self.arguments(lexer, ctx)?;
|
||||
ctx.unresolved.insert(ast::Dependency {
|
||||
ident: word,
|
||||
usage: span,
|
||||
});
|
||||
ast::Expression::Call(ast::CallPhrase {
|
||||
function: ident,
|
||||
arguments,
|
||||
@@ -1105,11 +1101,6 @@ impl Parser {
|
||||
|
||||
self.push_rule_span(Rule::SingularExpr, lexer);
|
||||
|
||||
context.unresolved.insert(ast::Dependency {
|
||||
ident: name,
|
||||
usage: name_span,
|
||||
});
|
||||
|
||||
let arguments = self.arguments(lexer, context)?;
|
||||
let span = lexer.span_with_start(name_span);
|
||||
|
||||
|
||||
Reference in new issue
Block a user