cleanup the api

This commit is contained in:
Aleksey Kladov 2019-01-31 22:14:28 +03:00
parent a16f6bb27d
commit b4b522fb39
3 changed files with 70 additions and 56 deletions

View file

@ -1,10 +1,9 @@
use crate::tt_cursor::TtCursor;
/// This module parses a raw `tt::TokenStream` into macro-by-example token
/// stream. This is a *mostly* identify function, expect for handling of
/// `$var:tt_kind` and `$(repeat),*` constructs.
use crate::tt_cursor::TtCursor;
pub fn parse(tt: &tt::Subtree) -> Option<crate::MacroRules> {
pub(crate) fn parse(tt: &tt::Subtree) -> Option<crate::MacroRules> {
let mut parser = TtCursor::new(tt);
let mut rules = Vec::new();
while !parser.is_eof() {