Remove unions from the DebugInfo class

This commit is contained in:
Gunnar Beutner 2014-11-13 09:02:43 +01:00
parent e692ca16cd
commit 02fef3f84a
2 changed files with 19 additions and 22 deletions

View File

@ -36,29 +36,11 @@ struct DebugInfo
{
String Path;
union
{
int FirstLine;
int first_line;
};
int FirstLine;
int FirstColumn;
union
{
int FirstColumn;
int first_column;
};
union
{
int LastLine;
int last_line;
};
union
{
int LastColumn;
int last_column;
};
int LastLine;
int LastColumn;
};
I2_BASE_API std::ostream& operator<<(std::ostream& out, const DebugInfo& val);

View File

@ -41,6 +41,21 @@ do { \
yycolumn += yyleng; \
} while (0);
#define YYLLOC_DEFAULT(Current, Rhs, N) \
do \
if (YYID (N)) { \
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
} else { \
(Current).first_line = (Current).last_line = \
YYRHSLOC(Rhs, 0).last_line; \
(Current).first_column = (Current).last_column = \
YYRHSLOC(Rhs, 0).last_column; \
} \
while (YYID(0))
#define YY_INPUT(buf, result, max_size) \
do { \
result = yyextra->ReadInput(buf, max_size); \