fix line number problem with %inline{} and recognize the 'explicit' directive in constructors
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8084 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
e5443e3bd4
commit
c694a41954
2 changed files with 6 additions and 3 deletions
|
|
@ -1260,7 +1260,7 @@ int yylex(void) {
|
||||||
if (strcmp(yytext,"catch") == 0) return (CATCH);
|
if (strcmp(yytext,"catch") == 0) return (CATCH);
|
||||||
if (strcmp(yytext,"inline") == 0) return(yylex());
|
if (strcmp(yytext,"inline") == 0) return(yylex());
|
||||||
if (strcmp(yytext,"mutable") == 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,"export") == 0) return(yylex());
|
||||||
if (strcmp(yytext,"typename") == 0) return (TYPENAME);
|
if (strcmp(yytext,"typename") == 0) return (TYPENAME);
|
||||||
if (strcmp(yytext,"template") == 0) {
|
if (strcmp(yytext,"template") == 0) {
|
||||||
|
|
|
||||||
|
|
@ -1437,7 +1437,7 @@ static void default_arguments(Node *n) {
|
||||||
%token ILLEGAL CONSTANT
|
%token ILLEGAL CONSTANT
|
||||||
%token NAME RENAME NAMEWARN EXTEND PRAGMA FEATURE VARARGS
|
%token NAME RENAME NAMEWARN EXTEND PRAGMA FEATURE VARARGS
|
||||||
%token ENUM
|
%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 USING
|
||||||
%token <node> NAMESPACE
|
%token <node> NAMESPACE
|
||||||
%token NATIVE INLINE
|
%token NATIVE INLINE
|
||||||
|
|
@ -1970,6 +1970,7 @@ inline_directive : INLINE HBLOCK {
|
||||||
}
|
}
|
||||||
| INLINE LBRACE {
|
| INLINE LBRACE {
|
||||||
String *cpps;
|
String *cpps;
|
||||||
|
int start_line = cparse_line;
|
||||||
skip_balanced('{','}');
|
skip_balanced('{','}');
|
||||||
if (Namespaceprefix) {
|
if (Namespaceprefix) {
|
||||||
Swig_error(cparse_file, cparse_start_line, "%%inline directive inside a namespace is disallowed.\n");
|
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);
|
Setattr($$,"code", code);
|
||||||
Delete(code);
|
Delete(code);
|
||||||
cpps=Copy(scanner_ccode);
|
cpps=Copy(scanner_ccode);
|
||||||
start_inline(Char(cpps), cparse_start_line);
|
start_inline(Char(cpps), start_line);
|
||||||
Delete(cpps);
|
Delete(cpps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3956,6 +3957,7 @@ cpp_constructor_decl : storage_class type LPAREN parms RPAREN ctor_end {
|
||||||
if (Classprefix) {
|
if (Classprefix) {
|
||||||
SwigType *decl = NewStringEmpty();
|
SwigType *decl = NewStringEmpty();
|
||||||
$$ = new_node("constructor");
|
$$ = new_node("constructor");
|
||||||
|
Setattr($$,"storage",$1);
|
||||||
Setattr($$,"name",$2);
|
Setattr($$,"name",$2);
|
||||||
Setattr($$,"parms",$4);
|
Setattr($$,"parms",$4);
|
||||||
SwigType_add_function(decl,$4);
|
SwigType_add_function(decl,$4);
|
||||||
|
|
@ -4293,6 +4295,7 @@ storage_class : EXTERN { $$ = "extern"; }
|
||||||
| TYPEDEF { $$ = "typedef"; }
|
| TYPEDEF { $$ = "typedef"; }
|
||||||
| VIRTUAL { $$ = "virtual"; }
|
| VIRTUAL { $$ = "virtual"; }
|
||||||
| FRIEND { $$ = "friend"; }
|
| FRIEND { $$ = "friend"; }
|
||||||
|
| EXPLICIT { $$ = "explicit"; }
|
||||||
| empty { $$ = 0; }
|
| empty { $$ = 0; }
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue