A bunch of cleanup

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@126 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2000-01-19 23:35:55 +00:00
commit ba0f57158f
10 changed files with 839 additions and 536 deletions

View file

@ -83,6 +83,8 @@ static int remap[SWIG_MAXTOKENS];
static int cscan_init = 0;
static int cplusplus_mode = 0;
static int objc_mode = 0;
static int strict_type = 1;
static SwigScanner *cscanner = 0;
/* -----------------------------------------------------------------------------
@ -125,6 +127,10 @@ void LParse_set_location(DOH *file, int line) {
SwigScanner_set_location(cscanner,file,line);
}
void LParse_strict_type(int i) {
strict_type = i;
}
/* -----------------------------------------------------------------------------
* LParse_cplusplus(int i) - Enable C++ scanning
* ----------------------------------------------------------------------------- */
@ -371,7 +377,7 @@ yylex1(void) {
/* Have an unknown identifier, as a last step, we'll */
/* do a typedef lookup on it. */
yylval.tok.text = NewString(yytext);
if (LParse_typedef_check(yylval.tok.text)) {
if (strict_type && LParse_typedef_check(yylval.tok.text)) {
return TYPE_TYPEDEF;
}
return(ID);

View file

@ -29,6 +29,8 @@
#define yynerrs lparse_yynerrs
extern int lparse_yylex();
extern void LParse_strict_type(int);
void yyerror (char *s);
#include "lparse.h"

View file

@ -150,7 +150,6 @@ LParseTypeStr(DOH *to) {
int i;
LParseType *t = (LParseType *) to;
s = NewString("");
Printf(s,"(%d) - ", t->type);
if (t->qualifier)
Printf(s,"%s ",t->qualifier);
Printf(s,"%s ",t->name);