diff options
author | John Hodge <tpg@ucc.asn.au> | 2019-11-02 11:07:23 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2019-11-02 11:07:23 +0800 |
commit | 1d02810c3cf908bfba7c15ae50eb5314603b9d85 (patch) | |
tree | 79dd5e4ef4c3ff79db0912ba546f08e61a7a8c10 /src/parse/parseerror.cpp | |
parent | 7111acba04d72fe4084b1a1f3209ff83efe8614d (diff) | |
parent | 8b53b38f40625ab0510f541d69db3f83332a830a (diff) | |
download | mrust-1d02810c3cf908bfba7c15ae50eb5314603b9d85.tar.gz |
Merge branch 'nightly-1.29' - #95 Working support for rustc 1.29
Diffstat (limited to 'src/parse/parseerror.cpp')
-rw-r--r-- | src/parse/parseerror.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/parse/parseerror.cpp b/src/parse/parseerror.cpp index 1bb30985..f2a5343b 100644 --- a/src/parse/parseerror.cpp +++ b/src/parse/parseerror.cpp @@ -61,7 +61,7 @@ ParseError::Unexpected::Unexpected(const TokenStream& lex, const Token& tok)//: Span pos = tok.get_pos(); if(pos.filename == "") pos = lex.point_span(); - ::std::cout << pos << ": Unexpected(" << tok << ")" << ::std::endl; + ERROR(pos, E0000, "Unexpected token " << tok); } ParseError::Unexpected::Unexpected(const TokenStream& lex, const Token& tok, Token exp)//: // m_tok( mv$(tok) ) @@ -69,22 +69,22 @@ ParseError::Unexpected::Unexpected(const TokenStream& lex, const Token& tok, Tok Span pos = tok.get_pos(); if(pos.filename == "") pos = lex.point_span(); - ::std::cout << pos << ": Unexpected(" << tok << ", " << exp << ")" << ::std::endl; + ERROR(pos, E0000, "Unexpected token " << tok << ", expected " << exp); } ParseError::Unexpected::Unexpected(const TokenStream& lex, const Token& tok, ::std::vector<eTokenType> exp) { Span pos = tok.get_pos(); if(pos.filename == "") pos = lex.point_span(); - ::std::cout << pos << ": Unexpected " << tok << ", expected "; - bool f = true; - for(auto v: exp) { - if(!f) - ::std::cout << " or "; - f = false; - ::std::cout << Token::typestr(v); - } - ::std::cout << ::std::endl; + ERROR(pos, E0000, "Unexpected token " << tok << ", expected one of " << FMT_CB(os, { + bool f = true; + for(auto v: exp) { + if(!f) + os << " or "; + f = false; + os << Token::typestr(v); + } + })); } ParseError::Unexpected::~Unexpected() throw() { |