blob: 29ad8dacd147210bf06e259db9517a255a135a4e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#include "../common.hpp"
#include "../ast/ast.hpp"
#include "../parse/parseerror.hpp"
// Path resolution checking
void ResolvePaths(AST::Crate& crate);
void ResolvePaths_HandleFunction(const AST::Crate& crate, AST::Function& fcn);
class CResolvePaths_NodeVisitor:
public AST::NodeVisitor
{
const AST::Crate& m_crate;
public:
CResolvePaths_NodeVisitor(const AST::Crate& crate):
m_crate(crate)
{
}
void visit(AST::ExprNode::TagNamedValue, AST::ExprNode& node) {
// TODO: Convert into a real absolute path
throw ParseError::Todo("CResolvePaths_NodeVisitor::visit(TagNamedValue)");
}
};
void ResolvePaths_Type(TypeRef& type)
{
// TODO: Convert type into absolute
throw ParseError::Todo("ResolvePaths_Type");
}
void ResolvePaths_HandleFunction(const AST::Crate& crate, AST::Function& fcn)
{
fcn.code().visit_nodes( CResolvePaths_NodeVisitor(crate) );
ResolvePaths_Type(fcn.rettype());
FOREACH_M(AST::Function::Arglist, arg, fcn.args())
{
ResolvePaths_Type(arg->second);
}
}
void ResolvePaths(AST::Crate& crate)
{
crate.iterate_functions(ResolvePaths_HandleFunction);
}
|