summaryrefslogtreecommitdiff
path: root/usr.bin/awk/awklex.l
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-01-20 19:43:25 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-01-20 19:43:25 +0000
commitf7e578b681f2047c43e6d75930fb5f278543dc32 (patch)
tree71e7f54a3183f4732b8ae0271c305720236851a4 /usr.bin/awk/awklex.l
parent0f2a4655788de684b2544b1175a3aeb883569249 (diff)
Latest research awk from June 29, 1996
Diffstat (limited to 'usr.bin/awk/awklex.l')
-rw-r--r--usr.bin/awk/awklex.l34
1 files changed, 17 insertions, 17 deletions
diff --git a/usr.bin/awk/awklex.l b/usr.bin/awk/awklex.l
index d7ea2357e08..a179a7d074a 100644
--- a/usr.bin/awk/awklex.l
+++ b/usr.bin/awk/awklex.l
@@ -1,4 +1,4 @@
-%Start A strng sc reg comment
+%Start A str sc reg comment
%{
/****************************************************************
@@ -211,7 +211,7 @@ WS [ \t]
}
}
}
-<A>\" { BEGIN strng; caddreset(gs); }
+<A>\" { BEGIN str; caddreset(gs); }
<A>"}" { if (--bracecnt < 0) ERROR "extra }" SYNTAX; BEGIN sc; RET(';'); }
<A>"]" { if (--brackcnt < 0) ERROR "extra ]" SYNTAX; RET(']'); }
@@ -231,28 +231,28 @@ WS [ \t]
RET(REGEXPR); }
<reg>. { CADD; }
-<strng>\" { BEGIN A;
+<str>\" { BEGIN A;
cadd(gs, 0); s = tostring(gs->cbuf);
cunadd(gs);
cadd(gs, ' '); cadd(gs, 0);
yylval.cp = setsymtab(gs->cbuf, s, 0.0, CON|STR, symtab);
RET(STRING); }
-<strng>\n { ERROR "newline in string %.10s...", gs->cbuf SYNTAX; lineno++; BEGIN A; }
-<strng>"\\\"" { cadd(gs, '"'); }
-<strng>"\\"n { cadd(gs, '\n'); }
-<strng>"\\"t { cadd(gs, '\t'); }
-<strng>"\\"f { cadd(gs, '\f'); }
-<strng>"\\"r { cadd(gs, '\r'); }
-<strng>"\\"b { cadd(gs, '\b'); }
-<strng>"\\"v { cadd(gs, '\v'); } /* these ANSIisms may not be known by */
-<strng>"\\"a { cadd(gs, '\007'); } /* your compiler. hence 007 for bell */
-<strng>"\\\\" { cadd(gs, '\\'); }
-<strng>"\\"({O}{O}{O}|{O}{O}|{O}) { int n;
+<str>\n { ERROR "newline in string %.10s...", gs->cbuf SYNTAX; lineno++; BEGIN A; }
+<str>"\\\"" { cadd(gs, '"'); }
+<str>"\\"n { cadd(gs, '\n'); }
+<str>"\\"t { cadd(gs, '\t'); }
+<str>"\\"f { cadd(gs, '\f'); }
+<str>"\\"r { cadd(gs, '\r'); }
+<str>"\\"b { cadd(gs, '\b'); }
+<str>"\\"v { cadd(gs, '\v'); } /* these ANSIisms may not be known by */
+<str>"\\"a { cadd(gs, '\007'); } /* your compiler. hence 007 for bell */
+<str>"\\\\" { cadd(gs, '\\'); }
+<str>"\\"({O}{O}{O}|{O}{O}|{O}) { int n;
sscanf(yytext+1, "%o", &n); cadd(gs, n); }
-<strng>"\\"x({H}+) { int n; /* ANSI permits any number! */
+<str>"\\"x({H}+) { int n; /* ANSI permits any number! */
sscanf(yytext+2, "%x", &n); cadd(gs, n); }
-<strng>"\\". { cadd(gs, yytext[1]); }
-<strng>. { CADD; }
+<str>"\\". { cadd(gs, yytext[1]); }
+<str>. { CADD; }
%%