From: Frank Mori Hess Date: Sat, 19 Apr 2003 01:40:32 +0000 (+0000) Subject: fix initialization of line counter, some yytext -> calib_yytext changes X-Git-Tag: r0_7_21~233 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=28b69b8a057edcc13ee29e60a408b42fb6fde7af;p=comedilib.git fix initialization of line counter, some yytext -> calib_yytext changes --- diff --git a/lib/calib_lex.l b/lib/calib_lex.l index ee60a7b..4d7e02f 100644 --- a/lib/calib_lex.l +++ b/lib/calib_lex.l @@ -35,6 +35,10 @@ %% +%{ + calib_llocp->first_line = 1; +%} + \n { calib_llocp->first_line++; } "#" { BEGIN(COMMENT); } @@ -43,9 +47,9 @@ \" { BEGIN(STRING); } [^\"]*\" { - if( strlen( yytext ) > 0 ) - yytext[ strlen( yytext ) - 1 ] = 0; - calib_lvalp->sval = yytext; + if( strlen( calib_yytext ) > 0 ) + calib_yytext[ strlen( calib_yytext ) - 1 ] = 0; + calib_lvalp->sval = calib_yytext; BEGIN(INITIAL); return ( T_STRING ); } @@ -62,7 +66,7 @@ channel { return ( T_CHANNEL ); } value { return ( T_VALUE ); } => { return ( T_ASSIGN ); }; -(0x)?(00)?[0-9a-fA-F]+ { calib_lvalp->ival = strtol( calib_yytext, NULL, 0 ); +(0[xX])?(00)?[0-9a-fA-F]+ { calib_lvalp->ival = strtol( calib_yytext, NULL, 0 ); return( T_NUMBER ); } [ \t]