1.1 --- a/src/compiler/AST.h Sat Dec 29 00:55:38 2012 -0800
1.2 +++ b/src/compiler/AST.h Tue Jan 01 15:34:07 2013 -0800
1.3 @@ -28,6 +28,7 @@
1.4 namespace ke {
1.5
1.6 class Scope;
1.7 +struct PathComponent;
1.8
1.9 #define ASTKINDS(_) \
1.10 _(VariableDeclaration) \
1.11 @@ -58,7 +59,7 @@
1.12 _(StructureStatement) \
1.13 _(SwitchStatement) \
1.14 _(ArrayLiteral) \
1.15 - _(ImportStatement)
1.16 + _(ImportStatement)
1.17
1.18 // Forward declarations.
1.19 #define _(name) class name;
1.20 @@ -1104,9 +1105,9 @@
1.21 class ImportStatement : public Statement
1.22 {
1.23 public:
1.24 - ImportStatement(const SourcePosition &pos, NameList *names, TokenKind suffix)
1.25 + ImportStatement(const SourcePosition &pos, PathComponent *path, TokenKind suffix)
1.26 : Statement(pos),
1.27 - names_(names),
1.28 + path_(path),
1.29 suffix_(suffix),
1.30 source_(NULL)
1.31 {
1.32 @@ -1114,8 +1115,8 @@
1.33
1.34 DECLARE_NODE(ImportStatement);
1.35
1.36 - NameList *path() const {
1.37 - return names_;
1.38 + PathComponent *path() const {
1.39 + return path_;
1.40 }
1.41 void setImportSource(TranslationUnit *unit) {
1.42 source_ = unit;
1.43 @@ -1126,13 +1127,9 @@
1.44 TokenKind suffix() const {
1.45 return suffix_;
1.46 }
1.47 - Handle<String> name() const {
1.48 - assert(suffix() != TOK_STAR);
1.49 - return *names_->at(names_->length() - 1);
1.50 - }
1.51
1.52 private:
1.53 - NameList *names_;
1.54 + PathComponent *path_;
1.55 TokenKind suffix_;
1.56 TranslationUnit *source_;
1.57 };