diff options
author | John Hodge <tpg@ucc.asn.au> | 2016-06-04 15:08:50 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2016-06-04 15:08:50 +0800 |
commit | f36518ed2fb6444884f991bcd6c8e0c3acd47beb (patch) | |
tree | 9ac3092f488192aba16e2ce1f4f160b98cd16ec0 /src/parse | |
parent | f92a45d8054cc18a037449ec136bf874ce20fc5a (diff) | |
download | mrust-f36518ed2fb6444884f991bcd6c8e0c3acd47beb.tar.gz |
Compilation fixes (clang and different gcc version)
Diffstat (limited to 'src/parse')
-rw-r--r-- | src/parse/lex.cpp | 3 | ||||
-rw-r--r-- | src/parse/parseerror.cpp | 3 | ||||
-rw-r--r-- | src/parse/parseerror.hpp | 2 | ||||
-rw-r--r-- | src/parse/root.cpp | 14 | ||||
-rw-r--r-- | src/parse/tokentree.hpp | 1 |
5 files changed, 13 insertions, 10 deletions
diff --git a/src/parse/lex.cpp b/src/parse/lex.cpp index 5530f0b5..2b84d0e4 100644 --- a/src/parse/lex.cpp +++ b/src/parse/lex.cpp @@ -930,8 +930,7 @@ void Lexer::ungetc() m_last_char_valid = true; } -TTStream::TTStream(const TokenTree& input_tt): - m_input_tt(input_tt) +TTStream::TTStream(const TokenTree& input_tt) { DEBUG("input_tt = [" << input_tt << "]"); m_stack.push_back( ::std::make_pair(0, &input_tt) ); diff --git a/src/parse/parseerror.cpp b/src/parse/parseerror.cpp index 7c6f6a21..116776a5 100644 --- a/src/parse/parseerror.cpp +++ b/src/parse/parseerror.cpp @@ -47,8 +47,7 @@ CompileError::Todo::~Todo() throw() {
}
-ParseError::BadChar::BadChar(const TokenStream& lex, char character):
- m_char(character)
+ParseError::BadChar::BadChar(const TokenStream& lex, char character)
{
::std::cout << lex.getPosition() << ": BadChar(" << character << ")" << ::std::endl;
}
diff --git a/src/parse/parseerror.hpp b/src/parse/parseerror.hpp index 42a89785..b847ccc4 100644 --- a/src/parse/parseerror.hpp +++ b/src/parse/parseerror.hpp @@ -14,7 +14,7 @@ using CompileError::Todo; class BadChar:
public CompileError::Base
{
- char m_char;
+ //char m_char;
public:
BadChar(const TokenStream& lex, char character);
virtual ~BadChar() throw ();
diff --git a/src/parse/root.cpp b/src/parse/root.cpp index 58708ec7..15b792d0 100644 --- a/src/parse/root.cpp +++ b/src/parse/root.cpp @@ -65,10 +65,14 @@ void Parse_TypeBound(TokenStream& lex, AST::GenericParams& ret, TypeRef checked_ do
{
if(GET_TOK(tok, lex) == TOK_LIFETIME) {
- ret.add_bound(AST::GenericBound::make_TypeLifetime( {type: checked_type, bound: tok.str()} ));
+ ret.add_bound(AST::GenericBound::make_TypeLifetime( {
+ checked_type.clone(), tok.str()
+ } ));
}
else if( tok.type() == TOK_QMARK ) {
- ret.add_bound(AST::GenericBound::make_MaybeTrait( {type: checked_type, trait: Parse_Path(lex, PATH_GENERIC_TYPE)} ));
+ ret.add_bound(AST::GenericBound::make_MaybeTrait( {
+ checked_type.clone(), Parse_Path(lex, PATH_GENERIC_TYPE)
+ } ));
}
else {
if( tok.type() == TOK_RWORD_FOR )
@@ -90,7 +94,9 @@ void Parse_TypeBound(TokenStream& lex, AST::GenericParams& ret, TypeRef checked_ PUTBACK(tok, lex);
}
- ret.add_bound( AST::GenericBound::make_IsTrait( {type: checked_type, hrls: lifetimes, trait: Parse_Path(lex, PATH_GENERIC_TYPE) }) );
+ ret.add_bound( AST::GenericBound::make_IsTrait({
+ checked_type.clone(), mv$(lifetimes), Parse_Path(lex, PATH_GENERIC_TYPE)
+ }) );
}
} while( GET_TOK(tok, lex) == TOK_PLUS );
PUTBACK(tok, lex);
@@ -131,7 +137,7 @@ AST::GenericParams Parse_GenericParams(TokenStream& lex) {
do {
GET_CHECK_TOK(tok, lex, TOK_LIFETIME);
- ret.add_bound(AST::GenericBound::make_Lifetime( {test: param_name, bound: tok.str()} ));
+ ret.add_bound(AST::GenericBound::make_Lifetime( {param_name, tok.str()} ));
} while( GET_TOK(tok, lex) == TOK_PLUS );
}
else
diff --git a/src/parse/tokentree.hpp b/src/parse/tokentree.hpp index 68080689..7f8810a7 100644 --- a/src/parse/tokentree.hpp +++ b/src/parse/tokentree.hpp @@ -61,7 +61,6 @@ public: class TTStream:
public TokenStream
{
- const TokenTree& m_input_tt;
::std::vector< ::std::pair<unsigned int, const TokenTree*> > m_stack;
public:
TTStream(const TokenTree& input_tt);
|