]> granicus.if.org Git - flex/commitdiff
Removed malloc() declaration.
authorVern Paxson <vern@ee.lbl.gov>
Tue, 20 Mar 1990 11:36:04 +0000 (11:36 +0000)
committerVern Paxson <vern@ee.lbl.gov>
Tue, 20 Mar 1990 11:36:04 +0000 (11:36 +0000)
Added detection of EOF in actions.

scan.l

diff --git a/scan.l b/scan.l
index ee9a2be9ab1eb2db619a1601421e1440d5920cd7..922f0d220beb08a3854f90f2c430c5619e4bcc16 100644 (file)
--- a/scan.l
+++ b/scan.l
@@ -132,8 +132,6 @@ ESCSEQ              \\([^\n]|[0-9]{1,3}|x[0-9a-f]{1,2})
 ^"%"[cr]{OPTWS}                /* ignore old lex directive */
 
 %t{OPTWS}\n            {
-                       char *malloc();
-
                        ++linenum;
                        xlation = (int *) malloc( sizeof( int ) * csize );
 
@@ -476,6 +474,11 @@ ESCSEQ             \\([^\n]|[0-9]{1,3}|x[0-9a-f]{1,2})
 <ACTION_STRING>\"      ACTION_ECHO; BEGIN(ACTION);
 <ACTION_STRING>.       ACTION_ECHO;
 
+<ACTION,ACTION_COMMENT,ACTION_STRING><<EOF>>   {
+                       synerr( "EOF encountered inside an action" );
+                       yyterminate();
+                       }
+
 
 <SECT2,QUOTE,CCL>{ESCSEQ}      {
                        yylval = myesc( yytext );