Fix %include inside %define macros - patch from Karl Wette
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12924 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
911ee91de1
commit
425b460a09
8 changed files with 82 additions and 7 deletions
|
|
@ -767,6 +767,10 @@ int yylex(void) {
|
|||
}
|
||||
if (strcmp(yytext, "%includefile") == 0)
|
||||
return (INCLUDE);
|
||||
if (strcmp(yytext, "%beginfile") == 0)
|
||||
return (BEGINFILE);
|
||||
if (strcmp(yytext, "%endoffile") == 0)
|
||||
return (ENDOFFILE);
|
||||
if (strcmp(yytext, "%val") == 0) {
|
||||
Swig_warning(WARN_DEPRECATED_VAL, cparse_file, cparse_line, "%%val directive deprecated (ignored).\n");
|
||||
return (yylex());
|
||||
|
|
|
|||
|
|
@ -1644,6 +1644,7 @@ static void tag_nodes(Node *n, const_String_or_char_ptr attrname, DOH *value) {
|
|||
%token <type> TYPE_INT TYPE_UNSIGNED TYPE_SHORT TYPE_LONG TYPE_FLOAT TYPE_DOUBLE TYPE_CHAR TYPE_WCHAR TYPE_VOID TYPE_SIGNED TYPE_BOOL TYPE_COMPLEX TYPE_TYPEDEF TYPE_RAW TYPE_NON_ISO_INT8 TYPE_NON_ISO_INT16 TYPE_NON_ISO_INT32 TYPE_NON_ISO_INT64
|
||||
%token LPAREN RPAREN COMMA SEMI EXTERN INIT LBRACE RBRACE PERIOD
|
||||
%token CONST_QUAL VOLATILE REGISTER STRUCT UNION EQUAL SIZEOF MODULE LBRACKET RBRACKET
|
||||
%token BEGINFILE ENDOFFILE
|
||||
%token ILLEGAL CONSTANT
|
||||
%token NAME RENAME NAMEWARN EXTEND PRAGMA FEATURE VARARGS
|
||||
%token ENUM
|
||||
|
|
@ -2110,7 +2111,7 @@ fragment_directive: FRAGMENT LPAREN fname COMMA kwargs RPAREN HBLOCK {
|
|||
%importfile(option1="xyz", ...) "filename" [ declarations ]
|
||||
------------------------------------------------------------ */
|
||||
|
||||
include_directive: includetype options string LBRACKET {
|
||||
include_directive: includetype options string BEGINFILE {
|
||||
$1.filename = Copy(cparse_file);
|
||||
$1.line = cparse_line;
|
||||
scanner_set_location(NewString($3),1);
|
||||
|
|
@ -2119,7 +2120,7 @@ include_directive: includetype options string LBRACKET {
|
|||
if (maininput)
|
||||
scanner_set_main_input_file(NewString(maininput));
|
||||
}
|
||||
} interface RBRACKET {
|
||||
} interface ENDOFFILE {
|
||||
String *mname = 0;
|
||||
$$ = $6;
|
||||
scanner_set_location($1.filename,$1.line+1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue