Skip to content

Commit

Permalink
A better fix for bison 3.5.
Browse files Browse the repository at this point in the history
  • Loading branch information
lzwdgc committed Feb 11, 2020
1 parent 7bb6472 commit f720815
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/schema/schema.yy
Expand Up @@ -68,21 +68,20 @@ struct MY_PARSER_DRIVER : MY_PARSER
Token t; Token t;
t.token = tok.type; t.token = tok.type;


by_type bt; if (0);
bt.type = tok.type; else if (by_type(token::INTEGER).type_get() == tok.type)
switch (bt.type_get())
{ {
case token::INTEGER:
t.type = Token::Integer; t.type = Token::Integer;
t.value = tok.value.as<int>(); t.value = tok.value.as<int>();
break; }
case token::STRING: else if (by_type(token::STRING).type_get() == tok.type)
{
t.type = Token::String; t.type = Token::String;
t.value = tok.value.as<std::string>(); t.value = tok.value.as<std::string>();
break; }
default: else
{
t.type = Token::None; t.type = Token::None;
break;
} }
return t; return t;
} }
Expand Down

0 comments on commit f720815

Please sign in to comment.