Changes for bison < 3.6
Includes fix for double quoted tokens in syntax errors.
This commit is contained in:
@@ -25,7 +25,7 @@ namespace VERILOG_FRONTEND {
|
||||
// get rid of override virtual function warning
|
||||
using FlexLexer::yylex;
|
||||
parser::symbol_type terminate() {
|
||||
return parser::make_FRONTEND_VERILOG_YYEOF(out_loc);
|
||||
return parser::symbol_type(0, std::move(out_loc));
|
||||
}
|
||||
private:
|
||||
std::shared_ptr<std::string> current_filename;
|
||||
|
||||
@@ -149,7 +149,7 @@ parser::symbol_type char_tok(char c, parser::location_type loc) {
|
||||
case 'p': return parser::make_TOK_p(loc);
|
||||
case 'x': return parser::make_TOK_x(loc);
|
||||
case 'z': return parser::make_TOK_z(loc);
|
||||
case 0: return parser::make_FRONTEND_VERILOG_YYEOF(loc);
|
||||
case 0: return parser::symbol_type(0, std::move(loc));
|
||||
default:
|
||||
return parser::make_ch_t(c, loc);
|
||||
}
|
||||
|
||||
@@ -428,7 +428,14 @@
|
||||
|
||||
void frontend_verilog_yy::parser::error(const frontend_verilog_yy::parser::location_type& loc, const std::string& msg)
|
||||
{
|
||||
err_at_loc(loc, "%s", msg.c_str());
|
||||
std::string new_msg(msg);
|
||||
size_t pos = new_msg.find("\"'");
|
||||
if (pos != std::string::npos)
|
||||
new_msg.replace(pos, 2, "'");
|
||||
pos = new_msg.find("'\"");
|
||||
if (pos != std::string::npos)
|
||||
new_msg.replace(pos, 2, "'");
|
||||
err_at_loc(loc, "%s", new_msg.c_str());
|
||||
}
|
||||
// end unqual
|
||||
}
|
||||
@@ -589,7 +596,7 @@
|
||||
%precedence OP_CAST
|
||||
%precedence UNARY_OPS
|
||||
|
||||
%define parse.error detailed
|
||||
%define parse.error verbose
|
||||
%define parse.lac full
|
||||
|
||||
%precedence FAKE_THEN
|
||||
|
||||
Reference in New Issue
Block a user