Another merge with master.

Change Doxygen error codes to start at 740 instead of at 720 as the latter was
taken by Scilab in the meanwhile.

Resolve conflicts in autodoc_runme.py once again.
This commit is contained in:
Vadim Zeitlin 2015-02-16 23:46:39 +01:00
commit 300ccce46c
419 changed files with 18675 additions and 1315 deletions

View file

@ -27,6 +27,7 @@ extern "C" {
extern int cparse_cplusplus;
extern int cparse_cplusplusout;
extern int cparse_start_line;
extern String *cparse_unknown_directive;
extern int scan_doxygen_comments;
extern void Swig_cparse_cplusplus(int);

View file

@ -40,6 +40,9 @@ int cparse_cplusplus = 0;
/* Generate C++ compatible code when wrapping C code */
int cparse_cplusplusout = 0;
/* To allow better error reporting */
String *cparse_unknown_directive = 0;
/* Private vars */
static int scan_init = 0;
static int num_brace = 0;
@ -823,8 +826,11 @@ int yylex(void) {
if (strcmp(yytext, "inline") == 0)
return (yylex());
/* SWIG directives */
} else {
Delete(cparse_unknown_directive);
cparse_unknown_directive = NULL;
/* SWIG directives */
if (strcmp(yytext, "%module") == 0)
return (MODULE);
if (strcmp(yytext, "%insert") == 0)
@ -900,6 +906,9 @@ int yylex(void) {
}
if (strcmp(yytext, "%warn") == 0)
return (WARN);
/* Note down the apparently unknown directive for error reporting. */
cparse_unknown_directive = Swig_copy_string(yytext);
}
/* Have an unknown identifier, as a last step, we'll do a typedef lookup on it. */

View file

@ -1628,7 +1628,11 @@ declaration : swig_directive { $$ = $1; }
| SEMI { $$ = 0; }
| error {
$$ = 0;
Swig_error(cparse_file, cparse_line,"Syntax error in input(1).\n");
if (cparse_unknown_directive) {
Swig_error(cparse_file, cparse_line, "Unknown directive '%s'.\n", cparse_unknown_directive);
} else {
Swig_error(cparse_file, cparse_line, "Syntax error in input(1).\n");
}
exit(1);
}
/* Out of class constructor/destructor declarations */
@ -3138,6 +3142,15 @@ c_decl_tail : SEMI {
skip_balanced('{','}');
$$ = 0;
}
| error {
$$ = 0;
if (yychar == RPAREN) {
Swig_error(cparse_file, cparse_line, "Unexpected ')'.\n");
} else {
Swig_error(cparse_file, cparse_line, "Syntax error - possibly a missing semicolon.\n");
}
exit(1);
}
;
initializer : def_args {
@ -4849,7 +4862,10 @@ storage_class : EXTERN { $$ = "extern"; }
| FRIEND { $$ = "friend"; }
| EXPLICIT { $$ = "explicit"; }
| CONSTEXPR { $$ = "constexpr"; }
| EXPLICIT CONSTEXPR { $$ = "explicit constexpr"; }
| CONSTEXPR EXPLICIT { $$ = "explicit constexpr"; }
| STATIC CONSTEXPR { $$ = "static constexpr"; }
| CONSTEXPR STATIC { $$ = "static constexpr"; }
| THREAD_LOCAL { $$ = "thread_local"; }
| THREAD_LOCAL STATIC { $$ = "static thread_local"; }
| STATIC THREAD_LOCAL { $$ = "static thread_local"; }