Changeset 1217 in kBuild for trunk/src/kash/arith_lex.l
- Timestamp:
- Oct 7, 2007 9:47:15 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/arith_lex.l
r809 r1217 35 35 */ 36 36 37 #ifdef HAVE_SYS_CDEFS_H 38 #include <sys/cdefs.h> 39 #endif 37 #if 0 40 38 #ifndef lint 41 #if 042 39 static char sccsid[] = "@(#)arith_lex.l 8.3 (Berkeley) 5/4/95"; 43 40 #else 44 41 __RCSID("$NetBSD: arith_lex.l,v 1.13 2005/03/21 22:37:09 dsl Exp $"); 42 #endif /* not lint */ 45 43 #endif 46 #endif /* not lint */47 44 48 #include <unistd.h>49 45 #include "arith.h" 50 46 #include "error.h" 51 47 #include "expand.h" 52 48 #include "var.h" 49 #include "shinstance.h" 53 50 54 51 extern int yylval; 52 extern shinstance *arith_psh; 55 53 extern char *arith_buf, *arith_startbuf; 56 54 #undef YY_INPUT … … 65 63 0[0-7]* { yylval = strtol(yytext, 0, 0); return(ARITH_NUM); } 66 64 [1-9][0-9]* { yylval = strtol(yytext, 0, 0); return(ARITH_NUM); } 67 [A-Za-z_][A-Za-z_0-9]* { char *v = lookupvar( yytext);65 [A-Za-z_][A-Za-z_0-9]* { char *v = lookupvar(arith_psh, yytext); 68 66 if (v) { 69 67 yylval = strtol(v, &v, 0); … … 71 69 return ARITH_NUM; 72 70 } 73 error( "arith: syntax error: \"%s\"", arith_startbuf);71 error(arith_psh, "arith: syntax error: \"%s\"", arith_startbuf); 74 72 } 75 73 "(" { return(ARITH_LPAREN); } … … 95 93 "~" { return(ARITH_BNOT); } 96 94 "!" { return(ARITH_NOT); } 97 . { error( "arith: syntax error: \"%s\"", arith_startbuf); }95 . { error(arith_psh, "arith: syntax error: \"%s\"", arith_startbuf); } 98 96 %% 99 97
Note:
See TracChangeset
for help on using the changeset viewer.