Parse template parameters and part of alias template

This commit is contained in:
Jonathan Müller 2017-03-23 09:10:14 +01:00
commit cd4a25e959
14 changed files with 688 additions and 45 deletions

View file

@ -76,15 +76,28 @@ namespace cppast
return tokens_.end();
}
// if it returns true, the last token is ">>",
// but should haven been ">"
// only a problem for template parameters
bool unmunch() const noexcept
{
return unmunch_;
}
private:
std::vector<token> tokens_;
bool unmunch_;
};
class token_stream
{
public:
explicit token_stream(const tokenizer& tokenizer, const CXCursor& cur)
: cursor_(cur), begin_(tokenizer.begin()), cur_(begin_), end_(tokenizer.end())
: cursor_(cur),
begin_(tokenizer.begin()),
cur_(begin_),
end_(tokenizer.end()),
unmunch_(tokenizer.unmunch())
{
}
@ -144,9 +157,15 @@ namespace cppast
cur_ = iter;
}
bool unmunch() const noexcept
{
return unmunch_;
}
private:
CXCursor cursor_;
token_iterator begin_, cur_, end_;
bool unmunch_;
};
// skips the next token