Doccomment import patterns
This commit is contained in:
parent
a53d38eef0
commit
4d2b6b98b5
|
@ -3,10 +3,14 @@ use serde::{Deserialize, Serialize};
|
||||||
use crate::{ModuleId, Span, VarId};
|
use crate::{ModuleId, Span, VarId};
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
|
||||||
|
/// possible patterns after the first module level in an [`ImportPattern`].
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub enum ImportPatternMember {
|
pub enum ImportPatternMember {
|
||||||
|
/// Wildcard import of items
|
||||||
Glob { span: Span },
|
Glob { span: Span },
|
||||||
|
/// single specific module or item
|
||||||
Name { name: Vec<u8>, span: Span },
|
Name { name: Vec<u8>, span: Span },
|
||||||
|
/// list of items
|
||||||
List { names: Vec<(Vec<u8>, Span)> },
|
List { names: Vec<(Vec<u8>, Span)> },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,6 +35,7 @@ impl ImportPatternMember {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The first item of a `use` statement needs to specify an explicit module
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub struct ImportPatternHead {
|
pub struct ImportPatternHead {
|
||||||
pub name: Vec<u8>,
|
pub name: Vec<u8>,
|
||||||
|
@ -38,6 +43,7 @@ pub struct ImportPatternHead {
|
||||||
pub span: Span,
|
pub span: Span,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The pattern specifying modules in a `use` statement
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub struct ImportPattern {
|
pub struct ImportPattern {
|
||||||
pub head: ImportPatternHead,
|
pub head: ImportPatternHead,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user