diff options
| author | gingerBill <bill@gingerbill.org> | 2017-10-18 22:29:14 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2017-10-18 22:29:14 +0100 |
| commit | 71729c2855f3a13f6809e1bed92c31ca87623140 (patch) | |
| tree | 8438a03278e11da9cb4588cd09534bdc84bea55a /src/checker.cpp | |
| parent | 6c8c430c2a5af0a04a70cb4e9bf79c22f6554ab9 (diff) | |
Add anonymous `using import` names with an underscore (#127)
`using import _ "foo.odin"`
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index 9fdf715e4..f78249b2f 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -2525,7 +2525,11 @@ void check_add_import_decl(Checker *c, AstNodeImportDecl *id) { String import_name = path_to_entity_name(id->import_name.string, id->fullpath); if (is_blank_ident(import_name)) { - error(token, "File name, %.*s, cannot be use as an import name as it is not a valid identifier", LIT(id->import_name.string)); + if (id->is_using) { + // TODO(bill): Should this be a warning? + } else { + error(token, "File name, %.*s, cannot be use as an import name as it is not a valid identifier", LIT(id->import_name.string)); + } } else { GB_ASSERT(id->import_name.pos.line != 0); id->import_name.string = import_name; |