diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2019-07-28 05:51:52 -0600 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2019-07-28 05:51:52 -0600 |
commit | 795a06b58cdea7f8bb1858e7c383582c660fdf85 (patch) | |
tree | 580654df6413567487f89b62506bd74ea28cacff /lex.c | |
parent | cebda366a942aed45f7087b4ff74921da431cdbf (diff) | |
download | one-true-awk-795a06b58cdea7f8bb1858e7c383582c660fdf85.tar.gz |
Remove trailing whitespace on lines in all files.
Diffstat (limited to 'lex.c')
-rw-r--r-- | lex.c | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -136,7 +136,7 @@ int gettok(char **pbuf, int *psz) /* get next input token */ if (bp-buf >= sz) if (!adjbuf(&buf, &sz, bp-buf+2, 100, &bp, "gettok")) FATAL( "out of space for number %.10s...", buf ); - if (isdigit(c) || c == 'e' || c == 'E' + if (isdigit(c) || c == 'e' || c == 'E' || c == '.' || c == '+' || c == '-') *bp++ = c; else { @@ -194,7 +194,7 @@ int yylex(void) /* should this also have STR set? */ RET(NUMBER); } - + yylval.i = c; switch (c) { case '\n': /* {EOL} */ @@ -225,7 +225,7 @@ int yylex(void) case '&': if (peek() == '&') { input(); RET(AND); - } else + } else RET('&'); case '|': if (peek() == '|') { @@ -323,7 +323,7 @@ int yylex(void) unputstr(buf); RET(INDIRECT); } - + case '}': if (--bracecnt < 0) SYNTAX( "extra }" ); @@ -346,10 +346,10 @@ int yylex(void) case '(': parencnt++; RET('('); - + case '"': return string(); /* BUG: should be like tran.c ? */ - + default: RET(c); } @@ -382,7 +382,7 @@ int string(void) c = input(); switch (c) { case '"': *bp++ = '"'; break; - case 'n': *bp++ = '\n'; break; + case 'n': *bp++ = '\n'; break; case 't': *bp++ = '\t'; break; case 'f': *bp++ = '\f'; break; case 'r': *bp++ = '\r'; break; @@ -419,7 +419,7 @@ int string(void) break; } - default: + default: *bp++ = c; break; } @@ -429,7 +429,7 @@ int string(void) break; } } - *bp = 0; + *bp = 0; s = tostring(buf); *bp++ = ' '; *bp++ = 0; yylval.cp = setsymtab(buf, s, 0.0, CON|STR|DONTFREE, symtab); @@ -455,7 +455,7 @@ int binsearch(char *w, Keyword *kp, int n) return -1; } -int word(char *w) +int word(char *w) { Keyword *kp; int c, n; @@ -519,11 +519,11 @@ int regexpr(void) FATAL("out of space for reg expr %.10s...", buf); if (c == '\n') { *bp = '\0'; - SYNTAX( "newline in regular expression %.10s...", buf ); + SYNTAX( "newline in regular expression %.10s...", buf ); unput('\n'); break; } else if (c == '\\') { - *bp++ = '\\'; + *bp++ = '\\'; *bp++ = input(); } else { *bp++ = c; |