fix line number problem with %inline{} and recognize the 'explicit' directive in constructors

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8084 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-12-27 21:26:10 +00:00
commit 6baa54ce6e
2 changed files with 6 additions and 3 deletions

View file

@ -1260,7 +1260,7 @@ int yylex(void) {
if (strcmp(yytext,"catch") == 0) return (CATCH);
if (strcmp(yytext,"inline") == 0) return(yylex());
if (strcmp(yytext,"mutable") == 0) return(yylex());
if (strcmp(yytext,"explicit") == 0) return(yylex());
if (strcmp(yytext,"explicit") == 0) return(EXPLICIT);
if (strcmp(yytext,"export") == 0) return(yylex());
if (strcmp(yytext,"typename") == 0) return (TYPENAME);
if (strcmp(yytext,"template") == 0) {

View file

@ -1437,7 +1437,7 @@ static void default_arguments(Node *n) {
%token ILLEGAL CONSTANT
%token NAME RENAME NAMEWARN EXTEND PRAGMA FEATURE VARARGS
%token ENUM
%token CLASS TYPENAME PRIVATE PUBLIC PROTECTED COLON STATIC VIRTUAL FRIEND THROW CATCH
%token CLASS TYPENAME PRIVATE PUBLIC PROTECTED COLON STATIC VIRTUAL FRIEND THROW CATCH EXPLICIT
%token USING
%token <node> NAMESPACE
%token NATIVE INLINE
@ -1970,6 +1970,7 @@ inline_directive : INLINE HBLOCK {
}
| INLINE LBRACE {
String *cpps;
int start_line = cparse_line;
skip_balanced('{','}');
if (Namespaceprefix) {
Swig_error(cparse_file, cparse_start_line, "%%inline directive inside a namespace is disallowed.\n");
@ -1984,7 +1985,7 @@ inline_directive : INLINE HBLOCK {
Setattr($$,"code", code);
Delete(code);
cpps=Copy(scanner_ccode);
start_inline(Char(cpps), cparse_start_line);
start_inline(Char(cpps), start_line);
Delete(cpps);
}
}
@ -3956,6 +3957,7 @@ cpp_constructor_decl : storage_class type LPAREN parms RPAREN ctor_end {
if (Classprefix) {
SwigType *decl = NewStringEmpty();
$$ = new_node("constructor");
Setattr($$,"storage",$1);
Setattr($$,"name",$2);
Setattr($$,"parms",$4);
SwigType_add_function(decl,$4);
@ -4293,6 +4295,7 @@ storage_class : EXTERN { $$ = "extern"; }
| TYPEDEF { $$ = "typedef"; }
| VIRTUAL { $$ = "virtual"; }
| FRIEND { $$ = "friend"; }
| EXPLICIT { $$ = "explicit"; }
| empty { $$ = 0; }
;