Add quasiquote for matchers and attributes
This commit is contained in:
parent
1576142495
commit
3541abedeb
10 changed files with 269 additions and 45 deletions
|
@ -243,12 +243,15 @@ pub fn nameize(p_s: &ParseSess, ms: &[TokenTree], res: &[Rc<NamedMatch>])
|
|||
ret_val
|
||||
}
|
||||
|
||||
pub enum ParseResult {
|
||||
Success(HashMap<Ident, Rc<NamedMatch>>),
|
||||
pub enum ParseResult<T> {
|
||||
Success(T),
|
||||
Failure(codemap::Span, String),
|
||||
Error(codemap::Span, String)
|
||||
}
|
||||
|
||||
pub type NamedParseResult = ParseResult<HashMap<Ident, Rc<NamedMatch>>>;
|
||||
pub type PositionalParseResult = ParseResult<Vec<Rc<NamedMatch>>>;
|
||||
|
||||
pub fn parse_or_else(sess: &ParseSess,
|
||||
cfg: ast::CrateConfig,
|
||||
rdr: TtReader,
|
||||
|
@ -280,7 +283,7 @@ pub fn parse(sess: &ParseSess,
|
|||
cfg: ast::CrateConfig,
|
||||
mut rdr: TtReader,
|
||||
ms: &[TokenTree])
|
||||
-> ParseResult {
|
||||
-> NamedParseResult {
|
||||
let mut cur_eis = Vec::new();
|
||||
cur_eis.push(initial_matcher_pos(Rc::new(ms.iter()
|
||||
.cloned()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue