bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gawk error line numbers


From: Dan Jacobson
Subject: gawk error line numbers
Date: 19 Jun 2001 15:21:08 +0800
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

I'm thinking that since emacs's compile function has the ability to
jump to the exact problem character, and gawk knows just which one it
is, then maybe
awk: aaaw:1: BEGIN{print .0675^2/2 +}
awk: aaaw:1:                        ^ parse error
could be printed as
awk: aaaw:1:23: BEGIN{print .0675^2/2 +}
awk: aaaw:1:23:                        ^ parse error

By the way, let's trip up gawk by calling a function without adding ():
$ echo|gawk-3.1.0 -f aaaw
0.00227813
gawk-3.1.0: aaaw:3: fatal: function `aa' called with space between name and `(',
or used in other expression context
$ nl -b a aaaw
     1  func aa(){a=1}
     2  
     3  BEGIN{print .0675^2/2 
     4  
     5  aa
     6  aa
     7  }
     8  /vv/{aa}

comments: this program ran anyway, even though there were "fatal" errors that
could be seen at parse time... [not like most division by zero, shows
up depending on input data.]
It is telling me to look at line 3 for the problem, but I think the
problem is on line 5 and 6.
Line 8 also has this problem, but it was not detected because the
input didn't trigger it.  OK, I put # comment marks on 5 and 6, and:
$ echo vv|awk -f aaaw
0.00227813
awk: aaaw:3: (FILENAME=- FNR=1) fatal: function `aa' called with space between 
name and `(',
or used in other expression context

Hmmm, it still says the problem is on line 3.
-- 
http://www.geocities.com/jidanni Tel886-4-25854780 e-mail:restore .com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]