Added the #line directive

This commit is contained in:
Pierre Pronchery 2008-03-03 16:01:30 +00:00
parent 4342ab2ec8
commit 9c6ae26a9a
2 changed files with 9 additions and 2 deletions

View File

@ -30,7 +30,8 @@ typedef enum _CppFilter { CPP_FILTER_TRIGRAPH = 1 } CppFilter;
typedef enum _CppCode
{
CPP_CODE_COMMA = 0,
CPP_CODE_NULL = TC_NULL,
CPP_CODE_COMMA,
CPP_CODE_DQUOTE,
CPP_CODE_META_DEFINE,
CPP_CODE_META_ELIF,
@ -41,6 +42,7 @@ typedef enum _CppCode
CPP_CODE_META_IFDEF,
CPP_CODE_META_IFNDEF,
CPP_CODE_META_INCLUDE,
CPP_CODE_META_LINE,
CPP_CODE_META_PRAGMA,
CPP_CODE_META_UNDEF,
CPP_CODE_META_WARNING,

View File

@ -74,6 +74,7 @@ typedef enum _CppDirective
CPP_DIRECTIVE_ERROR,
CPP_DIRECTIVE_IF,
CPP_DIRECTIVE_IFDEF,
CPP_DIRECTIVE_LINE,
CPP_DIRECTIVE_IFNDEF,
CPP_DIRECTIVE_INCLUDE,
CPP_DIRECTIVE_PRAGMA,
@ -145,7 +146,7 @@ static const size_t _cpp_directives_cnt = CPP_DIRECTIVE_COUNT;
static const char * _cpp_directives[CPP_DIRECTIVE_COUNT] =
{
"define", "elif", "else", "endif", "error", "if", "ifdef", "ifndef",
"include", "pragma", "undef", "warning"
"include", "line", "pragma", "undef", "warning"
};
@ -485,6 +486,10 @@ static int _cpp_callback_directive(Parser * parser, Token * token, int c,
case CPP_DIRECTIVE_INCLUDE:
ret = _directive_include(cpp, token, pos);
break;
case CPP_DIRECTIVE_LINE:
/* FIXME implement */
token_set_code(token, CPP_CODE_META_LINE);
break;
case CPP_DIRECTIVE_PRAGMA:
/* FIXME implement */
token_set_code(token, CPP_CODE_META_PRAGMA);