Script Problem - INTERNAL ERROR: parser gagged
jminer wrote on Sep 22, 2008
Hi, I am attempting to write a simple IRAF script to do some image manipulation, but I can't get past the 'parser gagged' error message. I have tried trivial scripts like the one below, but I still get the same error message... In fact, I have tried other inputs (a list file), and no inputs at all (hard-coding the filenames), to no avail. Is it an issue with my login.cl, or my IRAF installation? I tried to redo mkiraf and that didn't work either.
I do a
to declare the procedure, and then type
to run it.
The error message is
Thanks for any help, I am really stumped, because I have written many other scripts with no problem, and am pretty sure the syntax is correct. Of course, it doesn't help that I don't know what "parser gagged" even means!
-Jesse Miner
procedure junk (img)
string img
begin
imarith (img, "/", 2, "half.fits")
endI do a
task junk = scripts$junk.cl to declare the procedure, and then type
junk file.fits to run it.
The error message is
INTERNAL ERROR: parser gagged
called as: `junk (img=file.fits)' Thanks for any help, I am really stumped, because I have written many other scripts with no problem, and am pretty sure the syntax is correct. Of course, it doesn't help that I don't know what "parser gagged" even means!
-Jesse Miner
Mike Fitzpatrick wrote on Sep 22, 2008
Let me guess: You use emacs?
The script is syntactically fine, however emacs users sometimes get into a mode where the file is missing and EOF or a newline at the end of the last line. I can run your script correctly but can also reproduce the error if I remove the '\n' after the "end" statement. "Parser gagged " in this case means the interpreter saw the EOF before the newline terminating the last statement.
-Mike
The script is syntactically fine, however emacs users sometimes get into a mode where the file is missing and EOF or a newline at the end of the last line. I can run your script correctly but can also reproduce the error if I remove the '\n' after the "end" statement. "Parser gagged " in this case means the interpreter saw the EOF before the newline terminating the last statement.
-Mike
jminer wrote on Sep 22, 2008
Yes! I use emacs, and there was no \n after the "end". Thanks for the fix, I was really confused as to why I was getting that error message.
-Jesse Miner
-Jesse Miner
Last post on Sep 22, 2008