Skip to content
This repository was archived by the owner on Aug 18, 2025. It is now read-only.

Commit 2fd40e1

Browse files
committed
重构了表达式解析器中的函数调用逻辑,移除了对特定命名空间的硬编码处理,统一使用NamespacedFunctionCall接口来处理所有命名空间函数调用,提升了代码的可读性和灵活性。
1 parent 1d267ec commit 2fd40e1

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/parser/expression_parser.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -381,14 +381,9 @@ impl<'a> ExpressionParser for ParserBase<'a> {
381381

382382
self.expect(")")?;
383383

384-
// 使用FunctionCall而不是NamespacedFunctionCall,以便直接匹配库函数
385-
if path.len() == 2 && (path[0] == "http" || path[0] == "std") {
386-
debug_println(&format!("使用FunctionCall处理: {}", full_name));
387-
Ok(Expression::FunctionCall(full_name, args))
388-
} else {
389-
debug_println(&format!("使用NamespacedFunctionCall处理: {:?}", path));
390-
Ok(Expression::NamespacedFunctionCall(path, args))
391-
}
384+
// 使用统一的接口处理所有命名空间函数调用,不再硬编码特定命名空间
385+
debug_println(&format!("使用NamespacedFunctionCall处理: {:?}", path));
386+
Ok(Expression::NamespacedFunctionCall(path, args))
392387
}
393388
} else if self.peek() == Some(&"++".to_string()) {
394389
// 后置自增

0 commit comments

Comments
 (0)