Skip to content

Commit

Permalink
misc: removed Abs paths
Browse files Browse the repository at this point in the history
  • Loading branch information
baszalmstra committed Oct 26, 2020
1 parent 68df097 commit 7b50951
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
6 changes: 1 addition & 5 deletions crates/mun_hir/src/name_resolution/path_resolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,7 @@ impl PackageDefs {
}
.into(),
Visibility::Public,
)),
PathKind::Abs => {
// TODO: How do we get here?
return ResolvePathResult::empty(ReachedFixedPoint::No); // extern crate declarations can add to the extern prelude
}
))
};

for (i, segment) in segments {
Expand Down
5 changes: 0 additions & 5 deletions crates/mun_hir/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ pub enum PathKind {
// `self` is Super(0)
Super(u8),
Package,
Abs,
}

impl Path {
Expand All @@ -24,10 +23,6 @@ impl Path {
loop {
let segment = path.segment()?;

if segment.has_colon_colon() {
kind = PathKind::Abs;
}

match segment.kind()? {
ast::PathSegmentKind::Name(name) => {
segments.push(name.as_name());
Expand Down
9 changes: 3 additions & 6 deletions crates/mun_syntax/src/parsing/grammar/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ enum Mode {

fn path(p: &mut Parser, mode: Mode) {
let path = p.start();
path_segment(p, mode, true);
path_segment(p, mode);
let mut qualifier = path.complete(p, PATH);
loop {
let import_tree = matches!(p.nth(1), T![*] | T!['{']);
if p.at(T![::]) && !import_tree {
let path = qualifier.precede(p);
p.bump(T![::]);
path_segment(p, mode, false);
path_segment(p, mode);
let path = path.complete(p, PATH);
qualifier = path;
} else {
Expand All @@ -38,11 +38,8 @@ fn path(p: &mut Parser, mode: Mode) {
}
}

fn path_segment(p: &mut Parser, _mode: Mode, first: bool) {
fn path_segment(p: &mut Parser, _mode: Mode) {
let m = p.start();
if first {
p.eat(T![::]);
}
match p.current() {
IDENT => {
name_ref(p);
Expand Down

0 comments on commit 7b50951

Please sign in to comment.