summaryrefslogtreecommitdiff
path: root/src/parse/tokenstream.hpp
diff options
context:
space:
mode:
authorJohn Hodge (Mutabah) <acessdev@gmail.com>2016-12-25 17:19:27 +1100
committerGitHub <noreply@github.com>2016-12-25 17:19:27 +1100
commit753a2f44cc4c00b952cddae2ceed066ebb18a470 (patch)
treeed4bbff4be39c44c57164641f4ed32b5ad4675f0 /src/parse/tokenstream.hpp
parentd12a8a886caf2e0edf33c1af831b1df990d2c892 (diff)
parent0c14c734fa32014fd24297ccdbed927016185ffd (diff)
downloadmrust-753a2f44cc4c00b952cddae2ceed066ebb18a470.tar.gz
Merge pull request #11 from ubsan/whitespace-fix
No more tears!
Diffstat (limited to 'src/parse/tokenstream.hpp')
-rw-r--r--src/parse/tokenstream.hpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/parse/tokenstream.hpp b/src/parse/tokenstream.hpp
index ae737d0d..85fc62e2 100644
--- a/src/parse/tokenstream.hpp
+++ b/src/parse/tokenstream.hpp
@@ -26,15 +26,15 @@ struct ParseState
bool disallow_struct_literal = false;
// A debugging hook that disables expansion of macros
bool no_expand_macros = false;
-
+
::AST::Module* module = nullptr;
::AST::MetaItems* parent_attrs = nullptr;
-
+
::AST::Module& get_current_mod() {
assert(this->module);
return *this->module;
}
-
+
friend ::std::ostream& operator<<(::std::ostream& os, const ParseState& ps) {
os << "ParseState {";
if(ps.disallow_struct_literal) os << " disallow_struct_literal";
@@ -47,7 +47,7 @@ struct ParseState
class TokenStream
{
friend class TTLexer; // needs access to internals to know what was consumed
-
+
bool m_cache_valid;
Token m_cache;
Ident::Hygiene m_hygiene;
@@ -59,17 +59,17 @@ public:
Token getToken();
void putback(Token tok);
eTokenType lookahead(unsigned int count);
-
+
virtual Position getPosition() const = 0;
Ident::Hygiene getHygiene() const;
-
+
ParseState& parse_state() { return m_parse_state; }
-
+
ProtoSpan start_span() const;
Span end_span(ProtoSpan ps) const;
-
+
Ident get_ident(Token tok) const;
-
+
protected:
virtual Token realGetToken() = 0;
virtual Ident::Hygiene realGetHygiene() const = 0;